Controller for the extended properties step of proceedings
parent
a08bbfdb84
commit
f30274d7a6
|
|
@ -136,7 +136,7 @@ public abstract class AbstractPublicationWithPublisherPropertiesStep<T extends P
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!assetResult.isPresent()) {
|
||||
if (assetResult.isEmpty()) {
|
||||
return showPublisherNotFound(
|
||||
sectionIdentifier,
|
||||
documentPath,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import javax.ws.rs.PathParam;
|
|||
)
|
||||
public class CollectedVolumeExtendedPropertiesStep
|
||||
extends AbstractPublicationWithPublisherExtendedPropertiesStep<CollectedVolumeItem, CollectedVolume> {
|
||||
|
||||
|
||||
@Override
|
||||
public Class<CollectedVolumeExtendedPropertiesStep> getStepClass() {
|
||||
return CollectedVolumeExtendedPropertiesStep.class;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,233 @@
|
|||
package org.scientificcms.publications.ui.contenttypes;
|
||||
|
||||
import org.libreccm.security.AuthorizationRequired;
|
||||
import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef;
|
||||
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
||||
import org.scientificcms.publications.Proceedings;
|
||||
import org.scientificcms.publications.contenttypes.CollectedVolumeItem;
|
||||
import org.scientificcms.publications.contenttypes.ProceedingsItem;
|
||||
import org.scientificcms.publications.ui.SciPublicationsUiConstants;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.mvc.Controller;
|
||||
import javax.transaction.Transactional;
|
||||
import javax.ws.rs.FormParam;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@RequestScoped
|
||||
@Path(MvcAuthoringSteps.PATH_PREFIX
|
||||
+ ProceedingsExtendedPropertiesStep.EDIT_STEP_URL_FRAGMENT)
|
||||
@Controller
|
||||
@MvcAuthoringStepDef(
|
||||
bundle = SciPublicationsUiConstants.BUNDLE,
|
||||
descriptionKey = "authoringsteps.extendedproperties.description",
|
||||
labelKey = "authoringsteps.extendedproperties.label",
|
||||
supportedDocumentType = CollectedVolumeItem.class
|
||||
)
|
||||
public class ProceedingsExtendedPropertiesStep extends AbstractPublicationWithPublisherExtendedPropertiesStep<ProceedingsItem, Proceedings> {
|
||||
|
||||
public static final String EDIT_STEP_URL_FRAGMENT
|
||||
= "proceedings-extendedproperties";
|
||||
|
||||
@Override
|
||||
public Class<ProceedingsExtendedPropertiesStep> getStepClass() {
|
||||
return ProceedingsExtendedPropertiesStep.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<Proceedings> getPublicationClass() {
|
||||
return Proceedings.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEditStepUrlFragment() {
|
||||
return EDIT_STEP_URL_FRAGMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getStepTemplatePath() {
|
||||
return "org/scientificcms/contenttypes/ui/proceedings/edit-extended-properties.xhtml";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String showStep(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath
|
||||
) {
|
||||
return super.showStep(sectionIdentifier, documentPath);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/properties")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String updateProperties(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@FormParam("languageOfPublication")
|
||||
final String languageOfPublicationParam,
|
||||
@FormParam("peerReviewed")
|
||||
final String peerReviewedParam,
|
||||
@FormParam("yearFirstPublished")
|
||||
final String yearFirstPublishedParam,
|
||||
@FormParam("isbn10")
|
||||
final String isbn10,
|
||||
@FormParam("isbn13")
|
||||
final String isbn13,
|
||||
@FormParam("numberOfPages")
|
||||
final String numberOfPagesParam,
|
||||
@FormParam("numberOfVolumes")
|
||||
final String numberOfVolumesParam,
|
||||
@FormParam("volume")
|
||||
final String volumeParam
|
||||
) {
|
||||
return super.updateProperties(
|
||||
sectionIdentifier,
|
||||
documentPath,
|
||||
languageOfPublicationParam,
|
||||
peerReviewedParam,
|
||||
yearFirstPublishedParam,
|
||||
isbn10,
|
||||
isbn13,
|
||||
numberOfPagesParam,
|
||||
numberOfVolumesParam,
|
||||
volumeParam
|
||||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/edition/@add")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String addEditionValue(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@FormParam("locale") final String localeParam,
|
||||
@FormParam("value") final String value
|
||||
) {
|
||||
return super.addEditionValue(
|
||||
sectionIdentifier, documentPath, localeParam, value
|
||||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/edition/@edit/{locale}")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String editEditionValue(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("locale") final String localeParam,
|
||||
@FormParam("value") final String value
|
||||
) {
|
||||
return super.editEditionValue(
|
||||
sectionIdentifier, documentPath, localeParam, value
|
||||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/edition/@remove/{locale}")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String removeEditionValue(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("locale") final String localeParam
|
||||
) {
|
||||
return super.removeEditionValue(
|
||||
sectionIdentifier, documentPath, localeParam
|
||||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/series")
|
||||
@AuthorizationRequired
|
||||
@Transactional
|
||||
@Override
|
||||
public String addSeries(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@FormParam("seriesIdentifier")
|
||||
final String seriesIdentifier,
|
||||
@FormParam("volumeOfSeries")
|
||||
final String volumeOfSeries
|
||||
) {
|
||||
return super.addSeries(
|
||||
sectionIdentifier,
|
||||
documentPath,
|
||||
seriesIdentifier,
|
||||
volumeOfSeries
|
||||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/series/{volumeInSeriesUuid}")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String editVolumeInSeries(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("volumeInSeriesUuid")
|
||||
final String volumeInSeriesUuid,
|
||||
@FormParam("volumeOfSeries")
|
||||
final String volumeOfSeries
|
||||
) {
|
||||
return super.editVolumeInSeries(
|
||||
sectionIdentifier,
|
||||
documentPath,
|
||||
volumeInSeriesUuid,
|
||||
volumeOfSeries
|
||||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/series/{volumeInSeriesUuid}/remove")
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public String removeVolumeInSeries(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("volumeInSeriesUuid")
|
||||
final String volumeInSeriesUuid
|
||||
) {
|
||||
return super.removeVolumeInSeries(
|
||||
sectionIdentifier,
|
||||
documentPath,
|
||||
volumeInSeriesUuid
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue