updated pom version at 6.6.7
updated distro files git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@99372 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a9b7426571
commit
902802e954
|
@ -15,7 +15,7 @@ Author
|
|||
Version and Release Date
|
||||
------------------------
|
||||
|
||||
v. 6.6.6
|
||||
v. 6.6.7
|
||||
|
||||
|
||||
Description
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-6-7"
|
||||
date="2014-09-01">
|
||||
<Change>Support Ticket ##813 Broken Breadcrumb for long path
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-6-6"
|
||||
date="2014-07-02">
|
||||
<Change>#2798 Sharing Panel usability improved
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>workspace-tree-widget</artifactId>
|
||||
<version>6.6.6-SNAPSHOT</version>
|
||||
<version>6.6.7-SNAPSHOT</version>
|
||||
<name>gCube Workspace Tree Widget</name>
|
||||
<description>
|
||||
gCube Workspace Tree Widget.
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.workspace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||
import org.gcube.common.homelibrary.home.workspace.folder.FolderItemType;
|
||||
import org.gcube.common.homelibrary.home.workspace.search.SearchItem;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
import org.gcube.portlets.user.workspace.client.interfaces.GXTCategoryItemInterface;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
||||
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||
|
||||
/**
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @Jul 3, 2013
|
||||
*
|
||||
*/
|
||||
public class SmartFolderTest {
|
||||
|
||||
|
||||
protected static Logger logger = Logger.getLogger(SmartFolderTest.class);
|
||||
|
||||
// public static String DEFAULT_SCOPE = "/d4science.research-infrastructures.eu/gCubeApps/EcologicalModelling"; //PRODUCTION
|
||||
public static String DEFAULT_SCOPE = "/gcube/devsec"; //DEV
|
||||
|
||||
private static Workspace workspace;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
try {
|
||||
|
||||
ScopeBean scope = new ScopeBean(DEFAULT_SCOPE);
|
||||
ScopeProvider.instance.set(scope.toString());
|
||||
|
||||
System.out.println("instancing workspace");
|
||||
workspace = HomeLibrary
|
||||
.getHomeManagerFactory()
|
||||
.getHomeManager()
|
||||
.getHome("francesco.mangiacrapa")
|
||||
.getWorkspace();
|
||||
//
|
||||
System.out.println("start");
|
||||
List<FileGridModel> smarts = getSmartFolderResultsByCategory(GXTCategoryItemInterface.SMF_IMAGES);
|
||||
|
||||
for (FileGridModel fileGridModel : smarts) {
|
||||
System.out.println(fileGridModel.toString());
|
||||
}
|
||||
System.out.println("end");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<FileGridModel> getSmartFolderResultsByCategory(String category) throws Exception {
|
||||
|
||||
try {
|
||||
|
||||
|
||||
GWTWorkspaceBuilder builder = new GWTWorkspaceBuilder();
|
||||
|
||||
List<SearchItem> listWorkspaceItems = new ArrayList<SearchItem>();
|
||||
|
||||
//Category IMAGES
|
||||
if(category.equals(GXTCategoryItemInterface.SMF_IMAGES.toString())){
|
||||
|
||||
listWorkspaceItems = workspace.getFolderItems(FolderItemType.IMAGE_DOCUMENT, FolderItemType.EXTERNAL_IMAGE);
|
||||
|
||||
//Category BIODIVERSITY
|
||||
}else if(category.equals(GXTCategoryItemInterface.SMF_BIODIVERSITY.toString())){
|
||||
|
||||
listWorkspaceItems = workspace.getFolderItems(FolderItemType.AQUAMAPS_ITEM);
|
||||
|
||||
//Category DOCUMENTS
|
||||
}else if(category.equals(GXTCategoryItemInterface.SMF_DOCUMENTS.toString())){
|
||||
|
||||
listWorkspaceItems = workspace.getFolderItems(
|
||||
FolderItemType.EXTERNAL_FILE,
|
||||
FolderItemType.EXTERNAL_PDF_FILE,
|
||||
FolderItemType.QUERY,
|
||||
FolderItemType.PDF_DOCUMENT,
|
||||
FolderItemType.METADATA,
|
||||
FolderItemType.WORKFLOW_REPORT,
|
||||
FolderItemType.WORKFLOW_TEMPLATE,
|
||||
// FolderItemType.URL_DOCUMENT,
|
||||
FolderItemType.DOCUMENT
|
||||
);
|
||||
|
||||
//Category LINKS
|
||||
}else if(category.equals(GXTCategoryItemInterface.SMF_LINKS.toString())){
|
||||
|
||||
listWorkspaceItems = workspace.getFolderItems(FolderItemType.EXTERNAL_URL, FolderItemType.URL_DOCUMENT, FolderItemType.EXTERNAL_RESOURCE_LINK);
|
||||
|
||||
//Category REPORTS
|
||||
}else if(category.equals(GXTCategoryItemInterface.SMF_REPORTS.toString())){
|
||||
|
||||
listWorkspaceItems = workspace.getFolderItems(FolderItemType.REPORT_TEMPLATE, FolderItemType.REPORT);
|
||||
|
||||
//Category TIME SERIES
|
||||
}else if(category.equals(GXTCategoryItemInterface.SMF_TIMESERIES.toString())){
|
||||
|
||||
listWorkspaceItems = workspace.getFolderItems(FolderItemType.TIME_SERIES);
|
||||
}
|
||||
else
|
||||
new Exception("Smart folder category unknown");
|
||||
|
||||
|
||||
return builder.filterListFileGridModelItemByCategory(listWorkspaceItems, category);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error in server get smart folder by category");
|
||||
e.printStackTrace();
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue