Users currently associated to <%= farm.getName() %>:
-
-
-
-
-
-<%
- String orderByCol = ParamUtil.getString(request, "orderByCol");
- String orderByType = ParamUtil.getString(request, "orderByType");
- String sortingOrder = orderByType;
-
- //Logic for toggle asc and desc
- if (orderByType.equals("desc"))
- orderByType = "asc";
- else
- orderByType = "desc";
- if (Validator.isNull(orderByType)) {
- orderByType = "asc";
- }
-%>
-
-
-
-
-
-
- <%
- int totalUsers = teamUsers.size();
- List sortableUsers = ListUtil.subList(teamUsers, searchContainer.getStart(),
- searchContainer.getEnd());
-
- if (Validator.isNotNull(orderByCol)) {
- Collections.sort(sortableUsers, new UserComparator());
- if (sortingOrder.equalsIgnoreCase("desc"))
- Collections.reverse(sortableUsers);
- }
- pageContext.setAttribute("results", sortableUsers);
- pageContext.setAttribute("total", totalUsers);
- %>
-
-
-
- ${item.fullname}
- ${item.email}
- ${item.jobTitle}
-
-
-
-
-
-
-
-
-
-
-
-
- Liferay.provide(
- window,
- 'removeFarmUsers',
- function() {
- var removeUserIds = Liferay.Util.listCheckedExcept(document.fm, 'allRowIds');
-
- if (removeUserIds && confirm("Are you sure you want to remove the selected users from this Farm?")) {
- document.fm.removeUserIds.value = removeUserIds;
-
- submitForm(document.fm, '');
- } else {
-
- }
- },
- ['liferay-util-list-fields']
- );
-
\ No newline at end of file
diff --git a/src/main/webapp/html/editfarmusers/edit_farmadmin_users.jsp b/src/main/webapp/html/editfarmusers/edit_farmadmin_users.jsp
deleted file mode 100644
index 7e1d2f8..0000000
--- a/src/main/webapp/html/editfarmusers/edit_farmadmin_users.jsp
+++ /dev/null
@@ -1,91 +0,0 @@
-<%@page import="org.apache.tika.sax.ToTextContentHandler"%>
-<%@include file="../init.jsp"%>
-
-
Administrators currently associated to <%= theFarm.getName() %>:
-
-
-
-
-
-<%
- String orderByCol = ParamUtil.getString(request, "orderByCol");
- String orderByType = ParamUtil.getString(request, "orderByType");
- String sortingOrder = orderByType;
-
- //Logic for toggle asc and desc
- if (orderByType.equals("desc"))
- orderByType = "asc";
- else
- orderByType = "desc";
- if (Validator.isNull(orderByType)) {
- orderByType = "asc";
- }
-%>
-
-
-
-
-
-
- <%
- int totalUsers = admins.size();
- List sortableUsers = ListUtil.subList(admins, searchContainer.getStart(),
- searchContainer.getEnd());
-
- if (Validator.isNotNull(orderByCol)) {
- Collections.sort(sortableUsers, new UserComparator());
- if (sortingOrder.equalsIgnoreCase("desc"))
- Collections.reverse(sortableUsers);
- }
- pageContext.setAttribute("results", sortableUsers);
- pageContext.setAttribute("total", totalUsers);
- %>
-
-
-
- ${item.fullname}
- ${item.email}
- ${item.jobTitle}
-
-
-
-
-
-
-
-
-
-
-
-
- Liferay.provide(
- window,
- 'removeAdministratorRoleFromUsers',
- function() {
- var removeUserIds = Liferay.Util.listCheckedExcept(document.fm, 'allRowIds');
- var array = removeUserIds.split(',');
- var totalUsers = document.getElementById('totalUsers');
-
- if (array.length == totalUsers.value) {
- alert("Forbidden: You are trying removing the role from all the users of the company, at least one must have it.")
- return;
- }
- if (removeUserIds && confirm("Are you sure you want to remove the Administrator role from the selected users?")) {
- document.fm.removeUserIds.value = removeUserIds;
-
- submitForm(document.fm, '');
- } else {
-
- }
- },
- ['liferay-util-list-fields']
- );
-
\ No newline at end of file
diff --git a/src/main/webapp/html/emptyformsdocumentsdisplay/empty_forms_config.jsp b/src/main/webapp/html/emptyformsdocumentsdisplay/empty_forms_config.jsp
deleted file mode 100644
index 7193f56..0000000
--- a/src/main/webapp/html/emptyformsdocumentsdisplay/empty_forms_config.jsp
+++ /dev/null
@@ -1,47 +0,0 @@
-<%@include file="../init.jsp"%>
-<%@ page import="com.liferay.portal.kernel.util.Constants"%>
-<%@ page import="org.gcube.portlets.user.performfish.EmptyFormsDocumentsDisplay"%>
-
-
-
-
Here you should enter the FolderId of the shared folder where the documents are located and whether it shows
- Hatchery, Pre-ongrowing or Grow out documents.
- We're sorry
- <%=currentUser.getFirstName()%>. There was an error performing this operation. A Farm with the entered name may exists already, please choose antoher name or request support at https://support.d4science.org
-
- We're sorry
- <%=currentUser.getFirstName()%>. There was an error performing this operation. Try again, if the error occurs again please report this issue to https://support.d4science.org
-
"),s.cancel.show(),t.remove(),s.cancel.click(function(){x.splice(x.indexOf(t),1),u(n,l),s.statusbar.remove(),o.onCancel.call(n,l,s),n.selectedFiles-=l.length,c(o,n)}),!1},beforeSend:function(e,t){for(var r in t.headers)e.setRequestHeader(r,t.headers[r]);s.progressDiv.show(),s.cancel.hide(),s.done.hide(),o.showAbort&&(s.abort.show(),s.abort.click(function(){u(n,l),e.abort(),n.selectedFiles-=l.length,o.onAbort.call(n,l,s)})),a.formdata?s.progressbar.width("1%"):s.progressbar.width("5%")},uploadProgress:function(e,a,t,r){r>98&&(r=98);var i=r+"%";r>1&&s.progressbar.width(i),o.showProgress&&(s.progressbar.html(i),s.progressbar.css("text-align","center"))},success:function(a,r,i){if(s.cancel.remove(),F.pop(),"json"==o.returnType&&"object"==e.type(a)&&a.hasOwnProperty(o.customErrorKeyStr)){s.abort.hide();var d=a[o.customErrorKeyStr];return o.onError.call(this,l,200,d,s),o.showStatusAfterError?(s.progressDiv.hide(),s.statusbar.append("ERROR: "+d+"")):(s.statusbar.hide(),s.statusbar.remove()),n.selectedFiles-=l.length,void t.remove()}n.responses.push(a),s.progressbar.width("100%"),o.showProgress&&(s.progressbar.html("100%"),s.progressbar.css("text-align","center")),s.abort.hide(),o.onSuccess.call(this,l,a,i,s),o.showStatusAfterSuccess?(o.showDone?(s.done.show(),s.done.click(function(){s.statusbar.hide("slow"),s.statusbar.remove()})):s.done.hide(),o.showDelete?(s.del.show(),s.del.click(function(){u(n,l),s.statusbar.hide().remove(),o.deleteCallback&&o.deleteCallback.call(this,a,s),n.selectedFiles-=l.length,c(o,n)})):s.del.hide()):(s.statusbar.hide("slow"),s.statusbar.remove()),o.showDownload&&(s.download.show(),s.download.click(function(){o.downloadCallback&&o.downloadCallback(a,s)})),t.remove()},error:function(e,a,r){s.cancel.remove(),F.pop(),s.abort.hide(),"abort"==e.statusText?(s.statusbar.hide("slow").remove(),c(o,n)):(o.onError.call(this,l,a,r,s),o.showStatusAfterError?(s.progressDiv.hide(),s.statusbar.append("ERROR: "+r+"")):(s.statusbar.hide(),s.statusbar.remove()),n.selectedFiles-=l.length),t.remove()}};o.showPreview&&null!=d&&"image"==d.type.toLowerCase().split("/").shift()&&p(d,s.preview),o.autoSubmit?(t.ajaxForm(h),x.push(t),r()):(o.showCancel&&(s.cancel.show(),s.cancel.click(function(){x.splice(x.indexOf(t),1),u(n,l),t.remove(),s.statusbar.remove(),o.onCancel.call(n,l,s),n.selectedFiles-=l.length,c(o,n)})),t.ajaxForm(h))}var w=e.extend({url:"",method:"POST",enctype:"multipart/form-data",returnType:null,allowDuplicates:!0,duplicateStrict:!1,allowedTypes:"*",acceptFiles:"*",fileName:"file",formData:!1,dynamicFormData:!1,maxFileSize:-1,maxFileCount:-1,multiple:!0,dragDrop:!0,autoSubmit:!0,showCancel:!0,showAbort:!0,showDone:!1,showDelete:!1,showError:!0,showStatusAfterSuccess:!0,showStatusAfterError:!0,showFileCounter:!0,fileCounterStyle:"). ",showFileSize:!0,showProgress:!1,nestedForms:!0,showDownload:!1,onLoad:function(e){},onSelect:function(e){return!0},onSubmit:function(e,a){},onSuccess:function(e,a,t,r){},onError:function(e,a,t,r){},onCancel:function(e,a){},onAbort:function(e,a){},downloadCallback:!1,deleteCallback:!1,afterUploadAll:!1,serialize:!0,sequential:!1,sequentialCount:2,customProgressBar:!1,abortButtonClass:"ajax-file-upload-abort",cancelButtonClass:"ajax-file-upload-cancel",dragDropContainerClass:"ajax-upload-dragdrop",dragDropHoverClass:"state-hover",errorClass:"ajax-file-upload-error",uploadButtonClass:"ajax-file-upload",dragDropStr:"Drag & Drop Files",uploadStr:"Upload",abortStr:"Abort",cancelStr:"Cancel",deleteStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"is not allowed. Allowed extensions: ",duplicateErrorStr:"is not allowed. File already exists.",sizeErrorStr:"is not allowed. Allowed Max size: ",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:" is not allowed. Maximum allowed files are:",downloadStr:"Download",customErrorKeyStr:"jquery-upload-file-error",showQueueDiv:!1,statusBarWidth:400,dragdropWidth:400,showPreview:!1,previewHeight:"auto",previewWidth:"100%",extraHTML:!1,uploadQueueOrder:"top",headers:{}},t);this.fileCounter=1,this.selectedFiles=0;var g="ajax-file-upload-"+(new Date).getTime();this.formGroup=g,this.errorLog=e(""),this.responses=[],this.existingFileNames=[],a.formdata||(w.dragDrop=!1),a.formdata&&1!==w.maxFileCount||(w.multiple=!1),e(this).html("");var C=this,b=e("
"+w.uploadStr+"
");e(b).addClass(w.uploadButtonClass),function a(){if(e.fn.ajaxForm){if(w.dragDrop){var t=e('').width(w.dragdropWidth);e(C).append(t),e(t).append(b),e(t).append(e(w.dragDropStr)),o(C,w,t)}else e(C).append(b);e(C).append(C.errorLog),w.showQueueDiv?C.container=e("#"+w.showQueueDiv):C.container=e("").insertAfter(e(C)),w.onLoad.call(this,C),h(C,g,w,b)}else window.setTimeout(a,10)}(),this.startUpload=function(){e("form").each(function(a,t){e(this).hasClass(C.formGroup)&&x.push(e(this))}),x.length>=1&&r()},this.getFileCount=function(){return C.selectedFiles},this.stopUpload=function(){e("."+w.abortButtonClass).each(function(a,t){e(this).hasClass(C.formGroup)&&e(this).click()}),e("."+w.cancelButtonClass).each(function(a,t){e(this).hasClass(C.formGroup)&&e(this).click()})},this.cancelAll=function(){e("."+w.cancelButtonClass).each(function(a,t){e(this).hasClass(C.formGroup)&&e(this).click()})},this.update=function(a){w=e.extend(w,a),a.hasOwnProperty("url")&&e("form").each(function(t,r){e(this).attr("action",a.url)})},this.enqueueFile=function(e){e instanceof File&&l(w,C,[e])},this.reset=function(e){C.fileCounter=1,C.selectedFiles=0,C.errorLog.html(""),0!=e&&C.container.html("")},this.remove=function(){C.container.html(""),e(C).remove()},this.createProgress=function(e,a,t){var r=new m(this,w);r.progressDiv.show(),r.progressbar.width("100%");var o="";return o=w.showFileCounter?C.fileCounter+w.fileCounterStyle+e:e,w.showFileSize&&(o+=" ("+s(t)+")"),r.filename.html(o),C.fileCounter++,C.selectedFiles++,w.showPreview&&(r.preview.attr("src",a),r.preview.show()),w.showDownload&&(r.download.show(),r.download.click(function(){w.downloadCallback&&w.downloadCallback.call(C,[e],r)})),w.showDelete&&(r.del.show(),r.del.click(function(){r.statusbar.hide().remove();var a=[e];w.deleteCallback&&w.deleteCallback.call(this,a,r),C.selectedFiles-=1,c(w,C)})),r},this.getResponses=function(){return this.responses};var x=[],F=[],D=!1;return this}}(jQuery);
\ No newline at end of file
diff --git a/src/main/webapp/js/main.js b/src/main/webapp/js/main.js
deleted file mode 100644
index 5d241e9..0000000
--- a/src/main/webapp/js/main.js
+++ /dev/null
@@ -1,148 +0,0 @@
-function downloadItem(downloadFileURL) {
- var uri = downloadFileURL;
- window.open(uri, "_blank");
-}
-function downloadVersion(downloadFileURL) {
- var uri = downloadFileURL;
- window.open(uri, "_blank");
-}
-function getSelectedRadioFileId() {
- if (document.querySelector('input[name="fileItem"]:checked') == null)
- alert('Please select the file you wish to operate with first');
- return document.querySelector('input[name="fileItem"]:checked').id;
-}
-
-function getSelectedRadioFormWorkspaceItemId() {
- if (document.querySelector('input[name="fileItem"]:checked') == null)
- alert('Please select the file you wish to operate with first');
- return document.querySelector('input[name="fileItem"]:checked').value;
-}
-
-
-function getSelectedRadioFarmId() {
- if (document.querySelector('input[name="farmItem"]:checked') == null)
- alert('Please select the farm you want to manage');
- return document.querySelector('input[name="farmItem"]:checked').id;
-}
-
-function validateForm() {
- if (document.querySelector('input[name="fileItem"]:checked') == null) {
- alert('Please select the file first to see the versions');
- return false;
- }
- document.getElementById("form_versions").submit();// Form submission
-}
-
-function showFileNameWarningFromDOM(show) {
- if (show)
- document.getElementById('fileNamesExplain').style.display = "block";
- else
- document.getElementById('fileNamesExplain').style.display = "none";
-}
-
-
-
-function validateFile(companyId, farmId, endpoint, encodedURI, fileName, phase) {
- console.log("validateFile:" + endpoint);
- $('#validation-result-container').hide();
- $('#validation-portlet-container').show();
- $.ajax({
- url : endpoint,
- type : 'POST',
- datatype : 'json',
- data : {
- companyId : companyId,
- farmId : farmId,
- userId : Liferay.ThemeDisplay.getUserId(),
- encodedURI : encodedURI,
- groupId : Liferay.ThemeDisplay.getScopeGroupId(),
- fileName: fileName,
- phase: phase
- },
- success : function(data) {
- var content = JSON.parse(data);
- $('#validation-portlet-container').hide();
- $('#validation-result-container').show();
- if (content.success) {
- $('#resultFeedback').text('Congrats, the form is valid! '+ content.comment);
- $('#resultFeedback').css('color', 'green');
- $('#resultFeedbackButton').show();
- }
- else {
- $('#resultFeedback').text('Oops, the form is not valid! Motivation: ' + content.comment);
- $('#resultFeedback').css('color', 'red');
- }
- }
- });
-}
-
-/* in view_farm_repository */
-function publishAndAnonymise(endpoint, farmId, fileId) {
- console.log("publishAndAnonymise:" + endpoint);
- $('#publishAndAnonymise-Button').html('in progress ...please wait');
-
- $.ajax({
- url : endpoint,
- type : 'POST',
- datatype : 'json',
- data : {
- farmId : farmId,
- userId : Liferay.ThemeDisplay.getUserId(),
- fileToPublishId : fileId,
- groupId : Liferay.ThemeDisplay.getScopeGroupId()
- },
- success : function(data) {
- var content = JSON.parse(data);
- if (content.success == "OK") {
- $("#modalSuccess").show();
- }
- else {
- $("#modalFailed").show();
- }
- $('#publishAndAnonymise-Button').html('Anonymise and Publish');
- }
- });
-}
-
-function showInsertFarm(show) {
- if (show) {
- $('#formNewFarmButton').hide();
- $('#formNewFarm').show();
- } else {
- $('#formNewFarmButton').show();
- $('#formDeleteFarm').hide();
- $('#formEditFarm').hide();
- $('#formNewFarm').hide();
- }
-}
-
-
-
-function showEditFarm(show) {
- if (show) {
- $('#formEditFarmButton').hide();
- $('#formEditFarm').show();
- $('#formDeleteFarm').hide();
- $('#formNewFarm').hide();
- } else {
- $('#formEditFarmButton').show();
- $('#formDeleteFarm').hide();
- $('#formEditFarm').hide();
- $('#formNewFarm').hide();
- }
-}
-
-function showDeleteFarm(show) {
- if (show) {
- $('#formDeleteFarmButton').hide();
- $('#formDeleteFarm').show();
- $('#formEditFarm').hide();
- $('#formNewFarm').hide();
- } else {
- $('#formDeleteFarmButton').show();
- $('#formDeleteFarm').hide();
- $('#formEditFarm').hide();
- $('#formNewFarm').hide();
- }
-}
-