com.wewebu.ow.server.dmsdialogs.views
Class OwObjectTreeViewEXTJS

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwView
          extended by com.wewebu.ow.server.ui.OwTreeView
              extended by com.wewebu.ow.server.dmsdialogs.views.OwObjectTreeView
                  extended by com.wewebu.ow.server.dmsdialogs.views.OwObjectTreeViewEXTJS
All Implemented Interfaces:
OwBaseView, OwUpdateTarget

public class OwObjectTreeViewEXTJS
extends OwObjectTreeView

Object tree based on EXT-JS tree view.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.1.0.0

Nested Class Summary
 class OwObjectTreeViewEXTJS.OwTreeViewNodeJS
           Tree node representation used by OwObjectTreeViewEXTJS.
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.ui.OwTreeView
OwTreeView.OwTreeViewEventListner, OwTreeView.OwTreeViewNode
 
Field Summary
protected static String FOLDER_CLOSE_CSS_CLASS
          the CSS class for rendering close folder icon
protected static String FOLDER_OPEN_CSS_CLASS
          the CSS class for rendering open folder icon
 
Fields inherited from class com.wewebu.ow.server.dmsdialogs.views.OwObjectTreeView
m_Configuration, m_iMaxChildSize
 
Fields inherited from class com.wewebu.ow.server.ui.OwTreeView
childrenSort, DISPLAY_MODE_REGISTER_NODES, DISPLAY_MODE_TREE_NODES, m_eventlistner, m_focusNode, m_nodeMap, m_root, m_selectedNode, m_strDesignURL, m_strPath, NODE_ID_KEY, PATH_DELIMITER
 
Fields inherited from class com.wewebu.ow.server.ui.OwView
CURRENT_MODULE_KEY, FORMULAR_PLACEHOLDER_END_DELIMITER, FORMULAR_PLACEHOLDER_START_DELIMITER, m_externalFormEventTarget
 
Fields inherited from interface com.wewebu.ow.server.ui.OwBaseView
EMPTY_STRING
 
Constructor Summary
OwObjectTreeViewEXTJS()
           
 
Method Summary
 void addComponentUpdateURL(String elementId_p, String updateLink_p)
          Add the corresponding update URL for the given element ID.
protected  OwTreeView.OwTreeViewNode createTreeViewNode(OwTreeView treeView_p, Object obj_p)
          overridable factory method check of node has subnodes to be overwritten by the derived class
 String getCannotLoadNodeText()
          Returns the localized error message when subnodes of a node cannot be loaded.
 String getCollapseStacktraceMessage()
          Returns the localized message for collapsing the stacktrace.
 OwTreeView.OwTreeViewNode getCurrentSelectedNode()
          Get the current selected node.
protected  String getDisplayHTML(Object obj_p, OwTreeView.OwTreeViewNode node_p)
          Returns HTML code to be used to display a node.
If you override this method, you have to make sure that the HTML code is properly encoded!
 String getDnDAppletURL()
           
 String getErrorTitleText()
          Returns the localized title for error boxes.
 String getExternalUpdateURL()
          Get the URL that resolve the AJAX request when a node is clicked.
 String getLoadingMessage()
          Returns the localized loading message.
 String getRequestTimeOutText()
          Returns the localized error message for request timeout.
 String getRootClosedIcon()
          Get the closed icon URL for the root item.
 String getRootIcon()
          Returns the URL to the root icon.
 String getRootIconClass()
          Get the CSS class for icon of root folder.
 String getRootId()
          Get the id of the root node.
 String getRootOpenedIcon()
          Get the closed icon URL for the root item.
 String getRootText()
          Get the root displayable text.
 String getSelectedId()
          Get the id of selected node.
 String getSelectedPathIds()
          Returns a JavaScript array of IDs in the selected path.
 String getShowStacktraceMessage()
          Returns the localized message for showing the stacktrace.
 String getUpdateComponentIds()
          Get a prepared JavaScript array with identifiers for HTML elements that need to be updated using an AJAX request.
 String getUpdateComponentsURLs()
          Get a prepared JavaScript array the JavaScript array with update URL for HTML elements that need to be updated.
 String getUpdateErrorText()
          Returns the localized part preceding the real error cause for update error.
 boolean isExpandOnSelect()
          Get the tree node behavior when selected.
 boolean isIconClassInUse()
          Get the configuration flag that specify if icons in the tree are rendered using the icon CSS class.
 boolean isSelectedNodeExpanded()
          Get the status of the current node.
 void navigate(Object obj_p, String strPath_p)
          init the tree and set the root object
 void navigateToId(String nodeId_p)
          Navigate to the specific node id
