diff --git a/dist/app/re3gistry2/WEB-INF/classes/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.class b/dist/app/re3gistry2/WEB-INF/classes/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.class index 2bb72686..b9f3ae5f 100644 Binary files a/dist/app/re3gistry2/WEB-INF/classes/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.class and b/dist/app/re3gistry2/WEB-INF/classes/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.class differ diff --git a/dist/app/re3gistry2/WEB-INF/classes/localizations/LocalizationBundle_en.properties b/dist/app/re3gistry2/WEB-INF/classes/localizations/LocalizationBundle_en.properties index fe5dcb14..432c3f7e 100644 --- a/dist/app/re3gistry2/WEB-INF/classes/localizations/LocalizationBundle_en.properties +++ b/dist/app/re3gistry2/WEB-INF/classes/localizations/LocalizationBundle_en.properties @@ -73,6 +73,7 @@ label.managefields=Manage fields label.containeditems=Contained items label.proposeditems=New items proposed label.additem=Add item +warning.item.cannot.beedited=The current item cannot be edited because the status is set to {0} label.itemclassmanagemessage= This item does not allow to have sub-elements. Consider changing its properties in the content class management. label.itemclassmanagemessagenomanage=This item does not allow to have sub-elements. label.noregisters=There are no registers in this registry. diff --git a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Base-1.0.jar b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Base-1.0.jar index 365bb3da..5fc4999c 100644 Binary files a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Base-1.0.jar and b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Base-1.0.jar differ diff --git a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar index 1bd47d9a..44537c1d 100644 Binary files a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar and b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar differ diff --git a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar index 2a9039d5..04ef2fac 100644 Binary files a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar and b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar differ diff --git a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2JavaAPI-1.0.jar b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2JavaAPI-1.0.jar index 5e73ad05..1fdc1510 100644 Binary files a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2JavaAPI-1.0.jar and b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2JavaAPI-1.0.jar differ diff --git a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Migration-1.0.jar b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Migration-1.0.jar index 89e0acd9..eb1913e2 100644 Binary files a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Migration-1.0.jar and b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Migration-1.0.jar differ diff --git a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Model-1.0.jar b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Model-1.0.jar index bc65ecc6..5294957b 100644 Binary files a/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Model-1.0.jar and b/dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Model-1.0.jar differ diff --git a/dist/app/re3gistry2/jsp/ajaxServices/browseLoader.jsp b/dist/app/re3gistry2/jsp/ajaxServices/browseLoader.jsp index 714cf02f..0c06c260 100644 --- a/dist/app/re3gistry2/jsp/ajaxServices/browseLoader.jsp +++ b/dist/app/re3gistry2/jsp/ajaxServices/browseLoader.jsp @@ -183,6 +183,8 @@ registerURI = en.getValue(); } + boolean statusDisallowed = regItem.getRegStatus().getLocalid().equals(BaseConstants.KEY_STATUS_LOCALID_INVALID) || regItem.getRegStatus().getLocalid().equals(BaseConstants.KEY_STATUS_LOCALID_RETIRED) || regItem.getRegStatus().getLocalid().equals(BaseConstants.KEY_STATUS_LOCALID_SUPERSEDED); + String collecitonHTML = ItemHelper.getBreadcrumbCollectionHTMLForRegitem("", regItem, entityManager, currentLanguage); request.setCharacterEncoding("UTF-8"); %> @@ -232,6 +234,17 @@ + + <%if (statusDisallowed) { %> +
+
+ +
+
+ <% }%> + <%-- The URI field is always available and non editable --%>
@@ -351,7 +364,7 @@ else if (regFieldmapping.getRegField().getRegFieldtype().getLocalid().equals(BaseConstants.KEY_FIELD_TYPE_DATECREATION)) {%> <%-- Process the "date creation" of the current item --%> <%=JspHelper.jspDateCreationHandler(regItem, regItemproposed, regLocalizationproposeds, currentLanguage, masterLanguage, regStatusManager, regStatuslocalizationManager)%> - <%} // Date Edit + <%} // Date Edit else if (regFieldmapping.getRegField().getRegFieldtype().getLocalid().equals(BaseConstants.KEY_FIELD_TYPE_DATEEDIT)) {%> <%-- Process the "date edit" of the current item --%> <%=JspHelper.jspDateEditHandler(regItem, regItemproposed, regLocalizationproposeds, currentLanguage, masterLanguage, regStatusManager, regStatuslocalizationManager)%> @@ -439,7 +452,7 @@ <% boolean separatorNeeded = false; - if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite) { %> + if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite && !statusDisallowed) { %>
@@ -604,11 +619,14 @@ <% if (regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTER) || regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_ITEM)) {%> <%-- Bulk import commands --%> + <% + if (!statusDisallowed) { %>
+ <% }%> @@ -657,13 +675,15 @@
<%}%> - + <% + if (!statusDisallowed) {%> <% } %> <% } %> + <% } %>
diff --git a/dist/app/re3gistry2/jsp/install/step-clean-installation.jsp b/dist/app/re3gistry2/jsp/install/step-clean-installation.jsp index d3b55ae6..7b71f14a 100644 --- a/dist/app/re3gistry2/jsp/install/step-clean-installation.jsp +++ b/dist/app/re3gistry2/jsp/install/step-clean-installation.jsp @@ -130,7 +130,7 @@
-

