Commit 2247b5bd by Chamath

WorkFlowTemplates service added.

parent bde271d9
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure9.0 [oneit.objstore.BusinessObjectTemplate.xsl]
* Vendor: Apache Software Foundation (Xalan XSLTC) (Version: 1.0)
*/
package performa.search;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import oneit.servlets.orm.*;
import performa.orm.*;
import performa.orm.types.*;
// __#BUILD_NO_TABLE_NAME#: No table name == No persistence manager and scripts required.
public abstract class BaseSearchWorkFlowTemplate extends SearchExecutor
{
// Reference instance for the object
public static final SearchWorkFlowTemplate REFERENCE_SearchWorkFlowTemplate = new SearchWorkFlowTemplate ();
// Reference instance for the object
public static final SearchWorkFlowTemplate DUMMY_SearchWorkFlowTemplate = new DummySearchWorkFlowTemplate ();
// Static constants corresponding to field names
public static final String FIELD_OnlyGlobalTemplates = "OnlyGlobalTemplates";
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<SearchWorkFlowTemplate> HELPER_OnlyGlobalTemplates = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private Boolean _OnlyGlobalTemplates;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_SearchWorkFlowTemplate = new LinkedHashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_OnlyGlobalTemplates_Validators;
// Arrays of AttributeDecorators for each attribute
private static final AttributeDecorator<SearchWorkFlowTemplate, Boolean>[] FIELD_OnlyGlobalTemplates_Decorators;
// Arrays of SingleAssocDecorators for each attribute
// Arrays of MultiAssocDecorators for each attribute
// Arrays of behaviour decorators
private static final SearchWorkFlowTemplateBehaviourDecorator[] SearchWorkFlowTemplate_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_OnlyGlobalTemplates_Validators = (AttributeValidator[])setupAttribMetaData_OnlyGlobalTemplates(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_OnlyGlobalTemplates_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_SearchWorkFlowTemplate, FIELD_OnlyGlobalTemplates).toArray (new AttributeDecorator[0]);
REFERENCE_SearchWorkFlowTemplate.initialiseReference ();
DUMMY_SearchWorkFlowTemplate.initialiseReference ();
SearchWorkFlowTemplate_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(SearchWorkFlowTemplate.class).toArray(new SearchWorkFlowTemplateBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
private static List setupAttribMetaData_OnlyGlobalTemplates(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("name", "OnlyGlobalTemplates");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SearchWorkFlowTemplate.OnlyGlobalTemplates:", metaInfo);
ATTRIBUTES_METADATA_SearchWorkFlowTemplate.put (FIELD_OnlyGlobalTemplates, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SearchWorkFlowTemplate.class, "OnlyGlobalTemplates", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SearchWorkFlowTemplate.OnlyGlobalTemplates:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseSearchWorkFlowTemplate ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return SearchWorkFlowTemplate_BehaviourDecorators;
}
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_OnlyGlobalTemplates = (Boolean)(HELPER_OnlyGlobalTemplates.initialise (_OnlyGlobalTemplates));
}
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Attribute OnlyGlobalTemplates
*/
public Boolean getOnlyGlobalTemplates ()
{
assertValid();
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_OnlyGlobalTemplates_Decorators, (SearchWorkFlowTemplate)this, FIELD_OnlyGlobalTemplates, _OnlyGlobalTemplates);
for (SearchWorkFlowTemplateBehaviourDecorator bhd : SearchWorkFlowTemplate_BehaviourDecorators)
{
valToReturn = bhd.getOnlyGlobalTemplates ((SearchWorkFlowTemplate)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preOnlyGlobalTemplatesChange (Boolean newOnlyGlobalTemplates) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postOnlyGlobalTemplatesChange () throws FieldException
{
}
public FieldWriteability getWriteability_OnlyGlobalTemplates ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute OnlyGlobalTemplates. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setOnlyGlobalTemplates (Boolean newOnlyGlobalTemplates) throws FieldException
{
newOnlyGlobalTemplates = AttributeDecoratorUtils.setValue (FIELD_OnlyGlobalTemplates_Decorators, (SearchWorkFlowTemplate)this, FIELD_OnlyGlobalTemplates, newOnlyGlobalTemplates);
boolean oldAndNewIdentical = HELPER_OnlyGlobalTemplates.compare (_OnlyGlobalTemplates, newOnlyGlobalTemplates);
try
{
for (SearchWorkFlowTemplateBehaviourDecorator bhd : SearchWorkFlowTemplate_BehaviourDecorators)
{
newOnlyGlobalTemplates = bhd.setOnlyGlobalTemplates ((SearchWorkFlowTemplate)this, newOnlyGlobalTemplates);
oldAndNewIdentical = HELPER_OnlyGlobalTemplates.compare (_OnlyGlobalTemplates, newOnlyGlobalTemplates);
}
if (FIELD_OnlyGlobalTemplates_Validators.length > 0)
{
Object newOnlyGlobalTemplatesObj = HELPER_OnlyGlobalTemplates.toObject (newOnlyGlobalTemplates);
if (newOnlyGlobalTemplatesObj != null)
{
int loopMax = FIELD_OnlyGlobalTemplates_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SearchWorkFlowTemplate.get (FIELD_OnlyGlobalTemplates);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_OnlyGlobalTemplates_Validators[v].checkAttribute (this, FIELD_OnlyGlobalTemplates, metadata, newOnlyGlobalTemplatesObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_OnlyGlobalTemplates_Decorators, (SearchWorkFlowTemplate)this, FIELD_OnlyGlobalTemplates ,getWriteability_OnlyGlobalTemplates ()) != FieldWriteability.FALSE, "Field OnlyGlobalTemplates is not writeable");
preOnlyGlobalTemplatesChange (newOnlyGlobalTemplates);
markFieldChange (FIELD_OnlyGlobalTemplates);
_OnlyGlobalTemplates = newOnlyGlobalTemplates;
postFieldChange (FIELD_OnlyGlobalTemplates);
postOnlyGlobalTemplatesChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public SearchWorkFlowTemplate newInstance ()
{
return new SearchWorkFlowTemplate ();
}
public SearchWorkFlowTemplate referenceInstance ()
{
return REFERENCE_SearchWorkFlowTemplate;
}
public SearchWorkFlowTemplate getInTransaction (ObjectTransaction t) throws StorageException
{
return getSearchWorkFlowTemplateByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_SearchWorkFlowTemplate;
}
public String getBaseSetName ()
{
return "";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet PSet = allSets.getPersistentSet (myID, "", myPSetStatus);
PSet.setAttrib (FIELD_ObjectID, myID);
PSet.setAttrib (FIELD_OnlyGlobalTemplates, HELPER_OnlyGlobalTemplates.toObject (_OnlyGlobalTemplates)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet PSet = allSets.getPersistentSet (objectID, "");
_OnlyGlobalTemplates = (Boolean)(HELPER_OnlyGlobalTemplates.fromObject (_OnlyGlobalTemplates, PSet.getAttrib (FIELD_OnlyGlobalTemplates))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof SearchWorkFlowTemplate)
{
SearchWorkFlowTemplate otherSearchWorkFlowTemplate = (SearchWorkFlowTemplate)other;
try
{
setOnlyGlobalTemplates (otherSearchWorkFlowTemplate.getOnlyGlobalTemplates ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseSearchWorkFlowTemplate)
{
BaseSearchWorkFlowTemplate sourceSearchWorkFlowTemplate = (BaseSearchWorkFlowTemplate)(source);
_OnlyGlobalTemplates = sourceSearchWorkFlowTemplate._OnlyGlobalTemplates;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseSearchWorkFlowTemplate)
{
BaseSearchWorkFlowTemplate sourceSearchWorkFlowTemplate = (BaseSearchWorkFlowTemplate)(source);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseSearchWorkFlowTemplate)
{
BaseSearchWorkFlowTemplate sourceSearchWorkFlowTemplate = (BaseSearchWorkFlowTemplate)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_OnlyGlobalTemplates = (Boolean)(HELPER_OnlyGlobalTemplates.readExternal (_OnlyGlobalTemplates, vals.get(FIELD_OnlyGlobalTemplates))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_OnlyGlobalTemplates, HELPER_OnlyGlobalTemplates.writeExternal (_OnlyGlobalTemplates));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseSearchWorkFlowTemplate)
{
BaseSearchWorkFlowTemplate otherSearchWorkFlowTemplate = (BaseSearchWorkFlowTemplate)(other);
if (!HELPER_OnlyGlobalTemplates.compare(this._OnlyGlobalTemplates, otherSearchWorkFlowTemplate._OnlyGlobalTemplates))
{
listener.notifyFieldChange(this, other, FIELD_OnlyGlobalTemplates, HELPER_OnlyGlobalTemplates.toObject(this._OnlyGlobalTemplates), HELPER_OnlyGlobalTemplates.toObject(otherSearchWorkFlowTemplate._OnlyGlobalTemplates));
}
// Compare single assocs
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_OnlyGlobalTemplates, HELPER_OnlyGlobalTemplates.toObject(getOnlyGlobalTemplates()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static SearchWorkFlowTemplate createSearchWorkFlowTemplate (ObjectTransaction transaction) throws StorageException
{
SearchWorkFlowTemplate result = new SearchWorkFlowTemplate ();
result.initialiseNewObject (transaction);
return result;
}
public static SearchWorkFlowTemplate getSearchWorkFlowTemplateByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (SearchWorkFlowTemplate)(transaction.getObjectByID (REFERENCE_SearchWorkFlowTemplate, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_OnlyGlobalTemplates))
{
return filter.matches (getOnlyGlobalTemplates ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_OnlyGlobalTemplates))
{
return HELPER_OnlyGlobalTemplates.toObject (getOnlyGlobalTemplates ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_OnlyGlobalTemplates))
{
return HELPER_OnlyGlobalTemplates;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_OnlyGlobalTemplates))
{
setOnlyGlobalTemplates ((Boolean)(HELPER_OnlyGlobalTemplates.fromObject (_OnlyGlobalTemplates, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public boolean isReadable ()
{
return super.isReadable();
}
public boolean isReadable (String fieldName)
{
return super.isReadable(fieldName);
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_OnlyGlobalTemplates))
{
return getWriteability_OnlyGlobalTemplates ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_OnlyGlobalTemplates () != FieldWriteability.TRUE)
{
fields.add (FIELD_OnlyGlobalTemplates);
}
super.putUnwriteable (fields);
}
// This generally means there's no specific persistence manager and we don't read or write from a table
public boolean hasNoTable()
{
return true;
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_OnlyGlobalTemplates.getAttribObject (getClass (), _OnlyGlobalTemplates, false, FIELD_OnlyGlobalTemplates));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_SearchWorkFlowTemplate.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_SearchWorkFlowTemplate.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_SearchWorkFlowTemplate.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_SearchWorkFlowTemplate.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void copyAllAttributeMetadata (Map copyInto)
{
super.copyAllAttributeMetadata(copyInto);
copyInto.putAll(ATTRIBUTES_METADATA_SearchWorkFlowTemplate);
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class SearchWorkFlowTemplateBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<SearchWorkFlowTemplate>
{
/**
* Get the attribute OnlyGlobalTemplates
*/
public Boolean getOnlyGlobalTemplates (SearchWorkFlowTemplate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute OnlyGlobalTemplates.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setOnlyGlobalTemplates (SearchWorkFlowTemplate obj, Boolean newOnlyGlobalTemplates) throws FieldException
{
return newOnlyGlobalTemplates;
}
}
@Override
public ORMPipeLine pipes()
{
return new SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate> ((SearchWorkFlowTemplate)this);
}
@Override
public ORMPipeLine pipes(Collection _items)
{
return pipesSearchWorkFlowTemplate(_items);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate> pipelineSearchWorkFlowTemplate()
{
return (SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate>) pipes();
}
public static SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate> pipesSearchWorkFlowTemplate(Collection<SearchWorkFlowTemplate> items)
{
return REFERENCE_SearchWorkFlowTemplate.new SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate> (items);
}
public static SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate> pipesSearchWorkFlowTemplate(SearchWorkFlowTemplate[] _items)
{
return pipesSearchWorkFlowTemplate(Arrays.asList (_items));
}
public static SearchWorkFlowTemplatePipeLineFactory<SearchWorkFlowTemplate, SearchWorkFlowTemplate> pipesSearchWorkFlowTemplate()
{
return pipesSearchWorkFlowTemplate((Collection)null);
}
public class SearchWorkFlowTemplatePipeLineFactory<From extends BaseBusinessClass, Me extends SearchWorkFlowTemplate> extends SearchExecutorPipeLineFactory<From, Me>
{
public <Prev> SearchWorkFlowTemplatePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public SearchWorkFlowTemplatePipeLineFactory (From seed)
{
super(seed);
}
public SearchWorkFlowTemplatePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("OnlyGlobalTemplates"))
{
return toOnlyGlobalTemplates ();
}
return super.to(name);
}
public PipeLine<From, Boolean> toOnlyGlobalTemplates () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_OnlyGlobalTemplates)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummySearchWorkFlowTemplate extends SearchWorkFlowTemplate
{
// Default constructor primarily to support Externalisable
public DummySearchWorkFlowTemplate()
{
super();
}
public void assertValid ()
{
}
}
package performa.search;
import oneit.objstore.*;
import oneit.objstore.rdbms.filters.*;
import performa.orm.*;
public class SearchWorkFlowTemplate extends BaseSearchWorkFlowTemplate
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public SearchWorkFlowTemplate ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public BaseBusinessClass[] doSearch()
{
BaseWorkFlowTemplate.SearchAll searchByAll = WorkFlowTemplate.SearchByAll();
if (isTrue(getOnlyGlobalTemplates()))
{
return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction());
}
return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>()).search(getTransaction());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="SearchWorkFlowTemplate" package="performa.search" superclass="SearchExecutor" >
<IMPORT value="oneit.servlets.orm.*" />
<IMPORT value="performa.orm.*"/>
<IMPORT value="performa.orm.types.*"/>
<TABLE tablePrefix="object" polymorphic="FALSE" >
<ATTRIB name="OnlyGlobalTemplates" type="Boolean" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
......@@ -76,6 +76,12 @@
<QueryType factory="String" name="All" value="performa.search.SearchMessageTemplate"/>
</NODE>
<NODE name="WorkFlowTemplates" factory="Participant" class="oneit.appservices.ws.services.ORMSearchJSONService" boClass="performa.orm.WorkFlowTemplate" privilege="*">
<Overview>This service returns all the Workflow Templates</Overview>
<QueryType factory="String" name="All" value="performa.search.SearchWorkFlowTemplate"/>
</NODE>
<NODE name="SaveMessageAsCopy" factory="Participant" class="performa.ws.SaveMessageAsCopy" privilege="*">
<INHERITS nodename="SaveWebService::.*" mandatory="false"/>
</NODE>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment