ERXDirectActionHyperlink Class Reference

Inherits er::extensions::components::ERXStatelessComponent.

Inherited by ERXDirectActionImage.

Collaboration diagram for ERXDirectActionHyperlink:

Collaboration graph
[legend]

List of all members.

Public Member Functions

NSArray allObjectsForFormValues ()
String entityNameSeparator ()
 ERXDirectActionHyperlink (WOContext aContext)
String href ()
EOEnterpriseObject objectForFormValue ()
NSArray objectsForFormValues ()
boolean relative ()
boolean shouldEncryptObjectFormValues ()

Static Public Member Functions

static String applicationHostUrl ()
static String completeURLFromString (String s, WOContext c, String applicationName, boolean relative, String suffix)
static String directActionHyperlink (WOContext context, boolean encryptEos, NSArray eos, String entityNameSeparator, NSDictionary encryptedDict, NSDictionary unencryptedDict, String appName, String daName, boolean relative, String suffix)

Static Public Attributes

static final String ADAPTOR_PREFIX_MARKER = "**ADAPTOR_PREFIX**"
static final Logger log = Logger.getLogger(ERXDirectActionHyperlink.class)
static final String SUFFIX_MARKER = "**SUFFIX**"

Static Private Attributes

static String _applicationHostUrl


Detailed Description

This component can be used for two things:
1) Generating direct action urls for use in components that are being e-mailed to people. 2) Support for encoding enterprise objects in the form values of generated urls. At the moment this component still contains some custy code that needs to be cleaned up before it can really be used, like adding the .wo and .api files ;0.

Synopsis:
[actionClass=anActionClass];directActionName=aDirectActionName;[entityNameSeparator=aSeparator;] [relative=aBoolean;][shouldEncryptObjectFormValues=aBoolean;][objectsForFormValues=anArray;] [bindingDictionary=aDictionary;][unencryptedBindingDictionary=aDictionary;]

actionClass direct action class to be used directActionName direct action name entityNameSeparator separator used when constructiong urls with encoded enterprise objects relative generates relative or absolute url shouldEncryptObjectFormValues boolean flag that tells if the primary keys of the enterprise objects should be encrypted using blowfish objectForFormValue an enterprise object to be encoded in the url objectsForFormValues array of enterprise objects to be encoded in the url bindingDictionary adds the key-value pairs to generated url as form values, encrypting the values with blowfish. unencryptedBindingDictionary adds the key-value pairs to generated url as form values


Constructor & Destructor Documentation

ERXDirectActionHyperlink ( WOContext  aContext  ) 

Public constructor

Parameters:
aContext a context


Member Function Documentation

NSArray allObjectsForFormValues (  ) 

Returns all of the objects to be encoded in the form values. Collects those bound to both 'objectsForFormValues' and 'objectForFormValue' into a single array.

Returns:
complete collection of objects to be encoded in form values.

static String applicationHostUrl (  )  [static]

This returns the value stored in the system properties: ERApplicationHostURL if this isn't set then a runtime exception is thrown. This property should be of the form: http://mymachine.com

Returns:
the application host url that should be used when complete urls are generated.

static String completeURLFromString ( String  s,
WOContext  c,
String  applicationName,
boolean  relative,
String  suffix 
) [static]

This method is useful for completing urls that are being generated in components that are going to be e-mailed to users. This method has the ability to substitute different application names which can be helpful if one application is generating the component, but the action of the url points to a different application on the same host.

Parameters:
s href string to be completed
c current context
applicationName to be substituted if ADAPTOR_PREFIX_MARKER is present
relative flag to indicate if the generated url should be relative or absolute in which case the applicationHostUrl will be used
suffix string to be substitued if the SUFFIX_MARKER string is present
Returns:
complete url after substitutions have been made

static String directActionHyperlink ( WOContext  context,
boolean  encryptEos,
NSArray  eos,
String  entityNameSeparator,
NSDictionary  encryptedDict,
NSDictionary  unencryptedDict,
String  appName,
String  daName,
boolean  relative,
String  suffix 
) [static]

String entityNameSeparator (  ) 

Cover method to return the binding: entityNameSeparator The entity name separator is used when constructing URLs with enterprise objects encoded in the url. This value default to the value defined in the system property er.extensions.ERXDirectActionHyperlink.EntityNameSeparator which defaults as well to the character '

_
'.
Returns:
returns the value for binding: entityNameSeparator

String href (  ) 

Generates an href for the given direct action based on all of the bindings. Currently it generates an absolute url starting with the key: ADAPTOR_PREFIX_MARKER. Before this href can be really useful it needs to be cleaned up.

Returns:
href containing all of the specification from the bindings.

EOEnterpriseObject objectForFormValue (  ) 

Cover method to return the binding: objectsForFormValue This is an enterprise object to be encoded as form values.

Returns:
returns bound enterprise object to be encoded

NSArray objectsForFormValues (  ) 

Cover method to return the binding: objectsForFormValues This is an array of objects to be encoded as form values.

Returns:
returns bound array of objects to be encoded

boolean relative (  ) 

Cover method to return the boolean value of the binding: relative Defaults to true.

Returns:
returns if the generated url should be relative or not(absolute).

boolean shouldEncryptObjectFormValues (  ) 

Cover method to return the boolean value of the binding: shouldEncryptObjectFormValues Defaults to false.

Returns:
returns if the encoded objects' primary keys should be encrypted or not.


Member Data Documentation

String _applicationHostUrl [static, private]

Holds the application host url

final String ADAPTOR_PREFIX_MARKER = "**ADAPTOR_PREFIX**" [static]

Key used to denote an adaptor prefix for a generated url string

final Logger log = Logger.getLogger(ERXDirectActionHyperlink.class) [static]

logging support

final String SUFFIX_MARKER = "**SUFFIX**" [static]

Key used to denote a suffix for a generated url string


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:03 2012 for Project Wonder by  doxygen 1.5.8