com.flexive.shared.scripting
Enum FxScriptEvent

java.lang.Object
  extended by java.lang.Enum<FxScriptEvent>
      extended by com.flexive.shared.scripting.FxScriptEvent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FxScriptEvent>

public enum FxScriptEvent
extends java.lang.Enum<FxScriptEvent>

All kinds of scripts used in flexive, depending on the type scripts are initialized with different bindings

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Enum Constant Summary
AccountLogin
          Fired when an account logs in.
AccountLogout
          Fired when an account is logged off to clear state information if needed.
AfterAccountCreate
          Fired after a new user account has been created.
AfterAssignmentDataCreate
          Fired after a new instance is created that will contain the assignment

Passed variables:
FxPK pk: primary key of the created content
FxAssignment assignment: the new assignment
AfterAssignmentDataDelete
          Fired after an instance is deleted could contain the assignment, no guarantee can be made that the instance actually contains FxData for the assignment!

Passed variables:
FxPK pk: primary key of the created content
FxAssignment assignment: the assignment
AfterAssignmentDataSave
          Fired after an existing instance is saved that contains the assignment

Passed variables:
FxPK pk: primary key of the saved content
FxAssignment assignment: the updated assignment
AfterContentCreate
          Fired after a new content is created

Passed variables:
FxPK pk: Primary key of the created content
AfterContentInitialize
          Fired after a new content instance is initialized with default values

Passed variables:
FxContent content: the initialized content instance
AfterContentLoad
          Fired after a content is loaded

Passed variables:
FxContent content: the loaded content instance
AfterContentRemove
          Fired after a content is removed

Passed variables:
FxPK pk: Primary key of the removed content
AfterContentSave
          Fired after an existing content is saved

Passed variables:
FxPK pk: Primary key of the saved content
AfterDataChangeAdd
          Fired after a FxData is updated in an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change
AfterDataChangeDelete
          Fired after a FxData is removed from an existing existance, instance will not be removed!

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change
AfterDataChangeUpdate
          Fired after a FxData update of an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change
AfterTreeNodeActivated
          Fired after a node was activated (copied from Edit to Live tree).
AfterTreeNodeAdded
          Fired after a new node was added to the tree.
AfterTreeNodeFolderReplacement
          Fired after a content reference has been replaced by a folder reference.
AfterTreeNodeRemoved
          Fired after a new node was removed from the tree.
BeforeAssignmentDataCreate
          Fired before a new instance is created that will contain the assignment

Passed variables:
FxContent content: the content to be created
FxAssignment assignment: the new assignment
BeforeAssignmentDataDelete
          Fired before an instance is deleted could contain the assignment, no guarantee can be made that the instance actually contains FxData for the assignment!

Passed variables:
FxPK pk: primary key of the removed content
FxAssignment assignment: the assignment
BeforeAssignmentDataSave
          Fired before an existing instance is saved that contains the assignment

Passed variables:
FxContent content: the content to be saved
FxAssignment assignment: the updated assignment
BeforeContentCreate
          Fired before a new content is created

Passed variables:
FxContent content: content instance which is about to be saved
BeforeContentRemove
          Fired before a content is removed

Passed variables:
FxPK pk: Primary key of the removed content
BeforeContentSave
          Fired before an existing content is saved

Passed variables:
FxContent content: content instance which is about to be saved
BeforeDataChangeAdd
          Fired before a FxData is updated in an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change
BeforeDataChangeDelete
          Fired before a FxData is removed from an existing existance, instance will not be removed!

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change
BeforeDataChangeUpdate
          Fired before a FxData update of an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change
BeforeTreeNodeActivated
          Fired before a node is activated (copied from Edit to Live tree).
BeforeTreeNodeRemoved
          Fired after a new node was removed from the tree.
BinaryPreviewProcess
          Fired for processing of binaries.
Manual
          Manually execute script, not dependent on any 'trigger point' - will be executed on demand
PrepareContentCreate
          Fired for ContentEngine.prepareSave() for new contents

Passed variables:
FxContent content: the content to be prepared for creation
PrepareContentSave
          Fired for ContentEngine.prepareSave() for existing contents

Passed variables:
FxContent content: the content to be prepared for saving
 
Method Summary
 java.lang.String[] getBindingInfo()
          Get a list of all bindings available to the script.
static FxScriptEvent getById(long id)
          Get a FxScriptEvent by its id
 long getId()
          Getter for the internal id
 java.lang.String getName()
           
 FxScriptScope getScope()
          Get the scope of this script, ie if it is independent, for types or assignments
