Updated according to new FolderItemType GCUBE_ITEM

Added categories: FOLDERS, SHARED_FOLDERS

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@115443 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-06-19 10:53:25 +00:00
parent 1e349eb287
commit 6d685b3c30
7 changed files with 47 additions and 535 deletions

View File

@ -14,14 +14,17 @@ public class GXTCategoryItemInterface implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//Smart Folder SMF //Smart Folder SMF
//VALUE = KEY - THE KEY TO SEARCH BY CATEORY IN HOME LIBRARY
public static final String SMF_BIODIVERSITY = "Biodiversity"; public static final String SMF_BIODIVERSITY = "Biodiversity";
public static final String SMF_DOCUMENTS = "Documents"; public static final String SMF_DOCUMENTS = "Documents";
public static final String SMF_IMAGES = "Images"; public static final String SMF_IMAGES = "Images";
public static final String SMF_REPORTS = "Reports"; public static final String SMF_REPORTS = "Reports";
public static final String SMF_TIMESERIES = "Time Series"; public static final String SMF_TIMESERIES = "Time Series";
public static final String SMF_LINKS = "Links"; public static final String SMF_LINKS = "Links";
// public static final String NONE = "None";
public static final String SMF_UNKNOWN = "Unknown"; public static final String SMF_UNKNOWN = "Unknown";
public static final String SMF_FOLDERS = "Folders";
public static final String SMF_SHARED_FOLDERS = "Shared Folders";
public static final String SMF_GCUBE_ITEMS= "GcubeItems";
GXTCategoryItemInterface(){} GXTCategoryItemInterface(){}

View File

