public class GWTWorkspaceBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected static HashMap<String,InfoContactModel> |
hashTestUser |
protected static String |
IMAGE_SERVICE_URL |
protected static org.apache.log4j.Logger |
logger |
Constructor and Description |
---|
GWTWorkspaceBuilder()
Instantiates a new GWT workspace builder.
|
Modifier and Type | Method and Description |
---|---|
protected GWTExternalUrl |
buildGWTExternalUrl(org.gcube.common.homelibrary.home.workspace.folder.items.ExternalUrl url,
GWTWorkspaceFolder parent)
Builds the gwt external url.
|
protected GWTProperties |
buildGWTProperties(org.gcube.common.homelibrary.home.workspace.Properties metadata)
Builds the gwt properties.
|
FileDetailsModel |
buildGWTWorkspaceFileDetails(org.gcube.common.homelibrary.home.workspace.WorkspaceItem wsItem,
FileModel item)
Builds the gwt workspace file details.
|
protected GWTWorkspaceItem |
buildGWTWorkspaceImage(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item,
boolean isInteralImage,
boolean fullDetails)
Builds the gwt workspace image.
|
protected GWTWorkspaceItem |
buildGWTWorspaceUrl(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item,
boolean isInternalUrl,
boolean fullDetails)
Builds the gwt worspace url.
|
List<GxtAccountingField> |
buildGXTAccountingItem(List<org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntry> accoutings,
GxtAccountingEntryType gxtEntryType)
Builds the gxt accounting item.
|
List<GxtAccountingField> |
buildGXTAccountingItemFromReaders(List<org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryRead> readers)
Builds the gxt accounting item from readers.
|
FileGridModel |
buildGXTFileGridModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item,
FileModel parentFileModel)
Builds the gxt file grid model item.
|
protected FileModel |
buildGXTFileModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item,
FileModel parentFolderModel)
Builds the gxt file model item.
|
FolderModel |
buildGXTFolderModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceFolder wsFolder,
FileModel parent)
Builds the gxt folder model item.
|
FolderModel |
buildGXTFolderModelItemHandleSpecialFolder(org.gcube.common.homelibrary.home.workspace.WorkspaceFolder wsFolder,
FileModel parent,
String specialFolderName)
TODO ********TEMPORARY SOLUTION HL MUST MANAGE SPECIAL FOLDER AS WORKSPACESPECIALFOLDER****
REMOVE THIS METHOD AND ADDING INSTANCE OF AT buildGXTFolderModelItem.
|
protected InfoContactModel |
buildGxtInfoContactFromPortalLogin(String portalLogin)
Builds the gxt info contact from portal login.
|
protected List<InfoContactModel> |
buildGxtInfoContactFromPortalLoginTestMode(List<String> listPortalLogin)
Used in test mode.
|
InfoContactModel |
buildGXTInfoContactModel(org.gcube.common.homelibrary.home.User user)
Builds the gxt info contact model.
|
List<InfoContactModel> |
buildGxtInfoContactsFromPortalLogins(List<String> listPortalLogin)
Builds the gxt info contacts from portal logins.
|
List<BulkCreatorModel> |
buildGXTListBulkCreatorModel(List<org.gcube.common.homelibrary.home.workspace.folder.FolderBulkCreator> listFBC)
Builds the gxt list bulk creator model.
|
List<InfoContactModel> |
buildGXTListContactsModelFromGcubeGroup(List<org.gcube.common.homelibrary.home.workspace.usermanager.GCubeGroup> list)
Builds the gxt list contacts model from gcube group.
|
List<InfoContactModel> |
buildGXTListContactsModelFromUserModel(List<org.gcube.vomanagement.usermanagement.model.UserModel> listUsers)
Builds the gxt list contacts model from user model.
|
List<FileGridModel> |
buildGXTListFileGridModelItem(List<org.gcube.common.homelibrary.home.workspace.WorkspaceItem> listWorkspaceItems,
FileModel parentFileModel)
Builds the gxt list file grid model item.
|
List<FileGridModel> |
buildGXTListFileGridModelItemForSearch(List<org.gcube.common.homelibrary.home.workspace.search.SearchItem> listSearchItems)
Builds the gxt list file grid model item for search.
|
protected List<FileModel> |
buildGXTListFileModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceItem workspaceFolder,
FileModel parentFolderModel)
Builds the gxt list file model item.
|
protected List<FileModel> |
buildGXTListFileModelItemForAttachs(List<org.gcube.common.homelibrary.home.workspace.WorkspaceItem> listWorspaceItems)
Builds the gxt list file model item for attachs.
|
List<MessageModel> |
buildGXTListMessageModelForGrid(List<org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage> listMessages,
String typeMessages)
Builds the gxt list message model for grid.
|
List<ScopeModel> |
buildGXTListScopeModel(List<String> listFilteredScopes,
Map<String,String> mapPortalScopes)
Builds the gxt list scope model.
|
List<SmartFolderModel> |
buildGXTListSmartFolderModel(List<org.gcube.common.homelibrary.home.workspace.WorkspaceSmartFolder> listWorkspaceSmartFolder)
Builds the gxt list smart folder model.
|
List<FileTrashedModel> |
buildGXTListTrashContent(org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashFolder trash)
Builds the gxt list trash content.
|
MessageModel |
buildGXTMessageModel(org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage mess,
List<org.gcube.common.homelibrary.home.workspace.WorkspaceItem> listWorkspaceItems,
String messageType)
Builds the gxt message model.
|
SmartFolderModel |
buildGXTSmartFolderModel(org.gcube.common.homelibrary.home.workspace.WorkspaceSmartFolder wsFolder,
String query)
Builds the gxt smart folder model.
|
FileTrashedModel |
buildGXTTrashModelItem(org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashItem trashedItem)
Builds the gxt trash model item.
|
FileTrashedModel |
buildGXTTrashModelItemById(String itemId,
org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashFolder trash)
Builds the gxt trash model item by id.
|
protected String |
buildImageServiceUrl(String id,
ImageRequestType requestType)
Builds the image service url.
|
protected String |
buildImageUrl(String id)
Builds the image url.
|
List<String> |
buildListLoginFromContanctModel(List<InfoContactModel> listContactsModel)
Builds the list login from contanct model.
|
protected String |
buildThumbnailUrl(String id)
Builds the thumbnail url.
|
FolderModel |
buildWorkspaceFileModelRoot(org.gcube.common.homelibrary.home.workspace.WorkspaceFolder workspaceRoot)
Builds the workspace file model root.
|
List<FileGridModel> |
filterListFileGridModelItemByCategory(List<org.gcube.common.homelibrary.home.workspace.search.SearchItem> listSearchItem,
String category)
Filter list file grid model item by category.
|
static String |
formatFileSize(long size)
returns dynamically the formated size.
|
protected String |
getFolderItemTypeCategory(org.gcube.common.homelibrary.home.workspace.search.SearchItem item)
Gets the folder item type category.
|
String |
getFormatHtmlACLFromACLs(Map<org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType,List<String>> aclOwner)
Gets the formatted html acl from ac ls.
|
String |
getFormatHtmlGcubeItemProperties(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item)
Gets the format html gcube item properties.
|
Map<String,String> |
getGcubeItemProperties(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item)
Gets the gcube item properties.
|
static HashMap<String,InfoContactModel> |
getHashTestUsers()
Used in test mode.
|
String |
getItemDescriptionForTypeById(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item)
Gets the item description for type by id.
|
protected GWTDocumentMetadata |
getMetadata(org.gcube.common.homelibary.model.items.gcube.DocumentMetadata metadata,
String documentId)
Gets the metadata.
|
protected Map<String,GWTDocumentMetadata> |
getMetadatas(Map<String,org.gcube.common.homelibary.model.items.gcube.DocumentMetadata> metadatas,
String documentId)
Gets the metadatas.
|
String |
getPublicLinkForFolderItem(org.gcube.common.homelibrary.home.workspace.folder.FolderItem worspaceFolderItem)
Gets the public link for folder item.
|
String |
getStorageIDForFolderItem(org.gcube.common.homelibrary.home.workspace.folder.FolderItem worspaceFolderItem)
Gets the storage id for folder item.
|
List<WorkspaceACL> |
getWorkspaceACLFromACLs(List<org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType> types)
Gets the workspace acl from ac ls.
|
protected FileModel |
setFolderItemType(FileModel fileModel,
org.gcube.common.homelibrary.home.workspace.folder.FolderItem worspaceFolderItem)
Sets the folder item type.
|
protected FileModel |
setFolderItemTypeForSearch(FileModel fileModel,
org.gcube.common.homelibrary.home.workspace.search.SearchFolderItem searchFolderItem)
Sets the folder item type for search.
|
void |
setUserLogged(InfoContactModel infoContactModel)
Sets the user logged.
|
protected Date |
toDate(Calendar calendar)
To date.
|
protected Date |
toDateFormat(Calendar calendar)
To date format.
|
protected String |
toDateFormatToString(Calendar calendar)
To date format to string.
|
protected static final String IMAGE_SERVICE_URL
protected static org.apache.log4j.Logger logger
protected static HashMap<String,InfoContactModel> hashTestUser
public GWTWorkspaceBuilder()
public static HashMap<String,InfoContactModel> getHashTestUsers()
protected Date toDate(Calendar calendar)
calendar
- the calendarprotected String toDateFormatToString(Calendar calendar)
calendar
- the calendarprotected Date toDateFormat(Calendar calendar)
calendar
- the calendarprotected GWTProperties buildGWTProperties(org.gcube.common.homelibrary.home.workspace.Properties metadata) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
metadata
- the metadataorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected String buildImageUrl(String id)
id
- the idprotected String buildThumbnailUrl(String id)
id
- the idprotected String buildImageServiceUrl(String id, ImageRequestType requestType)
id
- the idrequestType
- the request typeprotected GWTWorkspaceItem buildGWTWorkspaceImage(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item, boolean isInteralImage, boolean fullDetails) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
item
- the itemisInteralImage
- the is interal imagefullDetails
- the full detailsorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected GWTExternalUrl buildGWTExternalUrl(org.gcube.common.homelibrary.home.workspace.folder.items.ExternalUrl url, GWTWorkspaceFolder parent) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
url
- the urlparent
- the parentorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected GWTWorkspaceItem buildGWTWorspaceUrl(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item, boolean isInternalUrl, boolean fullDetails) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
item
- the itemisInternalUrl
- the is internal urlfullDetails
- the full detailsorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected Map<String,GWTDocumentMetadata> getMetadatas(Map<String,org.gcube.common.homelibary.model.items.gcube.DocumentMetadata> metadatas, String documentId)
metadatas
- the metadatasdocumentId
- the document idprotected GWTDocumentMetadata getMetadata(org.gcube.common.homelibary.model.items.gcube.DocumentMetadata metadata, String documentId)
metadata
- the metadatadocumentId
- the document idpublic FolderModel buildWorkspaceFileModelRoot(org.gcube.common.homelibrary.home.workspace.WorkspaceFolder workspaceRoot) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
workspaceRoot
- the workspace rootorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected List<FileModel> buildGXTListFileModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceItem workspaceFolder, FileModel parentFolderModel) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
workspaceFolder
- the workspace folderparentFolderModel
- the parent folder modelorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected List<FileModel> buildGXTListFileModelItemForAttachs(List<org.gcube.common.homelibrary.home.workspace.WorkspaceItem> listWorspaceItems) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
listWorspaceItems
- the list worspace itemsorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<InfoContactModel> buildGxtInfoContactsFromPortalLogins(List<String> listPortalLogin)
listPortalLogin
- the list portal loginprotected InfoContactModel buildGxtInfoContactFromPortalLogin(String portalLogin)
portalLogin
- the portal loginprotected List<InfoContactModel> buildGxtInfoContactFromPortalLoginTestMode(List<String> listPortalLogin)
listPortalLogin
- the list portal loginprotected FileModel buildGXTFileModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item, FileModel parentFolderModel) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
item
- the itemparentFolderModel
- the parent folder modelorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<FileGridModel> buildGXTListFileGridModelItemForSearch(List<org.gcube.common.homelibrary.home.workspace.search.SearchItem> listSearchItems) throws Exception
listSearchItems
- the list search itemsException
- the exceptionpublic List<FileGridModel> buildGXTListFileGridModelItem(List<org.gcube.common.homelibrary.home.workspace.WorkspaceItem> listWorkspaceItems, FileModel parentFileModel) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
listWorkspaceItems
- the list workspace itemsparentFileModel
- the parent file modelorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic FileGridModel buildGXTFileGridModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item, FileModel parentFileModel) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
item
- the itemparentFileModel
- the parent file modelorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected FileModel setFolderItemTypeForSearch(FileModel fileModel, org.gcube.common.homelibrary.home.workspace.search.SearchFolderItem searchFolderItem)
fileModel
- the file modelsearchFolderItem
- the search folder itemprotected FileModel setFolderItemType(FileModel fileModel, org.gcube.common.homelibrary.home.workspace.folder.FolderItem worspaceFolderItem)
fileModel
- the file modelworspaceFolderItem
- the worspace folder itempublic String getPublicLinkForFolderItem(org.gcube.common.homelibrary.home.workspace.folder.FolderItem worspaceFolderItem) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
worspaceFolderItem
- the worspace folder itemorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic String getStorageIDForFolderItem(org.gcube.common.homelibrary.home.workspace.folder.FolderItem worspaceFolderItem) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
worspaceFolderItem
- the worspace folder itemorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic FolderModel buildGXTFolderModelItem(org.gcube.common.homelibrary.home.workspace.WorkspaceFolder wsFolder, FileModel parent) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
wsFolder
- the ws folderparent
- the parentorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic FolderModel buildGXTFolderModelItemHandleSpecialFolder(org.gcube.common.homelibrary.home.workspace.WorkspaceFolder wsFolder, FileModel parent, String specialFolderName) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
wsFolder
- the ws folderparent
- the parentspecialFolderName
- the special folder nameorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic FileDetailsModel buildGWTWorkspaceFileDetails(org.gcube.common.homelibrary.home.workspace.WorkspaceItem wsItem, FileModel item) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
wsItem
- the ws itemitem
- the itemorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionprotected String getFolderItemTypeCategory(org.gcube.common.homelibrary.home.workspace.search.SearchItem item) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
item
- the itemorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<FileGridModel> filterListFileGridModelItemByCategory(List<org.gcube.common.homelibrary.home.workspace.search.SearchItem> listSearchItem, String category) throws Exception
listSearchItem
- the list search itemcategory
- the categoryException
- the exceptionpublic List<SmartFolderModel> buildGXTListSmartFolderModel(List<org.gcube.common.homelibrary.home.workspace.WorkspaceSmartFolder> listWorkspaceSmartFolder) throws Exception
listWorkspaceSmartFolder
- the list workspace smart folderException
- the exceptionpublic SmartFolderModel buildGXTSmartFolderModel(org.gcube.common.homelibrary.home.workspace.WorkspaceSmartFolder wsFolder, String query) throws Exception
wsFolder
- the ws folderquery
- the queryException
- the exceptionpublic List<ScopeModel> buildGXTListScopeModel(List<String> listFilteredScopes, Map<String,String> mapPortalScopes)
listFilteredScopes
- the list filtered scopesmapPortalScopes
- the map portal scopespublic List<InfoContactModel> buildGXTListContactsModelFromUserModel(List<org.gcube.vomanagement.usermanagement.model.UserModel> listUsers) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
listUsers
- the list usersorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<InfoContactModel> buildGXTListContactsModelFromGcubeGroup(List<org.gcube.common.homelibrary.home.workspace.usermanager.GCubeGroup> list) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
list
- the listorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<String> buildListLoginFromContanctModel(List<InfoContactModel> listContactsModel) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
listContactsModel
- the list contacts modelorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<MessageModel> buildGXTListMessageModelForGrid(List<org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage> listMessages, String typeMessages) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
listMessages
- the list messagestypeMessages
- the type messagesorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic MessageModel buildGXTMessageModel(org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage mess, List<org.gcube.common.homelibrary.home.workspace.WorkspaceItem> listWorkspaceItems, String messageType) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
mess
- the messlistWorkspaceItems
- the list workspace itemsmessageType
- the message typeorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic InfoContactModel buildGXTInfoContactModel(org.gcube.common.homelibrary.home.User user) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
user
- the userorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<BulkCreatorModel> buildGXTListBulkCreatorModel(List<org.gcube.common.homelibrary.home.workspace.folder.FolderBulkCreator> listFBC) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
listFBC
- the list fbcorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic List<GxtAccountingField> buildGXTAccountingItem(List<org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntry> accoutings, GxtAccountingEntryType gxtEntryType)
accoutings
- the accoutingsgxtEntryType
- the gxt entry typepublic List<GxtAccountingField> buildGXTAccountingItemFromReaders(List<org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryRead> readers)
readers
- the readerspublic void setUserLogged(InfoContactModel infoContactModel)
infoContactModel
- the new user loggedpublic List<WorkspaceACL> getWorkspaceACLFromACLs(List<org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType> types) throws Exception
types
- the typesException
- the exceptionpublic List<FileTrashedModel> buildGXTListTrashContent(org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashFolder trash) throws Exception
trash
- the trashException
- the exceptionpublic FileTrashedModel buildGXTTrashModelItem(org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashItem trashedItem) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
trashedItem
- the trashed itemorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic FileTrashedModel buildGXTTrashModelItemById(String itemId, org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashFolder trash) throws org.gcube.common.homelibrary.home.exceptions.InternalErrorException
itemId
- the item idtrash
- the trashorg.gcube.common.homelibrary.home.exceptions.InternalErrorException
- the internal error exceptionpublic String getFormatHtmlACLFromACLs(Map<org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType,List<String>> aclOwner)
aclOwner
- the acl ownerpublic static String formatFileSize(long size)
size
- the sizepublic String getItemDescriptionForTypeById(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item) throws Exception
item
- the itemException
- the exceptionpublic String getFormatHtmlGcubeItemProperties(org.gcube.common.homelibrary.home.workspace.WorkspaceItem item)
item
- the itemCopyright © 2016. All Rights Reserved.