Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.2)

E22562-02

oracle.apps.fnd.applcore.attachments.attachmentService.applicationModule
Class AttachmentServiceAMImpl

java.lang.Object
  extended by oracle.jbo.common.NamedObjectImpl
      extended by oracle.jbo.server.NamedObjectImpl
          extended by oracle.jbo.server.ComponentObjectImpl
              extended by oracle.jbo.server.ContainerObjectImpl
                  extended by oracle.jbo.server.ApplicationModuleImpl
                      extended by oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl
                          extended by oracle.apps.fnd.applcore.attachments.attachmentService.applicationModule.AttachmentServiceAMImpl
All Implemented Interfaces:
java.util.EventListener, OAApplicationModule, OASeedDataService, oracle.jbo.ApplicationModule, oracle.jbo.common.TransPostControl, oracle.jbo.common.ws.WSApplicationModuleMarshaller, oracle.jbo.ComponentObject, oracle.jbo.ExprWrappable, oracle.jbo.GenericHints, oracle.jbo.OperationContainer, oracle.jbo.Properties, oracle.jbo.server.ContainerObject, oracle.jbo.server.TransactionListener, oracle.jbo.VariableManagerOwner, oracle.jbo.VariableManagerOwnerBase, oracle.jbo.WarningContainer, oracle.svcmsg.SvcMsgReceiver, oracle.svcmsg.SvcMsgSender

public class AttachmentServiceAMImpl
extends OAApplicationModuleImpl

Attachments Service Implementation class. This class provides a number of Java API methods to assist developers with some of the more complex tasks related to working with Attachments.

Author:
Michael Luetchford (michael.luetchford@oracle.com)

Field Summary
 
Fields inherited from class oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl
RCS_ID
 
Fields inherited from class oracle.jbo.server.ApplicationModuleImpl
DEFAULT_DEF_NAME, SHARED_SCOPE_APPLICATION, SHARED_SCOPE_SESSION
 
Fields inherited from class oracle.jbo.server.ContainerObjectImpl
mComponentList, mComponents
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX
 
Fields inherited from interface oracle.apps.fnd.applcore.oaext.model.OASeedDataService
RCS_ID_RECORDED
 
Fields inherited from interface oracle.jbo.ApplicationModule
ACTIVATE_CLIENT_FLAG, ACTIVATE_REMOVE_FLAG, ACTIVATE_SKIP_RESTORE_VO_FROM_DEF, ACTIVATE_TRANSIENT_FLAG, ACTIVATE_UNDO_FLAG, DEFAULT_DEF_FULL_NAME, DEFAULT_ROOT_APP_MOD_NAME, EFF_DT_PROPERTY_STR, IMAGE_LOC, PASSIVATE_DEFER_FLAG, PASSIVATE_HINT_FLAG, PASSIVATE_TO_DATABASE, PASSIVATE_TO_FILE, PASSIVATE_TO_MEMORY, PASSIVATE_TO_STACK_FLAG, PASSIVATE_TRANSIENT_FLAG, PASSIVATE_UNDO_FLAG, RELEASE_LEVEL_MANAGED, RELEASE_LEVEL_RESERVED, RELEASE_LEVEL_UNMANAGED, REMOVE_SNAPSHOT, RESET_CLIENT_ONLY_FLAG, RESET_INTERNAL_FLAG, RESET_KEEP_ALL_SNAPSHOTS_FLAG, RESET_MANAGE_SNAPSHOTS, RESET_RELOAD_FLAG, RESET_ROLLBACK_FLAG, SYNC_BATCH, SYNC_IMMEDIATE, SYNC_LAZY
 
Fields inherited from interface oracle.jbo.GenericHints
PROPERTY_LABEL, PROPERTY_LABEL_PLURAL, PROPERTY_TOOLTIP
 
Fields inherited from interface oracle.jbo.common.TransPostControl
TRANS_POST_GET_ATTR_BY_INDEX, TRANS_POST_GET_ATTR_BY_NAME, TRANS_POST_GET_ATTR_COUNT, TRANS_POST_GET_ATTR_INDEX_OF, TRANS_POST_GET_STRUCTURE_DEF, TRANS_POST_PUSHBACK, TRANS_POST_REFRESH_UNDO_CHANGES, TRANS_POST_REFRESH_WITH_DB_FORGET_CHANGES, TRANS_POST_REFRESH_WITH_DB_ONLY_IF_UNCHANGED, TRANS_POST_REMOVE, TRANS_POST_SET_ATTR_BY_INDEX, TRANS_POST_SET_ATTR_BY_NAME
 
Fields inherited from interface oracle.jbo.common.ws.WSApplicationModuleMarshaller
ACTIVATION_AFTER_LOSS_OF_AFFINITY, ACTIVATION_AFTER_RESTART, ACTIVATION_NONE, SYNC_INT_BATCH, SYNC_INT_BATCH_DO_WORK
 
Constructor Summary
AttachmentServiceAMImpl()
          This is the default constructor (do not remove).
 
Method Summary
 void attachFile(AttachmentsVORowImpl row, java.lang.String fileName, java.lang.String contentType, java.io.InputStream fileStream)
          Updates the supplied attachments row with the information to attach a file.
 AttachmentsVORowImpl attachFile(java.lang.String fileName, java.lang.String contentType, java.io.InputStream fileStream)
          Creates a new row from the internal attachments view object and populates the attributes to attach a file.
 void attachText(AttachmentsVORowImpl row, java.lang.String text)
          Updates the supplied attachments row with the information to attach text.
 AttachmentsVORowImpl attachText(java.lang.String text)
          Creates a new row from the internal attachments view object and populates the attributes to attach text.
 void attachUrl(AttachmentsVORowImpl row, java.lang.String url)
          Updates the supplied attachments row with the information to attach an URL.
 AttachmentsVORowImpl attachUrl(java.lang.String url)
          Creates a new row from the internal attachments view object and populates the attributes to attach URL.
 java.util.List<AttachmentsVORowImpl> copyAttachments(java.util.List<AttachmentsVORowImpl> attachments, java.lang.String entityName, java.lang.String pk1Value, java.lang.String pk2Value, java.lang.String pk3Value, java.lang.String pk4Value, java.lang.String pk5Value)
          Create copies of the supplied attachment rows assigning them to the entity values as provided.
 java.io.InputStream getAttachmentInputStream(AttachmentsVORowImpl row)
          Retrieve the attachment content for the supplied attachment row as a stream.
 AttachmentsVOImpl getAttachments1()
          Container's getter for Attachments1.
 java.io.OutputStream getAttachmentStream(AttachmentsVORowImpl row)
          Retrieve the attachment content for the supplied attachment row as a stream.
 java.lang.String getAttachmentUrl(AttachmentsVORowImpl row)
          Retrieve URL for the attachment content for the supplied attachment.
 OAViewObjectImpl getFndAttachedDocuments1()
          Container's getter for FndAttachedDocuments1.
 OAViewObjectImpl getFndDocuments1()
          Container's getter for FndDocuments1.
 java.lang.String getUnsignedAttachmentUrl(AttachmentsVORowImpl row)
           Retrieve unsigned URL for the attachment content for the supplied attachment.
 void setContentServerIdcConnection(oracle.stellent.ridc.IdcContext context, oracle.stellent.ridc.IdcClient client)
          *** For internal use only ***
 
Methods inherited from class oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl
getFNDNestedService, getFNDNestedService, getNLSLanguageForSeedData, getSeedContext, getSequenceValue, getSetId, invalidateSetIdCache, invalidateSetIdCache, isResetting, isSeedDataExtractMode, isSeedDataMode, isSeedDataUploadMode, isT2PMode, prepareSession, prepareSession, resetState, resetState, seedExtract, seedUpload, seedUpload, seedUpload, setNLSLanguageForSeedData, setSeedContext, setT2PMode, synchronizeApplSessionWithDB, unSetT2PMode
 
Methods inherited from class oracle.jbo.server.ApplicationModuleImpl
activate, activateConnectionState, activateOpenVOs, activateState, activateState, activateState, activateState, activateStateForUndo, addChild, addResponse, addWarning, afterActivation, afterCommit, afterConnect, afterRemove, afterRollback, afterValidate, beforeCommit, beforeDisconnect, beforeRollback, beforeValidate, bindToWorkingSet, clearVOCaches, createApplicationModule, createComponentObject, createCompositeViewDef, createRootApplicationModule, createSharedDataHandle, createViewLink, createViewLink, createViewLinkBetweenViewObjects, createViewLinkFromEntityAssocName, createViewObject, createViewObject, createViewObjectForDef, createViewObjectFromQueryClauses, createViewObjectFromQueryStmt, createViewObjectFromQueryStmt, createViewObjectOnEntity, createViewObjectOnRowSet, createWorkerApplicationModule, createXMLSharedDataHandle, detach, doMessage, doPoolMessage, dumpQueryResult, executeCommand, executeQueryOnViewObjects, fetchAttributeProperties, findApplicationModule, findComponentObject, findObject, findObject, findOrCreateSharedApplicationModule, findRSIForEntity, findViewLink, findViewObject, findViewObjectUsingEntity, findViewObjectWithParameters, findVOsWithEntityUsage, findVOsWithEntityUsage, finishLoadingComponents, finishSyncWorkingSet, getAMStatistics, getApplicationModuleDef, getApplicationModuleImpls, getApplicationModuleNames, getApplicationModuleNames, getAppModuleRequestHandler, getAttributeDefs, getAttributeDefs, getAttributeDefsForVO, getClientProxyClassName, getClientProxyClassName, getClientProxyInterfaceName, getComponentObjectNames, getComponentObjectNames, getCurrentWorkingSet, getDBTransaction, getDefFullName, getDefName, getEntityAttributesPermission, getEntityRowFromHandle, getExceptionHandler, getImageLoc, getListBindingName, getListBindingRSI, getMostRecentStackId, getObjectMarshaller, getPreferredListRSI, getReleaseLevel, getRemoteObjectId, getResponseName, getSession, getStyles, getSyncLock, getSyncMode, getTransaction, getTransactionInternal, getUserPrincipalName, getViewAttributesPermission, getViewLinkNames, getViewLinkNames, getViewLinks, getViewObjectNames, getViewObjectNames, getViewObjects, getWorkingSetMarshaller, handleDefinitionChangedOnActivate, hasPendingDataPosts, internalGetListBindingRSI, invokeMethod, isForRemote, isLoadComponentsLazily, isNameGenerated, isRoot, isTransientTransactionListener, isValidIdForUndo, launchTester, marshal, marshalForActivate, passivateConnectionState, passivateOpenVOs, passivateState, passivateState, passivateState, passivateState, passivateState, passivateStateForUndo, prepareApplicationModuleSession, prepareForActivation, prepareForPassivation, prepareSession, prepareViewObjects, processChangeNotifications, remove, removeChild, removeState, reservePassivationId, reserveSnapshotId, reset, resetState, selectAttributesForViewObjects, sendServiceMessage, sendWorkingSetRequests, setBoundToWorkingSet, setDataModelRefresh, setDBConnectionRequired, setExceptionHandler, setLoadComponentsLazily, setReleaseLevel, setRemoteAdapter, setSessionUserData, setStoreForPassiveState, setStyles, setSyncMode, setWorkingSetMarshaller, sync, syncMarshaller, syncWorkingSet, transformExceptionParams, transformExceptionParams, transPostGetAttr, transPostPushback, transPostRefresh, transPostRemove, transPostRevert, transPostRowOp, transPostSetAttr, transPostSetAttrValues
 
Methods inherited from class oracle.jbo.server.ContainerObjectImpl
addContainerListener, removeContainerListener
 
