Skip to content

Commit

Permalink
Commit including some bugfixes and improvement for version 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
df-git committed Jun 30, 2021
1 parent e5fc9f2 commit 14b1d84
Show file tree
Hide file tree
Showing 36 changed files with 185 additions and 119 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="./{0}?{1}={2}&{3}={4}">content class management</a>.
label.itemclassmanagemessagenomanage=This item does not allow to have sub-elements.
label.noregisters=There are no registers in this registry.
Expand Down
Binary file modified dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Base-1.0.jar
Binary file not shown.
Binary file modified dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDInterface-1.0.jar
Binary file not shown.
Binary file modified dist/app/re3gistry2/WEB-INF/lib/Re3gistry2CRUDrdb-1.0.jar
Binary file not shown.
Binary file modified dist/app/re3gistry2/WEB-INF/lib/Re3gistry2JavaAPI-1.0.jar
Binary file not shown.
Binary file modified dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Migration-1.0.jar
Binary file not shown.
Binary file modified dist/app/re3gistry2/WEB-INF/lib/Re3gistry2Model-1.0.jar
Binary file not shown.
26 changes: 23 additions & 3 deletions dist/app/re3gistry2/jsp/ajaxServices/browseLoader.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
%>
Expand Down Expand Up @@ -232,6 +234,17 @@
<input type="hidden" name="<%=BaseConstants.KEY_REQUEST_FORM_ITEMUUID%>" value="<%=regItem.getUuid()%>" />
<input type="hidden" name="<%=BaseConstants.KEY_FORM_FIELD_NAME_REGLANGUAGECODEUUID%>" value="<%=currentLanguage.getUuid()%>" />


<%if (statusDisallowed) { %>
<div class="row">
<div class="col-12">
<div class="alert alert-warning" role="alert">
<%=MessageFormat.format(localization.getString("warning.item.cannot.beedited"), regItem.getRegStatus().getLocalid())%>
</div>
</div>
</div>
<% }%>

<%-- The URI field is always available and non editable --%>
<div class="row form-group editing-labels">
<label for="URI" class="col-sm-4">${localization.getString("label.uri")}</label>
Expand Down Expand Up @@ -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)%>
Expand Down Expand Up @@ -439,7 +452,7 @@

<%
boolean separatorNeeded = false;
if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite) { %>
if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite && !statusDisallowed) { %>
<div class="col-sm-3">
<div class="dropdown d-inline">
<button type="button" class="btn btn-secondary dropdown-toggle width100" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">${localization.getString("label.moreactions")}</button>
Expand Down Expand Up @@ -496,10 +509,12 @@
</script>
<% } %>

<% if (!statusDisallowed) { %>
<div class="col-sm-3">
<button id="save-clarification" disabled="disabled" type="submit" class="btn btn-success width100"><i class="far fa-save"></i> ${localization.getString("label.saveclarification")}</button>
</div>
<% } %>
<% } %>


</div>
Expand Down Expand Up @@ -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) { %>
<div class="col-sm-6">
<button type="button" class="btn btn-primary float-right mr-2 width100" data-toggle="modal" data-target="#exampleModalLong" title="${localization.getString("load.template.bulkimport.title")}">
<i class="fas fa-upload"></i> ${localization.getString("label.bulkimport")}
</button>
</div>
<% }%>


<!-- Modal -->
Expand Down Expand Up @@ -657,13 +675,15 @@
<div class="col-sm-6"></div>
<%}%>


<%
if (!statusDisallowed) {%>
<div class="col-sm-6">
<a href=".<%=(regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTRY)) ? WebConstants.PAGE_URINAME_ADDREGISTER : WebConstants.PAGE_URINAME_ADDITEM%>?<%=BaseConstants.KEY_REQUEST_ITEMUUID%>=<%=regItem.getUuid()%>" class="btn btn-success float-right width100"><% if (regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTRY)) {%><i class="fas fa-plus"></i> ${localization.getString("label.addregister")}<%} else {%><i class="fas fa-plus"></i> ${localization.getString("label.additem")}<%}%></a>
</div>

<% } %>
<% } %>
<% } %>
</div>

</div>
Expand Down
4 changes: 2 additions & 2 deletions dist/app/re3gistry2/jsp/install/step-clean-installation.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<div class="row form-group editing-labels">
<div class="col-sm-6">
<label for="${constants.KEY_REQUEST_REGISTRY_BASEURI}">${localization.getString("installation.clean.registry.baseuri")}</label>
<p class="gray-text">${localization.getString("installation.clean.registry.localid.description")}</p>
<p class="gray-text">${localization.getString("installation.clean.registry.baseuri.description")}</p>
</div>
<div class="col-sm-6">
<div class="input-group">
Expand All @@ -145,7 +145,7 @@
<div class="row form-group editing-labels">
<div class="col-sm-6">
<label for="${constants.KEY_REQUEST_REGISTRY_LOCALID}">${localization.getString("installation.clean.registry.localid")}</label>
<p class="gray-text">${localization.getString("installation.clean.registry.baseuri.description")}</p>
<p class="gray-text">${localization.getString("installation.clean.registry.localid.description")}</p>
</div>
<div class="col-sm-6">
<div class="input-group">
Expand Down
Binary file modified dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Base-1.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dist/app/re3gistry2restapi/WEB-INF/lib/Re3gistry2Model-1.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions dist/webapp/public_html/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ div.overlay-loader .load-feedback{
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.overflowauto{
overflow: auto;
}
2 changes: 1 addition & 1 deletion dist/webapp/public_html/js/app_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion dist/webapp/public_html/js/app_core_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions dist/webapp/public_html/js/app_i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<RegItemproposed> 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<RegItemproposed> containedRegItemsCheck = regItemproposedManager.getAllNew(regItemclasses, regItem, regRelationpredicateCollection, start, length);
//
// if (!containedRegItemsCheck.isEmpty() && containedRegItemsCheck.size() != containedRegItems.size()) {
// containedRegItems = containedRegItemsCheck;
// totalCount = regItemproposedManager.countAllNew(regItemclasses, regItem, regRelationpredicateCollection);
// }
// }
List<RegItemproposed> containedRegItemsCheck = regItemproposedManager.getAllNew(regItemclasses, regItem, regRelationpredicateCollection, start, length);

if (!containedRegItemsCheck.isEmpty()
// && containedRegItemsCheck.size() != containedRegItems.size()
) {
containedRegItems = containedRegItemsCheck;
totalCount = regItemproposedManager.countAllNew(regItemclasses, regItem, regRelationpredicateCollection);
}

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="./{0}?{1}={2}&{3}={4}">content class management</a>.
label.itemclassmanagemessagenomanage=This item does not allow to have sub-elements.
label.noregisters=There are no registers in this registry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
%>
Expand Down Expand Up @@ -232,6 +234,17 @@
<input type="hidden" name="<%=BaseConstants.KEY_REQUEST_FORM_ITEMUUID%>" value="<%=regItem.getUuid()%>" />
<input type="hidden" name="<%=BaseConstants.KEY_FORM_FIELD_NAME_REGLANGUAGECODEUUID%>" value="<%=currentLanguage.getUuid()%>" />


<%if (statusDisallowed) { %>
<div class="row">
<div class="col-12">
<div class="alert alert-warning" role="alert">
<%=MessageFormat.format(localization.getString("warning.item.cannot.beedited"), regItem.getRegStatus().getLocalid())%>
</div>
</div>
</div>
<% }%>

<%-- The URI field is always available and non editable --%>
<div class="row form-group editing-labels">
<label for="URI" class="col-sm-4">${localization.getString("label.uri")}</label>
Expand Down Expand Up @@ -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)%>
Expand Down Expand Up @@ -439,7 +452,7 @@

<%
boolean separatorNeeded = false;
if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite) { %>
if ((permissionItemProposal || permissionItemRegisterRegistry || permissionRegisterRegistry) && canWrite && !statusDisallowed) { %>
<div class="col-sm-3">
<div class="dropdown d-inline">
<button type="button" class="btn btn-secondary dropdown-toggle width100" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">${localization.getString("label.moreactions")}</button>
Expand Down Expand Up @@ -496,10 +509,12 @@
</script>
<% } %>

<% if (!statusDisallowed) { %>
<div class="col-sm-3">
<button id="save-clarification" disabled="disabled" type="submit" class="btn btn-success width100"><i class="far fa-save"></i> ${localization.getString("label.saveclarification")}</button>
</div>
<% } %>
<% } %>


</div>
Expand Down Expand Up @@ -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) { %>
<div class="col-sm-6">
<button type="button" class="btn btn-primary float-right mr-2 width100" data-toggle="modal" data-target="#exampleModalLong" title="${localization.getString("load.template.bulkimport.title")}">
<i class="fas fa-upload"></i> ${localization.getString("label.bulkimport")}
</button>
</div>
<% }%>


<!-- Modal -->
Expand Down Expand Up @@ -657,13 +675,15 @@
<div class="col-sm-6"></div>
<%}%>


<%
if (!statusDisallowed) {%>
<div class="col-sm-6">
<a href=".<%=(regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTRY)) ? WebConstants.PAGE_URINAME_ADDREGISTER : WebConstants.PAGE_URINAME_ADDITEM%>?<%=BaseConstants.KEY_REQUEST_ITEMUUID%>=<%=regItem.getUuid()%>" class="btn btn-success float-right width100"><% if (regItem.getRegItemclass().getRegItemclasstype().getLocalid().equals(BaseConstants.KEY_ITEMCLASS_TYPE_REGISTRY)) {%><i class="fas fa-plus"></i> ${localization.getString("label.addregister")}<%} else {%><i class="fas fa-plus"></i> ${localization.getString("label.additem")}<%}%></a>
</div>

<% } %>
<% } %>
<% } %>
</div>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<div class="row form-group editing-labels">
<div class="col-sm-6">
<label for="${constants.KEY_REQUEST_REGISTRY_BASEURI}">${localization.getString("installation.clean.registry.baseuri")}</label>
<p class="gray-text">${localization.getString("installation.clean.registry.localid.description")}</p>
<p class="gray-text">${localization.getString("installation.clean.registry.baseuri.description")}</p>
</div>
<div class="col-sm-6">
<div class="input-group">
Expand All @@ -145,7 +145,7 @@
<div class="row form-group editing-labels">
<div class="col-sm-6">
<label for="${constants.KEY_REQUEST_REGISTRY_LOCALID}">${localization.getString("installation.clean.registry.localid")}</label>
<p class="gray-text">${localization.getString("installation.clean.registry.baseuri.description")}</p>
<p class="gray-text">${localization.getString("installation.clean.registry.localid.description")}</p>
</div>
<div class="col-sm-6">
<div class="input-group">
Expand Down
Loading

0 comments on commit 14b1d84

Please sign in to comment.