Several support classes for the authoring steps of publication items
parent
c654460b0a
commit
0ee32da953
|
|
@ -33,7 +33,7 @@ public class Monograph extends PublicationWithPublisher {
|
||||||
return reviewed;
|
return reviewed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReviewed(Boolean reviewed) {
|
public void setReviewed(final Boolean reviewed) {
|
||||||
this.reviewed = reviewed;
|
this.reviewed = reviewed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.scientificcms.publications.ui.assets;
|
package org.scientificcms.publications.ui;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.scientificcms.publications.ui.assets;
|
package org.scientificcms.publications.ui.assets;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ui.AuthorsTableRow;
|
||||||
import org.libreccm.api.Identifier;
|
import org.libreccm.api.Identifier;
|
||||||
import org.libreccm.api.IdentifierParser;
|
import org.libreccm.api.IdentifierParser;
|
||||||
import org.libreccm.l10n.GlobalizationHelper;
|
import org.libreccm.l10n.GlobalizationHelper;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.scientificcms.publications.ui.assets;
|
package org.scientificcms.publications.ui.assets;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ui.AuthorsTableRow;
|
||||||
import org.librecms.assets.Person;
|
import org.librecms.assets.Person;
|
||||||
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
import org.scientificcms.publications.assets.PublisherAsset;
|
import org.scientificcms.publications.assets.PublisherAsset;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.scientificcms.publications.ui.assets;
|
package org.scientificcms.publications.ui.assets;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ui.AuthorsTableRow;
|
||||||
import org.libreccm.api.Identifier;
|
import org.libreccm.api.Identifier;
|
||||||
import org.libreccm.api.IdentifierParser;
|
import org.libreccm.api.IdentifierParser;
|
||||||
import org.libreccm.l10n.GlobalizationHelper;
|
import org.libreccm.l10n.GlobalizationHelper;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.scientificcms.publications.ui.assets;
|
package org.scientificcms.publications.ui.assets;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ui.AuthorsTableRow;
|
||||||
import org.librecms.assets.Organization;
|
import org.librecms.assets.Organization;
|
||||||
import org.librecms.assets.Person;
|
import org.librecms.assets.Person;
|
||||||
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,282 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.libreccm.l10n.GlobalizationHelper;
|
||||||
|
import org.libreccm.security.AuthorizationRequired;
|
||||||
|
import org.libreccm.workflow.Workflow;
|
||||||
|
import org.librecms.contentsection.ContentItemManager;
|
||||||
|
import org.librecms.contentsection.ContentItemRepository;
|
||||||
|
import org.librecms.contenttypes.Event;
|
||||||
|
import org.librecms.ui.contentsections.documents.AbstractMvcDocumentCreateStep;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.PublicationRepository;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
import org.scientificcms.publications.ui.SciPublicationsUiConstants;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import javax.enterprise.context.Dependent;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
* @param <T> Type of item.
|
||||||
|
* @param <P> Type of publication
|
||||||
|
*/
|
||||||
|
@Dependent
|
||||||
|
public abstract class AbstractPublicationItemCreateStep<T extends PublicationItem<P>, P extends Publication>
|
||||||
|
extends AbstractMvcDocumentCreateStep<T> {
|
||||||
|
|
||||||
|
private static final String FORM_PARAM_NAME = "name";
|
||||||
|
|
||||||
|
private static final String FORM_PARAM_TITLE = "title";
|
||||||
|
|
||||||
|
private static final String FORM_PARAM_SHORT_DESCRIPTION
|
||||||
|
= "shortDescription";
|
||||||
|
|
||||||
|
private static final String FORM_PARAM_INITIAL_LOCALE = "locale";
|
||||||
|
|
||||||
|
private static final String FORM_PARAM_SELECTED_WORKFLOW = "workflow";
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private GlobalizationHelper globalizationHelper;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentItemManager itemManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentItemRepository itemRepo;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private PublicationRepository publicationRepo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the publication item.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The title of the publication.
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Short description of the publication.
|
||||||
|
*/
|
||||||
|
private String shortDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The initial local of the monograph item.
|
||||||
|
*/
|
||||||
|
private String initialLocale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The workflow to use for the new monograph item.
|
||||||
|
*/
|
||||||
|
private String selectedWorkflow;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getBundle() {
|
||||||
|
return SciPublicationsUiConstants.BUNDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShortDescription() {
|
||||||
|
return shortDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInitialLocale() {
|
||||||
|
return initialLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getSelectedWorkflow() {
|
||||||
|
if (selectedWorkflow == null || selectedWorkflow.isEmpty()) {
|
||||||
|
return getContentSection()
|
||||||
|
.getContentTypes()
|
||||||
|
.stream()
|
||||||
|
.filter(
|
||||||
|
type -> type.getContentItemClass().equals(
|
||||||
|
Event.class.getName()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.findAny()
|
||||||
|
.map(type -> type.getDefaultWorkflow())
|
||||||
|
.map(
|
||||||
|
workflow -> globalizationHelper.getValueFromLocalizedString(
|
||||||
|
workflow.getName()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.orElse("");
|
||||||
|
} else {
|
||||||
|
return selectedWorkflow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subclass of the {@link PublicationItem} to use.
|
||||||
|
*
|
||||||
|
* @return The subclass of the {@link PublicationItem} to use.
|
||||||
|
*/
|
||||||
|
protected abstract Class<T> getPublicationItemClass();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the publication entity to use.
|
||||||
|
*
|
||||||
|
* @return The publication entity to use.
|
||||||
|
*/
|
||||||
|
protected abstract P createPublication();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the edit step to show after the publication item was created
|
||||||
|
* successfully, without the leading <code>@</code>.
|
||||||
|
*
|
||||||
|
* @return The name of the edit step to show after the item was created
|
||||||
|
* successfully.
|
||||||
|
*/
|
||||||
|
protected abstract String getEditStepName();
|
||||||
|
|
||||||
|
@AuthorizationRequired
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
@Override
|
||||||
|
public String createItem(final Map<String, String[]> formParams) {
|
||||||
|
if (!formParams.containsKey(FORM_PARAM_NAME)
|
||||||
|
|| formParams.get(FORM_PARAM_NAME) == null
|
||||||
|
|| formParams.get(FORM_PARAM_NAME).length == 0) {
|
||||||
|
addMessage(
|
||||||
|
"danger",
|
||||||
|
globalizationHelper
|
||||||
|
.getLocalizedTextsUtil(getBundle())
|
||||||
|
.getText("createstep.name.error.missing")
|
||||||
|
);
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
|
||||||
|
name = formParams.get(FORM_PARAM_NAME)[0];
|
||||||
|
if (!name.matches("^([a-zA-Z0-9_-]*)$")) {
|
||||||
|
addMessage(
|
||||||
|
"danger",
|
||||||
|
globalizationHelper
|
||||||
|
.getLocalizedTextsUtil(getBundle())
|
||||||
|
.getText("createstep.name.error.invalid")
|
||||||
|
);
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formParams.containsKey(FORM_PARAM_TITLE)
|
||||||
|
|| formParams.get(FORM_PARAM_TITLE) == null
|
||||||
|
|| formParams.get(FORM_PARAM_TITLE).length == 0) {
|
||||||
|
addMessage(
|
||||||
|
"danger",
|
||||||
|
globalizationHelper
|
||||||
|
.getLocalizedTextsUtil(getBundle())
|
||||||
|
.getText("createstep.title.error.missing")
|
||||||
|
);
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
title = formParams.get(FORM_PARAM_TITLE)[0];
|
||||||
|
|
||||||
|
if (formParams.containsKey(FORM_PARAM_SHORT_DESCRIPTION)
|
||||||
|
&& formParams.get(FORM_PARAM_SHORT_DESCRIPTION) != null
|
||||||
|
&& formParams.get(FORM_PARAM_SHORT_DESCRIPTION).length > 0) {
|
||||||
|
shortDescription = formParams.get(FORM_PARAM_SHORT_DESCRIPTION)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formParams.containsKey(FORM_PARAM_INITIAL_LOCALE)
|
||||||
|
|| formParams.get(FORM_PARAM_INITIAL_LOCALE) == null
|
||||||
|
|| formParams.get(FORM_PARAM_INITIAL_LOCALE).length == 0) {
|
||||||
|
addMessage(
|
||||||
|
"danger",
|
||||||
|
globalizationHelper.getLocalizedTextsUtil(
|
||||||
|
getBundle()
|
||||||
|
).getText("createstep.initial_locale.error.missing")
|
||||||
|
);
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
final Locale locale = new Locale(
|
||||||
|
formParams.get(FORM_PARAM_INITIAL_LOCALE)[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!formParams.containsKey(FORM_PARAM_SELECTED_WORKFLOW)
|
||||||
|
|| formParams.get(FORM_PARAM_SELECTED_WORKFLOW) == null
|
||||||
|
|| formParams.get(FORM_PARAM_SELECTED_WORKFLOW).length == 0) {
|
||||||
|
addMessage(
|
||||||
|
"danger",
|
||||||
|
globalizationHelper.getLocalizedTextsUtil(
|
||||||
|
getBundle()
|
||||||
|
).getText("createstep.workflow.none_selected")
|
||||||
|
);
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
selectedWorkflow = formParams.get(FORM_PARAM_SELECTED_WORKFLOW)[0];
|
||||||
|
|
||||||
|
final Optional<Workflow> workflowResult = getContentSection()
|
||||||
|
.getWorkflowTemplates()
|
||||||
|
.stream()
|
||||||
|
.filter(template -> template.getUuid().equals(selectedWorkflow))
|
||||||
|
.findAny();
|
||||||
|
|
||||||
|
if (!workflowResult.isPresent()) {
|
||||||
|
addMessage(
|
||||||
|
"danger",
|
||||||
|
globalizationHelper.getLocalizedTextsUtil(
|
||||||
|
getBundle()
|
||||||
|
).getText("createstep.workflow.error.not_available")
|
||||||
|
);
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getMessages().isEmpty()) {
|
||||||
|
return showCreateStep();
|
||||||
|
}
|
||||||
|
|
||||||
|
final T item = itemManager.createContentItem(
|
||||||
|
name,
|
||||||
|
getContentSection(),
|
||||||
|
getFolder(),
|
||||||
|
workflowResult.get(),
|
||||||
|
getPublicationItemClass(),
|
||||||
|
locale
|
||||||
|
);
|
||||||
|
|
||||||
|
final P publication = createPublication();
|
||||||
|
|
||||||
|
publication.getTitle().putValue(locale, title);
|
||||||
|
if (shortDescription != null) {
|
||||||
|
publication
|
||||||
|
.getShortDescription()
|
||||||
|
.putValue(locale, shortDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
publicationRepo.save(publication);
|
||||||
|
|
||||||
|
item.getTitle().putValue(locale, title);
|
||||||
|
item.getDescription().putValue(locale, shortDescription);
|
||||||
|
item.setPublication(publication);
|
||||||
|
|
||||||
|
itemRepo.save(item);
|
||||||
|
|
||||||
|
return String.format(
|
||||||
|
"redirect:/%s/documents/%s/%s/@%s",
|
||||||
|
getContentSectionLabel(),
|
||||||
|
getFolderPath(),
|
||||||
|
name,
|
||||||
|
getEditStepName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.AbstractMvcAuthoringStep;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
* @param <T> Subtype of {@link PublicationAsset}.
|
||||||
|
* @param <P> Subtype of {@link Publication}
|
||||||
|
*/
|
||||||
|
public abstract class AbstractPublicationPropertiesStep<T extends PublicationItem<P>, P extends Publication>
|
||||||
|
extends AbstractMvcAuthoringStep {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.PublicationWithPublisher;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationWithPublisherItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
* @param <T> Subclass of {@link PublicationWithPublisherItem}
|
||||||
|
* @param <P> Subclass of {@link PublicationWithPublisher}
|
||||||
|
*/
|
||||||
|
public abstract class AbstractPublicationWithPublisherItemCreateStep<T extends PublicationWithPublisherItem<P>, P extends PublicationWithPublisher>
|
||||||
|
extends AbstractPublicationItemCreateStep<T, P> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.AbstractMvcAuthoringStep;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
* @param <T> Subtype of {@link PublicationWithPublisherItem}
|
||||||
|
* @param <P> Subtype of {@link PublicationWithPublisher}.
|
||||||
|
*/
|
||||||
|
public abstract class AbstractPublicationWithPublisherPropertiesStep<T extends PublicationItem<P>, P extends Publication>
|
||||||
|
extends AbstractMvcAuthoringStep {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsEditionStepModel")
|
||||||
|
public class EditionStepModel {
|
||||||
|
|
||||||
|
private boolean canEdit;
|
||||||
|
|
||||||
|
private Map<String, String> editionValues;
|
||||||
|
|
||||||
|
private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
|
||||||
|
private List<String> unusedLocales;
|
||||||
|
|
||||||
|
private String selectedLocale;
|
||||||
|
|
||||||
|
public Map<String, String> getEditionValues() {
|
||||||
|
return Collections.unmodifiableMap(editionValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setEditionValues(final Map<String, String> editionValues) {
|
||||||
|
this.editionValues = new HashMap<>(editionValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
|
return Collections.unmodifiableList(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setVariants(final List<CmsEditorLocaleVariantRow> variants) {
|
||||||
|
this.variants = new ArrayList<>(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUnusedLocales(final List<String> unusedLocales) {
|
||||||
|
this.unusedLocales = new ArrayList<>(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectedLocale() {
|
||||||
|
return selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setSelectedLocale(final String selectedLocale) {
|
||||||
|
this.selectedLocale = selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getCanEdit() {
|
||||||
|
return canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCanEdit(final boolean canEdit) {
|
||||||
|
this.canEdit = canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.libreccm.l10n.GlobalizationHelper;
|
||||||
|
import org.scientificcms.publications.Monograph;
|
||||||
|
import org.scientificcms.publications.contenttypes.MonographItem;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class MonographItemCreateStep extends AbstractPublicationItemCreateStep<MonographItem, Monograph> {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private GlobalizationHelper globalizationHelper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDocumentType() {
|
||||||
|
return MonographItem.class.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return globalizationHelper
|
||||||
|
.getLocalizedTextsUtil(getBundle())
|
||||||
|
.getText("monographitem.createstep.description");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String showCreateStep() {
|
||||||
|
return "org/scientificccms/contenttypes/ui/monograph/create-monograph.xhtml";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<MonographItem> getPublicationItemClass() {
|
||||||
|
return MonographItem.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Monograph createPublication() {
|
||||||
|
return new Monograph();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getEditStepName() {
|
||||||
|
return "monograph-basicproperties";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.contenttypes.Event;
|
||||||
|
import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef;
|
||||||
|
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
||||||
|
import org.librecms.ui.contenttypes.event.EventStepsConstants;
|
||||||
|
import org.scientificcms.publications.Monograph;
|
||||||
|
import org.scientificcms.publications.contenttypes.MonographItem;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.mvc.Controller;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Path(MvcAuthoringSteps.PATH_PREFIX + "monograph-basicproperties")
|
||||||
|
@Controller
|
||||||
|
@MvcAuthoringStepDef(
|
||||||
|
bundle = EventStepsConstants.BUNDLE,
|
||||||
|
descriptionKey = "monograph.authoringsteps.basicproperties.description",
|
||||||
|
labelKey = "monograph.authoringsteps.basicproperties.label",
|
||||||
|
supportedDocumentType = MonographItem.class
|
||||||
|
)
|
||||||
|
|
||||||
|
public class MonographPropertiesStep extends AbstractPublicationWithPublisherPropertiesStep<MonographItem, Monograph>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<MonographPropertiesStep> getStepClass() {
|
||||||
|
return MonographPropertiesStep.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsMonographPropertiesStepModel")
|
||||||
|
public class MonographPropertiesStepModel {
|
||||||
|
|
||||||
|
private boolean reviewed;
|
||||||
|
|
||||||
|
public boolean isReviewed() {
|
||||||
|
return reviewed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReviewed(final boolean reviewed) {
|
||||||
|
this.reviewed = reviewed;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsPublicationAbstractStepModel")
|
||||||
|
public class PublicationAbstractStepModel {
|
||||||
|
|
||||||
|
private boolean canEdit;
|
||||||
|
|
||||||
|
private Map<String, String> abstractValues;
|
||||||
|
|
||||||
|
private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
|
||||||
|
private List<String> unusedLocales;
|
||||||
|
|
||||||
|
private String selectedLocale;
|
||||||
|
|
||||||
|
public Map<String, String> getAbstractValues() {
|
||||||
|
return Collections.unmodifiableMap(abstractValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setAbstractValues(final Map<String, String> abstractValues) {
|
||||||
|
this.abstractValues = new HashMap<>(abstractValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
|
return Collections.unmodifiableList(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setVariants(final List<CmsEditorLocaleVariantRow> variants) {
|
||||||
|
this.variants = new ArrayList<>(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUnusedLocales(final List<String> unusedLocales) {
|
||||||
|
this.unusedLocales = new ArrayList<>(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectedLocales() {
|
||||||
|
return selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setSelectedLocale(final String selectedLocale) {
|
||||||
|
this.selectedLocale = selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getCanEdit() {
|
||||||
|
return canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCanEdit(final boolean canEdit) {
|
||||||
|
this.canEdit = canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.librecms.contentsection.ContentItem;
|
||||||
|
import org.librecms.contentsection.ContentItemRepository;
|
||||||
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
import org.librecms.ui.contentsections.ContentSectionsUi;
|
||||||
|
import org.librecms.ui.contentsections.ItemPermissionChecker;
|
||||||
|
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import javax.ws.rs.ForbiddenException;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.NotFoundException;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.PathParam;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Path(MvcAuthoringSteps.PATH_PREFIX + "publication-abstract-resources")
|
||||||
|
public class PublicationAbstractStepResources {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentItemRepository itemRepo;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentSectionsUi sectionsUi;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ItemPermissionChecker itemPermissionChecker;
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/variants/wordcount/{locale}")
|
||||||
|
@Produces(MediaType.TEXT_HTML)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getWordCount(
|
||||||
|
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||||
|
final String sectionIdentifier,
|
||||||
|
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||||
|
final String documentPathParam,
|
||||||
|
@PathParam("locale") final String localeParam
|
||||||
|
) {
|
||||||
|
final ContentSection contentSection = sectionsUi
|
||||||
|
.findContentSection(sectionIdentifier)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
final ContentItem document = itemRepo
|
||||||
|
.findByPath(contentSection, documentPathParam)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!(document instanceof PublicationItem)) {
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
final PublicationItem<?> item = (PublicationItem<?>) document;
|
||||||
|
if (itemPermissionChecker.canEditItem(item)) {
|
||||||
|
final Publication publication = item.getPublication();
|
||||||
|
|
||||||
|
final String text = publication
|
||||||
|
.getPublicationAbstract()
|
||||||
|
.getValue(new Locale(localeParam));
|
||||||
|
final Document jsoupDoc = Jsoup.parseBodyFragment(text);
|
||||||
|
final long result = new StringTokenizer(
|
||||||
|
jsoupDoc.body().text()
|
||||||
|
).countTokens();
|
||||||
|
return Long.toString(result);
|
||||||
|
} else {
|
||||||
|
throw new ForbiddenException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/variants/{locale}")
|
||||||
|
@Produces(MediaType.TEXT_HTML)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String viewAbstractValue(
|
||||||
|
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||||
|
final String sectionIdentifier,
|
||||||
|
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||||
|
final String documentPathParam,
|
||||||
|
@PathParam("locale") final String localeParam
|
||||||
|
) {
|
||||||
|
final ContentSection contentSection = sectionsUi
|
||||||
|
.findContentSection(sectionIdentifier)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
final ContentItem document = itemRepo
|
||||||
|
.findByPath(contentSection, documentPathParam)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!(document instanceof PublicationItem)) {
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(document instanceof PublicationItem)) {
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
final PublicationItem<?> item = (PublicationItem<?>) document;
|
||||||
|
if (itemPermissionChecker.canEditItem(item)) {
|
||||||
|
final Publication publication = item.getPublication();
|
||||||
|
|
||||||
|
return publication
|
||||||
|
.getPublicationAbstract()
|
||||||
|
.getValue(new Locale(localeParam));
|
||||||
|
} else {
|
||||||
|
throw new ForbiddenException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsPublicationExtendedPropertiesStepModel")
|
||||||
|
public class PublicationExtendedPropertiesStepModel {
|
||||||
|
|
||||||
|
private boolean peerReviewed;
|
||||||
|
|
||||||
|
private int yearFirstPublished;
|
||||||
|
|
||||||
|
private String languageOfPublication;
|
||||||
|
|
||||||
|
private List<VolumeInSeriesRow> volumeInSeries;
|
||||||
|
|
||||||
|
public boolean isPeerReviewed() {
|
||||||
|
return peerReviewed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeerReviewed(final boolean peerReviewed) {
|
||||||
|
this.peerReviewed = peerReviewed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getYearFirstPublished() {
|
||||||
|
return yearFirstPublished;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYearFirstPublished(final int yearFirstPublished) {
|
||||||
|
this.yearFirstPublished = yearFirstPublished;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguageOfPublication() {
|
||||||
|
return languageOfPublication;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguageOfPublication(final String languageOfPublication) {
|
||||||
|
this.languageOfPublication = languageOfPublication;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VolumeInSeriesRow> getVolumeInSeries() {
|
||||||
|
return Collections.unmodifiableList(volumeInSeries);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVolumeInSeries(final List<VolumeInSeriesRow> volumeInSeries) {
|
||||||
|
this.volumeInSeries = new ArrayList<>(volumeInSeries);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsPublicationMiscStepModel")
|
||||||
|
public class PublicationMiscStepModel {
|
||||||
|
|
||||||
|
private boolean canEdit;
|
||||||
|
|
||||||
|
private Map<String, String> miscValues;
|
||||||
|
|
||||||
|
private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
|
||||||
|
private List<String> unusedLocales;
|
||||||
|
|
||||||
|
private String selectedLocale;
|
||||||
|
|
||||||
|
public Map<String, String> getMiscValues() {
|
||||||
|
return Collections.unmodifiableMap(miscValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setMiscValues(final Map<String, String> miscValues) {
|
||||||
|
this.miscValues = miscValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
|
return Collections.unmodifiableList(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setVariants(final List<CmsEditorLocaleVariantRow> variants) {
|
||||||
|
this.variants = variants;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUnusedLocales(final List<String> unusedLocales) {
|
||||||
|
this.unusedLocales = new ArrayList<>(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectedLocale() {
|
||||||
|
return selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setSelectedLocale(final String selectedLocale) {
|
||||||
|
this.selectedLocale = selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getCanEdit() {
|
||||||
|
return canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCanEdit(final boolean canEdit) {
|
||||||
|
this.canEdit = canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.librecms.contentsection.ContentItem;
|
||||||
|
import org.librecms.contentsection.ContentItemRepository;
|
||||||
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
import org.librecms.ui.contentsections.ContentSectionsUi;
|
||||||
|
import org.librecms.ui.contentsections.ItemPermissionChecker;
|
||||||
|
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import javax.ws.rs.ForbiddenException;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.NotFoundException;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.PathParam;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Path(MvcAuthoringSteps.PATH_PREFIX + "publication-misc-resources")
|
||||||
|
public class PublicationMiscStepResources {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentItemRepository itemRepo;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContentSectionsUi sectionsUi;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ItemPermissionChecker itemPermissionChecker;
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/variants/wordcount/{locale}")
|
||||||
|
@Produces(MediaType.TEXT_HTML)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String getWordCount(
|
||||||
|
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||||
|
final String sectionIdentifier,
|
||||||
|
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||||
|
final String documentPathParam,
|
||||||
|
@PathParam("locale") final String localeParam
|
||||||
|
) {
|
||||||
|
final ContentSection contentSection = sectionsUi
|
||||||
|
.findContentSection(sectionIdentifier)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
final ContentItem document = itemRepo
|
||||||
|
.findByPath(contentSection, documentPathParam)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!(document instanceof PublicationItem)) {
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
final PublicationItem<?> item = (PublicationItem<?>) document;
|
||||||
|
if (itemPermissionChecker.canEditItem(item)) {
|
||||||
|
final Publication publication = item.getPublication();
|
||||||
|
final String misc = publication
|
||||||
|
.getMisc()
|
||||||
|
.getValue(new Locale(localeParam));
|
||||||
|
final Document jsoupDoc = Jsoup.parseBodyFragment(misc);
|
||||||
|
final long result = new StringTokenizer(
|
||||||
|
jsoupDoc.body().text()
|
||||||
|
).countTokens();
|
||||||
|
return Long.toString(result);
|
||||||
|
} else {
|
||||||
|
throw new ForbiddenException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/variants/{locale}")
|
||||||
|
@Produces(MediaType.TEXT_HTML)
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public String viewTextValue(
|
||||||
|
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||||
|
final String sectionIdentifier,
|
||||||
|
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||||
|
final String documentPathParam,
|
||||||
|
@PathParam("locale") final String localeParam
|
||||||
|
) {
|
||||||
|
final ContentSection contentSection = sectionsUi
|
||||||
|
.findContentSection(sectionIdentifier)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
final ContentItem document = itemRepo
|
||||||
|
.findByPath(contentSection, documentPathParam)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new NotFoundException()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!(document instanceof PublicationItem)) {
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
|
final PublicationItem<?> item = (PublicationItem<?>) document;
|
||||||
|
if (itemPermissionChecker.canEditItem(item)) {
|
||||||
|
final Publication publication = item.getPublication();
|
||||||
|
return publication.getMisc().getValue(new Locale(localeParam));
|
||||||
|
} else {
|
||||||
|
throw new ForbiddenException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ui.AuthorsTableRow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsPublicationPropertiesStepModel")
|
||||||
|
public class PublicationPropertiesStepModel {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Map<String, String> titleValues;
|
||||||
|
|
||||||
|
private List<String> unusedTitleLocales;
|
||||||
|
|
||||||
|
private Map<String, String> shortDecriptionValues;
|
||||||
|
|
||||||
|
private List<String> unusedShortDescriptionLocales;
|
||||||
|
|
||||||
|
private List<AuthorsTableRow> authors;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getTitleValues() {
|
||||||
|
return Collections.unmodifiableMap(titleValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitleValues(final Map<String, String> titleValues) {
|
||||||
|
this.titleValues = new HashMap<>(titleValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedTitleLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedTitleLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnusedTitleLocales(final List<String> unusedTitleLocales) {
|
||||||
|
this.unusedTitleLocales = new ArrayList<>(unusedTitleLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getShortDecriptionValues() {
|
||||||
|
return Collections.unmodifiableMap(shortDecriptionValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShortDecriptionValues(
|
||||||
|
final Map<String, String> shortDecriptionValues
|
||||||
|
) {
|
||||||
|
this.shortDecriptionValues = new HashMap<>(shortDecriptionValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedShortDescriptionLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedShortDescriptionLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnusedShortDescriptionLocales(
|
||||||
|
final List<String> unusedShortDescriptionLocales
|
||||||
|
) {
|
||||||
|
this.unusedShortDescriptionLocales = new ArrayList<>(
|
||||||
|
unusedShortDescriptionLocales
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AuthorsTableRow> getAuthors() {
|
||||||
|
return Collections.unmodifiableList(authors);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthors(final List<AuthorsTableRow> authors) {
|
||||||
|
this.authors = new ArrayList<>(authors);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsPublicationWithPublisherExtendedPropertiesStep")
|
||||||
|
public class PublicationWithPublisherExtentedPropertiesStep {
|
||||||
|
|
||||||
|
private String isbn10;
|
||||||
|
|
||||||
|
private String isbn13;
|
||||||
|
|
||||||
|
private int volume;
|
||||||
|
|
||||||
|
private int numberOfVolumes;
|
||||||
|
|
||||||
|
private int numberOfPages;
|
||||||
|
|
||||||
|
public String getIsbn10() {
|
||||||
|
return isbn10;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsbn10(final String isbn10) {
|
||||||
|
this.isbn10 = isbn10;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsbn13() {
|
||||||
|
return isbn13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsbn13(final String isbn13) {
|
||||||
|
this.isbn13 = isbn13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVolume() {
|
||||||
|
return volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVolume(final int volume) {
|
||||||
|
this.volume = volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumberOfVolumes() {
|
||||||
|
return numberOfVolumes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfVolumes(final int numberOfVolumes) {
|
||||||
|
this.numberOfVolumes = numberOfVolumes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumberOfPages() {
|
||||||
|
return numberOfPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfPages(final int numberOfPages) {
|
||||||
|
this.numberOfPages = numberOfPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("SciCmsPublicationWithPublisherPropertiesStepModel")
|
||||||
|
public class PublicationWithPublisherPropertiesStepModel {
|
||||||
|
|
||||||
|
private String publisherUuid;
|
||||||
|
|
||||||
|
private String publisherName;
|
||||||
|
|
||||||
|
private String publisherPlace;
|
||||||
|
|
||||||
|
public String getPublisherUuid() {
|
||||||
|
return publisherUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublisherUuid(final String publisherUuid) {
|
||||||
|
this.publisherUuid = publisherUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPublisherName() {
|
||||||
|
return publisherName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublisherName(final String publisherName) {
|
||||||
|
this.publisherName = publisherName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPublisherPlace() {
|
||||||
|
return publisherPlace;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublisherPlace(final String publisherPlace) {
|
||||||
|
this.publisherPlace = publisherPlace;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package org.scientificcms.publications.ui.contenttypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class VolumeInSeriesRow {
|
||||||
|
|
||||||
|
private String volumeInSeriesUuid;
|
||||||
|
|
||||||
|
private String seriesUuid;
|
||||||
|
|
||||||
|
private String volumeInSeries;
|
||||||
|
|
||||||
|
private String seriesTitle;
|
||||||
|
|
||||||
|
public String getVolumeInSeriesUuid() {
|
||||||
|
return volumeInSeriesUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVolumeInSeriesUuid(final String volumeInSeriesUuid) {
|
||||||
|
this.volumeInSeriesUuid = volumeInSeriesUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeriesUuid() {
|
||||||
|
return seriesUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeriesUuid(final String seriesUuid) {
|
||||||
|
this.seriesUuid = seriesUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVolumeInSeries() {
|
||||||
|
return volumeInSeries;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVolumeInSeries(final String volumeInSeries) {
|
||||||
|
this.volumeInSeries = volumeInSeries;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeriesTitle() {
|
||||||
|
return seriesTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeriesTitle(final String seriesTitle) {
|
||||||
|
this.seriesTitle = seriesTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -253,3 +253,4 @@ proceedings.editstep.shortdescription.remove.text=Are you sure to remove the fol
|
||||||
proceedings.editstep.shortdescription.remove.title=Confirm removal of localized description
|
proceedings.editstep.shortdescription.remove.title=Confirm removal of localized description
|
||||||
proceedings.editstep.shortdescription.title=Description
|
proceedings.editstep.shortdescription.title=Description
|
||||||
proceedings.editstep.properties.edit.submit=Save
|
proceedings.editstep.properties.edit.submit=Save
|
||||||
|
monographitem.createstep.description=Create new monograph item.
|
||||||
|
|
|
||||||
|
|
@ -253,3 +253,4 @@ proceedings.editstep.shortdescription.remove.text=Sind Sie sicher, dass Sie die
|
||||||
proceedings.editstep.shortdescription.remove.title=Entfernen einer lokalisierten Beschreibung best\u00e4tigen
|
proceedings.editstep.shortdescription.remove.title=Entfernen einer lokalisierten Beschreibung best\u00e4tigen
|
||||||
proceedings.editstep.shortdescription.title=Beschreibung
|
proceedings.editstep.shortdescription.title=Beschreibung
|
||||||
proceedings.editstep.properties.edit.submit=Speichern
|
proceedings.editstep.properties.edit.submit=Speichern
|
||||||
|
monographitem.createstep.description=Legt ein neues Item f\u00fcr eine Monographie an.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue