public class StandardAttachmentEntity extends DefaultTableEntity
TableEntity.AttachmentReceiving, TableEntity.FileInfo, TableEntity.FileInfoList, TableEntity.Receiving| Modifier and Type | Field and Description |
|---|---|
protected String |
attachmentDate |
protected String |
attachmentId |
protected String |
attachmentKeys |
protected String |
attachmentKeysColumns |
protected String |
attachmentPrivate |
protected String |
attachmentUser |
protected boolean |
checkPermissions |
protected String |
dataBaseTable |
static boolean |
DEBUG |
static String |
DEFAULT_ATTACHMENT_DATABASE_TABLE |
protected String |
fileDescription |
protected String |
fileName |
protected static String |
KEY_NAME_COLUMN |
protected static String |
KEY_VALUE_COLUMN |
protected String |
originalFileName |
protected String |
size |
protected String |
sourceAttachmentTable |
static boolean |
useMAXFunction |
propsalias, 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, auditorLog, AUTOCONFIGURATION, AUTONUMERICAL, autonumericalColumn, calendar, checkOperationResult, columnNames, COLUMNS, connectionRequestTime, COUNT_COLUMNS, countColumns, dataChangeListeners, dBLocalErrorMessage, defaultEntityScriptManagerClassName, DELETE_ACTION, DELETE_KEYS, deleteKeys, descendantColumnsOrder, descriptionAttachmentFileColumn, enableScripting, entitiesPropertiesParser, entitiesTableAttribute, entityName, entityScripting, FETCH_SIZE, fetchSize, FILE_COLUMNS, fileInfoList, FORCE_DISTINCT, forceDistinct, GENERATED_KEY, generatedKeyList, hOtherLocaleTablesColumns, hOtherLocaleTablesKey, INSERT_ACTION, INSERT_AUTOMATICLY_ATTACHMENT, INSERT_COLUMNS, INSERT_KEYS, insertAttachmentAutomatically, insertColumn, insertKeys, INTERROG, keys, KEYS, LIMIT_QUERY_OTHERS_ENTITIES, limitQueryOthersEntities, LOCALE_COLUMNS, LOCALE_TABLE, localeTable, 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, OTHER_LOCALE_TABLES, OTHER_LOCALE_TABLES_COLUMNS, OTHER_LOCALE_TABLES_KEY, 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, TRUNCATE_DATE_DEFAULT_VALUE, TRUNCATE_DATES, truncateDates, UNDERSCORE, UPDATE_ACTION, UPDATE_COLUMNS, UPDATE_KEYS, updateColumn, updateKeys, USE_SETSTRING_LONG_STRINGS, useAlwaysTableAttributeEntities, vLocaleColumns, vOtherLocaleTables, WILDCARD_COLUMNS, wildcardColumnsref| Constructor and Description |
|---|
StandardAttachmentEntity(EntityReferenceLocator referenceLocator,
DatabaseConnectionManager dbConnectionManager,
int port,
String properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkPermissions(int sessionId,
String action)
Checks if the user/session identified by
sessionId has the
permission defined by action
This method calls ServerManager.getServerSecurityManager()
and then, if a manager exists, calls
manager.checkActionPermission(int, String, String) |
Hashtable |
createAttachmentKeys(Hashtable kv) |
protected void |
createProperties() |
protected Integer |
increment() |
protected void |
initAlias() |
protected void |
initId() |
protected void |
loadAliasFile(String path)
Loads the alias properties file in
path. |
protected void |
loadAttachmentAliasFile(String path) |
String |
prepareToReceive(Hashtable keys,
String fileName,
String fileDescription,
int sessionId)
This method calls
TableEntity.prepareToReceive(Hashtable, String, String, String, int) with
null argument for originalFilePath |
String |
prepareToReceive(Hashtable keys,
String fileName,
String originalFilePath,
String fileDescription,
int sessionId)
Indicates to this entity that must be ready for receiving the contents of
a file.
|
EntityResult |
query(Hashtable keys,
Vector values,
int sessionId,
Connection con)
Executes a query operation using the provided Connection, with the
conditions and attributes required.
|
protected EntityResult |
queryNoPrivate(Hashtable keys,
Vector values,
int sessionId,
Connection con) |
protected EntityResult |
queryPrivate(Hashtable keys,
Vector values,
int sessionId,
Connection con) |
protected void |
readAdditionalProperties() |
protected void |
readAttachmentProperties(String path) |
protected void |
readProperties(Properties prop,
URL urlProp)
Loads and analyzes the properties
prop. |
protected void |
readProperties(String path)
Loads a Properties object located in
path using
this.getClass().getClassLoader().getResource(path). |
void |
setPathAttachment(String path) |
getExtendedAliasPropertiesName, getExtendedPropertiesName, loadAliasFile, readProperties, setNameaddEntityDataChangeListener, buildConditionsString, cancelReceiving, checkAmbiguousColumns, checkAvailableLocaleTables, checkBasicExpresionLocalesInKv, checkBasicExpresionLocalesInKv, checkConditionsWithTablePreffix, checkDeleteKeys, checkFinishedSession, checkInsertKeys, checkLocalesInKV, checkOrderColumns, checkOtherLocaleTables, checkUpdateKeys, configureReverseAlias, connect, connect, createAdvancedEntityResultForSessionId, createAdvancedEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityScriptManager, delete, delete, deleteAttachmentFile, deleteAttachmentFile, deleteHOtherLocaleTablesAlias, deleteLocaleColumns, deleteMultipleTableAttributesColumns, disconnect, disconnect, dispatcherAttribute, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executeStatement, filterAttributes, filterKeys, finishReceiving, fireDataChangeEvent, fireDataChangeEvent, fireTransactionDataChangeEvent, fireTransactionDataChangeEvent, generatedKeysToEntityResult, generateRandomId, getActions, getAliasForColumn, getAttachmentFileNameForKeys, getAttachmentFilePath, getAttachmentFilePath, getAutonumericalColumn, getBaseEntityName, getBytes, getColumnForAlias, getColumnListForAvancedQuery, getColumns, getColumnsWithoutLocale, getConditionsWithTablePreffix, getContidionsWithoutFilterKeys, getDatabaseConnectionManager, getDeleteKeys, getDescOrderColumns, getDescription, getEntityPrivilegedId, getEntityReference, getErrorMessage, getExtension, gethOtherLocaleTablesColumns, getInsertKeys, getJoinConditions, getKeys, getKeysVector, getLocaleColumnsFromTable, getLocaleIdFromSession, getLocaleTableName, getLocaleTableName, getMetadata, getName, getOrderColumns, getPrivilegedId, getPropertiesPath, getQueryRecordNumber, getQueryRecordNumber, getQueryTable, getSchemaQueryTable, getSchemaTable, getSecondaryColumnsWithoutKey, getSize, getSQLTypesFromMetaData, getStringsOn, getSubGroupValues, getSubGroupValues, getTable, getTypeFromMetadata, getUpdateColumns, getUpdateKeys, getUser, getValidAttributes, getValidDeletingKeysValues, getValidInsertingAttributesValues, getValidQueryingKeysValues, getValidUpdatingAttributesValues, getValidUpdatingKeysValues, getvLocaleColumns, getWildCardColumns, insert, insert, insertAutonumericalAlias, insertInLocaleTableLocaleColumns, insertInLocaleTablesForOneToOne, insertLocaleColumn, insertOtherEntities, isBinaryType, logToLogKeys, logUpdate, modifyBexpWithOtherLocaleTableAlias, modifyBexpWithOtherLocaleTableAlias, parseProperties, parseStringValue, particularizeConditions, performExtendedAliasProperties, performExtendedProperties, postDelete, postInsert, postUpdate, preDelete, preInsert, prepareToReceive, prepareToTransfer, prepareToTransfer, preUpdate, processColumnsWithoutLocale, processFileColumnsAttributes, processFileColumnsAttributes, processFileResults, processingMultipleValueAttributes, processingReferenceDataFieldAttributes, processingReferenceDataFieldAttributes, processMultipleAttributeKey, processMultipleTableAttribute, processMultipleTableAttribute, processOtherEntities, processValidLocaleColumnsValues, putBytes, query, query, query, query, queryOtherEntities, registerAttributeDispatcher, reloadScripts, removeEntityDataChangeListener, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAliasKeepColumns, resultSetToEntityResult, resultSetToEntityResult, resultSetToEntityResult, retrieveDataToInsert, setLimitQueryOthersEntities, setObject, setObject, setPrivilegedId, tagAttributes, tagAttributesWithoutAlias, tagKeysValues, toVectorOfBooleans, truncateDataToHour_00_00_00, truncateDateToMinutes, update, update, updateAttachmentValues, updateInLocaleTablesForOneToOne, updateLocaleColumns, vectorToStringSeparateBySemicolonclone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogpublic static boolean DEBUG
protected static final String KEY_VALUE_COLUMN
protected static final String KEY_NAME_COLUMN
public static final String DEFAULT_ATTACHMENT_DATABASE_TABLE
public static boolean useMAXFunction
protected String dataBaseTable
protected String attachmentId
protected String attachmentKeys
protected String attachmentKeysColumns
protected String sourceAttachmentTable
protected String attachmentDate
protected String attachmentPrivate
protected String attachmentUser
protected String fileName
protected String originalFileName
protected String fileDescription
protected String size
protected boolean checkPermissions
public StandardAttachmentEntity(EntityReferenceLocator referenceLocator, DatabaseConnectionManager dbConnectionManager, int port, String properties) throws Exception
Exceptionprotected void readProperties(String path) throws Exception
TableEntitypath using
this.getClass().getClassLoader().getResource(path).TableEntity.readProperties(Properties, URL)readProperties in class TableEntitypath - path from which the properties will be loadedExceptionprotected void readAttachmentProperties(String path) throws Exception
Exceptionpublic void setPathAttachment(String path)
protected void createProperties()
protected void readProperties(Properties prop, URL urlProp) throws Exception
TableEntityprop. The parameters for
this entity are read from the properties and this entity is configured
according to them.uRLProp protocol is 'file', then a properties file is
generated located in uRLProp.getPath()readProperties in class TableEntityprop - the properties objecturlProp - the properties file URLExceptionprotected void loadAliasFile(String path)
TableEntitypath.
If file does not exist, no error is produced. If file exists, resulting
alias are loaded in alias and aliasReverse
fields.
loadAliasFile in class TableEntitypath - the file location, relative to this entity's class file.protected void loadAttachmentAliasFile(String path)
protected void initAlias()
protected void readAdditionalProperties()
throws Exception
Exceptionprotected void initId()
protected Integer increment()
public String prepareToReceive(Hashtable keys, String fileName, String fileDescription, int sessionId) throws Exception
TableEntityTableEntity.prepareToReceive(Hashtable, String, String, String, int) with
null argument for originalFilePathprepareToReceive in interface FileManagementEntityprepareToReceive in class TableEntityExceptionpublic String prepareToReceive(Hashtable keys, String fileName, String originalFilePath, String fileDescription, int sessionId) throws Exception
TableEntitykeysValues. The method returns a String identifier for use
when sending new bytes.
This method performs a query, so QUERY_ACTION must be granted to the caller.
If insertAttachmentAutomatically is true, then a new record
is automatically inserted using the values contained in
keysValues. (So, INSERT_ACTION must be granted.)
The supplied fileName, originalFilePath and
fileDescription will be used when inserting if not null and
TableEntity.attachmentFileNameColumn,
TableEntity.originalAttachmentFileNameColumn and
TableEntity.descriptionAttachmentFileColumn are not null.
If insertAttachmentAutomatically is false, a record must
exist.
prepareToReceive in interface FileManagementEntityprepareToReceive in class TableEntitykeys - the keys-values that identify the record or the new values for
the new recordfileName - the attachment file name. The resulting file name will be the
generated by a call to getAttachmentFileNameForKeys. May be
nulloriginalFilePath - may be nullfileDescription - an optional file description. May be nullsessionId - the caller idException - if attachment file path or attachment filename column are
null for this entity, or an error ocurrspublic Hashtable createAttachmentKeys(Hashtable kv) throws Exception
Exceptionpublic EntityResult query(Hashtable keys, Vector values, int sessionId, Connection con) throws Exception
TableEntity
This method calls
TableEntity.query(Hashtable, Vector, int, Connection, Vector, boolean) using
null and true as the last two parameters.
query in interface TransactionalEntityquery in class TableEntityException - if an error ocurrsprotected EntityResult queryNoPrivate(Hashtable keys, Vector values, int sessionId, Connection con) throws Exception
Exceptionprotected EntityResult queryPrivate(Hashtable keys, Vector values, int sessionId, Connection con) throws Exception
Exceptionpublic void checkPermissions(int sessionId,
String action)
throws NotInPeriodException,
GeneralSecurityException
TableEntitysessionId has the
permission defined by action
This method calls ServerManager.getServerSecurityManager()
and then, if a manager exists, calls
manager.checkActionPermission(int, String, String)
checkPermissions in class TableEntitysessionId - the identifier to checkaction - the action to checkNotInPeriodException - if the action is restricted by time constraintsGeneralSecurityException - it the action is not allowedSessionNotFoundException - if the identifier sessionId has not an
associated session.Copyright © 2016 Imatia Innovation S.L.. All rights reserved.