com.wewebu.ow.server.ecm
Class OwStandardPropertyClass

java.lang.Object
  extended by com.wewebu.ow.server.ecm.OwStandardPropertyClass
All Implemented Interfaces:
OwPropertyClass, OwFieldDefinition
Direct Known Subclasses:
OwFileObject.OwFilePropertyClass, OwResource.OwSpecialPropertyClass, OwSearchPathField.OwSearchPathFieldClass, OwStandardClassSelectObject.OwStandardClassSelectObjectClass, OwStandardContentBasedRetrivalObject.OwStandardContentBasedRetrivalObjectClass, OwStandardHistoryEntry.OwStandardHistoryEntryPropertyClass, OwStandardSearchTemplate.OwOnTheFlySearchFieldDescription, OwVirtualLinkPropertyClasses.OwLinkFilterPropertyClass, OwVirtualLinkPropertyClasses.OwLinkRelationPropertyClass, OwVirtualLinkPropertyClasses.OwLinkSourcePropertyClass, OwVirtualLinkPropertyClasses.OwLinkTargetPropertyClass

public class OwStandardPropertyClass
extends Object
implements OwPropertyClass

Standard Implementation for property class descriptions. Class descriptions are defined by the ECM System, the contain information about the property type.

To be implemented with the specific ECM system.

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 EXACT_DATE_TEXT_FORMAT
          date format with millisecond information for exact date representation
protected  Object m_Default
          object representing the default value
protected  OwString m_description
          the displayable description of the class
protected  OwString m_DisplayName
          the displayable name of the class
protected  Object m_DMSType
          the ECM system specific type of the property
protected  OwEnumCollection m_Enums
           
protected  boolean m_fArray
          flag indicating, if property is an array of values
protected  boolean[] m_fHidden
          flag indicating, that property should not be displayed
protected  boolean m_fName
          flag indicating, if property is the name property i.e.
protected  boolean[] m_fReadOnly
          flag indicating, if property is read only for each context
protected  boolean m_fRequired
          flag indicating, if property is required to be set, i.e.
protected  boolean m_fSystem
          flag indicating, if property is a internal system property and contains no custom object information
protected  Object m_MaxValue
          object representing the maximum value
protected  Object m_MinValue
          object representing the minimum value
protected  Collection m_operators
          a collection of possible filter / search operators for the field
protected  String m_strClassName
          the name of the class
protected  String m_strJavaClassName
          class name of the java object associated with this property
 
Fields inherited from interface com.wewebu.ow.server.ecm.OwPropertyClass
CONTEXT_MAX, CONTEXT_NORMAL, CONTEXT_ON_CHECKIN, CONTEXT_ON_CREATE
 
Constructor Summary
OwStandardPropertyClass()
           
 
Method Summary
 String getCategory()
          get the property category, or an empty string of no category is set
 String getClassName()
          get the name of the class
static OwPropertyCollection getClonedProperties(OwObject object_p, Collection propertyNames_p)
          retrieve the specified properties from the object as a copy NOTE: The returned collection contains exactly the requested propertyNames_p, or all if propertyNames_p == null

NOTE: if the properties where not already obtained from the archive (e.g.
 List getComplexChildClasses()
          get child properties classes of a complex property class
 Object getDefaultValue()
          get the default value
 String getDescription(Locale locale_p)
          get the description defined by the DMS System
 String getDisplayName(Locale locale_p)
          get the displayable name of the type as defined by the ECM System can be identical to getClassName
 OwEnumCollection getEnums()
          get a list of enum objects for the enum type (see isEnum)
 OwFormat getFormat()
          get the formatter object for string representation
 String getJavaClassName()
          get the java class name of java object associated with this property
 Object getMaxValue()
          get the max allowed value for the field or null if not defined
 Object getMinValue()
          get the min allowed value for the field or null if not defined
 Object getNativeType()
          get the native type which is defined by the underlying system WARNING: The returned object is opaque.
 Node getNodeFromValue(Object value_p, Document doc_p)
          create a XML serialization of the given field value
static Node getNodeFromValue(Object value_p, Document doc_p, String javaClassName_p)
           
 Collection getOperators()
          get a collection of possible filter / search operators for the field
static Object getSkalarEmptyValue(String strJavaClassName_p)
          get a default empty value for the given class e.g.: 0 for Integer or "" for String
static Object getSkalarValueFromString(String strLiteral_p, String strJavaClassName_p)
          create a object from string literal
static String getStringFromValue(Object value_p, String strJavaClassName_p)
          get a standard string representation of the given value that can be used in getValueFromString
 Object getValueFromNode(Node node_p)
          create a value for the field described by this class with the given XML Node serialization
static Object getValueFromNode(Node node_p, OwFieldDefinition definition_p)
          create a value for the field described by this class with the given XML Node serialization
 Object getValueFromString(String text_p)
          create a value for the field described by this class with the given String serialization
static Object getValueFromString(String text_p, OwFieldDefinition definition_p)
          create a value for the field described by this class with the given String serialization
 boolean isArray()
          check if property contains a list of values
 boolean isComplex()
          check if the property is a component that contains another child properties
 boolean isEnum()
          check if property is a enum type (see getEnums)
 boolean isHidden(int iContext_p)
          check if property is visible to the user
 boolean isNameProperty()
          check if property is identical the the OwObject.getName Property
 boolean isReadOnly(int iContext_p)
          check if property is read only on the class level.
 boolean isRequired()
          check if property is required, i.e.
 boolean isSystemProperty()
          check if property is a internal system property and contains no custom object information
 boolean isType(Class base_p)
          check if given java class name is base type
static boolean isType(Class base_p, String sSubJavaClassName_p)
          check if given java class name is base type
 void setJavaClassName(String strJavaClassName_p)
          set the java classname parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXACT_DATE_TEXT_FORMAT

public static final String EXACT_DATE_TEXT_FORMAT
date format with millisecond information for exact date representation

See Also:
Constant Field Values

m_strClassName

protected String m_strClassName
the name of the class


m_strJavaClassName

protected String m_strJavaClassName
class name of the java object associated with this property


m_DisplayName

protected OwString m_DisplayName
the displayable name of the class


m_description

protected OwString m_description
the displayable description of the class


m_fSystem

protected boolean m_fSystem
flag indicating, if property is a internal system property and contains no custom object information


m_fReadOnly

protected boolean[] m_fReadOnly
flag indicating, if property is read only for each context


m_fName

protected boolean m_fName
flag indicating, if property is the name property i.e. identical to OwObject.getName.


m_Enums

protected OwEnumCollection m_Enums

m_fRequired

protected boolean m_fRequired
flag indicating, if property is required to be set, i.e. Value can not be null


m_fArray

protected boolean m_fArray
flag indicating, if property is an array of values


m_DMSType

protected Object m_DMSType
the ECM system specific type of the property


m_operators

protected Collection m_operators
a collection of possible filter / search operators for the field


m_MaxValue

protected Object m_MaxValue
object representing the maximum value


m_MinValue

protected Object m_MinValue
object representing the minimum value


m_Default

protected Object m_Default
object representing the default value


m_fHidden

protected boolean[] m_fHidden
flag indicating, that property should not be displayed

Constructor Detail

OwStandardPropertyClass

public OwStandardPropertyClass()
Method Detail

getClassName

public String getClassName()
get the name of the class

Specified by:
getClassName in interface OwFieldDefinition
Returns:
class name

getFormat

public OwFormat getFormat()
get the formatter object for string representation

Specified by:
getFormat in interface OwFieldDefinition
Returns:
Format, can be null to use the default format

setJavaClassName

public void setJavaClassName(String strJavaClassName_p)
set the java classname parameter

Parameters:
strJavaClassName_p - a String

getDisplayName

public String getDisplayName(Locale locale_p)
get the displayable name of the type as defined by the ECM System can be identical to getClassName

Specified by:
getDisplayName in interface OwFieldDefinition
Parameters:
locale_p - Locale to use
Returns:
type displayable name of property

getDescription

public String getDescription(Locale locale_p)
get the description defined by the DMS System

Specified by:
getDescription in interface OwFieldDefinition
Parameters:
locale_p - Locale to use
Returns:
type description of property

getJavaClassName

public String getJavaClassName()
get the java class name of java object associated with this property

Specified by:
getJavaClassName in interface OwFieldDefinition
Returns:
java class name

getNativeType

public Object getNativeType()
                     throws Exception
get the native type which is defined by the underlying system WARNING: The returned object is opaque. Using this object makes the client dependent on the underlying system

Specified by:
getNativeType in interface OwFieldDefinition
Returns:
Object native Type Object
Throws:
Exception

isArray

public boolean isArray()
                throws Exception
check if property contains a list of values

Specified by:
isArray in interface OwFieldDefinition
Returns:
true if property is array, false if property is scalar
Throws:
Exception

isEnum

public boolean isEnum()
               throws Exception
check if property is a enum type (see getEnums)

Specified by:
isEnum in interface OwFieldDefinition
Returns:
true if property is a enum type
Throws:
Exception

getEnums

public OwEnumCollection getEnums()
                          throws Exception
get a list of enum objects for the enum type (see isEnum)

Specified by:
getEnums in interface OwFieldDefinition
Returns:
list of OwEnum objects, which can be used in a select box.
Throws:
Exception

isSystemProperty

public boolean isSystemProperty()
                         throws Exception
check if property is a internal system property and contains no custom object information

Specified by:
isSystemProperty in interface OwPropertyClass
Throws:
Exception

isNameProperty

public boolean isNameProperty()
                       throws Exception
check if property is identical the the OwObject.getName Property

Specified by:
isNameProperty in interface OwPropertyClass
Throws:
Exception

isRequired

public boolean isRequired()
                   throws Exception
check if property is required, i.e. must be set by the user

Specified by:
isRequired in interface OwFieldDefinition
Returns:
true if property is required
Throws:
Exception

isReadOnly

public boolean isReadOnly(int iContext_p)
                   throws Exception
check if property is read only on the class level. NOTE: isReadOnly is also defined in OwProperty on the instance level. I.e. A Property might be defined as readable on the class level, but still be write protected on a specific instance

Specified by:
isReadOnly in interface OwPropertyClass
Parameters:
iContext_p - Context in which the property is read-only as defined by CONTEXT_...
Returns:
true if property is read only
Throws:
Exception

getMaxValue

public Object getMaxValue()
                   throws Exception
get the max allowed value for the field or null if not defined

Specified by:
getMaxValue in interface OwFieldDefinition
Throws:
Exception

getMinValue

public Object getMinValue()
                   throws Exception
get the min allowed value for the field or null if not defined

Specified by:
getMinValue in interface OwFieldDefinition
Throws:
Exception

getDefaultValue

public Object getDefaultValue()
                       throws Exception
get the default value

Specified by:
getDefaultValue in interface OwFieldDefinition
Throws:
Exception

isHidden

public boolean isHidden(int iContext_p)
                 throws Exception
check if property is visible to the user

Specified by:
isHidden in interface OwPropertyClass
Parameters:
iContext_p - Context in which the property is read-only as defined by CONTEXT_...
Returns:
true if property is visible to the user
Throws:
Exception

getValueFromNode

public Object getValueFromNode(Node node_p)
                        throws Exception
create a value for the field described by this class with the given XML Node serialization

Specified by:
getValueFromNode in interface OwFieldDefinition
Parameters:
node_p - the serialized value as a XML DOM Node
Returns:
Object the value of the field
Throws:
Exception

getValueFromNode

public static Object getValueFromNode(Node node_p,
                                      OwFieldDefinition definition_p)
                               throws Exception
create a value for the field described by this class with the given XML Node serialization

Parameters:
node_p - the serialized value as a XML DOM Node
Returns:
Object the value of the field
Throws:
Exception

getValueFromString

public Object getValueFromString(String text_p)
                          throws Exception
create a value for the field described by this class with the given String serialization

Specified by:
getValueFromString in interface OwFieldDefinition
Parameters:
text_p - String the serialized value
Returns:
Object the value of the field
Throws:
Exception

getValueFromString

public static Object getValueFromString(String text_p,
                                        OwFieldDefinition definition_p)
                                 throws Exception
create a value for the field described by this class with the given String serialization

Parameters:
text_p - String the serialized value
Returns:
Object the value of the field
Throws:
Exception

getSkalarEmptyValue

public static Object getSkalarEmptyValue(String strJavaClassName_p)
                                  throws Exception
get a default empty value for the given class e.g.: 0 for Integer or "" for String

Parameters:
strJavaClassName_p -
Returns:
Object value
Throws:
Exception

getSkalarValueFromString

public static Object getSkalarValueFromString(String strLiteral_p,
                                              String strJavaClassName_p)
                                       throws Exception
create a object from string literal

Parameters:
strLiteral_p -
strJavaClassName_p -
Returns:
an Object
Throws:
Exception

getNodeFromValue

public Node getNodeFromValue(Object value_p,
                             Document doc_p)
                      throws Exception
create a XML serialization of the given field value

Specified by:
getNodeFromValue in interface OwFieldDefinition
Parameters:
value_p - Object with field value
doc_p - DOM Document to add to
Returns:
DOM Node
Throws:
Exception

getNodeFromValue

public static Node getNodeFromValue(Object value_p,
                                    Document doc_p,
                                    String javaClassName_p)
                             throws Exception
Throws:
Exception

getStringFromValue

public static String getStringFromValue(Object value_p,
                                        String strJavaClassName_p)
get a standard string representation of the given value that can be used in getValueFromString

Parameters:
value_p -
Returns:
String
See Also:
getValueFromString(String)

getCategory

public String getCategory()
                   throws Exception
get the property category, or an empty string of no category is set

Specified by:
getCategory in interface OwPropertyClass
Returns:
Category of Property
Throws:
Exception

getOperators

public Collection getOperators()
                        throws Exception
get a collection of possible filter / search operators for the field

Specified by:
getOperators in interface OwFieldDefinition
Returns:
Collection of operators as defined with OwSearchOperator.CRIT_OP_..., or null if no operators are defined
Throws:
Exception

isType

public static boolean isType(Class base_p,
                             String sSubJavaClassName_p)
                      throws ClassNotFoundException
check if given java class name is base type

Parameters:
base_p -
sSubJavaClassName_p -
Returns:
a boolean
Throws:
ClassNotFoundException

isType

public boolean isType(Class base_p)
               throws ClassNotFoundException
check if given java class name is base type

Parameters:
base_p - a Class
Returns:
a boolean
Throws:
ClassNotFoundException

getClonedProperties

public static OwPropertyCollection getClonedProperties(OwObject object_p,
                                                       Collection propertyNames_p)
                                                throws Exception
retrieve the specified properties from the object as a copy NOTE: The returned collection contains exactly the requested propertyNames_p, or all if propertyNames_p == null

NOTE: if the properties where not already obtained from the archive (e.g. by OwNetwork.doSearch(...,PropertyList)), than the DMS Adaptor has to launch a new query. It is therefore best practice to obtain the needed properties in advance in a call to OwNetwork.doSearch(...)

Parameters:
object_p - OwObject to retrieve cloned properties from
propertyNames_p - a collection of property names to retrieve, if null all properties are retrieved
Returns:
a property list
Throws:
Exception

isComplex

public boolean isComplex()
Description copied from interface: OwFieldDefinition
check if the property is a component that contains another child properties

Specified by:
isComplex in interface OwFieldDefinition
Returns:
true if the property can contains child properties
See Also:
OwFieldDefinition.getComplexChildClasses()

getComplexChildClasses

public List getComplexChildClasses()
                            throws Exception
Description copied from interface: OwFieldDefinition
get child properties classes of a complex property class

Specified by:
getComplexChildClasses in interface OwFieldDefinition
Returns:
Collection of OwFieldDefinition or null if isComplex is false
Throws:
Exception
See Also:
OwFieldDefinition.isComplex()


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.