org.openmdx.portal.servlet
Class DefaultPortalExtension

java.lang.Object
  extended by org.openmdx.portal.servlet.DefaultPortalExtension
All Implemented Interfaces:
Serializable, PortalExtension_1_0

public class DefaultPortalExtension
extends Object
implements PortalExtension_1_0, Serializable

See Also:
Serialized Form

Field Summary
protected static Set WELL_KNOWN_PROTOCOLS
           
 
Constructor Summary
DefaultPortalExtension()
           
 
Method Summary
protected  void createCompositionHierarchy(org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 ofType, Map hierarchy)
          Returns classes which are in the composition hierarchy of the specified type.
 Autocompleter_1_0 getAutocompleter(ApplicationContext application, org.openmdx.base.accessor.jmi.cci.RefObject_1_0 context, String qualifiedFeatureName)
          Get autocompleter for the specified object.
protected  Locale getCurrentLocale(ApplicationContext application)
           
 DataBinding_1_0 getDataBinding(String dataBindingName, ApplicationContext application)
          Get data binding with given name
 int getDateStyle(String qualifiedFeatureName, ApplicationContext application)
          Get date style for given feature
 List getFindObjectsBaseFilter(ApplicationContext application, org.openmdx.base.accessor.jmi.cci.RefObject_1_0 context, String qualifiedFeatureName)
          Returns a list of FilterPropertys which are added to the query when processing a FIND_OBJECTS action.
 int getGridPageSize(String referencedTypeName)
           
 String getGridRowLevelId(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj)
          Returns the level id for an object shown in a grid.
 int getGridRowNestingLevel(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj)
          Returns the nesting level for an object shown in a grid.
 String getIdentityQueryFilterClause(String qualifiedReferenceName)
          Return query filter clause which must be performed when a user issues a find on the object identity.
 org.openmdx.base.accessor.jmi.cci.RefObject_1_0 getLookupObject(org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 lookupType, org.openmdx.base.accessor.jmi.cci.RefObject_1_0 startFrom, ApplicationContext application)
          Get object which allows to lookup objects of referenced type
 ObjectView getLookupView(String id, org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 lookupType, org.openmdx.base.accessor.jmi.cci.RefObject_1_0 startFrom, String filterValues, ControlFactory controlFactory, ApplicationContext application)
          get view required which allows to lookup referenced types
 int getTimeStyle(String qualifiedFeatureName, ApplicationContext application)
          Get time style for given feature
 String getTitle(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj, short locale, String localeAsString, ApplicationContext application)
          Evaluates the title obj the object refObj.
 org.openmdx.base.accessor.jmi.cci.RefObject_1_0 handleOperationResult(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 target, String operationName, javax.jmi.reflect.RefStruct params, javax.jmi.reflect.RefStruct result)
          The default implementation returns target as result, i.e.
 boolean hasGridColours(String referencedTypeName)
          Returns true if the rows of the grid containing objects of type referencedTypeName are colour enabled.
 boolean hasUserDefineableQualifier(Inspector inspector, ApplicationContext application)
          Returns true if the qualifier for the specified inspector is user-defineable.
 boolean isEnabled(String uiElementName, org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj, ApplicationContext context)
          Determines whether the ui element is enabled in the context of view.
 boolean isLookupType(org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 classDef)
          Returns true if the specified type is not a valid lookup type.
 void renderTextValue(HtmlPage p, String value)
          The default implementation renders the unmodified text value, i.e.
 boolean showGridContentOnInit(GridControl gridControl, ApplicationContext application)
          The default implementation shows the grid content according to the user settings.
protected  String toS(Object obj)
           
 void updateObject(Object target, Map parameterMap, Map fieldMap, ApplicationContext application, org.openmdx.base.accessor.jmi.cci.RefPackage_1_0 rootPkg)
          Maps the request input to the specified object.
protected static javax.xml.datatype.DatatypeFactory xmlDatatypeFactory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WELL_KNOWN_PROTOCOLS

protected static final Set WELL_KNOWN_PROTOCOLS
Constructor Detail

DefaultPortalExtension

public DefaultPortalExtension()
Method Detail

toS

protected String toS(Object obj)

getTitle

public String getTitle(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj,
                       short locale,
                       String localeAsString,
                       ApplicationContext application)
Description copied from interface: PortalExtension_1_0
Evaluates the title obj the object refObj.

Specified by:
getTitle in interface PortalExtension_1_0
Parameters:
refObj - object to evaluate the title
locale - locale index. Can be used to lookup code texts
localeAsString - the locale name
application - TODO
Returns:
evaluated object title

isEnabled

public boolean isEnabled(String uiElementName,
                         org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj,
                         ApplicationContext context)
Description copied from interface: PortalExtension_1_0
Determines whether the ui element is enabled in the context of view. The result is typically used in the ui rendering process to determine whether an ui element should be rendered as enabled or disabled.

Specified by:
isEnabled in interface PortalExtension_1_0
Parameters:
uiElementName - qualified name of the ui element
refObj - evaluate in the context of the object
context - evaluate in the application context
Returns:
true when the ui element is enabled

getIdentityQueryFilterClause

public String getIdentityQueryFilterClause(String qualifiedReferenceName)
Description copied from interface: PortalExtension_1_0
Return query filter clause which must be performed when a user issues a find on the object identity.

Specified by:
getIdentityQueryFilterClause in interface PortalExtension_1_0
Parameters:
qualifiedReferenceName - qualified reference name
Returns:
identity query. The query must have exactly one string parameter, e.g. (title LIKE ?s0).

getGridRowNestingLevel

public int getGridRowNestingLevel(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj)
Description copied from interface: PortalExtension_1_0
Returns the nesting level for an object shown in a grid. Objects at root level have a nesting level of 0.

Specified by:
getGridRowNestingLevel in interface PortalExtension_1_0
Parameters:
refObj - object for which the nesting level is calculated.
Returns:
nesting level of given object.

getGridRowLevelId

public String getGridRowLevelId(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 refObj)
Description copied from interface: PortalExtension_1_0
Returns the level id for an object shown in a grid. The row level allows to arrange grid rows in a tree-like structure. The row level has the format --, etc. Ids at level 0 must be unique, ids at level 1 must be unique within level 0, ids at level 2 must be unique within level 1, etc.

Specified by:
getGridRowLevelId in interface PortalExtension_1_0
Parameters:
refObj - object for which the row level id is calculated.
Returns:
row level id. Null if no row level is defined for given object.

getGridPageSize

public int getGridPageSize(String referencedTypeName)
Specified by:
getGridPageSize in interface PortalExtension_1_0

hasGridColours

public boolean hasGridColours(String referencedTypeName)
Description copied from interface: PortalExtension_1_0
Returns true if the rows of the grid containing objects of type referencedTypeName are colour enabled.

Specified by:
hasGridColours in interface PortalExtension_1_0

isLookupType

public boolean isLookupType(org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 classDef)
Description copied from interface: PortalExtension_1_0
Returns true if the specified type is not a valid lookup type. Autocompleter must exclude non lookup types in their lookup options.

Specified by:
isLookupType in interface PortalExtension_1_0

getAutocompleter

public Autocompleter_1_0 getAutocompleter(ApplicationContext application,
                                          org.openmdx.base.accessor.jmi.cci.RefObject_1_0 context,
                                          String qualifiedFeatureName)
Description copied from interface: PortalExtension_1_0
Get autocompleter for the specified object.

Specified by:
getAutocompleter in interface PortalExtension_1_0
Returns:
null if no autocompleter is available.

getFindObjectsBaseFilter

public List getFindObjectsBaseFilter(ApplicationContext application,
                                     org.openmdx.base.accessor.jmi.cci.RefObject_1_0 context,
                                     String qualifiedFeatureName)
Description copied from interface: PortalExtension_1_0
Returns a list of FilterPropertys which are added to the query when processing a FIND_OBJECTS action. E.g. non-active objects should not be returned by the find objects reply a filter of the form active=true can be returned.

Specified by:
getFindObjectsBaseFilter in interface PortalExtension_1_0

getCurrentLocale

protected Locale getCurrentLocale(ApplicationContext application)

updateObject

public void updateObject(Object target,
                         Map parameterMap,
                         Map fieldMap,
                         ApplicationContext application,
                         org.openmdx.base.accessor.jmi.cci.RefPackage_1_0 rootPkg)
Maps the request input to the specified object. The object must either be instanceof RefObject_1_0 or Map.

Specified by:
updateObject in interface PortalExtension_1_0
fieldMap - map containing the (modeled) field definitions of the target object. Entries are of the form (key=qualified feature name, value=feature instance of org.openmdx.portal.servlet.attribute.Attribute).

