com.wewebu.ow.server.plug.owshortcut
Class OwShortCutItemOwObject

java.lang.Object
  extended by com.wewebu.ow.server.plug.owshortcut.OwShortCutItem
      extended by com.wewebu.ow.server.plug.owshortcut.OwShortCutItemOwObject

public class OwShortCutItemOwObject
extends OwShortCutItem

Implementation of a shortcut item for object references.

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


Field Summary
static String DEFAULT_PATH_DELIMITER
          delimiter used to build the object path in the object tree
protected  int m_iMaxChildSize
          maximum number of child nodes
protected static String SUBPATH_DELIMITER
          delimiter for the subpath in the persist string
 
Fields inherited from class com.wewebu.ow.server.plug.owshortcut.OwShortCutItem
persistentId, TYPE_DELIMITER
 
Constructor Summary
protected OwShortCutItemOwObject(com.wewebu.ow.server.ecm.OwObjectReference ref_p)
          creates a short cut from the given OwObject Reference
  OwShortCutItemOwObject(com.wewebu.ow.server.ecm.OwObjectReference ref_p, String path_p, String subdisplaypath_p, int maxChildSize_p)
          Constructor
protected OwShortCutItemOwObject(String persistString_p, OwShortCutItemContext context_p, int maxChildSize_p)
          reconstruct the short cut from the given string
 
Method Summary
static OwShortCutItem createShortCutItem(com.wewebu.ow.server.ecm.OwObjectReference object_p, String path_p, String subdisplaypath_p, int maxChildSize_p)
          create a OwShortCutItem of OwShortCutItem from the given collection of OwObject
static Collection createShortCutItems(Collection objects_p)
          create a collection of OwShortCutItem's from the given collection of OwObject's
protected  com.wewebu.ow.server.ecm.OwObjectReference findPathReference(com.wewebu.ow.server.ecm.OwObjectReference root_p, String path_p, String pathDelimiter_p)
           
 String getId()
          Get the ID of the shortcut.
 String getName()
          get the name of the shortcut
 com.wewebu.ow.server.ecm.OwObjectReference getObjRef()
           
protected  String getPersistString()
          get a string that persists the short cut.
 int getType()
          get the type of the short cut as defined in OwClipboard.CONTENT_TYPE_OW_...
 void insertIcon(OwShortCutItemContext context_p, Writer w_p)
          render a icon link for this short cut
 void insertLabel(OwShortCutItemContext context_p, Writer w_p)
          render a label link for this short cut
 void refresh(com.wewebu.ow.server.ecm.OwRepository repository_p)
          Refresh current OwShortCutItem to have the latest version of the object.
protected  com.wewebu.ow.server.ecm.OwObject replaceWithLatestVersion(com.wewebu.ow.server.ecm.OwObject source_p)
          Replace the given OwObject source object with its latest version
 String toString()
           
protected  com.wewebu.ow.server.ecm.OwObjectReference updateObjectReference(com.wewebu.ow.server.ecm.OwRepository repository_p, com.wewebu.ow.server.ecm.OwObjectReference originalReference_p)
          Get the OwStandardObjectReference corresponding to the latest version of the OwObject
 
Methods inherited from class com.wewebu.ow.server.plug.owshortcut.OwShortCutItem
getPersistentId, loadShortCut, saveShortCut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PATH_DELIMITER

public static final String DEFAULT_PATH_DELIMITER
delimiter used to build the object path in the object tree

See Also:
Constant Field Values

SUBPATH_DELIMITER

protected static final String SUBPATH_DELIMITER
delimiter for the subpath in the persist string

See Also:
Constant Field Values

m_iMaxChildSize

protected int m_iMaxChildSize
maximum number of child nodes

Constructor Detail

OwShortCutItemOwObject

protected OwShortCutItemOwObject(String persistString_p,
                                 OwShortCutItemContext context_p,
                                 int maxChildSize_p)
                          throws Exception
reconstruct the short cut from the given string

Parameters:
persistString_p -
context_p -
maxChildSize_p - number of maximum children to be searched when retrieving the pointed object reference
Throws:
Exception
See Also:
getPersistString()

OwShortCutItemOwObject

protected OwShortCutItemOwObject(com.wewebu.ow.server.ecm.OwObjectReference ref_p)
creates a short cut from the given OwObject Reference

