Commit 166b3e6a by nilu

list and edit notification screens

parent db8c7c5b
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_notification_template</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="notification_type" type="String" nullable="false" length="200"/>
<column name="days_after" type="Long" nullable="false"/>
<column name="notification_content" type="CLOB" nullable="false"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE tl_notification_template;
CREATE TABLE tl_notification_template (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
notification_type varchar(200) NOT NULL,
days_after numeric(12) NOT NULL,
notification_content text NOT NULL
);
ALTER TABLE tl_notification_template ADD
CONSTRAINT PK_tl_notification_template PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE tl_notification_template;
CREATE TABLE tl_notification_template (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
notification_type varchar2(200) NOT NULL,
days_after number(12) NOT NULL,
notification_content clob NOT NULL
);
ALTER TABLE tl_notification_template ADD
CONSTRAINT PK_tl_notification_template PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table tl_notification_template;
CREATE TABLE tl_notification_template (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
notification_type varchar(200) NOT NULL,
days_after numeric(12) NOT NULL,
notification_content text NOT NULL
);
ALTER TABLE tl_notification_template ADD
CONSTRAINT pk_tl_notification_template PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
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 performa.orm.types.*;
import performa.orm.*;
public abstract class BaseNotificationTemplate extends BaseBusinessClass
{
// Reference instance for the object
public static final NotificationTemplate REFERENCE_NotificationTemplate = new NotificationTemplate ();
// Reference instance for the object
public static final NotificationTemplate DUMMY_NotificationTemplate = new DummyNotificationTemplate ();
// Static constants corresponding to field names
public static final String FIELD_NotificationType = "NotificationType";
public static final String FIELD_DaysAfter = "DaysAfter";
public static final String FIELD_NotificationContent = "NotificationContent";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final EnumeratedAttributeHelper<NotificationTemplate, NotificationType> HELPER_NotificationType = new EnumeratedAttributeHelper<NotificationTemplate, NotificationType> (NotificationType.FACTORY_NotificationType);
private static final DefaultAttributeHelper<NotificationTemplate> HELPER_DaysAfter = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<NotificationTemplate> HELPER_NotificationContent = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private NotificationType _NotificationType;
private Integer _DaysAfter;
private String _NotificationContent;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_NotificationTemplate = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_NotificationType_Validators;
private static final AttributeValidator[] FIELD_DaysAfter_Validators;
private static final AttributeValidator[] FIELD_NotificationContent_Validators;
// Arrays of behaviour decorators
private static final NotificationTemplateBehaviourDecorator[] NotificationTemplate_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_NotificationType_Validators = (AttributeValidator[])setupAttribMetaData_NotificationType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_DaysAfter_Validators = (AttributeValidator[])setupAttribMetaData_DaysAfter(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_NotificationContent_Validators = (AttributeValidator[])setupAttribMetaData_NotificationContent(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_NotificationTemplate.initialiseReference ();
DUMMY_NotificationTemplate.initialiseReference ();
NotificationTemplate_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(NotificationTemplate.class).toArray(new NotificationTemplateBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static List setupAttribMetaData_NotificationType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "notification_type");
metaInfo.put ("defaultValue", "NotificationType.TRIAL");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "NotificationType");
metaInfo.put ("type", "NotificationType");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for NotificationTemplate.NotificationType:", metaInfo);
ATTRIBUTES_METADATA_NotificationTemplate.put (FIELD_NotificationType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(NotificationTemplate.class, "NotificationType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for NotificationTemplate.NotificationType:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_DaysAfter(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "days_after");
metaInfo.put ("defaultValue", "0");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "DaysAfter");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for NotificationTemplate.DaysAfter:", metaInfo);
ATTRIBUTES_METADATA_NotificationTemplate.put (FIELD_DaysAfter, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(NotificationTemplate.class, "DaysAfter", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for NotificationTemplate.DaysAfter:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_NotificationContent(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "notification_content");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "NotificationContent");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for NotificationTemplate.NotificationContent:", metaInfo);
ATTRIBUTES_METADATA_NotificationTemplate.put (FIELD_NotificationContent, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(NotificationTemplate.class, "NotificationContent", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for NotificationTemplate.NotificationContent:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseNotificationTemplate ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return NotificationTemplate_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_NotificationType = (NotificationType)(NotificationType.TRIAL);
_DaysAfter = (Integer)(0);
_NotificationContent = (String)(HELPER_NotificationContent.initialise (_NotificationContent));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Get the attribute NotificationType
*/
public NotificationType getNotificationType ()
{
assertValid();
NotificationType valToReturn = _NotificationType;
for (NotificationTemplateBehaviourDecorator bhd : NotificationTemplate_BehaviourDecorators)
{
valToReturn = bhd.getNotificationType ((NotificationTemplate)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 preNotificationTypeChange (NotificationType newNotificationType) 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 postNotificationTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_NotificationType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute NotificationType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setNotificationType (NotificationType newNotificationType) throws FieldException
{
boolean oldAndNewIdentical = HELPER_NotificationType.compare (_NotificationType, newNotificationType);
try
{
for (NotificationTemplateBehaviourDecorator bhd : NotificationTemplate_BehaviourDecorators)
{
newNotificationType = bhd.setNotificationType ((NotificationTemplate)this, newNotificationType);
oldAndNewIdentical = HELPER_NotificationType.compare (_NotificationType, newNotificationType);
}
BusinessObjectParser.assertFieldCondition (newNotificationType != null, this, FIELD_NotificationType, "mandatory");
if (FIELD_NotificationType_Validators.length > 0)
{
Object newNotificationTypeObj = HELPER_NotificationType.toObject (newNotificationType);
if (newNotificationTypeObj != null)
{
int loopMax = FIELD_NotificationType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_NotificationTemplate.get (FIELD_NotificationType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_NotificationType_Validators[v].checkAttribute (this, FIELD_NotificationType, metadata, newNotificationTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_NotificationType () != FieldWriteability.FALSE, "Field NotificationType is not writeable");
preNotificationTypeChange (newNotificationType);
markFieldChange (FIELD_NotificationType);
_NotificationType = newNotificationType;
postFieldChange (FIELD_NotificationType);
postNotificationTypeChange ();
}
}
/**
* Get the attribute DaysAfter
*/
public Integer getDaysAfter ()
{
assertValid();
Integer valToReturn = _DaysAfter;
for (NotificationTemplateBehaviourDecorator bhd : NotificationTemplate_BehaviourDecorators)
{
valToReturn = bhd.getDaysAfter ((NotificationTemplate)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 preDaysAfterChange (Integer newDaysAfter) 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 postDaysAfterChange () throws FieldException
{
}
public FieldWriteability getWriteability_DaysAfter ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute DaysAfter. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setDaysAfter (Integer newDaysAfter) throws FieldException
{
boolean oldAndNewIdentical = HELPER_DaysAfter.compare (_DaysAfter, newDaysAfter);
try
{
for (NotificationTemplateBehaviourDecorator bhd : NotificationTemplate_BehaviourDecorators)
{
newDaysAfter = bhd.setDaysAfter ((NotificationTemplate)this, newDaysAfter);
oldAndNewIdentical = HELPER_DaysAfter.compare (_DaysAfter, newDaysAfter);
}
BusinessObjectParser.assertFieldCondition (newDaysAfter != null, this, FIELD_DaysAfter, "mandatory");
if (FIELD_DaysAfter_Validators.length > 0)
{
Object newDaysAfterObj = HELPER_DaysAfter.toObject (newDaysAfter);
if (newDaysAfterObj != null)
{
int loopMax = FIELD_DaysAfter_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_NotificationTemplate.get (FIELD_DaysAfter);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_DaysAfter_Validators[v].checkAttribute (this, FIELD_DaysAfter, metadata, newDaysAfterObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_DaysAfter () != FieldWriteability.FALSE, "Field DaysAfter is not writeable");
preDaysAfterChange (newDaysAfter);
markFieldChange (FIELD_DaysAfter);
_DaysAfter = newDaysAfter;
postFieldChange (FIELD_DaysAfter);
postDaysAfterChange ();
}
}
/**
* Get the attribute NotificationContent
*/
public String getNotificationContent ()
{
assertValid();
String valToReturn = _NotificationContent;
for (NotificationTemplateBehaviourDecorator bhd : NotificationTemplate_BehaviourDecorators)
{
valToReturn = bhd.getNotificationContent ((NotificationTemplate)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 preNotificationContentChange (String newNotificationContent) 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 postNotificationContentChange () throws FieldException
{
}
public FieldWriteability getWriteability_NotificationContent ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute NotificationContent. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setNotificationContent (String newNotificationContent) throws FieldException
{
boolean oldAndNewIdentical = HELPER_NotificationContent.compare (_NotificationContent, newNotificationContent);
try
{
for (NotificationTemplateBehaviourDecorator bhd : NotificationTemplate_BehaviourDecorators)
{
newNotificationContent = bhd.setNotificationContent ((NotificationTemplate)this, newNotificationContent);
oldAndNewIdentical = HELPER_NotificationContent.compare (_NotificationContent, newNotificationContent);
}
BusinessObjectParser.assertFieldCondition (newNotificationContent != null, this, FIELD_NotificationContent, "mandatory");
if (FIELD_NotificationContent_Validators.length > 0)
{
Object newNotificationContentObj = HELPER_NotificationContent.toObject (newNotificationContent);
if (newNotificationContentObj != null)
{
int loopMax = FIELD_NotificationContent_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_NotificationTemplate.get (FIELD_NotificationContent);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_NotificationContent_Validators[v].checkAttribute (this, FIELD_NotificationContent, metadata, newNotificationContentObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_NotificationContent () != FieldWriteability.FALSE, "Field NotificationContent is not writeable");
preNotificationContentChange (newNotificationContent);
markFieldChange (FIELD_NotificationContent);
_NotificationContent = newNotificationContent;
postFieldChange (FIELD_NotificationContent);
postNotificationContentChange ();
}
}
/**
* 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 NotificationTemplate newInstance ()
{
return new NotificationTemplate ();
}
public NotificationTemplate referenceInstance ()
{
return REFERENCE_NotificationTemplate;
}
public NotificationTemplate getInTransaction (ObjectTransaction t) throws StorageException
{
return getNotificationTemplateByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_NotificationTemplate;
}
public String getBaseSetName ()
{
return "tl_notification_template";
}
/**
* 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 tl_notification_templatePSet = allSets.getPersistentSet (myID, "tl_notification_template", myPSetStatus);
tl_notification_templatePSet.setAttrib (FIELD_ObjectID, myID);
tl_notification_templatePSet.setAttrib (FIELD_NotificationType, HELPER_NotificationType.toObject (_NotificationType)); //
tl_notification_templatePSet.setAttrib (FIELD_DaysAfter, HELPER_DaysAfter.toObject (_DaysAfter)); //
tl_notification_templatePSet.setAttrib (FIELD_NotificationContent, HELPER_NotificationContent.toObject (_NotificationContent)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_notification_templatePSet = allSets.getPersistentSet (objectID, "tl_notification_template");
_NotificationType = (NotificationType)(HELPER_NotificationType.fromObject (_NotificationType, tl_notification_templatePSet.getAttrib (FIELD_NotificationType))); //
_DaysAfter = (Integer)(HELPER_DaysAfter.fromObject (_DaysAfter, tl_notification_templatePSet.getAttrib (FIELD_DaysAfter))); //
_NotificationContent = (String)(HELPER_NotificationContent.fromObject (_NotificationContent, tl_notification_templatePSet.getAttrib (FIELD_NotificationContent))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof NotificationTemplate)
{
NotificationTemplate otherNotificationTemplate = (NotificationTemplate)other;
try
{
setNotificationType (otherNotificationTemplate.getNotificationType ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setDaysAfter (otherNotificationTemplate.getDaysAfter ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setNotificationContent (otherNotificationTemplate.getNotificationContent ());
}
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 BaseNotificationTemplate)
{
BaseNotificationTemplate sourceNotificationTemplate = (BaseNotificationTemplate)(source);
_NotificationType = sourceNotificationTemplate._NotificationType;
_DaysAfter = sourceNotificationTemplate._DaysAfter;
_NotificationContent = sourceNotificationTemplate._NotificationContent;
}
}
/**
* 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 BaseNotificationTemplate)
{
BaseNotificationTemplate sourceNotificationTemplate = (BaseNotificationTemplate)(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 BaseNotificationTemplate)
{
BaseNotificationTemplate sourceNotificationTemplate = (BaseNotificationTemplate)(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);
_NotificationType = (NotificationType)(HELPER_NotificationType.readExternal (_NotificationType, vals.get(FIELD_NotificationType))); //
_DaysAfter = (Integer)(HELPER_DaysAfter.readExternal (_DaysAfter, vals.get(FIELD_DaysAfter))); //
_NotificationContent = (String)(HELPER_NotificationContent.readExternal (_NotificationContent, vals.get(FIELD_NotificationContent))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_NotificationType, HELPER_NotificationType.writeExternal (_NotificationType));
vals.put (FIELD_DaysAfter, HELPER_DaysAfter.writeExternal (_DaysAfter));
vals.put (FIELD_NotificationContent, HELPER_NotificationContent.writeExternal (_NotificationContent));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseNotificationTemplate)
{
BaseNotificationTemplate otherNotificationTemplate = (BaseNotificationTemplate)(other);
if (!HELPER_NotificationType.compare(this._NotificationType, otherNotificationTemplate._NotificationType))
{
listener.notifyFieldChange(this, other, FIELD_NotificationType, HELPER_NotificationType.toObject(this._NotificationType), HELPER_NotificationType.toObject(otherNotificationTemplate._NotificationType));
}
if (!HELPER_DaysAfter.compare(this._DaysAfter, otherNotificationTemplate._DaysAfter))
{
listener.notifyFieldChange(this, other, FIELD_DaysAfter, HELPER_DaysAfter.toObject(this._DaysAfter), HELPER_DaysAfter.toObject(otherNotificationTemplate._DaysAfter));
}
if (!HELPER_NotificationContent.compare(this._NotificationContent, otherNotificationTemplate._NotificationContent))
{
listener.notifyFieldChange(this, other, FIELD_NotificationContent, HELPER_NotificationContent.toObject(this._NotificationContent), HELPER_NotificationContent.toObject(otherNotificationTemplate._NotificationContent));
}
// 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_NotificationType, HELPER_NotificationType.toObject(getNotificationType()));
visitor.visitField(this, FIELD_DaysAfter, HELPER_DaysAfter.toObject(getDaysAfter()));
visitor.visitField(this, FIELD_NotificationContent, HELPER_NotificationContent.toObject(getNotificationContent()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static NotificationTemplate createNotificationTemplate (ObjectTransaction transaction) throws StorageException
{
NotificationTemplate result = new NotificationTemplate ();
result.initialiseNewObject (transaction);
return result;
}
public static NotificationTemplate getNotificationTemplateByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (NotificationTemplate)(transaction.getObjectByID (REFERENCE_NotificationTemplate, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_NotificationType))
{
return filter.matches (getNotificationType ());
}
else if (attribName.equals (FIELD_DaysAfter))
{
return filter.matches (getDaysAfter ());
}
else if (attribName.equals (FIELD_NotificationContent))
{
return filter.matches (getNotificationContent ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<NotificationTemplate>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_notification_template.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_notification_template.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_notification_template.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andNotificationType (QueryFilter<NotificationType> filter)
{
filter.addFilter (context, "tl_notification_template.notification_type", "NotificationType");
return this;
}
public SearchAll andDaysAfter (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_notification_template.days_after", "DaysAfter");
return this;
}
public SearchAll andNotificationContent (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_notification_template.notification_content", "NotificationContent");
return this;
}
public NotificationTemplate[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_NotificationTemplate, SEARCH_All, criteria);
Set<NotificationTemplate> typedResults = new LinkedHashSet <NotificationTemplate> ();
for (BaseBusinessClass bbcResult : results)
{
NotificationTemplate aResult = (NotificationTemplate)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new NotificationTemplate[0]);
}
}
public static NotificationTemplate[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_NotificationType))
{
return HELPER_NotificationType.toObject (getNotificationType ());
}
else if (attribName.equals (FIELD_DaysAfter))
{
return HELPER_DaysAfter.toObject (getDaysAfter ());
}
else if (attribName.equals (FIELD_NotificationContent))
{
return HELPER_NotificationContent.toObject (getNotificationContent ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_NotificationType))
{
return HELPER_NotificationType;
}
else if (attribName.equals (FIELD_DaysAfter))
{
return HELPER_DaysAfter;
}
else if (attribName.equals (FIELD_NotificationContent))
{
return HELPER_NotificationContent;
}
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_NotificationType))
{
setNotificationType ((NotificationType)(HELPER_NotificationType.fromObject (_NotificationType, attribValue)));
}
else if (attribName.equals (FIELD_DaysAfter))
{
setDaysAfter ((Integer)(HELPER_DaysAfter.fromObject (_DaysAfter, attribValue)));
}
else if (attribName.equals (FIELD_NotificationContent))
{
setNotificationContent ((String)(HELPER_NotificationContent.fromObject (_NotificationContent, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_NotificationType))
{
return getWriteability_NotificationType ();
}
else if (fieldName.equals (FIELD_DaysAfter))
{
return getWriteability_DaysAfter ();
}
else if (fieldName.equals (FIELD_NotificationContent))
{
return getWriteability_NotificationContent ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_NotificationType () != FieldWriteability.TRUE)
{
fields.add (FIELD_NotificationType);
}
if (getWriteability_DaysAfter () != FieldWriteability.TRUE)
{
fields.add (FIELD_DaysAfter);
}
if (getWriteability_NotificationContent () != FieldWriteability.TRUE)
{
fields.add (FIELD_NotificationContent);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_NotificationType.getAttribObject (getClass (), _NotificationType, true, FIELD_NotificationType));
result.add(HELPER_DaysAfter.getAttribObject (getClass (), _DaysAfter, true, FIELD_DaysAfter));
result.add(HELPER_NotificationContent.getAttribObject (getClass (), _NotificationContent, true, FIELD_NotificationContent));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_NotificationTemplate.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_NotificationTemplate.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_NotificationTemplate.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_NotificationTemplate.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
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 NotificationTemplateBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<NotificationTemplate>
{
/**
* Get the attribute NotificationType
*/
public NotificationType getNotificationType (NotificationTemplate obj, NotificationType original)
{
return original;
}
/**
* Change the value set for attribute NotificationType.
* May modify the field beforehand
* Occurs before validation.
*/
public NotificationType setNotificationType (NotificationTemplate obj, NotificationType newNotificationType) throws FieldException
{
return newNotificationType;
}
/**
* Get the attribute DaysAfter
*/
public Integer getDaysAfter (NotificationTemplate obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute DaysAfter.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setDaysAfter (NotificationTemplate obj, Integer newDaysAfter) throws FieldException
{
return newDaysAfter;
}
/**
* Get the attribute NotificationContent
*/
public String getNotificationContent (NotificationTemplate obj, String original)
{
return original;
}
/**
* Change the value set for attribute NotificationContent.
* May modify the field beforehand
* Occurs before validation.
*/
public String setNotificationContent (NotificationTemplate obj, String newNotificationContent) throws FieldException
{
return newNotificationContent;
}
}
public ORMPipeLine pipes()
{
return new NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate> ((NotificationTemplate)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate> pipelineNotificationTemplate()
{
return (NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate>) pipes();
}
public static NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate> pipesNotificationTemplate(Collection<NotificationTemplate> items)
{
return REFERENCE_NotificationTemplate.new NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate> (items);
}
public static NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate> pipesNotificationTemplate(NotificationTemplate[] _items)
{
return pipesNotificationTemplate(Arrays.asList (_items));
}
public static NotificationTemplatePipeLineFactory<NotificationTemplate, NotificationTemplate> pipesNotificationTemplate()
{
return pipesNotificationTemplate((Collection)null);
}
public class NotificationTemplatePipeLineFactory<From extends BaseBusinessClass, Me extends NotificationTemplate> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> NotificationTemplatePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public NotificationTemplatePipeLineFactory (From seed)
{
super(seed);
}
public NotificationTemplatePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("NotificationType"))
{
return toNotificationType ();
}
if (name.equals ("DaysAfter"))
{
return toDaysAfter ();
}
if (name.equals ("NotificationContent"))
{
return toNotificationContent ();
}
return super.to(name);
}
public PipeLine<From, NotificationType> toNotificationType () { return pipe(new ORMAttributePipe<Me, NotificationType>(FIELD_NotificationType)); }
public PipeLine<From, Integer> toDaysAfter () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_DaysAfter)); }
public PipeLine<From, String> toNotificationContent () { return pipe(new ORMAttributePipe<Me, String>(FIELD_NotificationContent)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyNotificationTemplate extends NotificationTemplate
{
// Default constructor primarily to support Externalisable
public DummyNotificationTemplate()
{
super();
}
public void assertValid ()
{
}
}
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 performa.orm.*;
public class NotificationTemplate extends BaseNotificationTemplate
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public NotificationTemplate ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<BUSINESSCLASS name="NotificationTemplate" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="performa.orm.*"/>
<TABLE name="tl_notification_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="NotificationType" type="NotificationType" dbcol="notification_type" mandatory="true" defaultValue="NotificationType.TRIAL" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="DaysAfter" type="Integer" dbcol="days_after" mandatory="true" defaultValue="0" />
<ATTRIB name="NotificationContent" type="String" dbcol="notification_content" mandatory="true" />
</TABLE>
<SEARCH type="All" paramFilter="tl_notification_template.object_id is not null" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
import performa.orm.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class NotificationTemplatePersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea NotificationTemplatePersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "NotificationTemplate");
// Private attributes corresponding to business object data
private NotificationType dummyNotificationType;
private Integer dummyDaysAfter;
private String dummyNotificationContent;
// Static constants corresponding to attribute helpers
private static final EnumeratedAttributeHelper HELPER_NotificationType = new EnumeratedAttributeHelper (NotificationType.FACTORY_NotificationType);
private static final DefaultAttributeHelper HELPER_DaysAfter = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_NotificationContent = DefaultAttributeHelper.INSTANCE;
public NotificationTemplatePersistenceMgr ()
{
dummyNotificationType = (NotificationType)(HELPER_NotificationType.initialise (dummyNotificationType));
dummyDaysAfter = (Integer)(HELPER_DaysAfter.initialise (dummyDaysAfter));
dummyNotificationContent = (String)(HELPER_NotificationContent.initialise (dummyNotificationContent));
}
private String SELECT_COLUMNS = "{PREFIX}tl_notification_template.object_id as id, {PREFIX}tl_notification_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_notification_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_notification_template.notification_type, {PREFIX}tl_notification_template.days_after, {PREFIX}tl_notification_template.notification_content, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, NotificationTemplate.REFERENCE_NotificationTemplate);
if (objectToReturn instanceof NotificationTemplate)
{
LogMgr.log (NotificationTemplatePersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a NotificationTemplate");
}
}
PersistentSet tl_notification_templatePSet = allPSets.getPersistentSet(id, "tl_notification_template", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_notification_templatePSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_notification_templatePSet.containsAttrib(NotificationTemplate.FIELD_NotificationType)||
!tl_notification_templatePSet.containsAttrib(NotificationTemplate.FIELD_DaysAfter)||
!tl_notification_templatePSet.containsAttrib(NotificationTemplate.FIELD_NotificationContent))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (NotificationTemplatePersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
NotificationTemplate result = new NotificationTemplate ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_notification_template " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_notification_template.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_notification_templatePSet = allPSets.getPersistentSet(objectID, "tl_notification_template");
if (tl_notification_templatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_notification_templatePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_notification_template " +
"SET notification_type = ?, days_after = ?, notification_content = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_notification_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_NotificationType.getForSQL(dummyNotificationType, tl_notification_templatePSet.getAttrib (NotificationTemplate.FIELD_NotificationType))).listEntry (HELPER_DaysAfter.getForSQL(dummyDaysAfter, tl_notification_templatePSet.getAttrib (NotificationTemplate.FIELD_DaysAfter))).listEntry (HELPER_NotificationContent.getForSQL(dummyNotificationContent, tl_notification_templatePSet.getAttrib (NotificationTemplate.FIELD_NotificationContent))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_notification_template WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_notification_template", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (NotificationTemplatePersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_notification_template");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_notification_template for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (NotificationTemplatePersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_notification_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (NotificationTemplatePersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_notification_templatePSet = allPSets.getPersistentSet(objectID, "tl_notification_template");
LogMgr.log (NotificationTemplatePersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_notification_templatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_notification_templatePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_notification_template " +
"WHERE tl_notification_template.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_notification_template WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_notification_template");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_notification_template for row:" + objectID;
LogMgr.log (NotificationTemplatePersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_notification_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, NotificationTemplate> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (NotificationTemplate.REFERENCE_NotificationTemplate.getObjectIDSpace (), r.getLong ("id"));
NotificationTemplate resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, NotificationTemplate.REFERENCE_NotificationTemplate);
if (cachedElement instanceof NotificationTemplate)
{
LogMgr.log (NotificationTemplatePersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (NotificationTemplate)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a NotificationTemplate");
}
}
else
{
PersistentSet tl_notification_templatePSet = allPSets.getPersistentSet(objectID, "tl_notification_template", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new NotificationTemplate ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (NotificationTemplatePersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_notification_template " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (NotificationTemplate.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_notification_template.object_id is not null
String preFilter = "(tl_notification_template.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_notification_template " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_notification_templatePSet = allPSets.getPersistentSet(objectID, "tl_notification_template", PersistentSetStatus.FETCHED);
// Object Modified
tl_notification_templatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_notification_templatePSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_notification_templatePSet.setAttrib(NotificationTemplate.FIELD_NotificationType, HELPER_NotificationType.getFromRS(dummyNotificationType, r, "notification_type"));
tl_notification_templatePSet.setAttrib(NotificationTemplate.FIELD_DaysAfter, HELPER_DaysAfter.getFromRS(dummyDaysAfter, r, "days_after"));
tl_notification_templatePSet.setAttrib(NotificationTemplate.FIELD_NotificationContent, HELPER_NotificationContent.getFromRS(dummyNotificationContent, r, "notification_content"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_notification_templatePSet = allPSets.getPersistentSet(objectID, "tl_notification_template");
if (tl_notification_templatePSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_notification_templatePSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_notification_template " +
" (notification_type, days_after, notification_content, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_NotificationType.getForSQL(dummyNotificationType, tl_notification_templatePSet.getAttrib (NotificationTemplate.FIELD_NotificationType))).listEntry (HELPER_DaysAfter.getForSQL(dummyDaysAfter, tl_notification_templatePSet.getAttrib (NotificationTemplate.FIELD_DaysAfter))).listEntry (HELPER_NotificationContent.getForSQL(dummyNotificationContent, tl_notification_templatePSet.getAttrib (NotificationTemplate.FIELD_NotificationContent))) .listEntry (objectID.longID ()).toList().toArray());
tl_notification_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class NotificationType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_NotificationType = new NotificationTypeFactory();
public static final NotificationType CLOSED_JOB = new NotificationType ("CLOSED_JOB", "CLOSED_JOB", "Closed Job", false);
public static final NotificationType TRIAL = new NotificationType ("TRIAL", "TRIAL", "Trial", false);
private static final NotificationType[] allNotificationTypes =
new NotificationType[] { CLOSED_JOB,TRIAL};
private static NotificationType[] getAllNotificationTypes ()
{
return allNotificationTypes;
}
private NotificationType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allNotificationTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (NotificationType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return NotificationType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return NotificationType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_NotificationType;
}
public static NotificationType forName (String name)
{
if (name == null) { return null; }
NotificationType[] all = getAllNotificationTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static NotificationType forValue (String value)
{
if (value == null) { return null; }
NotificationType[] all = getAllNotificationTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllNotificationTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllNotificationTypes());
}
public static NotificationType[] getNotificationTypeArray ()
{
return (NotificationType[])getAllNotificationTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class NotificationTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return NotificationType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return NotificationType.forValue (name);
}
public Enumeration getAll ()
{
return NotificationType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="NotificationType">
<VALUE name="CLOSED_JOB" value="CLOSED_JOB" description="Closed Job"/>
<VALUE name="TRIAL" value="TRIAL" description="Trial" />
</CONSTANT>
</ROOT>
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
<INHERITS factory="Named" nodename="CoreORMAdmin"/> <INHERITS factory="Named" nodename="CoreORMAdmin"/>
</NODE> </NODE>
<NODE name="editNotificationTemplate_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
</NODE>
<NODE name="listNotificationTemplates_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
</NODE>
<NODE name="test_imap_jsp" factory="Participant"> <NODE name="test_imap_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/> <INHERITS factory="Named" nodename="CoreORMAdmin"/>
<FORM name="*.runEmailFetcher" factory="Participant" class="performa.form.RunEmailFetcherFP"/> <FORM name="*.runEmailFetcher" factory="Participant" class="performa.form.RunEmailFetcherFP"/>
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
<!-- <TOPMENU name="MENU.TEST_ANALYSIS" desc="Test Analysis" sortOrder="100" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" <!-- <TOPMENU name="MENU.TEST_ANALYSIS" desc="Test Analysis" sortOrder="100" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element"
link="/extensions/performa/testAnalysis.jsp"/> --> link="/extensions/performa/testAnalysis.jsp"/> -->
<CHILD name="Performa.SetupPlans" desc="Setup Plans" sortOrder="10" toplevel="ADMIN" priv="admin" link="/extensions/performa/setupPlans.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" /> <CHILD name="Performa.SetupPlans" desc="Setup Plans" sortOrder="10" toplevel="ADMIN" priv="admin" link="/extensions/performa/setupPlans.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
<CHILD name="Performa.MessageTemplate" desc="Message Template" sortOrder="20" toplevel="ADMIN" priv="admin" link="/extensions/performa/listMessageTemplate.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" /> <CHILD name="Performa.MessageTemplate" desc="Message Template" sortOrder="20" toplevel="ADMIN" priv="admin" link="/extensions/performa/listMessageTemplate.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
<CHILD name="Performa.NotificationTemplate" desc="Notification Template" sortOrder="30" toplevel="ADMIN" priv="admin" link="/extensions/performa/listNotificationTemplates.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
</NODE> </NODE>
</NODE> </NODE>
......
...@@ -18,11 +18,6 @@ ...@@ -18,11 +18,6 @@
%><%@include file="/saferedirect.jsp"%><% %><%@include file="/saferedirect.jsp"%><%
} }
if (toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
Debug.assertion(messageTemplate != null, "MessageTemplate is null in Edit Message Template", "404"); Debug.assertion(messageTemplate != null, "MessageTemplate is null in Edit Message Template", "404");
String continuePage = "editMessageTemplate.jsp?MessageTemplateID=" + messageTemplate.getObjectID(); String continuePage = "editMessageTemplate.jsp?MessageTemplateID=" + messageTemplate.getObjectID();
......
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="inc/stdimports.jsp" %>
<%@ include file="/editor/stdimports.jsp" %>
<%@ page import="oneit.business.content.editor.gui.*" %>
<%! protected String getName (ServletConfig config) { return "editNotificationTemplate_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "NotificationTemplate", NotificationTemplate.REFERENCE_NotificationTemplate);
NotificationTemplate notificationTemplate = (NotificationTemplate) process.getAttribute("NotificationTemplate");
if (toRedirect)
{
%><%@include file="/saferedirect.jsp"%><%
}
Debug.assertion(notificationTemplate != null, "NotificationTemplate is null in Edit Notification Template", "404");
String continuePage = "editNotificationTemplate.jsp?NotificationTemplateID=" + notificationTemplate.getObjectID();
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "NotificationTemplate").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "Notification Template");
%>
<%@include file="/editor/header.jsp" %>
<oneit:layout_total widths="<%= new double[] {2, 6, 4} %>" skin="bootstrap">
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= notificationTemplate %>" field="DaysAfter"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= notificationTemplate %>" attributeName="DaysAfter"/>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= notificationTemplate %>" field="NotificationContent"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<tagfile:htmleditor obj="<%= notificationTemplate %>" attribName="NotificationContent" id="texteditor"
toolbarSet="<%= EditorGUIOptions.Default %>"/>
</oneit:layout_field>
</oneit:skin>
</oneit:layout_total>
<div class="bottomButtons" hidden="true">
<oneit:button value="Save" name="save" cssClass="BUTTON_PRIMARY"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "listNotificationTemplates.jsp").toMap() %>"/>
<oneit:button value="Cancel" name="cancel" cssClass="BUTTON_SECONDARY" showIfReadOnly="true"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "listNotificationTemplates.jsp")
.mapEntry (UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
</div>
<%@include file="/editor/footer.jsp" %>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="inc/stdimports.jsp" %>
<%@ include file="/editor/stdimports.jsp" %>
<%@ page import="oneit.utils.filter.CollectionFilter"%>
<%! protected String getName (ServletConfig config) { return "listNotificationTemplates_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
NotificationTemplate[] notificationTemplates = NotificationTemplate.SearchByAll().search(objTran);
process.setAttribute ("NotificationTemplates", notificationTemplates);
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "listNotificationTemplate").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "List Notification Template");
%>
<%@include file="/editor/header.jsp" %>
<style>
.tbl-width{width:50%}
</style>
<%
if (notificationTemplates != null && notificationTemplates.length > 0)
{
List<NotificationTemplate> closedJob = (List<NotificationTemplate>) CollectionFilter.filter(Arrays.asList(notificationTemplates), NotificationTemplate.SearchByAll().andNotificationType(new EqualsFilter<>(NotificationType.CLOSED_JOB)));
if(closedJob != null && !closedJob.isEmpty())
{
%>
<oneit:skin tagName="layout_fieldset" legend="Closed Job Notification Settings">
<oneit:skin tagName="layout_search_results">
<oneit:table name="NotificationTemplateTable" sortable="true" cssClass="cougartable tbl-width" notgrid="true">
<oneit:colheader label="Days After" width="16" />
<oneit:colheader label="Notification Content" width="80" />
<oneit:colheader label="" width="4" cssClass="nosort nofilter" />
<%
for (NotificationTemplate notTemp : closedJob)
{
%>
<oneit:row rowObj="<%= notTemp %>">
<oneit:col><oneit:toString value="<%= notTemp.getDaysAfter() %>" mode="Integer" /></oneit:col>
<oneit:col><oneit:toString value="<%= notTemp.getNotificationContent() %>" mode="TidyHTML" /></oneit:col>
<oneit:col><a class="data-link " href="editNotificationTemplate.jsp?NotificationTemplateID=<%= notTemp.getObjectID() %>">>></a></oneit:col>
</oneit:row>
<%
}
%>
</oneit:table>
</oneit:skin>
</oneit:skin>
<%
}
List<NotificationTemplate> trial = (List<NotificationTemplate>) CollectionFilter.filter(Arrays.asList(notificationTemplates), NotificationTemplate.SearchByAll().andNotificationType(new EqualsFilter<>(NotificationType.TRIAL)));
if(trial != null && !trial.isEmpty())
{
%>
<oneit:skin tagName="layout_fieldset" legend="Trial Notification Settings">
<oneit:skin tagName="layout_search_results">
<oneit:table name="NotificationTemplateTable" sortable="true" cssClass="cougartable tbl-width" notgrid="true">
<oneit:colheader label="Days After" width="16" />
<oneit:colheader label="Notification Content" width="80" />
<oneit:colheader label="" width="4" cssClass="nosort nofilter" />
<%
for (NotificationTemplate notTemp : trial)
{
%>
<oneit:row rowObj="<%= notTemp %>">
<oneit:col><oneit:toString value="<%= notTemp.getDaysAfter() %>" mode="Integer" /></oneit:col>
<oneit:col><oneit:toString value="<%= notTemp.getNotificationContent() %>" mode="TidyHTML" /></oneit:col>
<oneit:col><a class="data-link " href="editNotificationTemplate.jsp?NotificationTemplateID=<%= notTemp.getObjectID() %>">>></a></oneit:col>
</oneit:row>
<%
}
%>
</oneit:table>
<oneit:button value="Add Trial Notification Template" cssClass="btn-primary" name="gotoPage"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", "editNotificationTemplate.jsp")
.mapEntry("ignoreProcess", Boolean.TRUE)
.toMap() %>" />
</oneit:skin>
</oneit:skin>
<%
}
}
%>
<%@include file="/editor/footer.jsp" %>
\ No newline at end of file
<?xml version="1.0"?>
<!-- @AutoRun -->
<OBJECTS name="">
<NODE name="Script" factory="Vector">
<NODE name='insertOp' factory='Participant' class='oneit.sql.transfer.InsertOperation'>
<tableName factory='String'>tl_notification_template</tableName>
<value name='object_id' factory='Participant' class='oneit.sql.transfer.DBTransferer$ObjectID'/>
<value name='object_last_updated_date' class='oneit.sql.transfer.DBTransferer$Timestamp'/>
<value name='object_created_date' class='oneit.sql.transfer.DBTransferer$Timestamp'/>
<value name='notification_type' factory='String'>CLOSED_JOB</value>
<value name='days_after' factory='Integer'>14</value>
<value name='notification_content' factory='String'>Please shortlist job applications</value>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_notification_template</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="notification_type" type="String" nullable="false" length="200"/>
<column name="days_after" type="Long" nullable="false"/>
<column name="notification_content" type="CLOB" nullable="false"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
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