createCompositionHierarchy

protected void createCompositionHierarchy(org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 ofType,
                                          Map hierarchy)
                                   throws org.openmdx.base.exception.ServiceException
Returns classes which are in the composition hierarchy of the specified type. Returns a map with the class name as key and a set of reference names as members, whereas the references are composite references of the class.

Throws:
org.openmdx.base.exception.ServiceException

getLookupObject

public org.openmdx.base.accessor.jmi.cci.RefObject_1_0 getLookupObject(org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 lookupType,
                                                                       org.openmdx.base.accessor.jmi.cci.RefObject_1_0 startFrom,
                                                                       ApplicationContext application)
                                                                throws org.openmdx.base.exception.ServiceException
Description copied from interface: PortalExtension_1_0
Get object which allows to lookup objects of referenced type

Specified by:
getLookupObject in interface PortalExtension_1_0
Throws:
org.openmdx.base.exception.ServiceException

getLookupView

public ObjectView getLookupView(String id,
                                org.openmdx.model1.accessor.basic.cci.ModelElement_1_0 lookupType,
                                org.openmdx.base.accessor.jmi.cci.RefObject_1_0 startFrom,
                                String filterValues,
                                ControlFactory controlFactory,
                                ApplicationContext application)
                         throws org.openmdx.base.exception.ServiceException
get view required which allows to lookup referenced types

Specified by:
getLookupView in interface PortalExtension_1_0
Throws:
org.openmdx.base.exception.ServiceException

hasUserDefineableQualifier

public boolean hasUserDefineableQualifier(Inspector inspector,
                                          ApplicationContext application)
Description copied from interface: PortalExtension_1_0
Returns true if the qualifier for the specified inspector is user-defineable. User-defineable qualifiers can be entered by the user when creating a new object.

Specified by:
hasUserDefineableQualifier in interface PortalExtension_1_0

showGridContentOnInit

public boolean showGridContentOnInit(GridControl gridControl,
                                     ApplicationContext application)
The default implementation shows the grid content according to the user settings. The default value is true if no user setting is found.

Specified by:
showGridContentOnInit in interface PortalExtension_1_0

renderTextValue

public void renderTextValue(HtmlPage p,
                            String value)
                     throws org.openmdx.base.exception.ServiceException
The default implementation renders the unmodified text value, i.e. calls p.write(value)

Specified by:
renderTextValue in interface PortalExtension_1_0
Throws:
org.openmdx.base.exception.ServiceException

getDateStyle

public int getDateStyle(String qualifiedFeatureName,
                        ApplicationContext application)
Description copied from interface: PortalExtension_1_0
Get date style for given feature

Specified by:
getDateStyle in interface PortalExtension_1_0
Parameters:
qualifiedFeatureName - null or qualified name of feature for which date style is returned.

getTimeStyle

public int getTimeStyle(String qualifiedFeatureName,
                        ApplicationContext application)
Description copied from interface: PortalExtension_1_0
Get time style for given feature

Specified by:
getTimeStyle in interface PortalExtension_1_0
Parameters:
qualifiedFeatureName - null or qualified name of feature for which date style is returned.

getDataBinding

public DataBinding_1_0 getDataBinding(String dataBindingName,
                                      ApplicationContext application)
Description copied from interface: PortalExtension_1_0
Get data binding with given name

Specified by:
getDataBinding in interface PortalExtension_1_0

handleOperationResult

public org.openmdx.base.accessor.jmi.cci.RefObject_1_0 handleOperationResult(org.openmdx.base.accessor.jmi.cci.RefObject_1_0 target,
                                                                             String operationName,
                                                                             javax.jmi.reflect.RefStruct params,
                                                                             javax.jmi.reflect.RefStruct result)
                                                                      throws org.openmdx.base.exception.ServiceException
The default implementation returns target as result, i.e. after an operation invocation the view shown to the user remains unchanged.

Specified by:
handleOperationResult in interface PortalExtension_1_0
Parameters:
target - operation was invoked on the target object
operationName - invoked operation
params - parameter of operation invocation
result - operation result
Returns:
object to be shown after operation invocation. null if user should not be directed to a new view.
Throws:
org.openmdx.base.exception.ServiceException

xmlDatatypeFactory

protected static javax.xml.datatype.DatatypeFactory xmlDatatypeFactory()
Returns:
a Datatype Factory Instance


This software is published under the BSD license. Copyright © 2006-2008, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.