static FxScriptEvent valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FxScriptEvent[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Manual

public static final FxScriptEvent Manual
Manually execute script, not dependent on any 'trigger point' - will be executed on demand


BeforeContentSave

public static final FxScriptEvent BeforeContentSave
Fired before an existing content is saved

Passed variables:
FxContent content: content instance which is about to be saved


AfterContentSave

public static final FxScriptEvent AfterContentSave
Fired after an existing content is saved

Passed variables:
FxPK pk: Primary key of the saved content


BeforeContentCreate

public static final FxScriptEvent BeforeContentCreate
Fired before a new content is created

Passed variables:
FxContent content: content instance which is about to be saved


AfterContentCreate

public static final FxScriptEvent AfterContentCreate
Fired after a new content is created

Passed variables:
FxPK pk: Primary key of the created content


BeforeContentRemove

public static final FxScriptEvent BeforeContentRemove
Fired before a content is removed

Passed variables:
FxPK pk: Primary key of the removed content


AfterContentRemove

public static final FxScriptEvent AfterContentRemove
Fired after a content is removed

Passed variables:
FxPK pk: Primary key of the removed content


AfterContentLoad

public static final FxScriptEvent AfterContentLoad
Fired after a content is loaded

Passed variables:
FxContent content: the loaded content instance


AfterContentInitialize

public static final FxScriptEvent AfterContentInitialize
Fired after a new content instance is initialized with default values

Passed variables:
FxContent content: the initialized content instance


PrepareContentCreate

public static final FxScriptEvent PrepareContentCreate
Fired for ContentEngine.prepareSave() for new contents

Passed variables:
FxContent content: the content to be prepared for creation


PrepareContentSave

public static final FxScriptEvent PrepareContentSave
Fired for ContentEngine.prepareSave() for existing contents

Passed variables:
FxContent content: the content to be prepared for saving


BeforeDataChangeUpdate

public static final FxScriptEvent BeforeDataChangeUpdate
Fired before a FxData update of an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change


AfterDataChangeUpdate

public static final FxScriptEvent AfterDataChangeUpdate
Fired after a FxData update of an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change


BeforeDataChangeDelete

public static final FxScriptEvent BeforeDataChangeDelete
Fired before a FxData is removed from an existing existance, instance will not be removed!

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change


AfterDataChangeDelete

public static final FxScriptEvent AfterDataChangeDelete
Fired after a FxData is removed from an existing existance, instance will not be removed!

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change


BeforeDataChangeAdd

public static final FxScriptEvent BeforeDataChangeAdd
Fired before a FxData is updated in an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change


AfterDataChangeAdd

public static final FxScriptEvent AfterDataChangeAdd
Fired after a FxData is updated in an existing existance

Passed variables:
FxContent content: the content to be updated
FxDeltaChange change: information about the change


BeforeAssignmentDataCreate

public static final FxScriptEvent BeforeAssignmentDataCreate
Fired before a new instance is created that will contain the assignment

Passed variables:
FxContent content: the content to be created
FxAssignment assignment: the new assignment


AfterAssignmentDataCreate

public static final FxScriptEvent AfterAssignmentDataCreate
Fired after a new instance is created that will contain the assignment

Passed variables:
FxPK pk: primary key of the created content
FxAssignment assignment: the new assignment


BeforeAssignmentDataSave

public static final FxScriptEvent BeforeAssignmentDataSave
Fired before an existing instance is saved that contains the assignment

Passed variables:
FxContent content: the content to be saved
FxAssignment assignment: the updated assignment


AfterAssignmentDataSave

public static final FxScriptEvent AfterAssignmentDataSave
Fired after an existing instance is saved that contains the assignment

Passed variables:
FxPK pk: primary key of the saved content
FxAssignment assignment: the updated assignment


BeforeAssignmentDataDelete

public static final FxScriptEvent BeforeAssignmentDataDelete
Fired before an instance is deleted could contain the assignment, no guarantee can be made that the instance actually contains FxData for the assignment!

Passed variables:
FxPK pk: primary key of the removed content
FxAssignment assignment: the assignment


AfterAssignmentDataDelete

public static final FxScriptEvent AfterAssignmentDataDelete
Fired after an instance is deleted could contain the assignment, no guarantee can be made that the instance actually contains FxData for the assignment!

Passed variables:
FxPK pk: primary key of the created content
FxAssignment assignment: the assignment


BinaryPreviewProcess

public static final FxScriptEvent BinaryPreviewProcess
Fired for processing of binaries.

Passed variables:
boolean processedk: has the binary already been processed? Usually return from the script if true
boolean useDefaultPreview: set from the script if a default preview should be used or the script creates one
int defaultId: set from the script: the default id to use for previews if using thed default preview id
String mimeType: set from the script: mime type
String metaData: set from the script: xml based meta data
File binaryFile: the original binary file
File previewFile1: set from script: file containing preview 1
File previewFile2: set from script: file containing preview 2
File previewFile3: set from script: file containing preview 3
int[] dimensionPreview1: set from script: dimension of preview 1
int[] dimensionPreview2: set from script: dimension of preview 2
int[] dimensionPreview3: set from script: dimension of preview 3


AfterAccountCreate

public static final FxScriptEvent AfterAccountCreate
Fired after a new user account has been created. The account ID and the contact data PK are bound as "accountId" and "pk" .

Passed variables:
long accountId: id of the account
FxPK pk: primary key of the contact data


AfterTreeNodeAdded

public static final FxScriptEvent AfterTreeNodeAdded
Fired after a new node was added to the tree. Note that this event will not be fired from the populate(mode) method!

Passed variables:
FxTreeNode node: the affected tree node


AfterTreeNodeRemoved

public static final FxScriptEvent AfterTreeNodeRemoved
Fired after a new node was removed from the tree. Note that this event will not be fired from the clear(mode) method!

Passed variables:
FxTreeNode node: the affected tree node


BeforeTreeNodeRemoved

public static final FxScriptEvent BeforeTreeNodeRemoved
Fired after a new node was removed from the tree. Note that this event will not be fired from the clear(mode) method!

Passed variables:
FxTreeNode node: the affected tree node


AfterTreeNodeActivated

public static final FxScriptEvent AfterTreeNodeActivated
Fired after a node was activated (copied from Edit to Live tree). The node passed as binding is the activated node from the Live tree! Please note that there is no deactivate event since this is equal to removal.

Passed variables:
FxTreeNode node: the affected tree node


BeforeTreeNodeActivated

public static final FxScriptEvent BeforeTreeNodeActivated
Fired before a node is activated (copied from Edit to Live tree). The node passed as binding is the node to be activated from the Edit tree! Please note that there is no deactivate event since this is equal to removal.

Passed variables:
FxTreeNode node: the affected tree node


AfterTreeNodeFolderReplacement

public static final FxScriptEvent AfterTreeNodeFolderReplacement
Fired after a content reference has been replaced by a folder reference. This event happens when a content that is referenced by the tree is removed and is no leaf node.

Passed variables:
FxTreeNode node: the affected tree node
FxPK content: primary key of the removed content


AccountLogin

public static final FxScriptEvent AccountLogin
Fired when an account logs in. The script has to return a UserTicket for the logged in user. If no scripts of this event type exist, the default database based login is performed which is skipped on presence of such scripts! Use this event if you want to authenticate against LDAP or the like. The callback provides access to the datasource, ejb context and if a session should be "taken over" to prevent multiple logins.

Passed variables:
String loginname: Name used to log on
String password: Plaintext password
FxCallback callback: An FxCallback instance providing a DataSource to access the database, the EJB context and a flag if user already logged in with this account should be logged off


AccountLogout

public static final FxScriptEvent AccountLogout
Fired when an account is logged off to clear state information if needed. If no scripts of this event type exist, the default database based logout is performed which is skipped on presence of such scripts! Passed variables:
UserTicket ticket: The UserTicket of the user that is being logged off

Method Detail

values

public static FxScriptEvent[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FxScriptEvent c : FxScriptEvent.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FxScriptEvent valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getScope

public FxScriptScope getScope()
Get the scope of this script, ie if it is independent, for types or assignments

Returns:
scope

getBindingInfo

public java.lang.String[] getBindingInfo()
Get a list of all bindings available to the script. Binding descriptions are human readable in the form "datatype variablename"

Returns:
list of all bindings available to the script

getId

public long getId()
Getter for the internal id

Returns:
internal id

getName

public java.lang.String getName()

getById

public static FxScriptEvent getById(long id)
                             throws FxNotFoundException
Get a FxScriptEvent by its id

Parameters:
id - requested id
Returns:
FxScriptEvent
Throws:
FxNotFoundException - on errors