Difference between revisions of "WorkspaceLightTree"

From Gcube Wiki
Jump to: navigation, search
Line 16: Line 16:
 
In the ''INSTALL'' file the developer can find the most updated information.
 
In the ''INSTALL'' file the developer can find the most updated information.
 
Here the last available information:
 
Here the last available information:
<code>
+
<source lang="text">
 
To use this widget some steps are required:
 
To use this widget some steps are required:
 
1. setup your gwt xml module configuration file adding this line:
 
1. setup your gwt xml module configuration file adding this line:
Line 36: Line 36:
 
4. Check in your portlet which is the username attribute name. The lighttree expect to find the username on httpsession attributes  
 
4. Check in your portlet which is the username attribute name. The lighttree expect to find the username on httpsession attributes  
 
with the name "username"
 
with the name "username"
</code>
+
</source>
  
 
==Examples==
 
==Examples==
Line 42: Line 42:
  
 
===Simple load popup===
 
===Simple load popup===
<code lang="java5">
+
<source lang="java5">
 
   WorkspaceLightTreeLoadPopup popup = new WorkspaceLightTreeLoadPopup("Show the entire tree - all items selectable", false, true);
 
   WorkspaceLightTreeLoadPopup popup = new WorkspaceLightTreeLoadPopup("Show the entire tree - all items selectable", false, true);
 
   popup.addPopupHandler(<my popup handler>);
 
   popup.addPopupHandler(<my popup handler>);
 
   popup.show();
 
   popup.show();
</code>
+
</source>

Revision as of 10:12, 5 April 2011

The Workspace Light Tree widget offers to the developers a "File Chooser" like GWT component to access the user's Workspace information. Like a File Chooser let choose a File the WorkspaceLightTree let the user select a WorkspaceItem.

Available Panels

The main panel is the WorkspaceLightTreePanel which shows the user Workspace tree where the user can select the WorkspaceItem. The developer can set which types of items are selectable and which are showable. All events are propagated through the GWT handling system. All the background login (contacting the HomeLibrary, loading the Workspace, converting the items) is hidden to the developer.

As support to common actions, selection of items to load or open and selection of items to save, three additional panel have been added:

  • WorkspaceLightTreeLoadPopup a pop-up panel that let the user to select an item for loading.
  • WorkspaceLightTreeSavePanel a save panel where the user can select a destination item (both folder and/or folder item) and if required can digit an item name (validated through the HomeLibrary).
  • WorkspaceLightTreeSavePopup a popup version of the save panel.

How to use the library

In the INSTALL file the developer can find the most updated information. Here the last available information:

To use this widget some steps are required:
1. setup your gwt xml module configuration file adding this line:
	 <inherits name='org.gcube.portlets.user.workspace.lighttree.WorkspacePortletLightTree'/>
 
2. add the light tree jar to your eclipse project as library (the home library is also needed, please read the homelibrary 
	INSTALL instructions)
3. setup your web.xml adding this lines:
    <servlet>
        <servlet-name>WorkspaceService</servlet-name>
         <servlet-class>org.gcube.portlets.user.workspace.lighttree.server.WorkspaceServiceImpl</servlet-class>
    </servlet>
 
    <servlet-mapping>
       <servlet-name>WorkspaceService</servlet-name>
       <url-pattern>/html/WorkspaceService</url-pattern>
    </servlet-mapping>
 
4. Check in your portlet which is the username attribute name. The lighttree expect to find the username on httpsession attributes 
	with the name "username"

Examples

Here some usage examples. For more examples and demo code please checkout the WorkspaceLightTreeSample project from d4science svn site.

Simple load popup

  WorkspaceLightTreeLoadPopup popup = new WorkspaceLightTreeLoadPopup("Show the entire tree - all items selectable", false, true);
  popup.addPopupHandler(<my popup handler>);
  popup.show();