Methods inherited from class oracle.jbo.server.ComponentObjectImpl
addListener, applyPersonalization, create, createRef, createVariableValueManager, ensureVariableManager, findOperationDefinitions, getAllProperties, getApplicationModule, getCompListeners, getCompListenersList, getDefinitionManager, getFullNameForPersDef, getHintValue, getLabel, getLabelPlural, getMessageBundleClass, getProxyClassName, getProxyClassName, getResourceBundleDef, getRootApplicationModule, getStringFromMessageBundle, getTooltip, getVariableManager, hasVariables, isDead, isPersonalized, isRegWithPiggyMan, resolvePropertyRaw, setName, setParent, setProxyClassName
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
setParent, setPropertiesMap
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
allocatePropertyMap, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionsMap, getPropertyMap, getResourcesFromBundle, isPropertyExpression, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setFullName, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.ComponentObject
getFullName, getName
 
Methods inherited from interface oracle.jbo.GenericHints
getHintValue, getLabel, getLabelPlural, getTooltip
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, getProperty, refreshProperty
 
Methods inherited from interface oracle.jbo.VariableManagerOwner
getName
 

Constructor Detail

AttachmentServiceAMImpl

public AttachmentServiceAMImpl()
This is the default constructor (do not remove).

Method Detail

attachFile

public void attachFile(AttachmentsVORowImpl row,
                       java.lang.String fileName,
                       java.lang.String contentType,
                       java.io.InputStream fileStream)
Updates the supplied attachments row with the information to attach a file.

Parameters:
row - attachments row to update.
fileName - the id of the file to attach.
contentType - the content-type of the file to attach.
fileStream - the stream of data for the file to attach.

attachFile

public AttachmentsVORowImpl attachFile(java.lang.String fileName,
                                       java.lang.String contentType,
                                       java.io.InputStream fileStream)
Creates a new row from the internal attachments view object and populates the attributes to attach a file. Mandatory information required by this row including EntityName etc., will need to be populated by the callee.

Parameters:
fileName - the id of the file to attach.
contentType - the content-type of the file to attach.
fileStream - the stream of data for the file to attach.
Returns:
a new attachments row with attached file information populated.

attachText

public void attachText(AttachmentsVORowImpl row,
                       java.lang.String text)
Updates the supplied attachments row with the information to attach text.

Parameters:
row - attachments row to update.
text - the text to attach.

attachText

public AttachmentsVORowImpl attachText(java.lang.String text)
Creates a new row from the internal attachments view object and populates the attributes to attach text. Mandatory information required by this row including EntityName etc., will need to be populated by the callee.

Parameters:
text - the text to attach.
Returns:
a new attachments row with attached text information populated.

attachUrl

public void attachUrl(AttachmentsVORowImpl row,
                      java.lang.String url)
Updates the supplied attachments row with the information to attach an URL.

Parameters:
row - attachments row to update.
url - the URL to attach.

attachUrl

public AttachmentsVORowImpl attachUrl(java.lang.String url)
Creates a new row from the internal attachments view object and populates the attributes to attach URL. Mandatory information required by this row including EntityName etc., will need to be populated by the callee.

Parameters:
url - the URL to attach.
Returns:
a new attachments row with attached URL information populated.

getAttachmentStream

public java.io.OutputStream getAttachmentStream(AttachmentsVORowImpl row)
                                         throws java.io.IOException
Retrieve the attachment content for the supplied attachment row as a stream.

Parameters:
row - attachments row containing content.
Returns:
stream of content from the supplied row.
Throws:
java.io.IOException - exceptions from attempting to stream the content.

getAttachmentInputStream

public java.io.InputStream getAttachmentInputStream(AttachmentsVORowImpl row)
                                             throws java.io.IOException
Retrieve the attachment content for the supplied attachment row as a stream.

Parameters:
row - attachments row containing content.
Returns:
stream of content from the supplied row.
Throws:
java.io.IOException - exceptions from attempting to stream the content.

getAttachmentUrl

public java.lang.String getAttachmentUrl(AttachmentsVORowImpl row)
Retrieve URL for the attachment content for the supplied attachment. For non-URL content, the URL returned points to the GetHandler servlet provided by Web Center. It expects this servlet to be available to the user.

Parameters:
row - attachments row containing content.
Returns:
URL of the content from the supplied row.

