|
|
|
@ -8,19 +8,22 @@ import java.util.Calendar;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.LinkedList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
import org.gcube.common.homelibary.model.items.gcube.DocumentAlternativeLink;
|
|
|
|
|
import org.gcube.common.homelibary.model.items.gcube.DocumentMetadata;
|
|
|
|
|
import org.gcube.common.homelibary.model.items.gcube.DocumentPartLink;
|
|
|
|
|
import org.gcube.common.homelibary.model.items.type.NodeProperty;
|
|
|
|
|
import org.gcube.common.homelibary.model.items.type.WorkspaceItemType;
|
|
|
|
|
import org.gcube.common.homelibrary.home.User;
|
|
|
|
|
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.Properties;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItemType;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSmartFolder;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType;
|
|
|
|
@ -37,25 +40,11 @@ import org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryUns
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryUpdate;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.FolderBulkCreator;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.AquaMapsItem;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalFile;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalImage;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalPDFFile;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalUrl;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.GCubeItem;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.Query;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.Report;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ReportTemplate;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.WorkflowReport;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.WorkflowTemplate;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.gcube.Document;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.gcube.DocumentMetadata;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.gcube.ImageDocument;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.gcube.Metadata;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.gcube.PDFDocument;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.gcube.UrlDocument;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ts.TimeSeries;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ts.TimeSeriesInfo;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.search.SearchFolderItem;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.search.SearchItem;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage;
|
|
|
|
@ -81,22 +70,10 @@ import org.gcube.portlets.user.workspace.client.workspace.GWTProperties;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceFolder;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItemAction;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTAquaMapsItem;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalFile;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalImage;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalPDFFile;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalUrl;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTQuery;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTReport;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTReportTemplate;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTTimeSeries;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTWorkflowReport;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTWorkflowTemplate;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTDocument;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTDocumentMetadata;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTMetadata;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTPDFDocument;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument;
|
|
|
|
|
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
|
|
|
|
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
|
|
|
@ -106,6 +83,8 @@ import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryTyp
|
|
|
|
|
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.model.UserModel;
|
|
|
|
|
|
|
|
|
|
import com.thoughtworks.xstream.XStream;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
|
|
@ -209,7 +188,7 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
protected GWTProperties buildGWTProperties(Properties metadata) throws InternalErrorException
|
|
|
|
|
{
|
|
|
|
|
//FIXME temp solution
|
|
|
|
|
//GWTProperties gwtProperties = new GWTProperties(metadata.getId(), metadata.getProperties());
|
|
|
|
|
// GWTProperties gwtProperties = new GWTProperties(metadata.getId(), metadata.getProperties());
|
|
|
|
|
return new GWTProperties();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -235,376 +214,376 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
protected GWTWorkspaceItem buildGWTWorkspaceImage(WorkspaceItem item, boolean isInteralImage, boolean fullDetails) throws InternalErrorException
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -614,9 +593,12 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
//
|
|
|
|
|
if(isInteralImage){
|
|
|
|
|
|
|
|
|
|
ImageDocument image = (ImageDocument) item; //Cast Image Document
|
|
|
|
|
|
|
|
|
|
Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(image.getMetadata(), image.getId());
|
|
|
|
|
GCubeItem image = (GCubeItem) item; //Cast OLD Image Document
|
|
|
|
|
|
|
|
|
|
List<DocumentAlternativeLink> links = (List<DocumentAlternativeLink>) new XStream().fromXML(image.getItemProperties().get(NodeProperty.ALTERNATIVES.toString()));
|
|
|
|
|
List<DocumentPartLink> parts = (List<DocumentPartLink>) new XStream().fromXML(image.getItemProperties().get(NodeProperty.PARTS.toString()));
|
|
|
|
|
Map<String, DocumentMetadata> metadatas = (Map<String, DocumentMetadata>) new XStream().fromXML(image.getItemProperties().get(NodeProperty.METADATA.toString()));
|
|
|
|
|
Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(metadatas, image.getId());
|
|
|
|
|
|
|
|
|
|
gwtImage = (GWTImageDocument) new GWTImageDocument(
|
|
|
|
|
toDate(image.getCreationTime()),
|
|
|
|
@ -630,19 +612,19 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
null,
|
|
|
|
|
buildImageUrl(image.getId()),
|
|
|
|
|
buildThumbnailUrl(image.getId()),
|
|
|
|
|
image.getWidth(),
|
|
|
|
|
image.getHeight(),
|
|
|
|
|
image.getThumbnailWidth(),
|
|
|
|
|
image.getThumbnailHeight(),
|
|
|
|
|
image.getThumbnailLength(),
|
|
|
|
|
Integer.parseInt(image.getItemProperties().get(NodeProperty.IMAGE_WIDTH.toString())),
|
|
|
|
|
Integer.parseInt(image.getItemProperties().get(NodeProperty.IMAGE_HEIGHT.toString())),
|
|
|
|
|
Integer.parseInt(image.getItemProperties().get(NodeProperty.THUMBNAIL_WIDTH.toString())),
|
|
|
|
|
Integer.parseInt(image.getItemProperties().get(NodeProperty.THUMBNAIL_HEIGHT.toString())),
|
|
|
|
|
-1,
|
|
|
|
|
image.getLength(),
|
|
|
|
|
image.getMimeType(),
|
|
|
|
|
image.getURI(),
|
|
|
|
|
image.getItemProperties().get(NodeProperty.OID.toString()),
|
|
|
|
|
gwtmetadatas,
|
|
|
|
|
new LinkedHashMap<String, String>(),
|
|
|
|
|
image.getCollectionName(),
|
|
|
|
|
image.getAlternatives().size(),
|
|
|
|
|
image.getParts().size());
|
|
|
|
|
image.getItemProperties().get(NodeProperty.COLLECTION_NAME.toString()),
|
|
|
|
|
links.size(),
|
|
|
|
|
parts.size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else{
|
|
|
|
@ -668,10 +650,9 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
image.getLength(),
|
|
|
|
|
image.getThumbnailWidth(),
|
|
|
|
|
image.getThumbnailHeight(),
|
|
|
|
|
image.getThumbnailLength(),
|
|
|
|
|
-1,
|
|
|
|
|
image.getMimeType());
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
gwtImage = new GWTExternalImage(
|
|
|
|
|
buildImageUrl(image.getId()),
|
|
|
|
@ -681,12 +662,10 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
image.getLength(),
|
|
|
|
|
image.getThumbnailWidth(),
|
|
|
|
|
image.getThumbnailHeight(),
|
|
|
|
|
image.getThumbnailLength(),
|
|
|
|
|
-1,
|
|
|
|
|
image.getMimeType());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return gwtImage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -712,6 +691,7 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
protected GWTWorkspaceItem buildGWTWorspaceUrl(WorkspaceItem item, boolean isInternalUrl, boolean fullDetails) throws InternalErrorException
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -723,9 +703,12 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
|
|
|
|
|
if(isInternalUrl){
|
|
|
|
|
|
|
|
|
|
UrlDocument document = (UrlDocument) item; //Cast
|
|
|
|
|
|
|
|
|
|
Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(document.getMetadata(), document.getId());
|
|
|
|
|
GCubeItem document = (GCubeItem) item; //Cast OLD UrlDocument
|
|
|
|
|
// UrlDocument document = (UrlDocument) item; //Cast
|
|
|
|
|
List<DocumentAlternativeLink> links = (List<DocumentAlternativeLink>) new XStream().fromXML(document.getItemProperties().get(NodeProperty.ALTERNATIVES.toString()));
|
|
|
|
|
List<DocumentPartLink> parts = (List<DocumentPartLink>) new XStream().fromXML(document.getItemProperties().get(NodeProperty.PARTS.toString()));
|
|
|
|
|
Map<String, DocumentMetadata> metadatas = (Map<String, DocumentMetadata>) new XStream().fromXML(document.getItemProperties().get(NodeProperty.METADATA.toString()));
|
|
|
|
|
Map<String, GWTDocumentMetadata> gwtmetadatas = getMetadatas(metadatas, document.getId());
|
|
|
|
|
|
|
|
|
|
gwtUrl = new GWTUrlDocument(
|
|
|
|
|
toDate(document.getCreationTime()),
|
|
|
|
@ -738,14 +721,14 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
GWTWorkspaceItemAction.valueOf(document.getLastAction().toString()),
|
|
|
|
|
null,
|
|
|
|
|
document.getLength(),
|
|
|
|
|
document.getURI(),
|
|
|
|
|
document.getItemProperties().get(NodeProperty.OID.toString()),
|
|
|
|
|
document.getMimeType(),
|
|
|
|
|
gwtmetadatas,
|
|
|
|
|
new LinkedHashMap<String, String>(),
|
|
|
|
|
document.getCollectionName(),
|
|
|
|
|
document.getAlternatives().size(),
|
|
|
|
|
document.getParts().size(),
|
|
|
|
|
document.getUrl());
|
|
|
|
|
document.getItemProperties().get(NodeProperty.COLLECTION_NAME.toString()),
|
|
|
|
|
links.size(),
|
|
|
|
|
parts.size(),
|
|
|
|
|
document.getItemProperties().get(NodeProperty.URL.toString()));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
|
@ -1317,14 +1300,26 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
case IMAGE_DOCUMENT:
|
|
|
|
|
fileModel.setFolderItemType(GXTFolderItemTypeEnum.IMAGE_DOCUMENT);
|
|
|
|
|
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_IMAGES);
|
|
|
|
|
ImageDocument imgDoc = (ImageDocument) worspaceFolderItem;
|
|
|
|
|
fileModel.setType(imgDoc.getMimeType());
|
|
|
|
|
// ImageDocument imgDoc = (ImageDocument) worspaceFolderItem;
|
|
|
|
|
GCubeItem imgDoc = (GCubeItem) worspaceFolderItem; //Cast GCubeItem
|
|
|
|
|
try {
|
|
|
|
|
fileModel.setType(imgDoc.getMimeType());
|
|
|
|
|
} catch (InternalErrorException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
logger.error("IMAGE_DOCUMENT InternalErrorException when getting MimeType on "+fileModel.getIdentifier());
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DOCUMENT:
|
|
|
|
|
fileModel.setFolderItemType(GXTFolderItemTypeEnum.DOCUMENT);
|
|
|
|
|
fileModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS);
|
|
|
|
|
Document doc = (Document) worspaceFolderItem;
|
|
|
|
|
fileModel.setType(doc.getMimeType());
|
|
|
|
|
// Document doc = (Document) worspaceFolderItem;
|
|
|
|
|
GCubeItem doc = (GCubeItem) worspaceFolderItem; //Cast GCubeItem
|
|
|
|
|
try {
|
|
|
|
|
fileModel.setType(doc.getMimeType());
|
|
|
|
|
} catch (InternalErrorException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
logger.error("DOCUMENT InternalErrorException when getting MimeType on "+fileModel.getIdentifier());
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case URL_DOCUMENT:
|
|
|
|
|
fileModel.setFolderItemType(GXTFolderItemTypeEnum.URL_DOCUMENT);
|
|
|
|
@ -1388,7 +1383,9 @@ public class GWTWorkspaceBuilder {
|
|
|
|
|
case PDF_DOCUMENT:
|
|
|
|
|
break;
|
|
|
|
|
case IMAGE_DOCUMENT:
|
|
|
|
|
return ((ImageDocument) worspaceFolderItem).getPublicLink();
|
|
|
|
|
GCubeItem imgDoc = (GCubeItem) worspaceFolderItem; //Cast GCubeItem
|
|
|
|
|
return imgDoc.getPublicLink(false);
|
|
|
|
|
// return ((ImageDocument) worspaceFolderItem).getPublicLink();
|
|
|
|
|
case DOCUMENT:
|
|
|
|
|
break;
|
|
|
|
|
case URL_DOCUMENT:
|
|
|
|
|