Ontimize 5.2072EN

com.ontimize.db
Class PrintTemplateEntity

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bycom.ontimize.db.TableEntity
                  extended bycom.ontimize.db.PrintTemplateEntity
All Implemented Interfaces:
AdvancedEntity, AdvancedQueryEntity, Entity, EntityDataChangeNotifier, FileManagementEntity, IdentifiedEntity, PrivilegedSecurityEntity, java.rmi.Remote, SecureEntity, java.io.Serializable, TransactionalEntity

public class PrintTemplateEntity
extends TableEntity

Class that must be inherit to be able to use the functionality of the print templates for each application form. In order that this entity works correctly, it is necessary to define a properties file for this entity. This file must contain the following parameters:
- Keys: the key must be one single column in a numerical format.
- TemplateFormColumn : name of the column, in which the name of the form owner of the template is stored.
- TemplateNameColumn : name of the column, in which the file name is stored
- TemplateWarehouseColumn: name of the column, in which the template is stored
- TemplateDefaultColumn: name of the column, in which the default template name is indicated

Since:
5.2057EN-1.3
Additionally to allow privacy for templates:
- TemplatePrivateColumn: Column to indicate whether template is private or not. (1 or 0 respectively).
- TemplateUserColumn : User that is owner of these template (only this user will be able to see the template).
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.ontimize.db.TableEntity
TableEntity.AttachmentReceiving, TableEntity.Receiving
 
Field Summary
static java.lang.String TEMPLATE_DEFAULT_COLUMN
           
static java.lang.String TEMPLATE_FORM_COLUMN
           
static java.lang.String TEMPLATE_NAME_COLUMN
           
static java.lang.String TEMPLATE_PRIVATE_COLUMN
           
static java.lang.String TEMPLATE_USER_COLUMN
           
static java.lang.String TEMPLATE_WAREHOUSE_COLUMN
           
protected  java.lang.String templateDefaultColumn
           
protected  java.lang.String templateFormColumn
           
protected  java.lang.String templateId
           
protected  java.lang.String templateNameColumn
           
protected  java.lang.String templatePrivateColumn
           
protected  java.lang.String templateUserColumn
           
protected  java.lang.String templateWarehouseColumn
           
 
Fields inherited from class com.ontimize.db.TableEntity
alias, aliasPropertiesParser, aliasReverse, ASTERISK, ATTACHMENT_FILE_DESCRIPTION_COLUMN, ATTACHMENT_FILE_NAME_COLUMN, ATTACHMENT_FILE_NAME_KEYS, ATTACHMENT_FILE_ORIGINAL_NAME_COLUMN, ATTACHMENT_FILE_ORIGINAL_PATH_COLUMN, ATTACHMENT_FILE_PATH, ATTACHMENT_FILE_SIZE_COLUMN, ATTACHMENT_SEPARATOR, ATTACHMENT_TABLE, attachmentFileNameColumn, attachmentFileNameKeys, attachmentFilePath, attachmentFileSizeColumn, attachTable, AUTOCONFIGURATION, AUTONUMERICAL, autonumericalColumn, calendar, checkOperationResult, columnNames, COLUMNS, connectionRequestTime, dataChangeListeners, dBLocalErrorMessage, DEBUG, DEBUG_DETAILS, DEBUG_TIMES, DEFAULT_MAX_CONNECTION_WAIT_TIME, defaultEntityScriptManagerClassName, DELETE_ACTION, DELETE_KEYS, deleteKeys, descendantColumnsOrder, descriptionAttachmentFileColumn, enableScripting, entitiesPropertiesParser, entitiesTableAttribute, entityName, entityScripting, FETCH_SIZE, fetchSize, FILE_COLUMNS, fileInfoList, FORCE_DISTINCT, forceDistinct, INSERT_ACTION, INSERT_AUTOMATICLY_ATTACHMENT, INSERT_COLUMNS, INSERT_KEYS, insertAttachmentAutomatically, insertColumn, insertKeys, INTERROG, keys, KEYS, LIMIT_QUERY_OTHERS_ENTITIES, limitQueryOthersEntities, locator, LOG_KEYS, logDelete, logInsert, logkeys, logQuery, logUpdate, M_ERROR_OPERATION, M_IT_HAS_NOT_CHANGED_ANY_RECORD, M_LICENSE_PERMISSION_ERROR, M_TEMPORALY_RESTRICTED_BY_PERMISSION_ACTION, M_YOU_DO_NOT_HAVE_PERMISSION_TO_EXECUTE_ACTION, manager, maxConnectionWaitTime, oneToOneMode, orderColumns, originalAttachmentFileNameColumn, originalAttachmentFilePathColumn, OTHER_ENTITIES, othersEntities, PERCENT, PRINCIPAL_COLUMNS, PRINCIPAL_KEYS, PRINCIPAL_TABLE, principalColumnNames, principalKeyName, principalTable, privilegedId, properties, propertiesPath, QUERY_ACTION, QUERY_TABLE, queryTable, receivedAttachmentFile, receivedTempFiles, RECORD_OPERATIONS, registeredDispatcher, REPORT_ADVANCED_QUERY_COLUMNS, REPORT_ADVANCED_QUERY_TYPES, reportAvancedQueryColumns, reportAvancedQueryTypes, SECONDARY_COLUMNS, SECONDARY_KEYS, SECONDARY_TABLE, secondaryColumnsNames, secondaryKeyName, secondaryTable, sendAttachmentFile, SORT, SORT_DESC, table, TABLE, TABLE_ATTRIBUTE_ENTITIES, tempFiles, TIME_BETWEEN_DEFAULT_CONNECTION_REQUEST, TRUNCATE_DATE_DEFAULT_VALUE, TRUNCATE_DATES, truncateDates, UNDERSCORE, UPDATE_ACTION, UPDATE_COLUMNS, UPDATE_KEYS, updateColumn, updateKeys, USE_SETSTRING_LONG_STRINGS, useAlwaysTableAttributeEntities, WILDCARD_COLUMNS, wildcardColumns
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
PrintTemplateEntity(EntityReferenceLocator referenceLocator, DatabaseConnectionManager dbConnectionManager, int port)
           
 
Method Summary
protected  java.lang.Integer increment()
           
protected  void initAlias()
           
protected  void initId()
           
 EntityResult insert(java.util.Hashtable values, int sessionId, java.sql.Connection con)
          Executes an insert operation with the provided Connection.
 EntityResult query(java.util.Hashtable keysValues, java.util.Vector attributes, int sessionId, java.sql.Connection con)
          Executes a query operation using the provided Connection, with the conditions and attributes required.
protected  void readAdditionalProperties()
           
 
Methods inherited from class com.ontimize.db.TableEntity
addEntityDataChangeListener, buildConditionsString, cancelReceiving, checkDeleteKeys, checkFinishedSession, checkInsertKeys, checkOrderColumns, checkPermissions, checkUpdateKeys, configureReverseAlias, connect, connect, createAdvancedEntityResultForSessionId, createAdvancedEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityScriptManager, delete, delete, deleteAttachmentFile, deleteAttachmentFile, deleteMultipleTableAttributesColumns, disconnect, disconnect, dispatcherAttribute, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executeStatement, finishReceiving, fireDataChangeEvent, fireDataChangeEvent, fireTransactionDataChangeEvent, fireTransactionDataChangeEvent, generateRandomId, getActions, getAliasForColumn, getAttachmentFileNameForKeys, getAttachmentFilePath, getAttachmentFilePath, getAutonumericalColumn, getBytes, getColumnForAlias, getColumnListForAvancedQuery, getColumns, getDatabaseConnectionManager, getDescOrderColumns, getDescription, getEntityPrivilegedId, getEntityReference, getErrorMessage, getExtendedAliasPropertiesName, getExtendedPropertiesName, getExtension, getName, getOrderColumns, getPrivilegedId, getPropertiesPath, getQueryRecordNumber, getQueryTable, getSize, getSQLTypesFromMetaData, getStringsOn, getSubGroupValues, getSubGroupValues, getTable, getUpdateColumns, getUser, getValidAttributes, getValidDeletingKeysValues, getValidInsertingAttributesValues, getValidQueryingKeysValues, getValidUpdatingAttributesValues, getValidUpdatingKeysValues, getWildCardColumns, insert, insertAutonumericalAlias, isBinaryType, loadAliasFile, loadAliasFile, logToLogKeys, logUpdate, parseStringValue, performExtendedAliasProperties, performExtendedProperties, postDelete, postInsert, postUpdate, preDelete, preInsert, prepareToReceive, prepareToReceive, prepareToReceive, prepareToTransfer, prepareToTransfer, preUpdate, processFileColumnsAttributes, processFileColumnsAttributes, processFileResults, processingMultipleValueAttributes, processingReferenceDataFieldAttributes, processingReferenceDataFieldAttributes, processMultipleAttributeKey, processMultipleTableAttribute, processMultipleTableAttribute, putBytes, query, query, query, query, queryOtherEntities, readProperties, readProperties, readProperties, registerAttributeDispatcher, reloadScripts, removeEntityDataChangeListener, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAliasKeepColumns, resultSetToEntityResult, resultSetToEntityResult, resultSetToEntityResult, setLimitQueryOthersEntities, setName, setObject, setObject, setPrivilegedId, toVectorOfBooleans, truncateDataToHour_00_00_00, truncateDateToMinutes, update, update, updateAttachmentValues, vectorToStringSeparateBySemicolon
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TEMPLATE_NAME_COLUMN

