Text editing for sci-types-project

pull/1/head
Jens Pelzetter 2022-05-07 17:02:27 +02:00
parent 76b5d83d8c
commit f194231550
10 changed files with 27 additions and 986 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
"webpack-cli": "^4.8.0" "webpack-cli": "^4.8.0"
}, },
"dependencies": { "dependencies": {
"@librecms/ccm-cms-editor": "^7.0.0-SNAPSHOT"
}, },
"targets": { "targets": {
"main": false "main": false

View File

@ -25,7 +25,9 @@ public class SciProjectAuthoringSteps implements MvcAuthoringSteps {
@Override @Override
public Set<Class<?>> getResourceClasses() { public Set<Class<?>> getResourceClasses() {
return Set.of( return Set.of(
SciProjectDescriptionStepResources.class,
SciProjectDescriptionStepService.class, SciProjectDescriptionStepService.class,
SciProjectFundingStepResources.class,
SciProjectFundingStepService.class SciProjectFundingStepService.class
); );
} }

View File

@ -153,7 +153,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
new Locale(localeParam).toString() new Locale(localeParam).toString()
); );
return "org/scientificcms/contenttypes/sciproject/ui/sciproject-fundingtext/view.xhtml"; return "org/scientificcms/contenttypes/sciproject/ui/funding/view.xhtml";
} else { } else {
return documentUi.showAccessDenied( return documentUi.showAccessDenied(
getContentSection(), getContentSection(),
@ -206,7 +206,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
} }
@GET @GET
@Path("/funding-text/edit") @Path("/funding-text/edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired @AuthorizationRequired
public String editFundingTextValue( public String editFundingTextValue(
@ -229,7 +229,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
new Locale(localeParam).toString() new Locale(localeParam).toString()
); );
return "org/scientificcms/contenttypes/sciproject/ui/sciproject-fundingtext/edit.xhtml"; return "org/scientificcms/contenttypes/sciproject/ui/fundingtext/edit.xhtml";
} else { } else {
return documentUi.showAccessDenied( return documentUi.showAccessDenied(
getContentSection(), getContentSection(),
@ -332,7 +332,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
new Locale(localeParam).toString() new Locale(localeParam).toString()
); );
return "org/scientificcms/contenttypes/sciproject/ui/sciproject-fundingvolume/view.xhtml"; return "org/scientificcms/contenttypes/sciproject/ui/fundingvolume/view.xhtml";
} else { } else {
return documentUi.showAccessDenied( return documentUi.showAccessDenied(
getContentSection(), getContentSection(),
@ -385,7 +385,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
} }
@GET @GET
@Path("/funding-volume/edit") @Path("/funding-volume/edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired @AuthorizationRequired
public String editFundingVolumeValue( public String editFundingVolumeValue(
@ -408,7 +408,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
new Locale(localeParam).toString() new Locale(localeParam).toString()
); );
return "org/scientificcms/contenttypes/sciproject/ui/sciproject-fundingtext/edit.xhtml"; return "org/scientificcms/contenttypes/sciproject/ui/fundingvolume/edit.xhtml";
} else { } else {
return documentUi.showAccessDenied( return documentUi.showAccessDenied(
getContentSection(), getContentSection(),
@ -695,7 +695,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep {
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
final Set<Locale> fundingVolumeLocales = getProject() final Set<Locale> fundingVolumeLocales = getProject()
.getProjectDescription() .getFundingVolume()
.getAvailableLocales(); .getAvailableLocales();
fundingVolumeModel.setUnusedLocales( fundingVolumeModel.setUnusedLocales(
globalizationHelper globalizationHelper

View File

@ -80,7 +80,7 @@ public class SciProjectFundingStepResources {
} }
@GET @GET
@Path("/project-funding/{locale}") @Path("/funding/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String viewFundingValue( public String viewFundingValue(
@ -117,7 +117,7 @@ public class SciProjectFundingStepResources {
} }
@GET @GET
@Path("/project-fundingvolume/wordcount/{locale}") @Path("/fundingvolume/wordcount/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String getFundingVolumeWordCount( public String getFundingVolumeWordCount(
@ -154,7 +154,7 @@ public class SciProjectFundingStepResources {
} }
@GET @GET
@Path("/project-fundingvolume/{locale}") @Path("/fundingvolume/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String viewFundingVolumeValue( public String viewFundingVolumeValue(

View File

@ -29,14 +29,14 @@
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{SciProjectDescriptionModel.selectedLocale}" selectedLocale="#{SciProjectDescriptionModel.selectedLocale}"
title="#{SciProjectMessageBundle['description.editor.header']}" title="#{SciProjectMessageBundle['description.editor.header']}"
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/description/variants" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description-resources/project-description"
/> />
</c:if> </c:if>
</ui:define> </ui:define>
<ui:define name="scripts"> <ui:define name="scripts">
<script src="#{request.contextPath}/assets/@sciproject/sciproject-description.js"></script> <script src="#{request.contextPath}/assets/@content-sections/cms-editor.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>

View File

@ -29,14 +29,14 @@
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{SciProjectFundingText.selectedLocale}" selectedLocale="#{SciProjectFundingText.selectedLocale}"
title="#{SciProjectMessageBundle['fundingtext.editor.header']}" title="#{SciProjectMessageBundle['fundingtext.editor.header']}"
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-funding/funding-text/variants" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-funding-resources/funding"
/> />
</c:if> </c:if>
</ui:define> </ui:define>
<ui:define name="scripts"> <ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/sciproject-fundingtext.js"></script> <script src="#{request.contextPath}/assets/@content-sections/cms-editor.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>

View File

@ -27,16 +27,16 @@
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-funding/funding-volume/edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-funding/funding-volume/edit"
editorId="sciproject-funding-volume-editor" editorId="sciproject-funding-volume-editor"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{SciProjectFundingText.selectedLocale}" selectedLocale="#{SciProjectFundingVolume.selectedLocale}"
title="#{SciProjectMessageBundle['fundingvolume.editor.header']}" title="#{SciProjectMessageBundle['fundingvolume.editor.header']}"
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-funding/funding-volume/variants" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-funding-resources/fundingvolume"
/> />
</c:if> </c:if>
</ui:define> </ui:define>
<ui:define name="scripts"> <ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/sciproject-fundingvolume.js"></script> <script src="#{request.contextPath}/assets/@content-sections/cms-editor.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>

View File

@ -11,7 +11,7 @@
"outDir": "target/generated-resources/assets/@content-sections", "outDir": "target/generated-resources/assets/@content-sections",
"sourceMap": true, "sourceMap": true,
"strict": true, "strict": true,
"target": "ES5" "target": "ES6"
}, },
"include": [ "include": [
"src/main/typescript/**/*" "src/main/typescript/**/*"

View File

@ -5,10 +5,10 @@ module.exports = {
chunkIds: false chunkIds: false
}, },
entry: { entry: {
"sciproject-description": "./src/main/typescript/sciproject-description.ts", // "sciproject-description": "./src/main/typescript/sciproject-description.ts",
//"sciproject-contacts": "./src/main/typescript/sciproject-contacts.ts", //"sciproject-contacts": "./src/main/typescript/sciproject-contacts.ts",
"sciproject-fundingtext": "./src/main/typescript/sciproject-fundingtext.ts", // "sciproject-fundingtext": "./src/main/typescript/sciproject-fundingtext.ts",
"sciproject-fundingvolume": "./src/main/typescript/sciproject-fundingvolume.ts", // "sciproject-fundingvolume": "./src/main/typescript/sciproject-fundingvolume.ts",
//"sciproject-sponsoring": "./src/main/typescript/sciproject-sponsoring.ts" //"sciproject-sponsoring": "./src/main/typescript/sciproject-sponsoring.ts"
}, },
output: { output: {