com.wewebu.ow.server.plug.owutil
Class OwMappingUtils

java.lang.Object
  extended by com.wewebu.ow.server.plug.owutil.OwMappingUtils

public class OwMappingUtils
extends Object

Static class with utility functions to create mappings and read mappings from XML.

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 int AUTO_SELECT_CLASS
          direction attribute used in getObjectClassMap
static int AUTO_SELECT_FOLDER
          direction attribute used in getObjectClassMap
static int EMPTY_MAPPING
          direction attribute used in getObjectClassMap
 
Constructor Summary
OwMappingUtils()
           
 
Method Summary
static int getObjectClassMap(OwXMLUtil confignode_p, Map objectclassmap_p)
          Compute a Map of object class - subfolder mappings reads the ObjectClassMapping section in the plugin descriptor List of object class mappings to be used.
static Map getParameterMapValuesFromObject(OwXMLUtil confignode_p, OwObject sourceObject_p, String mappingElementName_p)
          Compute a Map of values derived from the parent and to be set in advance in the new object reads the ParameterMapping section in the plugin descriptor Each Parameter from the Parent Object is set to the parameter in the new Object
Example:
Instruction: Name=Customer.Name
The Parameter Name in the new object gets the value of the Parameter Customer.Name in the Parent object
where Customer is a Object Reference Property and Name is the property of that reference.
static Map getParameterMapValuesFromRecord(OwXMLUtil confignode_p, OwObject rootObject_p, OwObject folderObject_p)
          Compute a Map of values derived from the parent and to be set in advance in the new object, reads the ParameterMapping section in the plugin descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_MAPPING

public static final int EMPTY_MAPPING
direction attribute used in getObjectClassMap

See Also:
Constant Field Values

AUTO_SELECT_CLASS

public static final int AUTO_SELECT_CLASS
direction attribute used in getObjectClassMap

See Also:
Constant Field Values

AUTO_SELECT_FOLDER

public static final int AUTO_SELECT_FOLDER
direction attribute used in getObjectClassMap

See Also:
Constant Field Values
Constructor Detail

OwMappingUtils

public OwMappingUtils()
Method Detail

getParameterMapValuesFromRecord

public static Map getParameterMapValuesFromRecord(OwXMLUtil confignode_p,
                                                  OwObject rootObject_p,
                                                  OwObject folderObject_p)
                                           throws Exception
Compute a Map of values derived from the parent and to be set in advance in the new object, reads the ParameterMapping section in the plugin descriptor. Each Parameter from the Parent Object is set to the parameter in the new Object
Example:
Instruction: Name=Customer.Name
The Parameter Name in the new object gets the value of the Parameter Customer.Name in the Parent object
where Customer is a Object Reference Property and Name is the property of that reference.

Parameters:
confignode_p - OwXMLUtil plugin configuration node
rootObject_p - the Parent OwObject where to create the object and derive the properties from
folderObject_p - the folder to look up the properties if not found look up in rootObject_p
Returns:
Map key is the property name of the new object, value is the value to set
Throws:
Exception

getParameterMapValuesFromObject

public static Map getParameterMapValuesFromObject(OwXMLUtil confignode_p,
                                                  OwObject sourceObject_p,
                                                  String mappingElementName_p)
                                           throws Exception
Compute a Map of values derived from the parent and to be set in advance in the new object reads the ParameterMapping section in the plugin descriptor Each Parameter from the Parent Object is set to the parameter in the new Object
Example:
Instruction: Name=Customer.Name
The Parameter Name in the new object gets the value of the Parameter Customer.Name in the Parent object
where Customer is a Object Reference Property and Name is the property of that reference.

Parameters:
confignode_p - OwXMLUtil plugin configuration node
sourceObject_p - the folder to look up the properties if not found look up in rootObject_p
Returns:
Map key is the property name of the new object, value is the value to set
Throws:
Exception

getObjectClassMap

public static int getObjectClassMap(OwXMLUtil confignode_p,
                                    Map objectclassmap_p)
                             throws Exception
Compute a Map of object class - subfolder mappings reads the ObjectClassMapping section in the plugin descriptor List of object class mappings to be used. Each object class is mapped to a subfolder path. Where the direction attribute will specify the following: "autoselectclass": The selected subfolder will select a object class to be used. "autoselectfolder": The selected class will select a subfolder to be used to store the new object.

Parameters:
confignode_p - OwXMLUtil plugin configuration node
objectclassmap_p - Map which will be filled with object class mappings depending on directionflag (see return value) keys and values are: AUTO_SELECT_CLASS: Key is the subfolder path and value is the object class. AUTO_SELECT_FOLDER: Key is the objectclass and value is the subfolderpath.
Returns:
int directionflag which is either AUTO_SELECT_CLASS or AUTO_SELECT_FOLDER
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.