public static final java.lang.String TEMPLATE_NAME_COLUMN
See Also:
Constant Field Values

TEMPLATE_FORM_COLUMN

public static final java.lang.String TEMPLATE_FORM_COLUMN
See Also:
Constant Field Values

TEMPLATE_WAREHOUSE_COLUMN

public static final java.lang.String TEMPLATE_WAREHOUSE_COLUMN
See Also:
Constant Field Values

TEMPLATE_DEFAULT_COLUMN

public static final java.lang.String TEMPLATE_DEFAULT_COLUMN
See Also:
Constant Field Values

TEMPLATE_PRIVATE_COLUMN

public static final java.lang.String TEMPLATE_PRIVATE_COLUMN
See Also:
Constant Field Values

TEMPLATE_USER_COLUMN

public static final java.lang.String TEMPLATE_USER_COLUMN
See Also:
Constant Field Values

templateId

protected java.lang.String templateId

templateFormColumn

protected java.lang.String templateFormColumn

templateNameColumn

protected java.lang.String templateNameColumn

templateWarehouseColumn

protected java.lang.String templateWarehouseColumn

templateDefaultColumn

protected java.lang.String templateDefaultColumn

templatePrivateColumn

protected java.lang.String templatePrivateColumn

templateUserColumn

protected java.lang.String templateUserColumn
Constructor Detail

PrintTemplateEntity

public PrintTemplateEntity(EntityReferenceLocator referenceLocator,
                           DatabaseConnectionManager dbConnectionManager,
                           int port)
                    throws java.lang.Exception
Method Detail

readAdditionalProperties

protected void readAdditionalProperties()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

initAlias

protected void initAlias()

initId

protected void initId()

increment

protected java.lang.Integer increment()

query

public EntityResult query(java.util.Hashtable keysValues,
                          java.util.Vector attributes,
                          int sessionId,
                          java.sql.Connection con)
                   throws java.lang.Exception
Description copied from class: TableEntity
Executes a query operation using the provided Connection, with the conditions and attributes required.

This method calls TableEntity.query(Hashtable, Vector, int, Connection, Vector, boolean) using null and true as the last two parameters.

Specified by:
query in interface TransactionalEntity
Overrides:
query in class TableEntity
Parameters:
keysValues -
attributes -
sessionId -
con -
Returns:
Throws:
java.lang.Exception - if an error ocurrs

insert

public EntityResult insert(java.util.Hashtable values,
                           int sessionId,
                           java.sql.Connection con)
                    throws java.lang.Exception
Description copied from class: TableEntity
Executes an insert operation with the provided Connection.

The attributesValues object determines the columns and values that will be inserted.

The sessionId number identifies the session.

When overriding, this method must suppose that the connection provided is not in autocommit mode, so all operations are executed in a transaction. This means that in an error ocurrs this method should throw an Exception to ensure that the calling method is properly notified.

The following methods of this class are called:

If no valid attributes-values are contained in attributesValues no insert is performed and no error is produced.

If there is no error, a TransactionDataChangeEvent is fired and all listeners are notified.

Specified by:
insert in interface TransactionalEntity
Overrides:
insert in class TableEntity
Parameters:
values - the table columns and corresponding values to insert
sessionId - the session identifier
con - the Connection to use when executing the PreparedStatement
Returns:
an EntityResult. This result will contain the autonumerical as a key-value pair, where the key is the autonumerical column and the value the autonumerical value
Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute the action.

Ontimize