Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MH-13018 re-add recordings json to 5x (includes MH-12828 re-add conflicts.json) #367

Conversation

karendolan
Copy link
Member

This pull for MH-13018 to readd recordings.json, also includes as a prerequisite the MH-12828 pulll that was merged to OC develop branch in https://github.com/opencast/opencast/pull/233/files. Both fixes use the getEventListAsJsonString() helper that is reused by both conflicts.json and recordings.json. Adding both here should make it easier to merge back this fix to develop branch.

The conflicts code is not altered in this pull, but it is moved into a helper method to avoid duplication.

Example result of /recordings/recordings.json?...
{
  "totalCount": "0",
  "events": []
}

or

{ "totalCount": "2",
  "events": [
    {
      "seriestitle": "Test Spring 2018 (29996)",
      "metadata": {"catalog": [... ]},
      "attachments": {"attachment": [...]},
      "series": 20180229996,
      "start": "2018-07-30T18:00:00Z",
      "id": "877067ba-857d-4527-980b-88f576764f5b",
      "media": "",
      "title": "Karen test schdule Jul 30 -2",
      "type": "L02",
      "publications": ""
    },
    {
      "seriestitle": "Computer Science 101 (29990) Spring 2018",
      "metadata": {"catalog": [...]},
      "attachments": {"attachment": [...]},
      "series": 20180229990,
      "creators": {"creator": "kdolan"},
      "start": "2018-08-05T18:00:00Z",
      "id": "e5d89b64-73ff-4287-98ad-a5040f5228a6",
      "media": "",
      "title": "Karen test schdule Jul 30 -1",
      "type": "L01",
      "publications": {"publication": {...}}
    }
  ]
}

@karendolan karendolan added the bug label Jul 30, 2018
@staubesv staubesv self-assigned this Aug 6, 2018
Date end = new DateTime(endDate).toDateTime(DateTimeZone.UTC).toDate();
@GET
@Produces(MediaType.TEXT_XML)
@Path("conflicts.xml")
Copy link
Contributor

@staubesv staubesv Aug 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... would you be willing to also do a @path("recordings.{type:xml|json}")-style here (instead of adding a second method)? Seems that avoids all the overhead of the REST docs and reduces code duplcation...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@staubesv
Copy link
Contributor

@karendolan Please note that I'm waiting on you to answer the "Would you be willing..."-question in the older comment...

@karendolan
Copy link
Member Author

Hi @staubesv ! Thank you for the ping. I am willing and able (back from vacation now)

@karendolan karendolan force-pushed the t/MH12828-MH13018-conflictsJSON-recordingsJSON-5x branch from c476fcc to 5f4b5ae Compare August 27, 2018 15:46
@Path("conflicts.{type:xml|json}")
@RestQuery(name = "conflictingrecordings", description = "Searches for conflicting recordings based on parameters and returns result as XML or JSON", returnDescription = "Returns NO CONTENT if no recordings are in conflict within specified period or list of conflicting recordings in XML or JSON",
pathParameters = {
@RestParameter(name = "type", isRequired = true, description = "The media type of the response [xml|json]", defaultValue = "xml", type = Type.STRING), },
Copy link
Contributor

@staubesv staubesv Aug 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove "defaultValue", it is confusing:

screen shot 2018-08-28 at 11 15 52

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: Superfluous comma on this line: [...] type = Type.STRING), },

@Path("recordings.{type:xml|json}")
@RestQuery(name = "recordingsaslist", description = "Searches recordings and returns result as XML or JSON", returnDescription = "XML or JSON formated results",
pathParameters = {
@RestParameter(name = "type", isRequired = true, description = "The media type of the response [xml|json]", defaultValue = "xml", type = Type.STRING), },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove "defaultValue" for this mandatory parameter

@karendolan karendolan force-pushed the t/MH12828-MH13018-conflictsJSON-recordingsJSON-5x branch from 538bae9 to 20810ed Compare August 28, 2018 12:11
@staubesv staubesv merged commit 5f4a46f into opencast:r/5.x Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants