Commit 182efaa9 by Chamath

Added SearchJobApplication service.

parent ff0b1874
package performa.orm; package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import performa.orm.types.*;
import oneit.security.*;
public class Message extends BaseMessage public class Message extends BaseMessage
{ {
...@@ -26,6 +10,4 @@ public class Message extends BaseMessage ...@@ -26,6 +10,4 @@ public class Message extends BaseMessage
{ {
// Do not add any code to this, always put it in initialiseNewObject // Do not add any code to this, always put it in initialiseNewObject
} }
} }
\ No newline at end of file
/*
* 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 BaseSearchJobApplication extends SearchExecutor
{
// Reference instance for the object
public static final SearchJobApplication REFERENCE_SearchJobApplication = new SearchJobApplication ();
// Reference instance for the object
public static final SearchJobApplication DUMMY_SearchJobApplication = new DummySearchJobApplication ();
// Static constants corresponding to field names
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
// Private attributes corresponding to business object data
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_SearchJobApplication = new LinkedHashMap ();
// Arrays of validators for each attribute
// Arrays of AttributeDecorators for each attribute
// Arrays of SingleAssocDecorators for each attribute
// Arrays of MultiAssocDecorators for each attribute
// Arrays of behaviour decorators
private static final SearchJobApplicationBehaviourDecorator[] SearchJobApplication_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
REFERENCE_SearchJobApplication.initialiseReference ();
DUMMY_SearchJobApplication.initialiseReference ();
SearchJobApplication_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(SearchJobApplication.class).toArray(new SearchJobApplicationBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseSearchJobApplication ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return SearchJobApplication_BehaviourDecorators;
}
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
}
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* 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 SearchJobApplication newInstance ()
{
return new SearchJobApplication ();
}
public SearchJobApplication referenceInstance ()
{
return REFERENCE_SearchJobApplication;
}
public SearchJobApplication getInTransaction (ObjectTransaction t) throws StorageException
{
return getSearchJobApplicationByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_SearchJobApplication;
}
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);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet PSet = allSets.getPersistentSet (objectID, "");
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof SearchJobApplication)
{
SearchJobApplication otherSearchJobApplication = (SearchJobApplication)other;
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseSearchJobApplication)
{
BaseSearchJobApplication sourceSearchJobApplication = (BaseSearchJobApplication)(source);
}
}
/**
* 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 BaseSearchJobApplication)
{
BaseSearchJobApplication sourceSearchJobApplication = (BaseSearchJobApplication)(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 BaseSearchJobApplication)
{
BaseSearchJobApplication sourceSearchJobApplication = (BaseSearchJobApplication)(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);
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseSearchJobApplication)
{
BaseSearchJobApplication otherSearchJobApplication = (BaseSearchJobApplication)(other);
// 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);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static SearchJobApplication createSearchJobApplication (ObjectTransaction transaction) throws StorageException
{
SearchJobApplication result = new SearchJobApplication ();
result.initialiseNewObject (transaction);
return result;
}
public static SearchJobApplication getSearchJobApplicationByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (SearchJobApplication)(transaction.getObjectByID (REFERENCE_SearchJobApplication, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else
{
return super.testFilter (attribName, filter);
}
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
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
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
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 ();
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_SearchJobApplication.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_SearchJobApplication.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_SearchJobApplication.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_SearchJobApplication.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void copyAllAttributeMetadata (Map copyInto)
{
super.copyAllAttributeMetadata(copyInto);
copyInto.putAll(ATTRIBUTES_METADATA_SearchJobApplication);
}
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 SearchJobApplicationBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<SearchJobApplication>
{
}
@Override
public ORMPipeLine pipes()
{
return new SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication> ((SearchJobApplication)this);
}
@Override
public ORMPipeLine pipes(Collection _items)
{
return pipesSearchJobApplication(_items);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication> pipelineSearchJobApplication()
{
return (SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication>) pipes();
}
public static SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication> pipesSearchJobApplication(Collection<SearchJobApplication> items)
{
return REFERENCE_SearchJobApplication.new SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication> (items);
}
public static SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication> pipesSearchJobApplication(SearchJobApplication[] _items)
{
return pipesSearchJobApplication(Arrays.asList (_items));
}
public static SearchJobApplicationPipeLineFactory<SearchJobApplication, SearchJobApplication> pipesSearchJobApplication()
{
return pipesSearchJobApplication((Collection)null);
}
public class SearchJobApplicationPipeLineFactory<From extends BaseBusinessClass, Me extends SearchJobApplication> extends SearchExecutorPipeLineFactory<From, Me>
{
public <Prev> SearchJobApplicationPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public SearchJobApplicationPipeLineFactory (From seed)
{
super(seed);
}
public SearchJobApplicationPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
return super.to(name);
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummySearchJobApplication extends SearchJobApplication
{
// Default constructor primarily to support Externalisable
public DummySearchJobApplication()
{
super();
}
public void assertValid ()
{
}
}
package performa.search;
import oneit.objstore.BaseBusinessClass;
import performa.orm.JobApplication;
public class SearchJobApplication extends BaseSearchJobApplication
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public SearchJobApplication ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public BaseBusinessClass[] doSearch()
{
return JobApplication.SearchByAll().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="SearchJobApplication" package="performa.search" superclass="SearchExecutor" >
<IMPORT value="oneit.servlets.orm.*" />
<IMPORT value="performa.orm.*"/>
<IMPORT value="performa.orm.types.*"/>
<TABLE tablePrefix="object" polymorphic="FALSE" >
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -95,6 +95,12 @@ ...@@ -95,6 +95,12 @@
<Overview>This service will set all messages to read in given job application</Overview> <Overview>This service will set all messages to read in given job application</Overview>
</NODE> </NODE>
<NODE name="JobApplications" factory="Participant" class="oneit.appservices.ws.services.ORMSearchJSONService" boClass="performa.orm.JobApplication" privilege="*">
<Overview>This service returns all the Job Applications</Overview>
<QueryType factory="String" name="All" value="performa.search.SearchJobApplication"/>
</NODE>
<!-- Enum services --> <!-- Enum services -->
<NODE name="ResponseAction" factory="Participant" class="oneit.appservices.ws.services.EnumJSONService" enumClass="performa.orm.types.ResponseAction" privilege="*"/> <NODE name="ResponseAction" factory="Participant" class="oneit.appservices.ws.services.EnumJSONService" enumClass="performa.orm.types.ResponseAction" privilege="*"/>
<NODE name="StageType" factory="Participant" class="oneit.appservices.ws.services.EnumJSONService" enumClass="performa.orm.types.StageType" privilege="*"/> <NODE name="StageType" factory="Participant" class="oneit.appservices.ws.services.EnumJSONService" enumClass="performa.orm.types.StageType" privilege="*"/>
......
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