${localization.getString("installation.clean.registry.localid.description")}

+

${localization.getString("installation.clean.registry.baseuri.description")}

@@ -145,7 +145,7 @@
-

${localization.getString("installation.clean.registry.baseuri.description")}

+

${localization.getString("installation.clean.registry.localid.description")}

diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Base-1.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Base-1.0.jar index 4a396ec4..5fc4999c 100644 Binary files a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Base-1.0.jar and b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Base-1.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar index 3748289d..44537c1d 100644 Binary files a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar and b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar index b084b4d8..04ef2fac 100644 Binary files a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar and b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Model-1.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Model-1.0.jar index 92349cdc..5294957b 100644 Binary files a/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Model-1.0.jar and b/dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Model-1.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/commons-beanutils-1.9.4.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/commons-beanutils-1.9.4.jar new file mode 100644 index 00000000..b73543cb Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/commons-beanutils-1.9.4.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/commons-io-2.7.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/commons-io-2.7.jar new file mode 100644 index 00000000..58894589 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/commons-io-2.7.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/encoder-1.2.2.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/encoder-1.2.2.jar new file mode 100644 index 00000000..529124fe Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/encoder-1.2.2.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-cache-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-cache-1.6.0.jar new file mode 100644 index 00000000..73af3bb0 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-cache-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-config-core-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-config-core-1.6.0.jar new file mode 100644 index 00000000..b768075f Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-config-core-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-config-ogdl-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-config-ogdl-1.6.0.jar new file mode 100644 index 00000000..6e8fccf5 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-config-ogdl-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-core-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-core-1.6.0.jar new file mode 100644 index 00000000..a5a735c6 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-core-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-cipher-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-cipher-1.6.0.jar new file mode 100644 index 00000000..c6149635 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-cipher-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-core-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-core-1.6.0.jar new file mode 100644 index 00000000..4d674ae4 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-core-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-hash-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-hash-1.6.0.jar new file mode 100644 index 00000000..a746f0d8 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-crypto-hash-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-event-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-event-1.6.0.jar new file mode 100644 index 00000000..e48b752f Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-event-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-lang-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-lang-1.6.0.jar new file mode 100644 index 00000000..03b43da2 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-lang-1.6.0.jar differ diff --git a/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-web-1.6.0.jar b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-web-1.6.0.jar new file mode 100644 index 00000000..2ee670e0 Binary files /dev/null and b/dist/app/re3gistry2restapi/WEB-INF/lib/shiro-web-1.6.0.jar differ diff --git a/dist/webapp/public_html/css/style.css b/dist/webapp/public_html/css/style.css index 28a5555f..8a3ef963 100644 --- a/dist/webapp/public_html/css/style.css +++ b/dist/webapp/public_html/css/style.css @@ -48,3 +48,6 @@ div.overlay-loader .load-feedback{ 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } +.overflowauto{ + overflow: auto; +} diff --git a/dist/webapp/public_html/js/app_core.js b/dist/webapp/public_html/js/app_core.js index 82012cfa..f0b8bb1a 100644 --- a/dist/webapp/public_html/js/app_core.js +++ b/dist/webapp/public_html/js/app_core.js @@ -124,7 +124,7 @@ function renderData(data) { "dom": "<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", - "order": [[0, "desc"]], + "order": [[0, "asc"]], "ordering": true, "paging": true, "searching": true, diff --git a/dist/webapp/public_html/js/app_core_search.js b/dist/webapp/public_html/js/app_core_search.js index 1eca8c15..efc47460 100644 --- a/dist/webapp/public_html/js/app_core_search.js +++ b/dist/webapp/public_html/js/app_core_search.js @@ -513,7 +513,7 @@ tmpOut = tmpOut.replace('{1}', tmpResLabel); // Handling the register let tmpHref = result.register_itemclass_baseuri + '/' + result.register_itemclass_localid - tmpOut = tmpOut.replace('{2}', i18n[key_searchRegisterLabel] + ': ' + renderHref(tmpHref)); + tmpOut = tmpOut.replace('{2}', i18n[key_searchRegisterLabel] + ': ' + renderHref(tmpHref,tmpHref)); // Handling definition let tmpResDefinition = checkField(result, key_solrResultFieldDefinitionPrefix, currentLanguage); if (tmpResDefinition.length > 0) { diff --git a/dist/webapp/public_html/js/app_i18n.js b/dist/webapp/public_html/js/app_i18n.js index 79a4b390..b2d24827 100644 --- a/dist/webapp/public_html/js/app_i18n.js +++ b/dist/webapp/public_html/js/app_i18n.js @@ -42,20 +42,25 @@ var i18n; * @param {type} selector */ function initLocalization(selector) { + let storedLanguage = val_emptyString; // checking if there is the language passed by URL if (languageFromUrl !== null && languageFromUrl.length === 2) { + currentLanguage = languageFromUrl; } else { + // Checking if there is a language stored in the cookies if (navigator.cookieEnabled) { + // Getting the language stored in the cookie storedLanguage = getCookie(key_cookieName_language); } // Takes the cookie stored language if available, otherwise the default currentLanguage = (storedLanguage !== val_emptyString && storedLanguage !== "undefined") ? storedLanguage : getBrowserLanguage(); + } // Storing the language to the cookie if needed diff --git a/sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.java b/sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.java index 5e46bcb9..f06cb519 100644 --- a/sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.java +++ b/sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/ItemProposedListLoaderServlet.java @@ -79,13 +79,13 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp String sStart = request.getParameter(BaseConstants.KEY_REQUEST_DT_START); String sLength = request.getParameter(BaseConstants.KEY_REQUEST_DT_LENGTH); String sDraw = request.getParameter(BaseConstants.KEY_REQUEST_DT_DRAW); - + itemUUID = (itemUUID != null) ? InputSanitizerHelper.sanitizeInput(itemUUID) : null; languageUUID = (languageUUID != null) ? InputSanitizerHelper.sanitizeInput(languageUUID) : null; sStart = (sStart != null) ? InputSanitizerHelper.sanitizeInput(sStart) : null; sLength = (sLength != null) ? InputSanitizerHelper.sanitizeInput(sLength) : null; sDraw = (sDraw != null) ? InputSanitizerHelper.sanitizeInput(sDraw) : null; - + int start; int length; int draw; @@ -166,17 +166,25 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp regItemclasses.clear(); regItemclasses.add(newRegItemclass); - containedRegItems = regItemproposedManager.getAllNew(regItemclasses, start, length); - totalCount = regItemproposedManager.countAllNew(regItemclasses); - - if (containedRegItems!=null && containedRegItems.size() > 0) { - //Check collections - List containedRegItemsCheck = regItemproposedManager.getAllNew(regItemclasses, regItem, regRelationpredicateCollection, start, length); - - if (!containedRegItemsCheck.isEmpty() && containedRegItemsCheck.size() != containedRegItems.size()) { - containedRegItems = containedRegItemsCheck; - totalCount = regItemproposedManager.countAllNew(regItemclasses, regItem, regRelationpredicateCollection); - } +// containedRegItems = regItemproposedManager.getAllNew(regItemclasses, start, length); +// totalCount = regItemproposedManager.countAllNew(regItemclasses); +// +// if (containedRegItems!=null && containedRegItems.size() > 0) { +// //Check collections +// List containedRegItemsCheck = regItemproposedManager.getAllNew(regItemclasses, regItem, regRelationpredicateCollection, start, length); +// +// if (!containedRegItemsCheck.isEmpty() && containedRegItemsCheck.size() != containedRegItems.size()) { +// containedRegItems = containedRegItemsCheck; +// totalCount = regItemproposedManager.countAllNew(regItemclasses, regItem, regRelationpredicateCollection); +// } +// } + List containedRegItemsCheck = regItemproposedManager.getAllNew(regItemclasses, regItem, regRelationpredicateCollection, start, length); + + if (!containedRegItemsCheck.isEmpty() +// && containedRegItemsCheck.size() != containedRegItems.size() + ) { + containedRegItems = containedRegItemsCheck; + totalCount = regItemproposedManager.countAllNew(regItemclasses, regItem, regRelationpredicateCollection); } } else { diff --git a/sources/Re3gistry2/src/main/resources/localizations/LocalizationBundle_en.properties b/sources/Re3gistry2/src/main/resources/localizations/LocalizationBundle_en.properties index fe5dcb14..432c3f7e 100644 --- a/sources/Re3gistry2/src/main/resources/localizations/LocalizationBundle_en.properties +++ b/sources/Re3gistry2/src/main/resources/localizations/LocalizationBundle_en.properties @@ -73,6 +73,7 @@ label.managefields=Manage fields label.containeditems=Contained items label.proposeditems=New items proposed label.additem=Add item +warning.item.cannot.beedited=The current item cannot be edited because the status is set to {0} label.itemclassmanagemessage= This item does not allow to have sub-elements. Consider changing its properties in the content class management. label.itemclassmanagemessagenomanage=This item does not allow to have sub-elements. label.noregisters=There are no registers in this registry. diff --git a/sources/Re3gistry2/src/main/webapp/jsp/ajaxServices/browseLoader.jsp b/sources/Re3gistry2/src/main/webapp/jsp/ajaxServices/browseLoader.jsp index 714cf02f..0c06c260 100644 --- a/sources/Re3gistry2/src/main/webapp/jsp/ajaxServices/browseLoader.jsp +++ b/sources/Re3gistry2/src/main/webapp/jsp/ajaxServices/browseLoader.jsp @@ -183,6 +183,8 @@ registerURI = en.getValue(); } + boolean statusDisallowed = regItem.getRegStatus().getLocalid().equals(BaseConstants.KEY_STATUS_LOCALID_INVALID) || regItem.getRegStatus().getLocalid().equals(BaseConstants.KEY_STATUS_LOCALID_RETIRED) || regItem.getRegStatus().getLocalid().equals(BaseConstants.KEY_STATUS_LOCALID_SUPERSEDED); + String collecitonHTML = ItemHelper.getBreadcrumbCollectionHTMLForRegitem("", regItem, entityManager, currentLanguage); request.setCharacterEncoding("UTF-8"); %> @@ -232,6 +234,17 @@ + + <%if (statusDisallowed) { %> +
+
+ +
+
+ <% }%> + <%-- The URI field is always available and non editable --%>
@@ -351,7 +364,7 @@ else if (regFieldmapping.getRegField().getRegFieldtype().getLocalid().equals(BaseConstants.KEY_FIELD_TYPE_DATECREATION)) {%> <%-- Process the "date creation" of the current item --%> <%=JspHelper.jspDateCreationHandler(regItem, regItemproposed, regLocalizationproposeds, currentLanguage, masterLanguage, regStatusManager, regStatuslocalizationManager)%> - <%} // Date Edit + <%} // Date Edit else if (regFieldmapping.getRegField().getRegFieldtype().getLocalid().equals(BaseConstants.KEY_FIELD_TYPE_DATEEDIT)) {%> <%-- Process the "date edit" of the current item --%> <%=JspHelper.jspDateEditHandler(regItem, regItemproposed, regLocalizationproposeds, currentLanguage, masterLanguage, regStatusManager, regStatuslocalizationManager)%> @@ -439,7 +452,7 @@ <% boolean separatorNeeded = false; - if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite) { %> + if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite && !statusDisallowed) { %>
@@ -604,11 +619,14 @@ <% if (regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTER) || regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_ITEM)) {%> <%-- Bulk import commands --%> + <% + if (!statusDisallowed) { %>
+ <% }%> @@ -657,13 +675,15 @@
<%}%> - + <% + if (!statusDisallowed) {%> <% } %> <% } %> + <% } %>
diff --git a/sources/Re3gistry2/src/main/webapp/jsp/install/step-clean-installation.jsp b/sources/Re3gistry2/src/main/webapp/jsp/install/step-clean-installation.jsp index d3b55ae6..7b71f14a 100644 --- a/sources/Re3gistry2/src/main/webapp/jsp/install/step-clean-installation.jsp +++ b/sources/Re3gistry2/src/main/webapp/jsp/install/step-clean-installation.jsp @@ -130,7 +130,7 @@
-

