Bugfixes for the authoring steps of collected volume and article in

collected volume.
pull/1/head
Jens Pelzetter 2022-07-28 20:21:19 +02:00
parent d6079c494b
commit fd188a4f92
11 changed files with 299 additions and 19 deletions

View File

@ -20,7 +20,7 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Entity
@Table(name = "ARTICLE_IN_COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
@Table(name = "ARTICLE_IN_JOURNAL_ITEMS", schema = DB_SCHEMA)
@Audited
@ContentTypeDescription(
labelBundle = "org.scientificcms.publications.contenttypes.ArticleInJournal",

View File

@ -52,7 +52,7 @@ public class ArticleInCollectedVolumePropertiesStep
extends AbstractPublicationPropertiesStep<ArticleInCollectedVolumeItem, ArticleInCollectedVolume> {
public static final String EDIT_STEP_URL_FRAGMENT
= "articleincollectedvolume";
= "articleincollectedvolume-basicproperties";
@Inject
private ArticleInCollectedVolumeManager articleManager;

View File

@ -34,7 +34,7 @@ public class CollectedVolumeItemCreateStep
@Override
public String showCreateStep() {
return "org/scientificcms/contenttypes/ui/collectedvolue/create-collectedvolume.xhtml";
return "org/scientificcms/contenttypes/ui/collectedvolume/create-collectedvolume.xhtml";
}
@Override

View File

@ -28,6 +28,7 @@ import javax.inject.Inject;
import javax.mvc.Controller;
import javax.mvc.Models;
import javax.transaction.Transactional;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
@ -46,7 +47,7 @@ import javax.ws.rs.PathParam;
bundle = SciPublicationsUiConstants.BUNDLE,
descriptionKey = "authoringsteps.basicproperties.description",
labelKey = "authoringsteps.basicproperties.label",
supportedDocumentType = MonographItem.class
supportedDocumentType = CollectedVolumeItem.class
)
public class CollectedVolumePropertiesStep
extends AbstractPublicationWithPublisherPropertiesStep<CollectedVolumeItem, CollectedVolume> {
@ -130,6 +131,237 @@ public class CollectedVolumePropertiesStep
return super.showStep(sectionIdentifier, documentPath);
}
@POST
@Path("/name")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String updateName(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath,
@FormParam("name") @DefaultValue("")
final String name
) {
return super.updateName(sectionIdentifier, documentPath, name);
}
@POST
@Path("/title/@add")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String addTitle(
@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.addTitle(
sectionIdentifier,
documentPath,
localeParam,
value
);
}
@POST
@Path("/title/@edit/{locale}")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String editTitle(
@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.editTitle(
sectionIdentifier,
documentPath,
localeParam,
value
);
}
@POST
@Path("/title/@remove/{locale}")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String removeTitle(
@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.removeTitle(sectionIdentifier, documentPath, localeParam);
}
@POST
@Path("/shortdescription/@add")
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String addShortDescription(
@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.addShortDescription(
sectionIdentifier,
documentPath,
localeParam,
value
);
}
@POST
@Path("/shortdescription/@edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String editShortDescription(
@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.editShortDescription(
sectionIdentifier,
documentPath,
localeParam,
value
);
}
@POST
@Path("/shortdescription/@remove/{locale}")
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String removeShortDescription(
@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.removeShortDescription(
sectionIdentifier,
documentPath,
localeParam
);
}
@POST
@Path("/authors")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String addAuthor(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath,
@FormParam("authorIdentifier")
final String authorIdentifier,
@FormParam("editor")
final String editorParam
) {
return super.addAuthor(
sectionIdentifier,
documentPath,
authorIdentifier,
editorParam
);
}
@POST
@Path("/authors/{authorshipUuid}")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String editAuthorship(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath,
@PathParam("authorshipUuid")
final String authorshipUuid,
@FormParam("editor")
final String editorParam
) {
return super.editAuthorship(
sectionIdentifier,
documentPath,
authorshipUuid,
editorParam
);
}
@POST
@Path("/authors/{authorshipUuid}/remove")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String removeAuthorship(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath,
@PathParam("authorshipUuid")
final String authorshipUuid
) {
return super.removeAuthorship(
sectionIdentifier,
documentPath,
authorshipUuid
);
}
@POST
@Path("/publisher")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String setPublisher(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath,
@FormParam("publisherIdentifier")
final String publisherIdentifier
) {
return super.setPublisher(
sectionIdentifier,
documentPath,
publisherIdentifier
);
}
@POST
@Path("/publisher/@remove")
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
@Override
public String removePublisher(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath
) {
return super.removePublisher(sectionIdentifier, documentPath);
}
@POST()
@Path("/properties")
@AuthorizationRequired

View File

@ -16,6 +16,10 @@ public class PublicationAuthoringSteps implements MvcAuthoringSteps {
@Override
public Set<Class<?>> getClasses() {
return Set.of(
ArticleInCollectedVolumePropertiesStep.class,
ArticleInCollectedVolumeExtendedPropertiesStep.class,
CollectedVolumePropertiesStep.class,
CollectedVolumeExtendedPropertiesStep.class,
MonographPropertiesStep.class,
MonographExtendedPropertiesStep.class,
PublicationAbstractStep.class,

View File

@ -121,8 +121,8 @@
<td class="col-type"></td>
<td class="col-action">
<button class="btn btn-primary"
data-publicationuuid=""
type="button">
data-publicationuuid=""
type="button">
#{SciPublicationsUiMessageBundle['publicationpicker.select']}
</button>
</td>
@ -138,14 +138,14 @@
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal-footer">
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{SciPublicationsUiMessageBundle['publicationpicker.close']}
</button>
</div>
</div>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@
shortDescription="Text of the publication picker button"
type="String" />
<cc:attribute name="buttonIcon"
default="pen"
default="plus-circle"
required="false"
shortDescription="Icon of the publication picker button"
type="String" />
@ -23,7 +23,7 @@
<cc:implementation>
<button class="btn btn-primary"
data-toggle="modal"
data-target="##{cc.attrs.publicationPickerId}"
data-target="##{cc.attrs.publicationPickerId}-dialog"
type="button">
<bootstrap:svgIcon icon="#{cc.attrs.buttonIcon}" />
<span class="sr-only">#{cc.attrs.buttonText}</span>

View File

@ -40,7 +40,7 @@
<h3 class="mt-5">#{SciPublicationsUiMessageBundle['articleincollectedvolume.basicproperties.collectedvolume']}</h3>
<c:if test="#{CmsSelectedDocumentModel.canEdit}">
<<div class="mb-2">
<div class="mb-2">
<div class="text-right">
<scicms:publicationPickerButton
publicationPickerId="collectedvolume-picker"
@ -68,7 +68,7 @@
#{SciCmsArticleInCollectedVolumePropertiesStepModel.collectedVolumeTitle}
</p>
</c:otherwise>
<c:if test="#{CmsSelectedDocumentModel.canEdit && SciCmsArticleInCollectedVolumePropertiesStepModel.collectedVolumeTitle == null}">
<c:if test="#{CmsSelectedDocumentModel.canEdit and SciCmsArticleInCollectedVolumePropertiesStepModel.collectedVolumeTitle == null}">
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@articleincollectedvolume-basicproperties/collectedvolume/remove"
buttonText="#{SciPublicationsUiMessageBundle['articleincollectedvolume.basicproperties.collectedvolume.remove']}"

View File

@ -15,11 +15,14 @@
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"
/>
<div class="text-right">
<scicms:publicationPickerButton
buttonText="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.add.label']}"
publicationPickerId="article-picker"
/>
</div>
<scicms:publicationPicker
actionUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties/articles"
@ -30,6 +33,7 @@
publicationType="#{SciCmsCollectedVolumePropertiesStepModel.articleType}"
/>
</c:if>
<c:choose>
<c:when test="#{SciCmsCollectedVolumePropertiesStepModel.articles.isEmpty()}">
<p>#{SciPublicationsUiMessageBundle['collectedvolume.aricles.none']}</p>

View File

@ -0,0 +1,20 @@
create table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS (
OBJECT_ID int8 not null,
primary key (OBJECT_ID)
);
create table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS_AUD (
OBJECT_ID int8 not null,
REV int4 not null,
primary key (OBJECT_ID, REV)
);
alter table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS
add constraint FKpqxysdqkjm5llk998ullii3pe
foreign key (OBJECT_ID)
references SCI_PUBLICATIONS.PUBLICATION_ITEMS;
alter table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS_AUD
add constraint FKrstbs1nh55apbago76itwbyv2
foreign key (OBJECT_ID, REV)
references SCI_PUBLICATIONS.PUBLICATION_ITEMS_AUD;

View File

@ -0,0 +1,20 @@
create table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS (
OBJECT_ID bigint not null,
primary key (OBJECT_ID)
);
create table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS_AUD (
OBJECT_ID bigint not null,
REV integer not null,
primary key (OBJECT_ID, REV)
);
alter table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS
add constraint FKpqxysdqkjm5llk998ullii3pe
foreign key (OBJECT_ID)
references SCI_PUBLICATIONS.PUBLICATION_ITEMS;
alter table SCI_PUBLICATIONS.ARTICLE_IN_JOURNAL_ITEMS_AUD
add constraint FKrstbs1nh55apbago76itwbyv2
foreign key (OBJECT_ID, REV)
references SCI_PUBLICATIONS.PUBLICATION_ITEMS_AUD;