getUnsignedAttachmentUrl

public java.lang.String getUnsignedAttachmentUrl(AttachmentsVORowImpl row)

Retrieve unsigned URL for the attachment content for the supplied attachment. For non-URL content, the URL returned points to the GetHandler servlet provided by Web Center. It expects this servlet to be available to the user.

The following code can be used to generate the signing parameters:

   String permission = SigningMechanism.READ_PERMISSION;
   SigningMechanism signingMechanism = new DefaultSigningMechanism(permission, user);
   SigningType signingType = new GenericSigningType(dmVersionNumber);
   SigningScheme scheme = new GenericSigningScheme(signingMechanism, signingType);
   PrivateKey privateKey = SigningUtils.getWSMEncryptionKeyPrivateKey();
   
   String digitalSignature = scheme.sign(privateKey);
   if (digitalSignature.startsWith("&"))
   {
     digitalSignature = digitalSignature.substring(1);
   }
   
   String url = am.getUnsignedAttachmentUrl(row) + "?" + digitalSignature;
 

Please note that the URL returned specifies the host and port of the local machine. Subsequent calls using this URL expect the servlet to be available at this specific host and port.

Where no servlet mapping exists to tell the application to use the GetHandler servlet provided by Web Center, the URL returned specifies the Content Server directly. eg. it specifies the GET_FILE service. In this case there is no need to replace the initial ampersand with a question mark. Here is some sample code:

     String permission = SigningMechanism.READ_PERMISSION;
     SigningMechanism signingMechanism = new DefaultSigningMechanism(permission, user);
     SigningType signingType = new GenericSigningType(dmVersionNumber);
     SigningScheme scheme = new GenericSigningScheme(signingMechanism, signingType);
     PrivateKey privateKey = SigningUtils.getWSMEncryptionKeyPrivateKey();
   
     String url = am.getUnsignedAttachmentUrl(row) + digitalSignature;
   

Parameters:
row - attachments row containing content.
Returns:
unsigned URL of the content from the supplied row.

copyAttachments

public java.util.List<AttachmentsVORowImpl> copyAttachments(java.util.List<AttachmentsVORowImpl> attachments,
                                                            java.lang.String entityName,
                                                            java.lang.String pk1Value,
                                                            java.lang.String pk2Value,
                                                            java.lang.String pk3Value,
                                                            java.lang.String pk4Value,
                                                            java.lang.String pk5Value)
Create copies of the supplied attachment rows assigning them to the entity values as provided.

Parameters:
attachments - List of attachment rows to be copied.
entityName - Parameter for the id of the entity to be assigned to the copied rows.
pk1Value - Parameter for the primary key value of the entity to be assigned to the copied rows.
pk2Value - Parameter for the primary key value of the entity to be assigned to the copied rows.
pk3Value - Parameter for the primary key value of the entity to be assigned to the copied rows.
pk4Value - Parameter for the primary key value of the entity to be assigned to the copied rows.
pk5Value - Parameter for the primary key value of the entity to be assigned to the copied rows.
Returns:
List of the new copied attachment rows.

getFndAttachedDocuments1

public OAViewObjectImpl getFndAttachedDocuments1()
Container's getter for FndAttachedDocuments1.

Returns:
FndAttachedDocuments VO

getFndDocuments1

public OAViewObjectImpl getFndDocuments1()
Container's getter for FndDocuments1.

Returns:
FndDocuments VO

getAttachments1

public AttachmentsVOImpl getAttachments1()
Container's getter for Attachments1.

Returns:
Attachments1

setContentServerIdcConnection

public void setContentServerIdcConnection(oracle.stellent.ridc.IdcContext context,
                                          oracle.stellent.ridc.IdcClient client)

*** For internal use only ***

Used to allow tests to run in WLS stand-alone mode where the external connection may not be available. Preferred solution would be to have external connection available in WLS stand-alone mode and inject by the build scripts.

Parameters:
context - The new context
client - The new client

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.2)

E22562-02

Copyright © 2011 Oracle. All Rights Reserved.