Class CmisSender

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, NameAware, HasKeystore, HasTruststore, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

@Forward(name="notFound", description="if the requested object could not be found for actions GET, UPDATE and DELETE") public class CmisSender extends AbstractSenderWithParameters implements HasKeystore, HasTruststore
Sender to obtain information from and write to a CMIS application.

When action=get the input (xml string) indicates the id of the document to get. This input is mandatory.

Example:

<cmis>
    <id>documentId</id>
</cmis>

When action=delete the input (xml string) indicates the id of the document to get. This input is mandatory.

Example:

<cmis>
    <id>documentId</id>
</cmis>

When action=create the input (xml string) indicates document properties to set. This input is optional.

Example:

<cmis>
    <name>Offerte</name>
    <objectTypeId>NNB_Geldlening</objectTypeId>
    <mediaType>application/pdf</mediaType>
    <properties>
        <property name="ArrivedAt" type="datetime" formatString="yyyy-MM-dd'T'HH:mm:ss.SSSz">2014-11-27T16:43:01.268+0100</property>
        <property name="ArrivedBy">HDN</property>
        <property name="DocumentType">Geldlening</property>
    </properties>
</cmis>

attributesdescriptiondefault
namemandatory property "cmis:name". If not set the sender attribute fileNameSessionKey is used"[unknown]"
objectTypeIdmandatory property "cmis:objectTypeId""cmis:document"
mediaTypethe MIME type of the document to store"application/octet-stream"
propertycustom document property to set. Possible attributes:
namedescriptiondefault
type
  • string: renders the value
  • datetime: converts the value to a Date, by default using formatString yyyy-MM-dd HH:mm:ss
string
formatStringused in combination with datetimeyyyy-MM-dd HH:mm:ss
 

When action=find the input (xml string) indicates the query to perform.

Example:

<query>
   <statement>select * from cmis:document</statement>
   <maxItems>10</maxItems>
   <skipCount>0</skipCount>
   <searchAllVersions>true</searchAllVersions>
   <includeAllowableActions>true</includeAllowableActions>
</query

When action=update the input (xml string) indicates document properties to update.

Example:

<cmis>
   <id>123456789</id>
   <properties>
      <property name="ArrivedAt" type="datetime" formatString="yyyy-MM-dd'T'HH:mm:ss.SSSz">2014-11-27T16:43:01.268+0100</property>
      <property name="ArrivedBy">HDN</property>
      <property name="DocumentType">Geldlening</property>
      <property name="DocumentDetail" isNull="true" />
   </properties>
</cmis>

attributesdescriptiondefault
idmandatory property "cmis:objectId" which indicates the document to update 
propertycustom document property to update. See action=create for possible attributes 

