Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

er.extensions
Class ERXDirectActionHyperlink  view ERXDirectActionHyperlink download ERXDirectActionHyperlink.java

java.lang.Object
  extended byWOComponent
      extended byer.extensions.ERXStatelessComponent
          extended byer.extensions.ERXDirectActionHyperlink
Direct Known Subclasses:
ERXDirectActionImage

public class ERXDirectActionHyperlink
extends ERXStatelessComponent

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;]


Field Summary
private static java.lang.String _applicationHostUrl
          Holds the application host url
static java.lang.String ADAPTOR_PREFIX_MARKER
          Key used to denote an adaptor prefix for a generated url string
static ERXLogger log
          logging support
static java.lang.String SUFFIX_MARKER
          Key used to denote a suffix for a generated url string
 
Constructor Summary
ERXDirectActionHyperlink(WOContext aContext)
          Public constructor
 
Method Summary
 NSArray allObjectsForFormValues()
          Returns all of the objects to be encoded in the form values.
static java.lang.String applicationHostUrl()
          This returns the value stored in the system properties: ERApplicationHostURL if this isn't set then a runtime exception is thrown.
static java.lang.String completeURLFromString(java.lang.String s, WOContext c, java.lang.String applicationName, boolean relative, java.lang.String suffix)
          This method is useful for completing urls that are being generated in components that are going to be e-mailed to users.
static java.lang.String directActionHyperlink(WOContext context, boolean encryptEos, NSArray eos, java.lang.String entityNameSeparator, NSDictionary encryptedDict, NSDictionary unencryptedDict, java.lang.String appName, java.lang.String daName, boolean relative, java.lang.String suffix)
           
 java.lang.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.
 java.lang.String href()
          Generates an href for the given direct action based on all of the bindings.
 EOEnterpriseObject objectForFormValue()
          Cover method to return the binding: objectsForFormValue This is an enterprise object to be encoded as form values.
 NSArray objectsForFormValues()
          Cover method to return the binding: objectsForFormValues This is an array of objects to be encoded as form values.
 boolean relative()
          Cover method to return the boolean value of the binding: relative Defaults to true.
 boolean shouldEncryptObjectFormValues()
          Cover method to return the boolean value of the binding: shouldEncryptObjectFormValues Defaults to false.
 java.lang.String stringForBinding(java.lang.String binding)
          Retrives a given binding and if it is not null then returns toString called on the bound object.
 
Methods inherited from class er.extensions.ERXStatelessComponent
isStateless, synchronizesVariablesWithBindings, valueForBooleanBinding, valueForBooleanBinding, valueForBooleanBinding, valueForIntBinding, valueForObjectBinding, valueForObjectBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADAPTOR_PREFIX_MARKER

public static final java.lang.String ADAPTOR_PREFIX_MARKER
Key used to denote an adaptor prefix for a generated url string

See Also:
Constant Field Values

SUFFIX_MARKER

public static final java.lang.String SUFFIX_MARKER
Key used to denote a suffix for a generated url string

See Also:
Constant Field Values

log

public static final ERXLogger log
logging support


_applicationHostUrl

private static java.lang.String _applicationHostUrl
Holds the application host url

Constructor Detail

ERXDirectActionHyperlink

public ERXDirectActionHyperlink(WOContext aContext)
Public constructor

Method Detail

entityNameSeparator

public java.lang.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 '
_
'.


relative

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


shouldEncryptObjectFormValues

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


objectsForFormValues

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


objectForFormValue

public EOEnterpriseObject objectForFormValue()
Cover method to return the binding: objectsForFormValue This is an enterprise object to be encoded as form values.


allObjectsForFormValues

public 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.


stringForBinding

public java.lang.String stringForBinding(java.lang.String binding)
Retrives a given binding and if it is not null then returns toString called on the bound object.


href

public java.lang.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.


applicationHostUrl

public static java.lang.String applicationHostUrl()
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


directActionHyperlink

public static java.lang.String directActionHyperlink(WOContext context,
                                                     boolean encryptEos,
                                                     NSArray eos,
                                                     java.lang.String entityNameSeparator,
                                                     NSDictionary encryptedDict,
                                                     NSDictionary unencryptedDict,
                                                     java.lang.String appName,
                                                     java.lang.String daName,
                                                     boolean relative,
                                                     java.lang.String suffix)

completeURLFromString

public static java.lang.String completeURLFromString(java.lang.String s,
                                                     WOContext c,
                                                     java.lang.String applicationName,
                                                     boolean relative,
                                                     java.lang.String suffix)
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.