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
MH-13018 re-add recordings json to 5x (includes MH-12828 re-add conflicts.json) #367
Conversation
Date end = new DateTime(endDate).toDateTime(DateTimeZone.UTC).toDate(); | ||
@GET | ||
@Produces(MediaType.TEXT_XML) | ||
@Path("conflicts.xml") |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@karendolan Please note that I'm waiting on you to answer the "Would you be willing..."-question in the older comment... |
Hi @staubesv ! Thank you for the ping. I am willing and able (back from vacation now) |
…conflicts json REST endpoint (includes peer review to continue throwing UnauthorizedException)
c476fcc
to
5f4b5ae
Compare
@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), }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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), }, |
There was a problem hiding this comment.
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
538bae9
to
20810ed
Compare
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": {...}}
}
]
}