wt.ixb.actor.actions
Class IxbActionsHelper

java.lang.Object
  extended bywt.ixb.actor.actions.IxbActionsHelper

public class IxbActionsHelper
extends Object


Field Summary
static String CHECKOUT
           
static String CREATE_NEW_OBJECT
           
static boolean DEBUG
           
static String DEFAULT_IMPORT_POLICY_FILE
           
static String IGNORE
           
static String IMPORT_NONVERSIONED_ATTRIBUTES
           
static String IMPORT_POLICY_FILE_KEY
           
private static String importPolicyFilePath
           
static String NEW_ITERATION
           
static String NEW_VERSION
           
static String PICK_EXISTING_OBJECT
           
static String RB
           
static String RESTORE
           
static String SUBSTITUTE_OBJECT
           
static String UNLOCK_AND_NEW_ITER
           
static String UPDATE_IN_PLACE
           
static String XML_ACTION_INFO_TAG
           
static String XML_ACTION_KEY
           
static String XML_ACTION_PARAMS_KEY
           
static String XML_ACTION_PARAMS_TAG
           
static String XML_ACTION_TAG
           
static String XML_EXISTING_OBJECT_ID_TAG
           
 
Constructor Summary
IxbActionsHelper()
           
 
Method Summary
static void checkApplicabilityOfAction(String objId, String action)
          Checks if the given action can be applied to the given object.
static void checkIfObjectCanBeCheckedOut(Object obj)
          To be used by actors which need to check out object, currently CHECKOUT
static void checkIfObjectCanBeLocked(Object obj)
           
static void checkIfObjectCanBeUnlocked(Object obj)
          To be used by actors which will need to unlock the object in the system, currently UNLOCK_AND_NEW_ITER
static void checkIfObjectIsCheckedOut(Object obj)
          To be used by actors which work with checked out object, currently UPDATE_IN_PLACE
static String getActorDisplayName(String actorName)
           
private static String getDefaultActorDisplayName(Locale locale)
           
static String getDefaultImportAction(IxbDocument fileXml)
           
static String getDefaultImportAction(IxbDocument fileXml, StreamSource importPolicySource)
          Gets default Import action from Import policy.
private static void PP(String s)
           
private static void printStackTrace(Exception e)
           
static IxbDocument writeActionAndParametersToFileXML(IxbDocument fileXml, StreamSource importPolicySource)
          Helper method to be used by standard ixb service.
