XHTML for editing the properties of a collected volume.

pull/1/head
Jens Pelzetter 2022-07-23 13:58:55 +02:00
parent 5e47f19dee
commit cdf9ff8d94
7 changed files with 243 additions and 116 deletions

View File

@ -8,11 +8,21 @@ import java.util.Comparator;
*/ */
public class ArticleInCollectedVolumeRow public class ArticleInCollectedVolumeRow
implements Comparable<ArticleInCollectedVolumeRow> { implements Comparable<ArticleInCollectedVolumeRow> {
private String articleUuid;
private String title; private String title;
private String chapter; private String chapter;
public String getArticleUuid() {
return articleUuid;
}
public void setArticleUuid(final String articleUuid) {
this.articleUuid = articleUuid;
}
public String getTitle() { public String getTitle() {
return title; return title;
} }

View File

@ -279,6 +279,7 @@ public class CollectedVolumePropertiesStep
) { ) {
final ArticleInCollectedVolumeRow row final ArticleInCollectedVolumeRow row
= new ArticleInCollectedVolumeRow(); = new ArticleInCollectedVolumeRow();
row.setArticleUuid(article.getUuid());
row.setTitle( row.setTitle(
globalizationHelper.getValueFromLocalizedString( globalizationHelper.getValueFromLocalizedString(
article.getTitle() article.getTitle()

View File

@ -1,5 +1,7 @@
package org.scientificcms.publications.ui.contenttypes; package org.scientificcms.publications.ui.contenttypes;
import org.scientificcms.publications.ArticleInCollectedVolume;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -16,7 +18,7 @@ import javax.inject.Named;
public class CollectedVolumePropertiesStepModel { public class CollectedVolumePropertiesStepModel {
private List<ArticleInCollectedVolumeRow> articles; private List<ArticleInCollectedVolumeRow> articles;
public List<ArticleInCollectedVolumeRow> getArticles() { public List<ArticleInCollectedVolumeRow> getArticles() {
return Collections.unmodifiableList(articles); return Collections.unmodifiableList(articles);
} }
@ -25,6 +27,8 @@ public class CollectedVolumePropertiesStepModel {
this.articles = new ArrayList<>(articles); this.articles = new ArrayList<>(articles);
} }
public String getArticleType() {
return ArticleInCollectedVolume.class.getName();
}
} }

View File

@ -0,0 +1,85 @@
<!DOCTYPE html [<!ENTITY times '&#215;'>]>
<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-with-publisher.xhtml">
<ui:param name="authoringStep"
value="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties" />
<ui:param name="authoringStepTitle"
value="#{SciPublicationsUiMessageBundle.getMessage('collectedvolume.basicproperties.header', [SciCmsPublicationPropertiesStepModel.name])}" />
<ui:define name="publicationWithPublisherProperties">
<c:if test="#{CmsSelectedDocumentModel.canEdit}">
<scicms:publicationPickerButton
buttonText="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.add.label']}"
publicationPickerId="article-picker"
/>
<scicms:publicationPicker
actionUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties/articles"
baseUrl="#{SciCmsPublicationPropertiesStepModel.baseUrl}"
contentSection="#{ContentSectionModel.sectionName}"
formParamName="articleIdentifier"
publicationPickerId="article-picker"
publicationType="#{SciCmsCollectedVolumePropertiesStepModel.articleType}"
/>
</c:if>
<c:choose>
<c:when test="#{SciCmsCollectedVolumePropertiesStepModel.articles.isEmpty()}">
<p>#{SciPublicationsUiMessageBundle['collectedvolume.aricles.none']}</p>
</c:when>
<c:otherwise>
<table class="articles-table">
<thead>
<tr>
<th>#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.title']}</th>
<th>#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.chapter']}</th>
<th colspan="2">
#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions']}
</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{SciCmsCollectedVolumePropertiesStepModel.articles}"
var="article">
<tr>
<td>#{article.title}</td>
<td>#{article.chapter}</td>
<td>
<a class="btn btn-secondary"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@articleincollectedvolume-basicproperties">
<bootstrap:svgIcon icon="pen" />
<span class="sr-only">
#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.edit']}
</span>
</a>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties/articles/#{article.articleUuid}/remove"
buttonText="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove']}"
cancelLabel="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove.cancel']}"
confirmLabel="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove.confirm']}"
dialogId="article-#{article.articleUuid}-remove-dialog"
dialogTitle="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove.title']}"
message="#{SciPublicationsUiMessageBundle.getMessage('collectedvolume.basicproperties.articles.actions.remove.message', [SciCmsPublicationPropertiesStepModel.name, article.title])}"
/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:otherwise>
</c:choose>
</ui:define>
</ui:composition>
</html>

View File

@ -261,11 +261,13 @@
name="editor" name="editor"
/> />
</librecms:assetPicker> </librecms:assetPicker>
<c:choose> </c:if>
<c:when test="#{SciCmsPublicationPropertiesStepModel.authors.isEmpty()}"> <c:choose>
<p>#{SciPublicationsUiMessageBundle['basicproperties.authors.none']}</p> <c:when test="#{SciCmsPublicationPropertiesStepModel.authors.isEmpty()}">
</c:when> <p>#{SciPublicationsUiMessageBundle['basicproperties.authors.none']}</p>
<c:otherwise> </c:when>
<c:otherwise>
<c:if test="#{CmsSelectedDocumentModel.canEdit}">
<button class="btn btn-secondary authors-save-order-button" <button class="btn btn-secondary authors-save-order-button"
disabled="disabled" disabled="disabled"
type="button"> type="button">
@ -280,116 +282,117 @@
</span> </span>
<span>#{SciPublicationsUiMessageBundle['authors.order.save']}</span> <span>#{SciPublicationsUiMessageBundle['authors.order.save']}</span>
</button> </button>
<table id="authors-table" </c:if>
data-saveUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@publication-authors/save-order"> <table id="authors-table"
<thead> data-saveUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@publication-authors/save-order">
<tr> <thead>
<th>#{SciPublicationsUiMessageBundle['basicproperties.authors.table.name']}</th> <tr>
<th> <th>#{SciPublicationsUiMessageBundle['basicproperties.authors.table.name']}</th>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor']} <th>
</th> #{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor']}
<th colspan="2"> </th>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.actions']} <th colspan="2">
</th> #{SciPublicationsUiMessageBundle['basicproperties.authors.table.actions']}
</tr> </th>
</thead> </tr>
<tbody> </thead>
<c:forEach items="#{SciCmsPublicationPropertiesStepModel.authors}" <tbody>
var="author"> <c:forEach items="#{SciCmsPublicationPropertiesStepModel.authors}"
<tr class="publication-author" var="author">
id="#{author.authorshipId}" <tr class="publication-author"
data-id="#{author.authorshipId}"> id="#{author.authorshipId}"
<td> data-id="#{author.authorshipId}">
<button class="btn btn-secondary cms-sort-handle mr-2" <td>
type="button"> <button class="btn btn-secondary cms-sort-handle mr-2"
<bootstrap:svgIcon icon="arrows-move" /> type="button">
<span class="sr-only">#{SciPublicationsUiMessageBundle['basicproperties.authors.move']}</span> <bootstrap:svgIcon icon="arrows-move" />
</button> <span class="sr-only">#{SciPublicationsUiMessageBundle['basicproperties.authors.move']}</span>
#{author.authorName} </button>
</td> #{author.authorName}
<td> </td>
<c:choose> <td>
<c:when test="#{author.editor}"> <c:choose>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.yes']} <c:when test="#{author.editor}">
</c:when> #{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.yes']}
<c:otherwise> </c:when>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.no']} <c:otherwise>
</c:otherwise> #{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.no']}
</c:choose> </c:otherwise>
</td> </c:choose>
<td> </td>
<button class="btn btn-secondary" <td>
data-toggle="modal" <button class="btn btn-secondary"
data-target="#authorship-edit-#{author.authorshipUuid}" data-toggle="modal"
type="button"> data-target="#authorship-edit-#{author.authorshipUuid}"
<bootstrap:svgIcon icon="pen" /> type="button">
<span class="sr-only"> <bootstrap:svgIcon icon="pen" />
#{SciPublicationsUiMessageBundle['basicproperties.authors.edit.label']} <span class="sr-only">
</span> #{SciPublicationsUiMessageBundle['basicproperties.authors.edit.label']}
</button> </span>
<div aria-hidden="true" </button>
aria-labelledby="authorship-edit-#{author.authorshipUuid}-title" <div aria-hidden="true"
class="modal fade" aria-labelledby="authorship-edit-#{author.authorshipUuid}-title"
id="authorship-edit-#{author.authorshipUuid}" class="modal fade"
tabindex="-1"> id="authorship-edit-#{author.authorshipUuid}"
<div class="modal-dialog"> tabindex="-1">
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}" <div class="modal-dialog">
class="modal-content" <form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}"
method="post"> class="modal-content"
<div class="modal-header"> method="post">
<h4 class="modal-title" <div class="modal-header">
id="authorship-edit-#{author.authorshipUuid}-title"> <h4 class="modal-title"
#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.editdialog.title', [author.authorName])} id="authorship-edit-#{author.authorshipUuid}-title">
</h4> #{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.editdialog.title', [author.authorName])}
<button aria-label="{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}" </h4>
class="close" <button aria-label="{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}"
data-dismiss="modal" class="close"
type="button"> data-dismiss="modal"
<bootstrap:svgIcon icon="x" /> type="button">
</button> <bootstrap:svgIcon icon="x" />
</div> </button>
<div class="modal-body"> </div>
<bootstrap:formCheck <div class="modal-body">
checked="#{author.editor}" <bootstrap:formCheck
inputId="#{author.authorshipUuid}-editor" checked="#{author.editor}"
label="#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.editor.label']}" inputId="#{author.authorshipUuid}-editor"
name="editor" label="#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.editor.label']}"
value="true" name="editor"
/> value="true"
</div> />
<div class="modal-footer"> </div>
<button class="btn btn-warning" <div class="modal-footer">
data-dismiss="modal" <button class="btn btn-warning"
type="button"> data-dismiss="modal"
#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']} type="button">
</button> #{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}
<button class="btn btn-success" </button>
type="submit"> <button class="btn btn-success"
#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.submit']} type="submit">
</button> #{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.submit']}
</div> </button>
</form> </div>
</div> </form>
</div> </div>
</td> </div>
<td> </td>
<libreccm:deleteDialog <td>
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}/remove" <libreccm:deleteDialog
buttonText="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.label']}" actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}/remove"
cancelLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.cancel']}" buttonText="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.label']}"
confirmLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.confirm']}" cancelLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.cancel']}"
dialogId="remove-author-#{author.authorshipUuid}" confirmLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.confirm']}"
dialogTitle="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.title', [author.authorName])}" dialogId="remove-author-#{author.authorshipUuid}"
message="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.text', [author.authorName])}" dialogTitle="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.title', [author.authorName])}"
/> message="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.text', [author.authorName])}"
</td> />
</tr> </td>
</c:forEach> </tr>
</tbody> </c:forEach>
</table> </tbody>
</c:otherwise> </table>
</c:choose> </c:otherwise>
</c:if> </c:choose>
<ui:insert name="publicationProperties" /> <ui:insert name="publicationProperties" />
</ui:define> </ui:define>

