Difference between revisions of "WorkspaceLightTree"
(Created page with '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 th…') |
|||
Line 2: | Line 2: | ||
Like a File Chooser let choose a File the WorkspaceLightTree let the user select a WorkspaceItem. | 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 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. | The developer can set which types of items are selectable and which are showable. | ||
All events are propagated through the GWT handling system. | All events are propagated through the GWT handling system. | ||
Line 9: | Line 9: | ||
As support to common actions, selection of items to load or open and selection of items to save, three additional panel have been added: | 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. | + | * '''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). | + | * '''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. | + | * '''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: | ||
+ | <code> | ||
+ | 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" | ||
+ | </code> | ||
+ | |||
+ | ==Examples== | ||
+ | Here some usage examples. For more examples and demo code please checkout the WorkspaceLightTreeSample project from d4science svn site. | ||
+ | |||
+ | ===Simple load popup=== | ||
+ | <code lang="java5"> | ||
+ | WorkspaceLightTreeLoadPopup popup = new WorkspaceLightTreeLoadPopup("Show the entire tree - all items selectable", false, true); | ||
+ | popup.addPopupHandler(<my popup handler>); | ||
+ | popup.show(); | ||
+ | </code> |
Revision as of 09:09, 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();