${localization.getString("installation.clean.registry.localid.description")}

+

${localization.getString("installation.clean.registry.baseuri.description")}

@@ -145,7 +145,7 @@
-

${localization.getString("installation.clean.registry.baseuri.description")}

+

${localization.getString("installation.clean.registry.localid.description")}

diff --git a/sources/Re3gistry2Migration/src/main/java/eu/europa/ec/re3gistry2/migration/manager/MigrateItems.java b/sources/Re3gistry2Migration/src/main/java/eu/europa/ec/re3gistry2/migration/manager/MigrateItems.java index 39870710..4f6f545c 100644 --- a/sources/Re3gistry2Migration/src/main/java/eu/europa/ec/re3gistry2/migration/manager/MigrateItems.java +++ b/sources/Re3gistry2Migration/src/main/java/eu/europa/ec/re3gistry2/migration/manager/MigrateItems.java @@ -116,115 +116,115 @@ public void startMigrationItems() throws Exception { for (Itemclass itemclass : itemclassList) { - Integer AUTO_INCREMENT_REG_FIELD_LIST_ORDER = 0; + Integer AUTO_INCREMENT_REG_FIELD_LIST_ORDER = 0; - /** - * if the reg item class exist than use than one, otherwise - * create it - */ - RegItemclass regItemclass; - try { - RegItemclassManager regItemclassManager = new RegItemclassManager(entityManagerRe3gistry2); - regItemclass = regItemclassManager.getByLocalid(itemclass.getUriname()); - } catch (Exception exe) { - try { - RegItemclasstypeManager regItemclasstypeManager = new RegItemclasstypeManager(entityManagerRe3gistry2); - RegItemclasstype regItemclasstypeItem = regItemclasstypeManager.getByLocalid("item"); - regItemclass = addRegItemClassByItemclass(itemclass, procedureorder, regItemclasstypeItem, commit); - } catch (Exception ex) { - logger.error(ex.getMessage()); - throw new Exception(ex.getMessage()); - } - } - procedureorder++; - - RegInstallationHandler regInstallationHandler = new RegInstallationHandler(entityManagerRe3gistry2); - HashMap regFieldsMap = new HashMap<>(); - regFieldsMap.put("label", regInstallationHandler.createDefaultField(regItemclass, "label", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_STRING_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("definition", regInstallationHandler.createDefaultField(regItemclass, "definition", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_LONGTEXT_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("description", regInstallationHandler.createDefaultField(regItemclass, "description", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_LONGTEXT_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - - regFieldsMap.put("collection", regInstallationHandler.createDefaultField(regItemclass, "collection", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_COLLECTION_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("parent", regInstallationHandler.createDefaultField(regItemclass, "parent", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_PARENT_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("successor", regInstallationHandler.createDefaultField(regItemclass, "successor", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_SUCCESSOR_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("predecessor", regInstallationHandler.createDefaultField(regItemclass, "predecessor", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_PREDECESSOR_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("registry", regInstallationHandler.createDefaultField(regItemclass, "registry", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_REGISTRY_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - regFieldsMap.put("register", regInstallationHandler.createDefaultField(regItemclass, "register", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_REGISTER_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - - AUTO_INCREMENT_REG_FIELD_LIST_ORDER = migrateCustomattributesByItemClass(itemclass, regItemclass, regFieldsMap, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit); - regFieldsMap.put("status", regInstallationHandler.createDefaultField(regItemclass, "status", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_STATUS_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); - - /** - * now you can commit all the item classes - */ + /** + * if the reg item class exist than use than one, otherwise + * create it + */ + RegItemclass regItemclass; + try { + RegItemclassManager regItemclassManager = new RegItemclassManager(entityManagerRe3gistry2); + regItemclass = regItemclassManager.getByLocalid(itemclass.getUriname()); + } catch (Exception exe) { try { - if (!entityManagerRe3gistry2.getTransaction().isActive()) { - entityManagerRe3gistry2.getTransaction().begin(); - } - entityManagerRe3gistry2.getTransaction().commit(); + RegItemclasstypeManager regItemclasstypeManager = new RegItemclasstypeManager(entityManagerRe3gistry2); + RegItemclasstype regItemclasstypeItem = regItemclasstypeManager.getByLocalid("item"); + regItemclass = addRegItemClassByItemclass(itemclass, procedureorder, regItemclasstypeItem, commit); } catch (Exception ex) { logger.error(ex.getMessage()); throw new Exception(ex.getMessage()); } - /** - * commit is false because we don't want to commit anything - * before the end of the item creation so, once the item and - * all its related relations have been created, than we - * commit the entire item and relations - */ - commit = false; + } + procedureorder++; + + RegInstallationHandler regInstallationHandler = new RegInstallationHandler(entityManagerRe3gistry2); + HashMap regFieldsMap = new HashMap<>(); + regFieldsMap.put("label", regInstallationHandler.createDefaultField(regItemclass, "label", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_STRING_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("definition", regInstallationHandler.createDefaultField(regItemclass, "definition", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_LONGTEXT_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("description", regInstallationHandler.createDefaultField(regItemclass, "description", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_LONGTEXT_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + + regFieldsMap.put("collection", regInstallationHandler.createDefaultField(regItemclass, "collection", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_COLLECTION_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("parent", regInstallationHandler.createDefaultField(regItemclass, "parent", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_PARENT_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("successor", regInstallationHandler.createDefaultField(regItemclass, "successor", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_SUCCESSOR_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("predecessor", regInstallationHandler.createDefaultField(regItemclass, "predecessor", Boolean.FALSE, BaseConstants.KEY_FIELDTYPE_PREDECESSOR_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("registry", regInstallationHandler.createDefaultField(regItemclass, "registry", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_REGISTRY_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + regFieldsMap.put("register", regInstallationHandler.createDefaultField(regItemclass, "register", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_REGISTER_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + + AUTO_INCREMENT_REG_FIELD_LIST_ORDER = migrateCustomattributesByItemClass(itemclass, regItemclass, regFieldsMap, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit); + regFieldsMap.put("status", regInstallationHandler.createDefaultField(regItemclass, "status", Boolean.TRUE, BaseConstants.KEY_FIELDTYPE_STATUS_UUID, null, AUTO_INCREMENT_REG_FIELD_LIST_ORDER++, commit)); + + /** + * now you can commit all the item classes + */ + try { + if (!entityManagerRe3gistry2.getTransaction().isActive()) { + entityManagerRe3gistry2.getTransaction().begin(); + } + entityManagerRe3gistry2.getTransaction().commit(); + } catch (Exception ex) { + logger.error(ex.getMessage()); + throw new Exception(ex.getMessage()); + } + /** + * commit is false because we don't want to commit anything + * before the end of the item creation so, once the item and all + * its related relations have been created, than we commit the + * entire item and relations + */ + commit = false; + try { + Query queryItemByItemClass = entityManagerRe3gistry2Migration.createNativeQuery(ConstantsMigration.ITEMS_LATEST_VERSION_LIST_BY_ITEMCLASS.replace(":" + ConstantsMigration.KEY_PARAMETER_ITEMCLASS, "'" + itemclass.getUuid() + "'"), ConstantsMigration.KEY_PARAMETER_ITEMRESULT); + queryItemByItemClass.setParameter(ConstantsMigration.KEY_PARAMETER_ITEMCLASS, itemclass); + + List itemsList; try { - Query queryItemByItemClass = entityManagerRe3gistry2Migration.createNativeQuery(ConstantsMigration.ITEMS_LATEST_VERSION_LIST_BY_ITEMCLASS.replace(":" + ConstantsMigration.KEY_PARAMETER_ITEMCLASS, "'" + itemclass.getUuid() + "'"), ConstantsMigration.KEY_PARAMETER_ITEMRESULT); - queryItemByItemClass.setParameter(ConstantsMigration.KEY_PARAMETER_ITEMCLASS, itemclass); + itemsList = queryItemByItemClass.getResultList(); + } catch (Exception ex) { + logger.error("Error in getting the result list for " + queryItemByItemClass + " " + ex.getMessage()); + throw new Exception("Error in getting the localization for " + queryItemByItemClass + " " + ex.getMessage()); + } - List itemsList; - try { - itemsList = queryItemByItemClass.getResultList(); - } catch (Exception ex) { - logger.error("Error in getting the result list for " + queryItemByItemClass + " " + ex.getMessage()); - throw new Exception("Error in getting the localization for " + queryItemByItemClass + " " + ex.getMessage()); - } + for (Item item : itemsList) { - for (Item item : itemsList) { - - Item collection = getCollectionFromItem(item); - - RegItem regItem = migrateItemLatestVersion.migrateItemLatestVersion(item, collection, regItemclass, regFieldsMap, item.getItemclass(), commit); - itemsToIndexSOLR.add(regItem); - /** - * check if item has other versions* - */ - try { - List previousVersions = getAllItemVersionOrderDescByVersionnumber(item); - if (previousVersions != null) { - for (Item previousVersionItem : previousVersions) { - if (previousVersionItem.getVersionnumber() != 0) { - - Item collectionHistory = getCollectionFromItem(previousVersionItem); - RegItemhistory regItemHistory = migrateItemHistory.migrateItemHistory(previousVersionItem, collectionHistory, regItemclass, regFieldsMap, regItem, commit); - correspondentItemToRegItemHistoryMap.put(previousVersionItem.getUuid() + previousVersionItem.getVersionnumber(), regItemHistory.getUuid()); - } + Item collection = getCollectionFromItem(item); + + RegItem regItem = migrateItemLatestVersion.migrateItemLatestVersion(item, collection, regItemclass, regFieldsMap, item.getItemclass(), commit); + itemsToIndexSOLR.add(regItem); + /** + * check if item has other versions* + */ + try { + List previousVersions = getAllItemVersionOrderDescByVersionnumber(item); + if (previousVersions != null) { + for (Item previousVersionItem : previousVersions) { + if (previousVersionItem.getVersionnumber() != 0) { + + Item collectionHistory = getCollectionFromItem(previousVersionItem); + RegItemhistory regItemHistory = migrateItemHistory.migrateItemHistory(previousVersionItem, collectionHistory, regItemclass, regFieldsMap, regItem, commit); + correspondentItemToRegItemHistoryMap.put(previousVersionItem.getUuid() + previousVersionItem.getVersionnumber(), regItemHistory.getUuid()); } } - } catch (Exception ex) { - logger.error(ex.getMessage()); - throw new Exception(ex.getMessage()); } + } catch (Exception ex) { + logger.error(ex.getMessage()); + throw new Exception(ex.getMessage()); + } - try { - if (!entityManagerRe3gistry2.getTransaction().isActive()) { - entityManagerRe3gistry2.getTransaction().begin(); - } - entityManagerRe3gistry2.getTransaction().commit(); - } catch (Exception ex) { - logger.error(ex.getMessage()); - throw new Exception(ex.getMessage()); + try { + if (!entityManagerRe3gistry2.getTransaction().isActive()) { + entityManagerRe3gistry2.getTransaction().begin(); } - + entityManagerRe3gistry2.getTransaction().commit(); + } catch (Exception ex) { + logger.error(ex.getMessage()); + throw new Exception(ex.getMessage()); } - } catch (Exception ex) { - logger.error(ex.getMessage()); + } + } catch (Exception ex) { + logger.error(ex.getMessage()); + } } /** @@ -853,7 +853,15 @@ private void addRegFieldMappingByCustomAttribute(RegField regField, RegItemclass /** * difficult to understand how to put the table visibility */ - regFieldmapping.setTablevisible(Boolean.TRUE); + if (regItemclass.getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTER)) { + if (regField.getIstitle()) { + regFieldmapping.setTablevisible(Boolean.TRUE); + } else { + regFieldmapping.setTablevisible(Boolean.FALSE); + } + } else { + regFieldmapping.setTablevisible(Boolean.TRUE); + } regFieldmapping.setInsertdate(new Date()); /** * set status, but maybe will be deleted