@ -26,6 +26,7 @@ public enum GXTFolderItemTypeEnum implements Serializable {
UNKNOWN_TYPE("Unknow Type"), UNKNOWN_TYPE("Unknow Type"),
ANNOTATION("Annotation"), ANNOTATION("Annotation"),
FOLDER("Folder"), FOLDER("Folder"),
GCUBE_ITEM("Gcube Item"),
SHARED_FOLDER("Shared Folder"); SHARED_FOLDER("Shared Folder");
protected String label; protected String label;

View File

@ -268,386 +268,16 @@ public class GWTWorkspaceBuilder {
return sb.toString(); return sb.toString();
} }
// protected GWTExternalFile buildGWTExternalFile(ExternalFile file, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(file.getProperties());
// GWTExternalFile gwtFile = new GWTExternalFile(
// toDate(file.getCreationTime()),
// file.getId(),
// gwtProperties,
// file.getName(),
// file.getOwner().getPortalLogin(),
// file.getDescription(),
// toDate(file.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(file.getLastAction().toString()),
// parent,
// file.getLength(),
// file.getMimeType());
//
// return gwtFile;
// }
//
// protected GWTExternalPDFFile buildGWTExternalPDFFile(ExternalPDFFile pdfFile, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(pdfFile.getProperties());
// GWTExternalPDFFile gwtPDFFile = new GWTExternalPDFFile(
// toDate(pdfFile.getCreationTime()),
// pdfFile.getId(),
// gwtProperties,
// pdfFile.getName(),
// pdfFile.getOwner().getPortalLogin(),
// pdfFile.getDescription(),
// toDate(pdfFile.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(pdfFile.getLastAction().toString()),
// parent,
// pdfFile.getLength(),
// pdfFile.getMimeType(),
// pdfFile.getAuthor(),
// pdfFile.getNumberOfPages(),
// pdfFile.getProducer(),
// pdfFile.getTitle(),
// pdfFile.getVersion());
//
// return gwtPDFFile;
// }
//
// protected GWTExternalImage buildGWTExternalImage(ExternalImage image, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(image.getProperties());
// GWTExternalImage gwtImage = new GWTExternalImage(
// toDate(image.getCreationTime()),
// image.getId(),
// gwtProperties,
// image.getName(),
// image.getOwner().getPortalLogin(),
// image.getDescription(),
// toDate(image.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(image.getLastAction().toString()),
// parent,
// buildImageUrl(image.getId()),
// buildThumbnailUrl(image.getId()),
// image.getWidth(),
// image.getHeight(),
// image.getLength(),
// image.getThumbnailWidth(),
// image.getThumbnailHeight(),
// image.getThumbnailLength(),
// image.getMimeType());
//
// return gwtImage;
// }
//
// protected GWTQuery buildGWTQuery(Query query, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(query.getProperties());
// GWTQuery gwtQuery = new GWTQuery(
// query.getId(),
// query.getName(),
// query.getDescription(),
// query.getOwner().getPortalLogin(),
// toDate(query.getCreationTime()),
// gwtProperties,
// toDate(query.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(query.getLastAction().toString()),
// parent,
// query.getLength());
//
// return gwtQuery;
// }
//
// protected GWTAquaMapsItem buildGWTAquaMapsItem(AquaMapsItem aquamapsItem, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(aquamapsItem.getProperties());
//
// GWTAquaMapsItem gwtAquaMapsItem = new GWTAquaMapsItem(
// aquamapsItem.getId(),
// aquamapsItem.getName(),
// aquamapsItem.getDescription(),
// aquamapsItem.getOwner().getPortalLogin(),
// toDate(aquamapsItem.getCreationTime()),
// gwtProperties,
// toDate(aquamapsItem.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(aquamapsItem.getLastAction().toString()),
// parent,
// aquamapsItem.getLength(),
// aquamapsItem.getMapName(),
// aquamapsItem.getMapType(),
// aquamapsItem.getAuthor(),
// aquamapsItem.getNumberOfSpecies(),
// aquamapsItem.getBoundingBox(),
// aquamapsItem.getPsoThreshold(),
// aquamapsItem.getNumberOfGeneratedImages()
// );
//
// return gwtAquaMapsItem;
// }
//
//
// protected GWTTimeSeries buildGWTTimeSeries(TimeSeries timeseries, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(timeseries.getProperties());
//
// TimeSeriesInfo timeSeriesInfo = timeseries.getTimeSeriesInfo();
//
// GWTTimeSeries gwtTimeSeries = new GWTTimeSeries(
// timeseries.getId(),
// timeseries.getName(),
// timeseries.getDescription(),
// timeseries.getOwner().getPortalLogin(),
// toDate(timeseries.getCreationTime()),
// gwtProperties,
// toDate(timeseries.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(timeseries.getLastAction().toString()),
// parent,
// timeseries.getLength(),
// timeSeriesInfo.getId(),
// timeSeriesInfo.getTitle(),
// timeSeriesInfo.getCreator(),
// timeSeriesInfo.getDescription(),
// timeSeriesInfo.getCreationDate(),
// timeSeriesInfo.getPublisher(),
// timeSeriesInfo.getSourceId(),
// timeSeriesInfo.getSourceName(),
// timeSeriesInfo.getRights(),
// timeSeriesInfo.getDimension(),
// new LinkedList<String>(timeseries.getHeaderLabels())
// );
//
// return gwtTimeSeries;
// }
//
// protected GWTReportTemplate buildGWTReportTemplate(ReportTemplate template, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(template.getProperties());
// GWTReportTemplate gwtTemplate = new GWTReportTemplate(
// template.getId(),
// template.getName(),
// template.getDescription(),
// template.getOwner().getPortalLogin(),
// toDate(template.getCreationTime()),
// gwtProperties,
// toDate(template.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(template.getLastAction().toString()),
// parent,
// template.getLength(),
// toDate(template.getCreated()),
// toDate(template.getLastEdit()),
// template.getAuthor(),
// template.getLastEditBy(),
// template.getNumberOfSections(),
// template.getStatus());
//
// return gwtTemplate;
// }
//
// protected GWTReport buildGWTReport(Report template, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(template.getProperties());
// GWTReport gwtReport = new GWTReport(
// template.getId(),
// template.getName(),
// template.getDescription(),
// template.getOwner().getPortalLogin(),
// toDate(template.getCreationTime()),
// gwtProperties,
// toDate(template.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(template.getLastAction().toString()),
// parent,
// template.getLength(),
// toDate(template.getCreated()),
// toDate(template.getLastEdit()),
// template.getAuthor(),
// template.getLastEditBy(),
// template.getTemplateName(),
// template.getNumberOfSections(),
// template.getStatus()
// );
// return gwtReport;
// }
//
// protected GWTWorkflowReport buildGWTWorkflowReport(WorkflowReport workflowReport, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(workflowReport.getProperties());
// GWTWorkflowReport gwtWorkflowReport = new GWTWorkflowReport(
// workflowReport.getId(),
// workflowReport.getName(),
// workflowReport.getDescription(),
// workflowReport.getOwner().getPortalLogin(),
// toDate(workflowReport.getCreationTime()),
// gwtProperties,
// toDate(workflowReport.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(workflowReport.getLastAction().toString()),
// parent,
// workflowReport.getLength()
// );
// gwtWorkflowReport.setWorkflowStatus(workflowReport.getWorkflowStatus());
// return gwtWorkflowReport;
// }
//
// protected GWTWorkflowTemplate buildGWTWorkflowTemplate(WorkflowTemplate workflowTemplate, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(workflowTemplate.getProperties());
// GWTWorkflowTemplate gwtWorkflowReport = new GWTWorkflowTemplate(
// workflowTemplate.getId(),
// workflowTemplate.getName(),
// workflowTemplate.getDescription(),
// workflowTemplate.getOwner().getPortalLogin(),
// toDate(workflowTemplate.getCreationTime()),
// gwtProperties,
// toDate(workflowTemplate.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(workflowTemplate.getLastAction().toString()),
// parent,
// workflowTemplate.getLength()
// );
// gwtWorkflowReport.setWorkflowStatus(workflowTemplate.getWorkflowStatus());
// return gwtWorkflowReport;
// }
//
// protected GWTImageDocument buildGWTImageDocument(ImageDocument image, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(image.getProperties());
//
// Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(image.getMetadata(), image.getId());
//
// GWTImageDocument gwtImage = new GWTImageDocument(
// toDate(image.getCreationTime()),
// image.getId(),
// gwtProperties,
// image.getName(),
// image.getOwner().getPortalLogin(),
// image.getDescription(),
// toDate(image.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(image.getLastAction().toString()),
// parent,
// buildImageUrl(image.getId()),
// buildThumbnailUrl(image.getId()),
// image.getWidth(),
// image.getHeight(),
// image.getThumbnailWidth(),
// image.getThumbnailHeight(),
// image.getThumbnailLength(),
// image.getLength(),
// image.getMimeType(),
// image.getURI(),
// gwtmetadatas,
// new LinkedHashMap<String, String>(),
// image.getCollectionName(),
// image.getAlternatives().size(),
// image.getParts().size()
//
// );
//
// return gwtImage;
//
// }
//
// protected GWTPDFDocument buildGWTPDFDocument(PDFDocument pdfDocument, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(pdfDocument.getProperties());
//
// Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(pdfDocument.getMetadata(), pdfDocument.getId());
//
// GWTPDFDocument gwtPDF = new GWTPDFDocument(
// toDate(pdfDocument.getCreationTime()),
// pdfDocument.getId(),
// gwtProperties,
// pdfDocument.getName(),
// pdfDocument.getOwner().getPortalLogin(),
// pdfDocument.getDescription(),
// toDate(pdfDocument.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(pdfDocument.getLastAction().toString()),
// parent,
// pdfDocument.getLength(),
// pdfDocument.getURI(),
// pdfDocument.getMimeType(),
// gwtmetadatas,
// new LinkedHashMap<String, String>(),
// pdfDocument.getCollectionName(),
// pdfDocument.getAlternatives().size(),
// pdfDocument.getParts().size(),
// pdfDocument.getAuthor(),
// pdfDocument.getNumberOfPages(),
// pdfDocument.getProducer(),
// pdfDocument.getTitle(),
// pdfDocument.getVersion(),
// "DocumentService?id="+pdfDocument.getId()
// );
//
// return gwtPDF;
//
// }
//
// protected GWTDocument buildGWTDocument(Document document, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(document.getProperties());
//
// Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(document.getMetadata(), document.getId());
//
// GWTDocument gwtPDF = new GWTDocument(
// toDate(document.getCreationTime()),
// document.getId(),
// gwtProperties,
// document.getName(),
// document.getOwner().getPortalLogin(),
// document.getDescription(),
// toDate(document.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(document.getLastAction().toString()),
// parent,
// document.getLength(),
// document.getURI(),
// document.getMimeType(),
// gwtmetadatas,
// new LinkedHashMap<String, String>(),
// document.getCollectionName(),
// document.getAlternatives().size(),
// document.getParts().size()
// );
//
// return gwtPDF;
//
// }
//
// protected GWTMetadata buildGWTMetadata(Metadata metadata, GWTWorkspaceFolder parent) throws InternalErrorException
// {
// GWTProperties gwtProperties = buildGWTProperties(metadata.getProperties());
//
// GWTMetadata gwtMetadata = new GWTMetadata(
// metadata.getId(),
// metadata.getName(),
// metadata.getDescription(),
// metadata.getOwner().getPortalLogin(),
// toDate(metadata.getCreationTime()),
// gwtProperties,
// toDate(metadata.getLastModificationTime()),
// GWTWorkspaceItemAction.valueOf(metadata.getLastAction().toString()),
// parent,
// metadata.getLength(),
// metadata.getURI(),
// metadata.getSchema(),
// metadata.getLanguage(),
// metadata.getCollectionName(),
// "MetadataService?id="+metadata.getId()+"&type="+MetadataFormat.HTML,
// "MetadataService?id="+metadata.getId()+"&type="+MetadataFormat.RAW_XML_AS_HTML
// );
//
// return gwtMetadata;
//
// }
///////////////////////*********************USED
//ADD FRANCESCO
/** /**
* Builds the gwt workspace image. * Builds the gwt workspace image.
* *
* @param item the item * @param item the item
* @param isInteralImage the is interal image * @param isInteralImage the is interal image
* @param fullDetails the full details * @param fullDetails the full details
* @return the GWT workspace item * @return the GWT workspace item
* @throws InternalErrorException the internal error exception * @throws InternalErrorException the internal error exception
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected GWTWorkspaceItem buildGWTWorkspaceImage(WorkspaceItem item, boolean isInteralImage, boolean fullDetails) throws InternalErrorException protected GWTWorkspaceItem buildGWTWorkspaceImage(WorkspaceItem item, boolean isInteralImage, boolean fullDetails) throws InternalErrorException
{ {
@ -732,9 +362,7 @@ public class GWTWorkspaceBuilder {
} }
return gwtImage; return gwtImage;
} }
/** /**
* Builds the gwt external url. * Builds the gwt external url.
* *
@ -863,10 +491,6 @@ public class GWTWorkspaceBuilder {
"MetadataService?id="+documentId+"&schema="+metadata.getSchemaName()+"&type="+MetadataFormat.RAW_XML_AS_HTML, "MetadataService?id="+documentId+"&schema="+metadata.getSchemaName()+"&type="+MetadataFormat.RAW_XML_AS_HTML,
"MetadataService?id="+documentId+"&schema="+metadata.getSchemaName()+"&type="+MetadataFormat.FORMATTED_XML); "MetadataService?id="+documentId+"&schema="+metadata.getSchemaName()+"&type="+MetadataFormat.FORMATTED_XML);
} }
//*****************************************************NEW
/** /**
* Builds the workspace file model root. * Builds the workspace file model root.
@ -1009,7 +633,6 @@ public class GWTWorkspaceBuilder {
} }
return new InfoContactModel(portalLogin, portalLogin, UserUtil.getUserFullName(portalLogin), false); return new InfoContactModel(portalLogin, portalLogin, UserUtil.getUserFullName(portalLogin), false);
} }
@ -1051,13 +674,10 @@ public class GWTWorkspaceBuilder {
fileModel.setType(GXTFolderItemTypeEnum.FOLDER.toString()); fileModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
fileModel.setShareable(true); fileModel.setShareable(true);
fileModel.setDescription(item.getDescription()); fileModel.setDescription(item.getDescription());
// WorkspaceFolder folder = (WorkspaceFolder) item;
break; break;
case FOLDER_ITEM: case FOLDER_ITEM:
// fileModel = new FileModel(item.getId(), item.getName(), item.getPath(), (FolderModel) parentFolderModel, false);
fileModel = new FileModel(item.getId(), item.getName(), (FolderModel) parentFolderModel, false, false); fileModel = new FileModel(item.getId(), item.getName(), (FolderModel) parentFolderModel, false, false);
FolderItem folderItem = (FolderItem) item; FolderItem folderItem = (FolderItem) item;
fileModel = setFolderItemType(fileModel, folderItem); fileModel = setFolderItemType(fileModel, folderItem);
@ -1071,10 +691,6 @@ public class GWTWorkspaceBuilder {
fileModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); fileModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString());
fileModel.setShareable(true); fileModel.setShareable(true);
fileModel.setDescription(item.getDescription()); fileModel.setDescription(item.getDescription());
// WorkspaceSharedFolder sharedFolder = (WorkspaceSharedFolder) item;
// fileModel.setListShareUser(buildGxtInfoContactFromPortalLogin(sharedFolder.getUsers()));
break; break;
default: default:
@ -1082,22 +698,17 @@ public class GWTWorkspaceBuilder {
break; break;
} }
//ACCOUNTING //ACCOUNTING
//REMOVED IS MARK AS READ FROM HL //REMOVED IS MARK AS READ FROM HL
// fileModel.setMarkAsRead(item.isMarkedAsRead()); // fileModel.setMarkAsRead(item.isMarkedAsRead());
if(parentFolderModel!=null && parentFolderModel.isShared()){ if(parentFolderModel!=null && parentFolderModel.isShared()){
fileModel.setShared(true); fileModel.setShared(true);
fileModel.setShareable(false); //UPDATED TO CHANGE PERMISSIONS TO SHARED SUBFOLDERS fileModel.setShareable(false); //UPDATED TO CHANGE PERMISSIONS TO SHARED SUBFOLDERS
// fileModel.setShareable(true); // fileModel.setShareable(true);
} }
// fileModel.setOwner(new InfoContactModel(item.getOwner().getId(), item.getOwner().getPortalLogin(), "name")); // fileModel.setOwner(new InfoContactModel(item.getOwner().getId(), item.getOwner().getPortalLogin(), "name"));
//// fileModel.setShared(item.isShared()); //// fileModel.setShared(item.isShared());
return fileModel; return fileModel;
} }
@ -1141,7 +752,7 @@ public class GWTWorkspaceBuilder {
// fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getCreationDate()), parentFileModel, -1, true, false); // fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getCreationDate()), parentFileModel, -1, true, false);
fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, false,false); fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, false,false);
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.toString()); fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_FOLDERS);
fileGridModel.setShareable(true); fileGridModel.setShareable(true);
break; break;
@ -1156,7 +767,7 @@ public class GWTWorkspaceBuilder {
//ATTENTION: SEARCH ITEM IS NOT CASTABLE AT WorkspaceSharedFolder //ATTENTION: SEARCH ITEM IS NOT CASTABLE AT WorkspaceSharedFolder
fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, true, item.isVreFolder()); fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, true, item.isVreFolder());
fileGridModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); fileGridModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString());
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_SHARED_FOLDERS);
fileGridModel.setShareable(true); fileGridModel.setShareable(true);
break; break;
@ -1168,8 +779,6 @@ public class GWTWorkspaceBuilder {
} }
//TODO ISSHARED IN SEARCH ITEM IN HL TO RETRIEVE SHARE ON WORKSPACEITEM //TODO ISSHARED IN SEARCH ITEM IN HL TO RETRIEVE SHARE ON WORKSPACEITEM
//OWNER //OWNER
if(item.isShared()){ //IS READ FROM HL ONLY IF THE ITEM IS SHARED if(item.isShared()){ //IS READ FROM HL ONLY IF THE ITEM IS SHARED
fileGridModel.setShared(true); //TEMPORARY SOLUTION: ADDED TO FIX WRONG TYPE SearchFolderItem fileGridModel.setShared(true); //TEMPORARY SOLUTION: ADDED TO FIX WRONG TYPE SearchFolderItem
@ -1184,8 +793,6 @@ public class GWTWorkspaceBuilder {
if(userLogged!=null) if(userLogged!=null)
fileGridModel.setOwnerFullName(userLogged.getName()); fileGridModel.setOwnerFullName(userLogged.getName());
} }
return fileGridModel; return fileGridModel;
} }
@ -1232,18 +839,15 @@ public class GWTWorkspaceBuilder {
switch (item.getType()) { switch (item.getType()) {
case FOLDER: case FOLDER:
// fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getCreationTime()), parentFileModel, -1, true, false);
fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModificationTime()), parentFileModel, -1, true, false,false); fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModificationTime()), parentFileModel, -1, true, false,false);
fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.toString()); fileGridModel.setType(GXTFolderItemTypeEnum.FOLDER.toString());
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_FOLDERS);
fileGridModel.setShareable(true); fileGridModel.setShareable(true);
fileGridModel.setDescription(item.getDescription()); fileGridModel.setDescription(item.getDescription());
break; break;
case FOLDER_ITEM: case FOLDER_ITEM:
FolderItem folderItem = (FolderItem) item; FolderItem folderItem = (FolderItem) item;
// fileGridModel = new FileGridModel(item.getId(), item.getName(), toDate(item.getCreationTime()), parentFileModel, folderItem.getLength(), false, false);
fileGridModel = new FileGridModel(item.getId(), item.getName(), toDate(item.getLastModificationTime()), parentFileModel, folderItem.getLength(), false, false); fileGridModel = new FileGridModel(item.getId(), item.getName(), toDate(item.getLastModificationTime()), parentFileModel, folderItem.getLength(), false, false);
fileGridModel = (FileGridModel) setFolderItemType(fileGridModel, folderItem); fileGridModel = (FileGridModel) setFolderItemType(fileGridModel, folderItem);
break; break;
@ -1253,7 +857,7 @@ public class GWTWorkspaceBuilder {
String name = shared.isVreFolder()?shared.getDisplayName():item.getName(); String name = shared.isVreFolder()?shared.getDisplayName():item.getName();
fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), name, toDate(item.getLastModificationTime()), parentFileModel, -1, true, true, shared.isVreFolder()); fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), name, toDate(item.getLastModificationTime()), parentFileModel, -1, true, true, shared.isVreFolder());
fileGridModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); fileGridModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString());
fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_SHARED_FOLDERS);
fileGridModel.setShareable(true); fileGridModel.setShareable(true);
fileGridModel.setDescription(item.getDescription()); fileGridModel.setDescription(item.getDescription());
break; break;
@ -1263,8 +867,7 @@ public class GWTWorkspaceBuilder {
break; break;
} }
if(parentFileModel!=null && parentFileModel.isShared()){ if(parentFileModel!=null && parentFileModel.isShared()){
fileGridModel.setShared(true); fileGridModel.setShared(true);
fileGridModel.setShareable(false); //UPDATED TO CHANGE PERMISSIONS TO SHARED SUBFOLDERS fileGridModel.setShareable(false); //UPDATED TO CHANGE PERMISSIONS TO SHARED SUBFOLDERS
@ -1287,10 +890,8 @@ public class GWTWorkspaceBuilder {
// fileGridModel.setOwner(new InfoContactModel(userLogged.getId(), userLogged.getLogin(), userLogged.getName())); // fileGridModel.setOwner(new InfoContactModel(userLogged.getId(), userLogged.getLogin(), userLogged.getName()));
fileGridModel.setOwnerFullName(userLogged.getName()); fileGridModel.setOwnerFullName(userLogged.getName());
} }
//// fileGridModel.setShared(item.isShared());
return fileGridModel; return fileGridModel;
} }
/** /**
@ -1368,11 +969,14 @@ public class GWTWorkspaceBuilder {
fileModel.setFolderItemType(GXTFolderItemTypeEnum.METADATA); fileModel.setFolderItemType(GXTFolderItemTypeEnum.METADATA);
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS);
break; break;
case GCUBE_ITEM:
fileModel.setFolderItemType(GXTFolderItemTypeEnum.GCUBE_ITEM);
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_GCUBE_ITEMS);
break;
default: default:
fileModel.setFolderItemType(GXTFolderItemTypeEnum.UNKNOWN_TYPE); fileModel.setFolderItemType(GXTFolderItemTypeEnum.UNKNOWN_TYPE);
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_UNKNOWN); fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_UNKNOWN);
fileModel.setType(GXTFolderItemTypeEnum.UNKNOWN_TYPE.toString()); fileModel.setType(GXTFolderItemTypeEnum.UNKNOWN_TYPE.toString());
// logger.trace("**************************************UNKNOWN******* filemodel "+ fileModel.getName());
break; break;
} }
@ -1381,9 +985,7 @@ public class GWTWorkspaceBuilder {
} }
/** /**
* Sets the folder item type. * Sets the folder item type.
* *
@ -1445,7 +1047,6 @@ public class GWTWorkspaceBuilder {
try { try {
fileModel.setType(imgDoc.getMimeType()); fileModel.setType(imgDoc.getMimeType());
} catch (InternalErrorException e) { } catch (InternalErrorException e) {
// TODO Auto-generated catch block
logger.error("IMAGE_DOCUMENT InternalErrorException when getting MimeType on "+fileModel.getIdentifier()); logger.error("IMAGE_DOCUMENT InternalErrorException when getting MimeType on "+fileModel.getIdentifier());
} }
break; break;
@ -1457,7 +1058,6 @@ public class GWTWorkspaceBuilder {
try { try {
fileModel.setType(doc.getMimeType()); fileModel.setType(doc.getMimeType());
} catch (InternalErrorException e) { } catch (InternalErrorException e) {
// TODO Auto-generated catch block
logger.error("DOCUMENT InternalErrorException when getting MimeType on "+fileModel.getIdentifier()); logger.error("DOCUMENT InternalErrorException when getting MimeType on "+fileModel.getIdentifier());
} }
break; break;
@ -1469,25 +1069,14 @@ public class GWTWorkspaceBuilder {
fileModel.setFolderItemType(GXTFolderItemTypeEnum.METADATA); fileModel.setFolderItemType(GXTFolderItemTypeEnum.METADATA);
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS);
break; break;
//REMOVED BY HL 2.0 case GCUBE_ITEM:
// case WORKFLOW_REPORT: fileModel.setFolderItemType(GXTFolderItemTypeEnum.GCUBE_ITEM);
// fileModel.setFolderItemType(GXTFolderItemTypeEnum.WORKFLOW_REPORT); fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_GCUBE_ITEMS);
// fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); break;
// break;
// case WORKFLOW_TEMPLATE:
// fileModel.setFolderItemType(GXTFolderItemTypeEnum.WORKFLOW_TEMPLATE);
// fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS);
//// logger.trace("**************************************DOCUMENTS******* filemodel "+ fileModel.getName());
// break;
// case EXTERNAL_RESOURCE_LINK:
// fileModel.setFolderItemType(GXTFolderItemTypeEnum.EXTERNAL_RESOURCE_LINK);
// fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_LINKS);
// break;
default: default:
fileModel.setFolderItemType(GXTFolderItemTypeEnum.UNKNOWN_TYPE); fileModel.setFolderItemType(GXTFolderItemTypeEnum.UNKNOWN_TYPE);
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_UNKNOWN); fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_UNKNOWN);
fileModel.setType(GXTFolderItemTypeEnum.UNKNOWN_TYPE.toString()); fileModel.setType(GXTFolderItemTypeEnum.UNKNOWN_TYPE.toString());
// logger.trace("**************************************UNKNOWN******* filemodel "+ fileModel.getName());
break; break;
} }
@ -1501,15 +1090,13 @@ public class GWTWorkspaceBuilder {
* @return the publi link for folder item * @return the publi link for folder item
* @throws InternalErrorException the internal error exception * @throws InternalErrorException the internal error exception
*/ */
public String getPubliLinkForFolderItem(FolderItem worspaceFolderItem) throws InternalErrorException{ public String getPublicLinkForFolderItem(FolderItem worspaceFolderItem) throws InternalErrorException{
if(worspaceFolderItem==null) if(worspaceFolderItem==null)
return ""; return "";
try{ try{
switch(worspaceFolderItem.getFolderItemType()){
switch(worspaceFolderItem.getFolderItemType())
{
case EXTERNAL_IMAGE: case EXTERNAL_IMAGE:
return ((ExternalImage) worspaceFolderItem).getPublicLink(); return ((ExternalImage) worspaceFolderItem).getPublicLink();
case EXTERNAL_FILE: case EXTERNAL_FILE:
@ -1624,15 +1211,12 @@ public class GWTWorkspaceBuilder {
folder.setShareable(true); folder.setShareable(true);
folder.setDescription(wsFolder.getDescription()); folder.setDescription(wsFolder.getDescription());
// folder.setOwner(wsFolder.getOwner()); // folder.setOwner(wsFolder.getOwner());
if(parent != null && parent.isShared()){ if(parent != null && parent.isShared()){
folder.setShared(true); folder.setShared(true);
folder.setShareable(false); folder.setShareable(false);
} }
return folder; return folder;
} }
/** /**
@ -1707,6 +1291,8 @@ public class GWTWorkspaceBuilder {
return GXTCategoryItemInterface.SMF_DOCUMENTS; return GXTCategoryItemInterface.SMF_DOCUMENTS;
case METADATA: case METADATA:
return GXTCategoryItemInterface.SMF_DOCUMENTS; return GXTCategoryItemInterface.SMF_DOCUMENTS;
case GCUBE_ITEM:
return GXTCategoryItemInterface.SMF_GCUBE_ITEMS;
default: default:
return GXTCategoryItemInterface.SMF_UNKNOWN; return GXTCategoryItemInterface.SMF_UNKNOWN;
} }
@ -1729,24 +1315,12 @@ public class GWTWorkspaceBuilder {
public List<FileGridModel> filterListFileGridModelItemByCategory(List<SearchItem> listSearchItem, String category) throws InternalErrorException { public List<FileGridModel> filterListFileGridModelItemByCategory(List<SearchItem> listSearchItem, String category) throws InternalErrorException {
List<FileGridModel> filteredList = new ArrayList<FileGridModel>(); List<FileGridModel> filteredList = new ArrayList<FileGridModel>();
logger.trace("filterListFileGridModelItemByCategory - Category:" + category + "listSearchItem size " + listSearchItem.size()); logger.trace("filterListFileGridModelItemByCategory - Category:" + category + "listSearchItem size " + listSearchItem.size());
//FOR DEBUG
// System.out.println("filterListFileGridModelItemByCategory - Category:" + category + "listSearchItem size " + listSearchItem.size());
for(SearchItem searchItem: listSearchItem){ for(SearchItem searchItem: listSearchItem){
logger.trace("wsItem: " + searchItem.getName()); logger.trace("wsItem: " + searchItem.getName());
// FOR DEBUG if(category.equals(getFolderItemTypeCategory(searchItem)))
// System.out.println("wsItem: " + searchItem.getName()); filteredList.add(buildGXTFileGridModelItemForSearch(searchItem,null));
if(category.equals(getFolderItemTypeCategory(searchItem))){
filteredList.add(buildGXTFileGridModelItemForSearch(searchItem,null));
}
} }
return filteredList; return filteredList;
} }
@ -1797,16 +1371,9 @@ public class GWTWorkspaceBuilder {
public List<ScopeModel> buildGXTListScopeModel(List<String> listFilteredScopes, Map<String, String> mapPortalScopes) { public List<ScopeModel> buildGXTListScopeModel(List<String> listFilteredScopes, Map<String, String> mapPortalScopes) {
List<ScopeModel> listScopeModel = new ArrayList<ScopeModel>(); List<ScopeModel> listScopeModel = new ArrayList<ScopeModel>();
// listScopeModel.add(AllScope.getScopeModel());
for(String scope: listFilteredScopes) for(String scope: listFilteredScopes)
listScopeModel.add(new ScopeModel(mapPortalScopes.get(scope),scope)); listScopeModel.add(new ScopeModel(mapPortalScopes.get(scope),scope));
// listScopeModel.add(new ScopeModel("1", "Aquamaps"));
// listScopeModel.add(new ScopeModel("2", "VTI"));
// listScopeModel.add(new ScopeModel("3", "TimeSeries"));
return listScopeModel; return listScopeModel;
} }
@ -1959,19 +1526,14 @@ public class GWTWorkspaceBuilder {
*/ */
public MessageModel buildGXTMessageModel(WorkspaceMessage mess, List<WorkspaceItem> listWorkspaceItems, String messageType) throws InternalErrorException { public MessageModel buildGXTMessageModel(WorkspaceMessage mess, List<WorkspaceItem> listWorkspaceItems, String messageType) throws InternalErrorException {
List<FileModel> listAttachs = buildGXTListFileModelItemForAttachs(listWorkspaceItems); List<FileModel> listAttachs = buildGXTListFileModelItemForAttachs(listWorkspaceItems);
// List<InfoContactModel> listContacts = new ArrayList<InfoContactModel>(); // List<InfoContactModel> listContacts = new ArrayList<InfoContactModel>();
// mess.getAddresses(); // mess.getAddresses();
// listContacts.add(new InfoContactModel("1", "Empty")); // listContacts.add(new InfoContactModel("1", "Empty"));
return new MessageModel(mess.getId(), mess.getSubject(), buildGXTInfoContactModel(mess.getSender()), toDate(mess.getSendTime()), mess.getBody(), listAttachs, mess.getAddresses(), messageType, mess.isRead()); return new MessageModel(mess.getId(), mess.getSubject(), buildGXTInfoContactModel(mess.getSender()), toDate(mess.getSendTime()), mess.getBody(), listAttachs, mess.getAddresses(), messageType, mess.isRead());
} }
/** /**
* Builds the gxt info contact model. * Builds the gxt info contact model.
* *
@ -2015,13 +1577,9 @@ public class GWTWorkspaceBuilder {
bulk = new BulkCreatorModel(item.getId(), item.getDestinationFolder().getName(), item.getStatus(), BulkCreatorModel.FAILED, item.getNumberOfRequests(), item.getFailures()); bulk = new BulkCreatorModel(item.getId(), item.getDestinationFolder().getName(), item.getStatus(), BulkCreatorModel.FAILED, item.getNumberOfRequests(), item.getFailures());
else else
bulk = new BulkCreatorModel(item.getId(), item.getDestinationFolder().getName(), item.getStatus(), BulkCreatorModel.FAILED, item.getNumberOfRequests(), item.getFailures()); bulk = new BulkCreatorModel(item.getId(), item.getDestinationFolder().getName(), item.getStatus(), BulkCreatorModel.FAILED, item.getNumberOfRequests(), item.getFailures());
} }
listBulkCreatorModel.add(bulk); listBulkCreatorModel.add(bulk);
} }
return listBulkCreatorModel; return listBulkCreatorModel;
} }
@ -2074,10 +1632,7 @@ public class GWTWorkspaceBuilder {
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.READ)){ if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.READ)){
AccountingEntryRead read = (AccountingEntryRead) accountingEntry; AccountingEntryRead read = (AccountingEntryRead) accountingEntry;
af.setOperation(GxtAccountingEntryType.READ); af.setOperation(GxtAccountingEntryType.READ);
// af.setDescription(GxtAccountingEntryType.READ.getName() + " by "+user.getName());
af.setDescription(read.getItemName() + " " + GxtAccountingEntryType.READ.getName() + " by "+user.getName()); af.setDescription(read.getItemName() + " " + GxtAccountingEntryType.READ.getName() + " by "+user.getName());
String msg = ""; String msg = "";
@ -2096,10 +1651,7 @@ public class GWTWorkspaceBuilder {
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.CUT)){ if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.CUT)){
af.setOperation(GxtAccountingEntryType.CUT); af.setOperation(GxtAccountingEntryType.CUT);
AccountingEntryCut cut = (AccountingEntryCut) accountingEntry; AccountingEntryCut cut = (AccountingEntryCut) accountingEntry;
// af.setDescription(GxtAccountingEntryType.CUT.getName()+ " "+cut.getItemName()+" by "+user.getName());
String msg = ""; String msg = "";
if(cut.getItemName()==null || cut.getItemName().isEmpty()) if(cut.getItemName()==null || cut.getItemName().isEmpty())
@ -2108,8 +1660,6 @@ public class GWTWorkspaceBuilder {
msg = cut.getItemName()+" "+GxtAccountingEntryType.CUT.getName() +" by "+user.getName(); msg = cut.getItemName()+" "+GxtAccountingEntryType.CUT.getName() +" by "+user.getName();
af.setDescription(msg); af.setDescription(msg);
// af.setDescription(cut.getItemName()+" "+GxtAccountingEntryType.CUT.getName() +" by "+user.getName());
} }
break; break;
@ -2118,10 +1668,8 @@ public class GWTWorkspaceBuilder {
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.PASTE)){ if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.PASTE)){
af.setOperation(GxtAccountingEntryType.PASTE); af.setOperation(GxtAccountingEntryType.PASTE);
AccountingEntryPaste paste = (AccountingEntryPaste) accountingEntry; AccountingEntryPaste paste = (AccountingEntryPaste) accountingEntry;
af.setDescription(GxtAccountingEntryType.PASTE.getName() + " from "+paste.getFromPath()+" by "+user.getName()); af.setDescription(GxtAccountingEntryType.PASTE.getName() + " from "+paste.getFromPath()+" by "+user.getName());
} }
@ -2131,8 +1679,7 @@ public class GWTWorkspaceBuilder {
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.REMOVE)){ if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALL) || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.REMOVE)){
af.setOperation(GxtAccountingEntryType.REMOVE); af.setOperation(GxtAccountingEntryType.REMOVE);
AccountingEntryRemoval rem = (AccountingEntryRemoval) accountingEntry; AccountingEntryRemoval rem = (AccountingEntryRemoval) accountingEntry;
String msg = ""; String msg = "";
@ -2142,9 +1689,6 @@ public class GWTWorkspaceBuilder {
msg = rem.getItemName() + " "+GxtAccountingEntryType.REMOVE.getName() +" by "+user.getName(); msg = rem.getItemName() + " "+GxtAccountingEntryType.REMOVE.getName() +" by "+user.getName();
af.setDescription(msg); af.setDescription(msg);
// af.setDescription(GxtAccountingEntryType.REMOVE.getName() + " "+rem.getItemName()+" by "+user.getName());
// af.setDescription(rem.getItemName() + " "+GxtAccountingEntryType.REMOVE.getName() +" by "+user.getName());
} }
break; break;
@ -2163,9 +1707,6 @@ public class GWTWorkspaceBuilder {
msg = ren.getOldItemName() +" "+GxtAccountingEntryType.RENAME.getName()+ " by "+user.getName(); msg = ren.getOldItemName() +" "+GxtAccountingEntryType.RENAME.getName()+ " by "+user.getName();
af.setDescription(msg); af.setDescription(msg);
// af.setDescription(GxtAccountingEntryType.RENAME.getName()+" from "+ren.getOldItemName() + " by "+user.getName());
// af.setDescription(ren.getOldItemName() +" "+GxtAccountingEntryType.RENAME.getName()+ " by "+user.getName());
} }
break; break;
@ -2184,8 +1725,6 @@ public class GWTWorkspaceBuilder {
msg = acc.getItemName() + " "+GxtAccountingEntryType.ADD.getName()+ " by "+user.getName(); msg = acc.getItemName() + " "+GxtAccountingEntryType.ADD.getName()+ " by "+user.getName();
af.setDescription(msg); af.setDescription(msg);
// af.setDescription(acc.getItemName() + " "+GxtAccountingEntryType.ADD.getName()+ " by "+user.getName());
} }
break; break;
@ -2204,9 +1743,6 @@ public class GWTWorkspaceBuilder {
msg = acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName(); msg = acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName();
af.setDescription(msg); af.setDescription(msg);
// af.setDescription(GxtAccountingEntryType.UPDATE.getName()+ " "+acc.getItemName() +" by "+user.getName());
// af.setDescription(acc.getItemName() +" "+GxtAccountingEntryType.UPDATE.getName()+" by "+user.getName());
} }
break; break;
@ -2221,12 +1757,9 @@ public class GWTWorkspaceBuilder {
String msg = ""; String msg = "";
if(acc.getItemName()==null || acc.getItemName().isEmpty()) if(acc.getItemName()==null || acc.getItemName().isEmpty())
msg = user.getName() + " "+GxtAccountingEntryType.SHARE.getName()+ " workspace folder"; msg = user.getName() + " "+GxtAccountingEntryType.SHARE.getName()+ " workspace folder";
// msg = GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
else else
msg = user.getName() + " "+GxtAccountingEntryType.SHARE.getName()+ " workspace folder "+acc.getItemName(); msg = user.getName() + " "+GxtAccountingEntryType.SHARE.getName()+ " workspace folder "+acc.getItemName();
// msg = acc.getItemName() +" "+GxtAccountingEntryType.SHARE.getName()+" by "+user.getName();
if(acc.getMembers()!=null && acc.getMembers().size()>0){ if(acc.getMembers()!=null && acc.getMembers().size()>0){
msg+=" with "+UserUtil.separateFullNameToCommaForPortalLogin(acc.getMembers()); msg+=" with "+UserUtil.separateFullNameToCommaForPortalLogin(acc.getMembers());
@ -2254,15 +1787,10 @@ public class GWTWorkspaceBuilder {
} }
break; break;
} }
listAccFields.add(af); listAccFields.add(af);
} }
} }
logger.trace("get accounting readers converting completed - returning size "+listAccFields.size()); logger.trace("get accounting readers converting completed - returning size "+listAccFields.size());
return listAccFields; return listAccFields;
@ -2285,15 +1813,12 @@ public class GWTWorkspaceBuilder {
for (AccountingEntryRead accReader : readers) { for (AccountingEntryRead accReader : readers) {
GxtAccountingField af = new GxtAccountingField(); GxtAccountingField af = new GxtAccountingField();
InfoContactModel user = buildGxtInfoContactFromPortalLogin(accReader.getUser()); InfoContactModel user = buildGxtInfoContactFromPortalLogin(accReader.getUser());
af.setUser(user); af.setUser(user);
af.setDate(toDate(accReader.getDate())); af.setDate(toDate(accReader.getDate()));
af.setOperation(GxtAccountingEntryType.READ); af.setOperation(GxtAccountingEntryType.READ);
// af.setDescription(GxtAccountingEntryType.READ.getName() +" by "+user.getName());
String msg = ""; String msg = "";
if(accReader.getItemName()==null || accReader.getItemName().isEmpty()) if(accReader.getItemName()==null || accReader.getItemName().isEmpty())
msg = GxtAccountingEntryType.READ.getName() + " by "+user.getName(); msg = GxtAccountingEntryType.READ.getName() + " by "+user.getName();
@ -2301,9 +1826,6 @@ public class GWTWorkspaceBuilder {
msg = accReader.getItemName() + " " + GxtAccountingEntryType.READ.getName() + " by "+user.getName(); msg = accReader.getItemName() + " " + GxtAccountingEntryType.READ.getName() + " by "+user.getName();
af.setDescription(msg); af.setDescription(msg);
// af.setDescription(accReader.getItemName() + " " + GxtAccountingEntryType.READ.getName() + " by "+user.getName());
listAccFields.add(af); listAccFields.add(af);
} }
@ -2547,11 +2069,7 @@ public class GWTWorkspaceBuilder {
WorkspaceSharedFolder theFolder = (WorkspaceSharedFolder) item; WorkspaceSharedFolder theFolder = (WorkspaceSharedFolder) item;
return theFolder.getDescription(); return theFolder.getDescription();
} }
case GCUBE_ITEM:{
GCubeItem theGcubeItem = (GCubeItem) item;
return theGcubeItem.getDescription();
}
case SMART_FOLDER:{ case SMART_FOLDER:{
WorkspaceSmartFolder theFolder = (WorkspaceSmartFolder) item; WorkspaceSmartFolder theFolder = (WorkspaceSmartFolder) item;
return theFolder.getDescription(); return theFolder.getDescription();
@ -2616,9 +2134,7 @@ public class GWTWorkspaceBuilder {
} }
return null; return null;
} }
/** /**
* Gets the gcube item properties. * Gets the gcube item properties.
* *

View File

@ -2820,7 +2820,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
if(wsItem.getType().equals(WorkspaceItemType.FOLDER_ITEM)){ if(wsItem.getType().equals(WorkspaceItemType.FOLDER_ITEM)){
FolderItem folderItem = (FolderItem) wsItem; FolderItem folderItem = (FolderItem) wsItem;
String smpUri = builder.getPubliLinkForFolderItem(folderItem); String smpUri = builder.getPublicLinkForFolderItem(folderItem);
if(smpUri==null || smpUri.isEmpty()) if(smpUri==null || smpUri.isEmpty())
throw new Exception("Sorry, public link on "+wsItem.getName() +" is not available"); throw new Exception("Sorry, public link on "+wsItem.getName() +" is not available");

View File

@ -46,7 +46,7 @@ public class ScopeUtilFilter {
public List<String> convertListScopeToPortlet(List<String> listScopes){ public List<String> convertListScopeToPortlet(List<String> listScopes){
logger.trace("Scope converting..."); logger.trace("List Scope converting..."+listScopes);
List<String> scopesConverted = new ArrayList<String>(); List<String> scopesConverted = new ArrayList<String>();
scopesConverted.add(ALLSCOPE); scopesConverted.add(ALLSCOPE);
@ -60,9 +60,7 @@ public class ScopeUtilFilter {
for (String scope : listScopes) { for (String scope : listScopes) {
if(scope.compareTo(scopeRoot)==0){ //CASE SCOPE IS ROOT if(scope.compareTo(scopeRoot)==0){ //CASE SCOPE IS ROOT
logger.trace("found scope root "+scope+" added to list without converting"); logger.trace("found scope root "+scope+" added to list without converting");
hashScopesFiltered.put(scopeRoot, scopeRoot); hashScopesFiltered.put(scopeRoot, scopeRoot);
scopesConverted.add(scopeRoot); scopesConverted.add(scopeRoot);
@ -78,13 +76,9 @@ public class ScopeUtilFilter {
// System.out.println("end "+end); // System.out.println("end "+end);
if(index!=-1){ //CASE SCOPE ROOT IS FOUND if(index!=-1){ //CASE SCOPE ROOT IS FOUND
String filerString = scope.substring(index+start, scope.length()); String filerString = scope.substring(index+start, scope.length());
hashScopesFiltered.put(filerString, scope); hashScopesFiltered.put(filerString, scope);
scopesConverted.add(filerString);
scopesConverted.add(filerString);
logger.trace("scope "+scope+ " is converted in: "+filerString); logger.trace("scope "+scope+ " is converted in: "+filerString);
}else{ //CASE SCOPE ROOT NOT IS FOUND }else{ //CASE SCOPE ROOT NOT IS FOUND
@ -92,9 +86,7 @@ public class ScopeUtilFilter {
} }
} }
} }
logger.trace("Scope converting was completed"); logger.trace("Scope converting was completed");
return scopesConverted; return scopesConverted;
} }

View File

@ -104,7 +104,7 @@ public class SinglePublicLinkTest {
if(wsItem.getType().equals(WorkspaceItemType.FOLDER_ITEM)){ if(wsItem.getType().equals(WorkspaceItemType.FOLDER_ITEM)){
FolderItem folderItem = (FolderItem) wsItem; FolderItem folderItem = (FolderItem) wsItem;
String smpUri = builder.getPubliLinkForFolderItem(folderItem); String smpUri = builder.getPublicLinkForFolderItem(folderItem);
if(smpUri==null || smpUri.isEmpty()) if(smpUri==null || smpUri.isEmpty())
throw new Exception("Sorry, public link on "+wsItem.getName() +" is not available"); throw new Exception("Sorry, public link on "+wsItem.getName() +" is not available");

View File

@ -182,7 +182,7 @@ public class UriResolverReaderRR {
FolderItem folderItem = (FolderItem) wsItem; FolderItem folderItem = (FolderItem) wsItem;
System.out.println("get public link..."); System.out.println("get public link...");
String smpUri = builder.getPubliLinkForFolderItem(folderItem); String smpUri = builder.getPublicLinkForFolderItem(folderItem);
System.out.println("smpUri "+smpUri); System.out.println("smpUri "+smpUri);
System.out.println("get uriResolver..."); System.out.println("get uriResolver...");