protected  void onActivate(int index_p, Object reason_p)
          activate the target from a navigation module.
 void onAjaxGetTreeData(javax.servlet.http.HttpServletRequest request_p, javax.servlet.http.HttpServletResponse response_p)
          Method called when the tree is loading.
 void onAjaxNodeCollapsed(javax.servlet.http.HttpServletRequest request_p, javax.servlet.http.HttpServletResponse response_p)
          Update the server collapsed state for the node.
protected  void onRender(Writer w_p)
          called when the view should create its HTML content to be displayed
protected  void renderMainRegion(Writer w_p)
           
 void setDnDAppletURL(String dnDAppletURL)
           
 void setExpandOnSelect(boolean expandOnSelect_p)
          Set the behavior of the tree node when is selected.
 void setExternalUpdateURL(String externalUpdateURL_p)
          Set the URL that resolve the AJAX request when a node is clicked.
 void setIconClassInUse(boolean useIconClass_p)
          Set the flag that specify if icons in the tree are rendered using the icon CSS class.
protected  String writeFirstLevel(OwObjectTreeViewEXTJS.OwTreeViewNodeJS currentNode_p)
          Write in EXTJS required style the current node and its first level children.
 
Methods inherited from class com.wewebu.ow.server.dmsdialogs.views.OwObjectTreeView
createChildObjects, expandParents, getCloseIconURL, getDisplayName, getName, getOpenIconURL, hasPlusMinusIcon, init, isDynamicSplitUsed, navigateChildObject, setIsDynamicSplitUsed, setMaxChildSize
 
Methods inherited from class com.wewebu.ow.server.ui.OwTreeView
addNode, canNavigate, clearSelection, getChildrenSort, getClientSideId, getCurrentNode, getDisplayMode, getNodeForObject, getNodeFromID, getRegisterItemStyle, getSelectedRegisterItemStyle, getSelectedTreeItemStyle, getTreeItemStyle, isEmpty, isEnabled, isFocused, isSelected, navigate, navigateToChild, navigateUp, onClickLabel, onClickPlusMinus, openNode, refreshCurrentNode, refreshNodeForObject, renderFolderIconLink, renderMinusIconLink, renderNode, renderNodeLink, renderPlusIconLink, renderRegister, setChildrenSort, setDisplayMode, setEventListner, useFormEventUrls, writeTooltip
 
Methods inherited from class com.wewebu.ow.server.ui.OwView
activate, addView, detach, getBreadcrumbPart, getDocument, getExternalFormEventTarget, getFormName, getFormTarget, getIcon, getIterator, getMaximizeView, getParent, getRenderedNamedRegion, getRenderedRegion, getTitle, getViewList, isFormTargetExternal, isNamedRegion, isRegion, isShowMaximized, isShowMinimized, isShowNormal, onUpdate, render, renderHTMLFormular, renderNamedRegion, renderRegion, serverSideDesignInclude, serverSideInclude, setDocument, setExternalFormTarget, setMaximizeView, setParent, showMaximized, showMinimized, showNormal, usesFormWithAttributes
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest, updateExternalFormTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOLDER_CLOSE_CSS_CLASS

protected static final String FOLDER_CLOSE_CSS_CLASS
the CSS class for rendering close folder icon

See Also:
Constant Field Values

FOLDER_OPEN_CSS_CLASS

protected static final String FOLDER_OPEN_CSS_CLASS
the CSS class for rendering open folder icon

See Also:
Constant Field Values
Constructor Detail

OwObjectTreeViewEXTJS

public OwObjectTreeViewEXTJS()
Method Detail

onRender

protected void onRender(Writer w_p)
                 throws Exception
Description copied from class: OwTreeView
called when the view should create its HTML content to be displayed

Overrides:
onRender in class OwTreeView
Parameters:
w_p - Writer object to write HTML to
Throws:
Exception

