Controllers and views for the authoring steps of Grey Literature.
parent
575125ce7d
commit
284935bd72
|
|
@ -0,0 +1,161 @@
|
|||
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.GreyLiterature;
|
||||
import org.scientificcms.publications.contenttypes.GreyLiteratureItem;
|
||||
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 + "greyliterature-extendedproeprties")
|
||||
@Controller
|
||||
@MvcAuthoringStepDef(
|
||||
bundle = SciPublicationsUiConstants.BUNDLE,
|
||||
descriptionKey = "authoringsteps.extendedproperties.description",
|
||||
labelKey = "authoringsteps.extendedproperties.label",
|
||||
supportedDocumentType = GreyLiteratureItem.class
|
||||
)
|
||||
public class GreyLiteratureExtendedPropertiesStep
|
||||
extends AbstractPublicationExtendedPropertiesStep<GreyLiteratureItem, GreyLiterature> {
|
||||
|
||||
@Override
|
||||
public Class<GreyLiteratureExtendedPropertiesStep> getStepClass() {
|
||||
return GreyLiteratureExtendedPropertiesStep.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<GreyLiterature> getPublicationClass() {
|
||||
return GreyLiterature.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEditStepUrlFragment() {
|
||||
return "grepyliterature-extendedproperties";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getStepTemplatePath() {
|
||||
return "org/scientificcms/contenttypes/ui/greyliterature/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
|
||||
) {
|
||||
return super.updateProperties(
|
||||
sectionIdentifier,
|
||||
documentPath,
|
||||
languageOfPublicationParam,
|
||||
peerReviewedParam,
|
||||
yearFirstPublishedParam
|
||||
);
|
||||
}
|
||||
|
||||
@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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
<ui:composition template="/WEB-INF/views/org/scientificcms/contenttypes/ui/edit-publication-extended-properties.xhtml">
|
||||
|
||||
<ui:param name="authoringStep"
|
||||
value="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@expertise-extendedproperties" />
|
||||
value="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@greyliterature-extendedproperties" />
|
||||
|
||||
<ui:param name="authoringStepTitle"
|
||||
value="#{SciPublicationsUiMessageBundle.getMessage('expertise.extendedproperties.header', [CmsSelectedDocumentModel.itemName])}" />
|
||||
value="#{SciPublicationsUiMessageBundle.getMessage('greyliterature.extendedproperties.header', [CmsSelectedDocumentModel.itemName])}" />
|
||||
|
||||
<ui:param name="editStepUrlFragement"
|
||||
value="expertise-extendedproperties" />
|
||||
value="greyliterature-extendedproperties" />
|
||||
|
||||
<ui:define name="publicationExtendedPropertiesList">
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html [<!ENTITY times '×'>]>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:bootstrap="http://xmlns.jcp.org/jsf/composite/components/bootstrap"
|
||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||
xmlns:libreccm="http://xmlns.jcp.org/jsf/composite/components/libreccm"
|
||||
xmlns:librecms="http://xmlns.jcp.org/jsf/composite/components/librecms"
|
||||
xmlns:scicms="http://xmlns.jcp.org/jsf/composite/components/scicms"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
<ui:composition template="/WEB-INF/views/org/scientificcms/contenttypes/ui/edit-publication.xhtml">
|
||||
|
||||
<ui:param name="authoringStep"
|
||||
value="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@greyliterature-basicproperties" />
|
||||
|
||||
<ui:param name="authoringStepTitle"
|
||||
value="#{SciPublicationsUiMessageBundle.getMessage('greyliterature.basicproperties.header', [SciCmsPublicationPropertiesStepModel.name])}" />
|
||||
|
||||
<ui:define name="publicationMessages">
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="publicationBasicPropertiesForm">
|
||||
<bootstrap:formGroupNumber
|
||||
help="#{SciPublicationsUiMessageBundle['greyliterature.basicproperties.startpage.help']}"
|
||||
inputId="start-page"
|
||||
label="#{SciPublicationsUiMessageBundle['greyliterature.basicproperties.startpage.label']}"
|
||||
name="startPage"
|
||||
value="#{SciCmsGreyLiteraturePropertiesStepModel.startPage}"
|
||||
/>
|
||||
|
||||
<bootstrap:formGroupNumber
|
||||
help="#{SciPublicationsUiMessageBundle['greyliterature.basicproperties.endpage.help']}"
|
||||
inputId="end-page"
|
||||
label="#{SciPublicationsUiMessageBundle['greyliterature.basicproperties.endpage.label']}"
|
||||
name="endPage"
|
||||
value="#{SciCmsGreyLiteraturePropertiesStepModel.endPage}"
|
||||
/>
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="publicationBasicPropertiesDl">
|
||||
<div>
|
||||
<dt>#{SciPublicationsUiMessageBundle['greyliterature.basicproperties.startpage.label']}</dt>
|
||||
<dd>#{SciCmsGreyLiteraturePropertiesStepModel.startPage}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>#{SciPublicationsUiMessageBundle['greyliterature.basicproperties.endpage.label']}</dt>
|
||||
<dd>#{SciCmsGreyLiteraturePropertiesStepModel.endPage}</dd>
|
||||
</div>
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="publicationProperties">
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
|
||||
</html>
|
||||
|
|
@ -593,3 +593,8 @@ expertise.extendedproperties.header=Extended properties of Expertise {0}
|
|||
greyliteratureitem.createstep.description=Creates a new grey literature publication item.
|
||||
greyliterature.createform.title=Create a new grey literature item
|
||||
greyliterature.createform.submit=Create grey literature publication
|
||||
greyliterature.basicproperties.header=Edit basic properties of grey literature publication {0}
|
||||
greyliterature.basicproperties.startpage.help=The first page of the publication, if the publication is part of another publication.
|
||||
greyliterature.basicproperties.startpage.label=First page
|
||||
greyliterature.basicproperties.endpage.help=The last page of the publication, if the publication is part of another publication.
|
||||
greyliterature.basicproperties.endpage.label=Last page
|
||||
|
|
|
|||
|
|
@ -593,3 +593,8 @@ expertise.extendedproperties.header=Erweiterte Eigenschaften des Gutachtens {0}
|
|||
greyliteratureitem.createstep.description=Erstellt eine neue "Graue Literatur"-Publikation
|
||||
greyliterature.createform.title=Neue "Graue Literatur"-Publikation anlegen
|
||||
greyliterature.createform.submit="Graue Literatur"-Publikation anlegen
|
||||
greyliterature.basicproperties.header=Basiseigenschaften der "Graue Literatur"-Publikation {0} bearbeiten
|
||||
greyliterature.basicproperties.startpage.help=Die erste Seite der Publikation, sofern die Publikation Teil einer anderen Publikation ist.
|
||||
greyliterature.basicproperties.startpage.label=Erste Seite
|
||||
greyliterature.basicproperties.endpage.help=Die letzte Seite der Publikation, sofern die Publikation Teil einer anderen Publikation ist.
|
||||
greyliterature.basicproperties.endpage.label=Letzte Seite
|
||||
|
|
|
|||
Loading…
Reference in New Issue