View File

@ -434,3 +434,15 @@ collectedvolume.createstep.description=Create a new collected volume.
collectedvolume.createform.submit=Create collected volume collectedvolume.createform.submit=Create collected volume
articleincollectedvolume.createform.submit=Create article in collected volume articleincollectedvolume.createform.submit=Create article in collected volume
articleincollectedvolume.createform.title=Create a new article in a collected volume articleincollectedvolume.createform.title=Create a new article in a collected volume
collectedvolume.basicproperties.header=Edit basic properties of collected volume {0}
collectedvolume.basicproperties.articles.add.label=Add article to collected volume
collectedvolume.aricles.none=This collected volume has no articles yet.
collectedvolume.basicproperties.articles.title=Title
collectedvolume.basicproperties.articles.chapter=Chapter
collectedvolume.basicproperties.articles.actions=Actions
collectedvolume.basicproperties.articles.actions.edit=Edit article
collectedvolume.basicproperties.articles.actions.remove=Remove article
collectedvolume.basicproperties.articles.actions.cancel=Cancel
collectedvolume.basicproperties.articles.actions.remove.confirm=Remove article
collectedvolume.basicproperties.articles.actions.remove.title=Confirm removal of article
collectedvolume.basicproperties.articles.actions.remove.message=Are you sure to remove the article {1} from the collected volume {0}.