renderMainRegion

protected void renderMainRegion(Writer w_p)
                         throws Exception
Parameters:
w_p - Writer to write to
Throws:
Exception

onAjaxNodeCollapsed

public void onAjaxNodeCollapsed(javax.servlet.http.HttpServletRequest request_p,
                                javax.servlet.http.HttpServletResponse response_p)
                         throws Exception
Update the server collapsed state for the node.

Parameters:
request_p -
response_p -
Throws:
Exception
Since:
3.1.0.3

onAjaxGetTreeData

public void onAjaxGetTreeData(javax.servlet.http.HttpServletRequest request_p,
                              javax.servlet.http.HttpServletResponse response_p)
                       throws Exception
Method called when the tree is loading. The tree is loaded asynchronously. When the user expand a node, only the children from the first level are returned. In case that the tree should be refreshed from an external request (e.g - the Browse plugin is shown after an Edit Properties action), the selected path is returned, together with the not expanded siblings of the selected nodes.

Parameters:
request_p - - the AJAX request
response_p - - the response
Throws:
Exception

writeFirstLevel

protected String writeFirstLevel(OwObjectTreeViewEXTJS.OwTreeViewNodeJS currentNode_p)
                          throws Exception
Write in EXTJS required style the current node and its first level children.

Parameters:
currentNode_p - - the current node
Returns:
a String object containing the current node written in EXTJS required style.
Throws:
Exception

getRootIconClass

public String getRootIconClass()
Get the CSS class for icon of root folder.

Returns:
- the CSS class of the root folder

getRootText

public String getRootText()
                   throws Exception
Get the root displayable text.

Returns:
- the display text for root element.
Throws:
Exception

getRootId

public String getRootId()
Get the id of the root node.

Returns:
- the id of the root node.

getDisplayHTML

protected String getDisplayHTML(Object obj_p,
                                OwTreeView.OwTreeViewNode node_p)
                         throws Exception
Description copied from class: OwObjectTreeView
Returns HTML code to be used to display a node.
If you override this method, you have to make sure that the HTML code is properly encoded!

Overrides:
getDisplayHTML in class OwObjectTreeView
Parameters:
obj_p - Object which is managed by the tree view
node_p - the node to return the text for
Returns:
HTML code to be used to display a node
Throws:
Exception

createTreeViewNode

protected OwTreeView.OwTreeViewNode createTreeViewNode(OwTreeView treeView_p,
                                                       Object obj_p)
Description copied from class: OwTreeView
overridable factory method check of node has subnodes to be overwritten by the derived class

Overrides:
createTreeViewNode in class OwTreeView
Parameters:
treeView_p - OwTreeView
obj_p - template Object which is managed by the tree node

getExternalUpdateURL

public String getExternalUpdateURL()
Get the URL that resolve the AJAX request when a node is clicked.

Returns:
- the URL.

setExternalUpdateURL

public void setExternalUpdateURL(String externalUpdateURL_p)
Set the URL that resolve the AJAX request when a node is clicked.

Parameters:
externalUpdateURL_p - - the URL

getSelectedId

public String getSelectedId()
Get the id of selected node.

Returns:
- the id of selected node.

getSelectedPathIds

public String getSelectedPathIds()
Returns a JavaScript array of IDs in the selected path.

Returns:
a String object representing the JavaScript array of IDs in the selected path.

getRootIcon

public String getRootIcon()
                   throws Exception
Returns the URL to the root icon.

Returns:
the URL to the root icon.
Throws:
Exception

addComponentUpdateURL

public void addComponentUpdateURL(String elementId_p,
                                  String updateLink_p)
Add the corresponding update URL for the given element ID.

Parameters:
elementId_p - - the DOM id for the container to be updated
updateLink_p - - the URL where the update AJAX request will be send.

getUpdateComponentIds

public String getUpdateComponentIds()
Get a prepared JavaScript array with identifiers for HTML elements that need to be updated using an AJAX request.

Returns:
- the JavaScript array with identifiers of HTML elements that need to be updated

getUpdateComponentsURLs

public String getUpdateComponentsURLs()
Get a prepared JavaScript array the JavaScript array with update URL for HTML elements that need to be updated.