Author:
Peter Leeuwenburgh, Niels Meijer
Specific parameters
authAlias overrides authAlias specified by the attribute authAlias, username overrides username specified by the attribute username, password overrides password specified by the attribute password
  • Field Details

  • Constructor Details

    • CmisSender

      public CmisSender()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractSenderWithParameters
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • createCmisSession

      public CloseableCmisSession createCmisSession(ParameterValueList pvl) throws SenderException
      Creates a session during JMV runtime, tries to retrieve parameters and falls back on the defaults when they can't be found
      Throws:
      SenderException
    • getSessionBuilder

      protected CmisSessionBuilder getSessionBuilder()
    • start

      public void start()
      Description copied from interface: ISender
      This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in the sendMessage() method.
      Specified by:
      start in interface ISender
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Overrides:
      start in class AbstractSender
    • stop

      public void stop()
      Description copied from interface: ISender
      Stop/close the sender and deallocate resources.
      Specified by:
      stop in interface ISender
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Overrides:
      stop in class AbstractSender
    • sendMessage

      public @NonNull SenderResult sendMessage(@NonNull Message message, @NonNull PipeLineSession session) throws SenderException, TimeoutException
      Description copied from interface: ISender
      Send a message to some destination (as configured in the Sender object). This method may only be called after the configure() method is called.

      The following table shows the difference between synchronous and a-synchronous senders:

       synchronousa-synchronous
      ISender.isSynchronous() returnstruefalse
      return value of sendMessage() isthe reply-messagethe messageId of the message sent
      the correlationID specified with sendMessage()may be ignoredis sent with the message
      a {link TimeOutException}may be thrown if a timeout occurs waiting for a replyshould not be expected

      Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or synchronized.

      Specified by:
      sendMessage in interface ISender
      Throws:
      SenderException
      TimeoutException
    • setAction

      @Mandatory public void setAction(CmisSender.CmisAction action)
      Specifies action to perform
    • setMaxConnections

      public void setMaxConnections(int i)
      The maximum number of concurrent connections
      Default value
      10
    • setTimeout

      public void setTimeout(int i)
      READ_TIMEOUT timeout in MS. Defaults to 10000, inherited from HttpSender#setTimeout.
      Default value
      10000
    • setUrl

      public void setUrl(String url)
      URL to connect to
    • setRepository

      public void setRepository(String repository)
      Repository ID
    • setAuthAlias

      public void setAuthAlias(String authAlias)
      Alias used to obtain credentials for authentication to host
    • setUsername

      public void setUsername(String username)
      Username used in authentication to host
    • setPassword

      public void setPassword(String password)
      Password used in authentication to host
    • setBindingType

      @Mandatory public void setBindingType(CmisSessionBuilder.BindingTypes bindingType)
      BindingType CMIS protocol to use
    • setFileSessionKey

      public void setFileSessionKey(String string)
      If action=create the sessionKey that contains the file to use. If action=get and getProperties=true the sessionKey to store the result in
    • setFilenameSessionKey

      public void setFilenameSessionKey(String string)
      If action=create the session key that contains the name of the file to use. If not set, the value of the property filename from the input message is used
    • setDefaultMediaType

      public void setDefaultMediaType(String string)
      If action=create the mime type used to store the document when it's not set in the input message by a property
      Default value
      'application/octet-stream'
    • setGetProperties

      public void setGetProperties(boolean b)
      (Only used when action=get). If true, the content of the document is put to FileSessionKey and all document properties are put in the result as a xml string
      Default value
      false
    • setGetDocumentContent

      public void setGetDocumentContent(boolean getDocumentContent)
      (Only used when action=get). If true, the attachment for the document is the sender result or, if set, stored in fileSessionKey. If false, only the properties are returned
      Default value
      true
    • setUseRootFolder

      public void setUseRootFolder(boolean b)
      (Only used when action=create). If true, the document is created in the root folder of the repository. Otherwise the document is created in the repository
      Default value
      true
    • setKeepSession

      public void setKeepSession(boolean keepSession)
      If true, the session is not closed at the end and it will be used in the next call
      Default value
      true
    • setOverrideEntryPointWSDL

      public void setOverrideEntryPointWSDL(String overrideEntryPointWSDL)
      Override entrypoint WSDL by reading it from the classpath, overrides url attribute
    • setKeystoreConfiguration

      public void setKeystoreConfiguration(KeystoreConfiguration keystoreConfiguration)
      Description copied from interface: HasKeystore
      Set the KeystoreConfiguration object
      Specified by:
      setKeystoreConfiguration in interface HasKeystore
    • getKeystoreConfiguration

      public KeystoreConfiguration getKeystoreConfiguration()
      Specified by:
      getKeystoreConfiguration in interface HasKeystore
    • getTruststoreConfiguration

      public TruststoreConfiguration getTruststoreConfiguration()
      Specified by:
      getTruststoreConfiguration in interface HasTruststore
    • setTruststoreConfiguration

      public void setTruststoreConfiguration(TruststoreConfiguration truststoreConfiguration)
      Specified by:
      setTruststoreConfiguration in interface HasTruststore
    • setProxyHost

      public void setProxyHost(String proxyHost)
      Proxy host url
    • setProxyPort

      public void setProxyPort(int proxyPort)
      Proxy host port
      Default value
      80
    • setProxyAuthAlias

      public void setProxyAuthAlias(String proxyAuthAlias)
      Alias used to obtain credentials for authentication to proxy
    • setProxyUsername

      public void setProxyUsername(String proxyUsername)
      Proxy Username
    • setProxyPassword

      public void setProxyPassword(String proxyPassword)
      Proxy Password