static IxbDocument writeActionParametersToFileXML(IxbDocument fileXml, String paramString)
          Some actions (e.g.
static void writeActionToFileXML(IxbElement rootElem, String action, boolean override)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORT_POLICY_FILE_KEY

public static final String IMPORT_POLICY_FILE_KEY
See Also:
Constant Field Values

DEFAULT_IMPORT_POLICY_FILE

public static final String DEFAULT_IMPORT_POLICY_FILE

RB

public static final String RB
See Also:
Constant Field Values

DEBUG

public static boolean DEBUG

XML_ACTION_INFO_TAG

public static final String XML_ACTION_INFO_TAG
See Also:
Constant Field Values

XML_ACTION_TAG

public static final String XML_ACTION_TAG
See Also:
Constant Field Values

XML_ACTION_KEY

public static final String XML_ACTION_KEY
See Also:
Constant Field Values

XML_ACTION_PARAMS_TAG

public static final String XML_ACTION_PARAMS_TAG
See Also:
Constant Field Values

XML_ACTION_PARAMS_KEY

public static final String XML_ACTION_PARAMS_KEY
See Also:
Constant Field Values

XML_EXISTING_OBJECT_ID_TAG

public static final String XML_EXISTING_OBJECT_ID_TAG
See Also:
Constant Field Values

PICK_EXISTING_OBJECT

public static final String PICK_EXISTING_OBJECT
See Also:
Constant Field Values

IGNORE

public static final String IGNORE
See Also:
Constant Field Values

UPDATE_IN_PLACE

public static final String UPDATE_IN_PLACE
See Also:
Constant Field Values

NEW_ITERATION

public static final String NEW_ITERATION
See Also:
Constant Field Values

NEW_VERSION

public static final String NEW_VERSION
See Also:
Constant Field Values

CHECKOUT

public static final String CHECKOUT
See Also:
Constant Field Values

UNLOCK_AND_NEW_ITER

public static final String UNLOCK_AND_NEW_ITER
See Also:
Constant Field Values

CREATE_NEW_OBJECT

public static final String CREATE_NEW_OBJECT
See Also:
Constant Field Values

IMPORT_NONVERSIONED_ATTRIBUTES

public static final String IMPORT_NONVERSIONED_ATTRIBUTES
See Also:
Constant Field Values

SUBSTITUTE_OBJECT

public static final String SUBSTITUTE_OBJECT
See Also:
Constant Field Values

RESTORE

public static final String RESTORE
See Also:
Constant Field Values

importPolicyFilePath

private static String importPolicyFilePath
Constructor Detail

IxbActionsHelper

public IxbActionsHelper()
Method Detail

getDefaultImportAction

public static String getDefaultImportAction(IxbDocument fileXml)
                                     throws WTException
Throws:
WTException

getDefaultImportAction

public static String getDefaultImportAction(IxbDocument fileXml,
                                            StreamSource importPolicySource)
                                     throws WTException
Gets default Import action from Import policy. Import policy is represented as XSL file and XSLT is used to calculate the action for the given object.

Parameters:
fileXml - IxbDocument representing the object which should be imported
importPolicySource - StreamSource representing XSL file with import policy. Can be null, in which case customized or default import policy file from the registry will be used.
Returns:
name of appropriate action
Throws:
WTException

writeActionToFileXML

public static void writeActionToFileXML(IxbElement rootElem,
                                        String action,
                                        boolean override)
                                 throws WTException
Throws:
WTException

writeActionAndParametersToFileXML

public static IxbDocument writeActionAndParametersToFileXML(IxbDocument fileXml,
                                                            StreamSource importPolicySource)
                                                     throws WTException
Helper method to be used by standard ixb service. It should be called from service explicitly before actual import. It sets Import action which should be performed for a given imported object and action parameters (if any). This information is obtained from Import policy and written to IxbDocument representing imported object.

Parameters:
importPolicySource - StreamSource representing XSL file with import policy. Can be null, in which case customized or default import policy file from the registry will be used.
Throws:
WTException

writeActionParametersToFileXML

public static IxbDocument writeActionParametersToFileXML(IxbDocument fileXml,
                                                         String paramString)
                                                  throws WTException
Some actions (e.g. CREATE_NEW_OBJECT) may need additional user defined parameters. These parameters are written to IxbDocument itself, along with the action name.

Parameters:
fileXml - IxbDocument
paramString - name/value pairs for action parameters in the following format: "param1=value1,param2=value2" etc
Throws:
WTException

checkApplicabilityOfAction

public static void checkApplicabilityOfAction(String objId,
                                              String action)
                                       throws WTException
Checks if the given action can be applied to the given object.

Parameters:
objId - Ufid of the matching object (hopefully, the same one to which the action will be really applied!!!)
action - action name
Throws:
IxbUnapplicableActionException - if the action is not applicable
WTException

checkIfObjectCanBeUnlocked

public static void checkIfObjectCanBeUnlocked(Object obj)
                                       throws WTException
To be used by actors which will need to unlock the object in the system, currently UNLOCK_AND_NEW_ITER

Throws:
WTException

checkIfObjectIsCheckedOut

public static void checkIfObjectIsCheckedOut(Object obj)
                                      throws WTException
To be used by actors which work with checked out object, currently UPDATE_IN_PLACE

Throws:
WTException

checkIfObjectCanBeCheckedOut

public static void checkIfObjectCanBeCheckedOut(Object obj)
                                         throws IxbInapplicableActionException
To be used by actors which need to check out object, currently CHECKOUT

Throws:
IxbInapplicableActionException

checkIfObjectCanBeLocked

public static void checkIfObjectCanBeLocked(Object obj)
                                     throws IxbInapplicableActionException
Throws:
IxbInapplicableActionException

getActorDisplayName

public static String getActorDisplayName(String actorName)

getDefaultActorDisplayName

private static String getDefaultActorDisplayName(Locale locale)

printStackTrace

private static void printStackTrace(Exception e)

PP

private static void PP(String s)