View File

@ -434,3 +434,15 @@ collectedvolume.createstep.description=Einen neuen Sammelband anlegen.
collectedvolume.createform.submit=Sammelband anlegen collectedvolume.createform.submit=Sammelband anlegen
articleincollectedvolume.createform.submit=Sammelbandartikel anlegen articleincollectedvolume.createform.submit=Sammelbandartikel anlegen
articleincollectedvolume.createform.title=Einen neuen Sammelbandartikel anlegen articleincollectedvolume.createform.title=Einen neuen Sammelbandartikel anlegen
collectedvolume.basicproperties.header=Basiseigenschaften des Sammelbands {0} bearbeiten
collectedvolume.basicproperties.articles.add.label=Einen Artikel zum Sammelband hinzuf\u00fcgen
collectedvolume.aricles.none=Diesem Sammelband wurden noch keine Publikationen zugeordnet.
collectedvolume.basicproperties.articles.title=Titel
collectedvolume.basicproperties.articles.chapter=Kapitel
collectedvolume.basicproperties.articles.actions=Aktionen
collectedvolume.basicproperties.articles.actions.edit=Artikel bearbeiten
collectedvolume.basicproperties.articles.actions.remove=Artikel entfernen
collectedvolume.basicproperties.articles.actions.cancel=Abbrechen
collectedvolume.basicproperties.articles.actions.remove.confirm=Artikel entfernen
collectedvolume.basicproperties.articles.actions.remove.title=Entfernen des Artikels best\u00e4tigen
collectedvolume.basicproperties.articles.actions.remove.message=Sind Sie sicher dass Sie den Artikel {1} aus dem Sammelband {0} entfernen wollen?