Returns:
- the JavaScript array with update URL for HTML elements that need to be updated

getRootClosedIcon

public String getRootClosedIcon()
                         throws Exception
Get the closed icon URL for the root item.

Returns:
- the closed icon URL for the root item.
Throws:
Exception

getRootOpenedIcon

public String getRootOpenedIcon()
                         throws Exception
Get the closed icon URL for the root item.

Returns:
- the closed icon URL for the root item.
Throws:
Exception

isIconClassInUse

public boolean isIconClassInUse()
Get the configuration flag that specify if icons in the tree are rendered using the icon CSS class.

Returns:
the configuration flag that specify if icons in the tree are rendered using the icon CSS class.

setIconClassInUse

public void setIconClassInUse(boolean useIconClass_p)
Set the flag that specify if icons in the tree are rendered using the icon CSS class. If the useIconClass_p is true, the designer has the possibility to configure the icons for folder closed or folder opened via FOLDER_CLOSE_CSS_CLASS or via FOLDER_OPEN_CSS_CLASS CSS classes.

Parameters:
useIconClass_p - - if true the folder icons are configured via CSS style classes (FOLDER_CLOSE_CSS_CLASS or FOLDER_OPEN_CSS_CLASS), otherwise the MIME icons are used for folder icons.

getLoadingMessage

public String getLoadingMessage()
Returns the localized loading message.

Returns:
- the localized loading message

getErrorTitleText

public String getErrorTitleText()
Returns the localized title for error boxes.

Returns:
- the localized title for error boxes.

getUpdateErrorText

public String getUpdateErrorText()
Returns the localized part preceding the real error cause for update error.

Returns:
- the localized part preceding the real error cause for update error.

getRequestTimeOutText

public String getRequestTimeOutText()
Returns the localized error message for request timeout.

Returns:
- the localized error message for request timeout.

getCannotLoadNodeText

public String getCannotLoadNodeText()
Returns the localized error message when subnodes of a node cannot be loaded.

Returns:
- the localized error message when subnodes of a node cannot be loaded.

getShowStacktraceMessage

public String getShowStacktraceMessage()
Returns the localized message for showing the stacktrace.

Returns:
- the localized message for showing the stacktrace.

getCollapseStacktraceMessage

public String getCollapseStacktraceMessage()
Returns the localized message for collapsing the stacktrace.

Returns:
- the localized message for collapsing the stacktrace.

setExpandOnSelect

public void setExpandOnSelect(boolean expandOnSelect_p)
Set the behavior of the tree node when is selected.

Parameters:
expandOnSelect_p - - if true when a code

isExpandOnSelect

public boolean isExpandOnSelect()
Get the tree node behavior when selected.

Returns:
- the tree node behavior when selected.

navigateToId

public void navigateToId(String nodeId_p)
                  throws Exception
Description copied from class: OwTreeView
Navigate to the specific node id

Overrides:
navigateToId in class OwTreeView
Parameters:
nodeId_p - String representing id of the node
Throws:
Exception

navigate

public void navigate(Object obj_p,
                     String strPath_p)
              throws Exception
Description copied from class: OwTreeView
init the tree and set the root object

Overrides:
navigate in class OwTreeView
Parameters:
obj_p - Root Object to be managed by the tree
strPath_p - String representing path
Throws:
Exception
Since:
3.1.0.4
See Also:
OwTreeView.navigate(java.lang.Object, java.lang.String)

isSelectedNodeExpanded

public boolean isSelectedNodeExpanded()
Get the status of the current node.

Returns:
the status of the current node

getCurrentSelectedNode

public OwTreeView.OwTreeViewNode getCurrentSelectedNode()
Get the current selected node.

Returns:
- the current selected node.

onActivate

protected void onActivate(int index_p,
                          Object reason_p)
                   throws Exception
Description copied from class: OwView
activate the target from a navigation module. Called when menu item was pressed for this target.

Overrides:
onActivate in class OwView
Parameters:
index_p - int tab iIndex of Navigation
reason_p - User Object which was submitted when target was attached to the navigation module
Throws:
Exception

getDnDAppletURL

public String getDnDAppletURL()

setDnDAppletURL

public void setDnDAppletURL(String dnDAppletURL)


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.