|
Ontimize 5.2072EN | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.ontimize.db.TableEntity
com.ontimize.db.DefaultTableEntity
com.ontimize.db.StandardAttachmentEntity
Class that must be inherit to be able to use the functionality of attaching
files 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:
- AttachmentFileNameColumn: name of the column, in which the name of the
attached file is stored
- AttachmentFileOriginalNameColumn: name of the column, in which the name of
the file (before its attachment) is stored.
- AttachmentFileDescriptionColumn: name of the column, in which the
description, that is added at this file, is stored.
- AttachmentFilePath: path, in which the attached files are stored.
- AttachmentFileNameKeys: columns that are used to created the name of the
attached file
- InsertAutomaticlyAttachment: it must be fixed to 'yes'.
| Nested Class Summary |
| Nested classes inherited from class com.ontimize.db.TableEntity |
TableEntity.AttachmentReceiving, TableEntity.Receiving |
| Field Summary | |
protected java.lang.String |
attachmentDate
|
protected java.lang.String |
attachmentId
|
protected java.lang.String |
attachmentKeys
|
protected java.lang.String |
attachmentKeysColumns
|
protected java.lang.String |
attachmentPrivate
|
protected java.lang.String |
attachmentUser
|
protected boolean |
checkPermissions
|
protected java.lang.String |
dataBaseTable
|
static boolean |
DEBUG
|
static java.lang.String |
DEFAULT_ATTACHMENT_DATABASE_TABLE
|
protected java.lang.String |
fileDescription
|
protected java.lang.String |
fileName
|
protected static java.lang.String |
KEY_NAME_COLUMN
|
protected static java.lang.String |
KEY_VALUE_COLUMN
|
protected java.lang.String |
originalFileName
|
protected java.lang.String |
size
|
protected java.lang.String |
sourceAttachmentTable
|
| Fields inherited from class com.ontimize.db.DefaultTableEntity |
props |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
StandardAttachmentEntity(EntityReferenceLocator referenceLocator,
DatabaseConnectionManager dbConnectionManager,
int port,
java.lang.String properties)
|
|
| Method Summary | |
void |
checkPermissions(int sessionId,
java.lang.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) |
java.util.Hashtable |
createAttachmentKeys(java.util.Hashtable kv)
|
protected void |
createProperties()
|
protected java.lang.Integer |
increment()
|
protected void |
initAlias()
|
protected void |
initId()
|
protected void |
loadAliasFile(java.lang.String path)
Loads the alias properties file in path.
|
protected void |
loadAttachmentAliasFile(java.lang.String path)
|
java.lang.String |
prepareToReceive(java.util.Hashtable keys,
java.lang.String fileName,
java.lang.String fileDescription,
int sessionId)
This method calls prepareToReceive(Hashtable, String, String, String, int) with
null argument for originalFilePath |
java.lang.String |
prepareToReceive(java.util.Hashtable keys,
java.lang.String fileName,
java.lang.String originalFilePath,
java.lang.String fileDescription,
int sessionId)
Indicates to this entity that must be ready for receiving the contents of a file. |
EntityResult |
query(java.util.Hashtable keys,
java.util.Vector values,
int sessionId,
java.sql.Connection con)
Executes a query operation using the provided Connection, with the conditions and attributes required. |
protected EntityResult |
queryNoPrivate(java.util.Hashtable keys,
java.util.Vector values,
int sessionId,
java.sql.Connection con)
|
protected EntityResult |
queryPrivate(java.util.Hashtable keys,
java.util.Vector values,
int sessionId,
java.sql.Connection con)
|
protected void |
readAdditionalProperties()
|
protected void |
readAttachmentProperties(java.lang.String path)
|
protected void |
readProperties(java.util.Properties prop,
java.net.URL urlProp)
Loads and analyzes the properties prop. |
protected void |
readProperties(java.lang.String path)
Loads a Properties object located in path using
this.getClass().getClassLoader().getResource(path). |
void |
setPathAttachment(java.lang.String path)
|
| Methods inherited from class com.ontimize.db.DefaultTableEntity |
getExtendedAliasPropertiesName, getExtendedPropertiesName, loadAliasFile, readProperties, setName |
| 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 |
public static boolean DEBUG
protected static final java.lang.String KEY_VALUE_COLUMN
protected static final java.lang.String KEY_NAME_COLUMN
public static final java.lang.String DEFAULT_ATTACHMENT_DATABASE_TABLE
protected java.lang.String dataBaseTable
protected java.lang.String attachmentId
protected java.lang.String attachmentKeys
protected java.lang.String attachmentKeysColumns
protected java.lang.String sourceAttachmentTable
protected java.lang.String attachmentDate
protected java.lang.String attachmentPrivate
protected java.lang.String attachmentUser
protected java.lang.String fileName
protected java.lang.String originalFileName
protected java.lang.String fileDescription
protected java.lang.String size
protected boolean checkPermissions
| Constructor Detail |
public StandardAttachmentEntity(EntityReferenceLocator referenceLocator,
DatabaseConnectionManager dbConnectionManager,
int port,
java.lang.String properties)
throws java.lang.Exception
| Method Detail |
protected void readProperties(java.lang.String path)
throws java.lang.Exception
TableEntitypath using
this.getClass().getClassLoader().getResource(path).TableEntity.readProperties(Properties, URL)
readProperties in class TableEntitypath - path from which the properties will be loaded
java.lang.Exception
protected void readAttachmentProperties(java.lang.String path)
throws java.lang.Exception
java.lang.Exceptionpublic void setPathAttachment(java.lang.String path)
protected void createProperties()
protected void readProperties(java.util.Properties prop,
java.net.URL urlProp)
throws java.lang.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 URL
java.lang.Exceptionprotected void loadAliasFile(java.lang.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(java.lang.String path)
protected void initAlias()
protected void readAdditionalProperties()
throws java.lang.Exception
java.lang.Exceptionprotected void initId()
protected java.lang.Integer increment()
public java.lang.String prepareToReceive(java.util.Hashtable keys,
java.lang.String fileName,
java.lang.String fileDescription,
int sessionId)
throws java.lang.Exception
TableEntityTableEntity.prepareToReceive(Hashtable, String, String, String, int) with
null argument for originalFilePath
prepareToReceive in interface FileManagementEntityprepareToReceive in class TableEntityjava.lang.Exception
public java.lang.String prepareToReceive(java.util.Hashtable keys,
java.lang.String fileName,
java.lang.String originalFilePath,
java.lang.String fileDescription,
int sessionId)
throws java.lang.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 id
java.lang.Exception - if attachment file path or attachment filename column are null
for this entity, or an error ocurrs
public java.util.Hashtable createAttachmentKeys(java.util.Hashtable kv)
throws java.lang.Exception
java.lang.Exception
public EntityResult query(java.util.Hashtable keys,
java.util.Vector values,
int sessionId,
java.sql.Connection con)
throws java.lang.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 TableEntitykeys - values - sessionId - con -
java.lang.Exception - if an error ocurrs
protected EntityResult queryNoPrivate(java.util.Hashtable keys,
java.util.Vector values,
int sessionId,
java.sql.Connection con)
throws java.lang.Exception
java.lang.Exception
protected EntityResult queryPrivate(java.util.Hashtable keys,
java.util.Vector values,
int sessionId,
java.sql.Connection con)
throws java.lang.Exception
java.lang.Exception
public void checkPermissions(int sessionId,
java.lang.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 check
NotInPeriodException - if the action is restricted by time constraints
GeneralSecurityException - it the action is not allowed
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||