Parameters:
ref_p -

OwShortCutItemOwObject

public OwShortCutItemOwObject(com.wewebu.ow.server.ecm.OwObjectReference ref_p,
                              String path_p,
                              String subdisplaypath_p,
                              int maxChildSize_p)
Constructor

Parameters:
ref_p - the root object reference
path_p - relative path to the pointed object
subdisplaypath_p - the path to be displayed for this shortcut in the shortcut views
maxChildSize_p - number of maximum children to be searched when retrieving the pointed object reference
Method Detail

findPathReference

protected com.wewebu.ow.server.ecm.OwObjectReference findPathReference(com.wewebu.ow.server.ecm.OwObjectReference root_p,
                                                                       String path_p,
                                                                       String pathDelimiter_p)
                                                                throws Exception
Parameters:
root_p - the root object
path_p - the relative path to search the reference in
pathDelimiter_p - the delimiter used in constructing the path
Returns:
an OwObjectReference for the object found under the given path relative to the given root object
Throws:
Exception

getName

public String getName()
get the name of the shortcut

Specified by:
getName in class OwShortCutItem
Returns:
the name String

getId

public String getId()
             throws Exception
Get the ID of the shortcut. The ID is generated using the .hashCode() method, if a folder is add to shortcut also the path to the folder is hashed.

Specified by:
getId in class OwShortCutItem
Returns:
String defining the ID of current shortcut
Throws:
Exception

createShortCutItems

public static Collection createShortCutItems(Collection objects_p)
create a collection of OwShortCutItem's from the given collection of OwObject's

Parameters:
objects_p - Collection of OwObjectReferences
Returns:
Collection of OwShortCutItem

createShortCutItem

public static OwShortCutItem createShortCutItem(com.wewebu.ow.server.ecm.OwObjectReference object_p,
                                                String path_p,
                                                String subdisplaypath_p,
                                                int maxChildSize_p)
create a OwShortCutItem of OwShortCutItem from the given collection of OwObject

Parameters:
object_p -
path_p -
subdisplaypath_p -
maxChildSize_p -
Returns:
the newly created OwShortCutItem

getPersistString

protected String getPersistString()
                           throws Exception
get a string that persists the short cut. Used in string constructor.

Specified by:
getPersistString in class OwShortCutItem
Throws:
Exception

getType

public int getType()
get the type of the short cut as defined in OwClipboard.CONTENT_TYPE_OW_...

Specified by:
getType in class OwShortCutItem

insertIcon

public void insertIcon(OwShortCutItemContext context_p,
                       Writer w_p)
                throws Exception
render a icon link for this short cut

Specified by:
insertIcon in class OwShortCutItem
Throws:
Exception

insertLabel

public void insertLabel(OwShortCutItemContext context_p,
                        Writer w_p)
                 throws Exception
render a label link for this short cut

Specified by:
insertLabel in class OwShortCutItem
Throws:
Exception

getObjRef

public com.wewebu.ow.server.ecm.OwObjectReference getObjRef()
Returns:
a reference of the pointed object

toString

public String toString()
Overrides:
toString in class Object

refresh

public void refresh(com.wewebu.ow.server.ecm.OwRepository repository_p)
Description copied from class: OwShortCutItem
Refresh current OwShortCutItem to have the latest version of the object.

Specified by:
refresh in class OwShortCutItem
Parameters:
repository_p - - the repository

updateObjectReference

protected com.wewebu.ow.server.ecm.OwObjectReference updateObjectReference(com.wewebu.ow.server.ecm.OwRepository repository_p,
                                                                           com.wewebu.ow.server.ecm.OwObjectReference originalReference_p)
                                                                    throws Exception
Get the OwStandardObjectReference corresponding to the latest version of the OwObject

Parameters:
repository_p -
originalReference_p -
Returns:
the OwStandardObjectReference updated.
Throws:
Exception
Since:
3.1.0.3

replaceWithLatestVersion

protected com.wewebu.ow.server.ecm.OwObject replaceWithLatestVersion(com.wewebu.ow.server.ecm.OwObject source_p)
Replace the given OwObject source object with its latest version

Parameters:
source_p - - the stored OwObject source.
Returns:
- the latest version of the stored object, or the given OwObject if no version is available.
Since:
3.1.0.3


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.