@Produces({ MediaType.APPLICATION_JSON })
public String retreiveOffice(@PathParam("officeId") final Long officeId, @Context final UriInfo uriInfo) {
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
OfficeData office = this.readPlatformService.retrieveOffice(officeId);
if (settings.isTemplate()) {
final Collection<OfficeData> allowedParents = this.readPlatformService.retrieveAllowedParents(officeId);
office = OfficeData.appendedTemplate(office, allowedParents);
}
return this.toApiJsonSerializer.serialize(settings, office, this.RESPONSE_DATA_PARAMETERS);