com.flexive.shared.scripting.groovy
Class GroovyTypeBuilder

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.util.BuilderSupport
          extended by com.flexive.shared.scripting.groovy.GroovyTypeBuilder
All Implemented Interfaces:
groovy.lang.GroovyObject, java.io.Serializable

public class GroovyTypeBuilder
extends groovy.util.BuilderSupport
implements java.io.Serializable

A FxType groovy builder. By convention, group names start with an uppercase letter, and properties with a lowercase letter. An example, taken from the test cases:

 // create the type "builderTest"
 new GroovyTypeBuilder().builderTest {
 // assign the caption property
 myCaption(assignment: "ROOT/CAPTION")
 // add some new properties
 stringPropertyDefault()
 numberProperty(FxDataType.Number)
 descriptionProperty(description: new FxString("string property description"))
 multilineProperty(multiline: true)
 multilangProperty(multilang: true)
 uniqueProperty(uniqueMode: UniqueMode.Global)
 referenceProperty(FxDataType.Reference, referencedType: CacheAdmin.environment.getType("DOCUMENT"))
 listProperty(FxDataType.SelectMany, referencedList: CacheAdmin.environment.getSelectLists().get(0))
 

// create a new group MultiGroup(description: new FxString("my group"), multiplicity: FxMultiplicity.MULT_0_N) { // assign a property inside the group nestedCaption(assignment: "ROOT/CAPTION") // create a new property groupNumberProperty(FxDataType.Number)

// nest another group NestedGroup(multiplicity: FxMultiplicity.MULT_1_N) { nestedProperty() } } }

Type node arguments:

description FxString The type description
acl ACL The type ACL to be used
useInstancePermissions,
usePropertyPermissions,
useStepPermissions,
useTypePermissions
boolean Enable or disable the given type permissions.
usePermissions boolean If set to false, disables all permissions checks for the type (and contents of this type)

Version:
$Rev: 2906 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at), Christopher Blasnik (c.blasnik@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Constructor Summary
GroovyTypeBuilder()
           
GroovyTypeBuilder(FxType type)
           
GroovyTypeBuilder(long typeId)
           
GroovyTypeBuilder(java.lang.String typeName)
           
 
Method Summary
protected  java.lang.Object createNode(java.lang.Object name)
           
protected  java.lang.Object createNode(java.lang.Object name, java.util.Map attributes)
           
protected  java.lang.Object createNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)
           
protected  java.lang.Object createNode(java.lang.Object name, java.lang.Object value)
           
protected  java.lang.Object postNodeCompletion(java.lang.Object parent, java.lang.Object node)
           
protected  void setParent(java.lang.Object parent, java.lang.Object child)
           
 
Methods inherited from class groovy.util.BuilderSupport
doInvokeMethod, getCurrent, getName, invokeMethod, invokeMethod, nodeCompleted, setClosureDelegate, setCurrent
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyTypeBuilder

public GroovyTypeBuilder()

GroovyTypeBuilder

public GroovyTypeBuilder(FxType type)

GroovyTypeBuilder

public GroovyTypeBuilder(java.lang.String typeName)

GroovyTypeBuilder

public GroovyTypeBuilder(long typeId)
Method Detail

postNodeCompletion

protected java.lang.Object postNodeCompletion(java.lang.Object parent,
                                              java.lang.Object node)
Overrides:
postNodeCompletion in class groovy.util.BuilderSupport

setParent

protected void setParent(java.lang.Object parent,
                         java.lang.Object child)
Specified by:
setParent in class groovy.util.BuilderSupport

createNode

protected java.lang.Object createNode(java.lang.Object name)
Specified by:
createNode in class groovy.util.BuilderSupport

createNode

protected java.lang.Object createNode(java.lang.Object name,
                                      java.lang.Object value)
Specified by:
createNode in class groovy.util.BuilderSupport

createNode

protected java.lang.Object createNode(java.lang.Object name,
                                      java.util.Map attributes)
Specified by:
createNode in class groovy.util.BuilderSupport

createNode

protected java.lang.Object createNode(java.lang.Object name,
                                      java.util.Map attributes,
                                      java.lang.Object value)
Specified by:
createNode in class groovy.util.BuilderSupport