C H A P T E R 14 |
Submission Verifier Workflows |
Content submitted to Sun Java System Content Delivery Server goes through a validation process that is managed by the submission verifier workflows. A workflow typically includes steps to validate the content using content validation adapters. The workflow that is executed is determined by the criteria that you specify. Content that does not require special processing must be processed by the default workflow.
This chapter includes the following topics:
A content validation adapter is used in a submission verifier workflow to process the content that is submitted to Content Delivery Server. Any preprocessing that is required before the content is accepted can be handled by an adapter. For example, adapters can be used to verify that the content meets the guidelines established by your enterprise, add code for digital rights management (DRM), or obfuscate the code.
Each step in a workflow must include the name of the content validation adapter to be run for that step. The following table describes the adapters that are provided with Content Delivery Server.
Adds an additional device capability to the content that can be used to match the content to devices. |
|
Stores the edition that is published, stocked, and downloaded. |
|
Verifies that only APIs allowed by the developer plan assigned to the developer who submitted the content are used. It also determines which devices support the APIs that the content uses. |
|
Publishes content automatically without requiring action from the Catalog Manager administrator based on rules defined in the $CDS_HOME/deployment/deployment-name/conf/AutoPublishRules.properties file. See Section 1.7, Setting Up Automatic Publishing for information on setting up the rules. |
|
Converts externally hosted content that was submitted using the Content Aggregator Interface to content that is stored locally. |
|
Validates that the byte stream is an iAppli application archive file. |
|
Redirects certain method calls to methods that provide the special processing required by MIDlets instrumented with DRM agents. |
|
Validates that the byte stream is a MIDlet application archive file. |
|
Adds permissions to the MIDlet-Permissions and MIDlet-Permissions-Opt attributes that are needed to run MIDlets that are instrumented with connected DRM agents. |
|
Accepts content packaged in a DRM message as defined by OMA DRM 1.0 and adds the MIME type of the content as a required device capability. |
|
Specifies an edition weight for the content so when multiple editions match the capabilities of a device, the edition with the higher weight is delivered. |
If none of the adapters provided meets your needs, you can create your own adapter using the Content Validation API. See the Sun Java System Content Delivery Server Customization Guide for information on the Content Validation API.
If the adapter that you write needs values that cannot be known at the time the adapter is written, create a property file for the adapter. For example, if the adapter needs to know the location of a utility that it uses, create a property file that contains a property for the location. Set the location property to point to the directory that contains the utility on the system on which the adapter runs. Write the adapter to reference the location property when the location of the utility is needed. The property file that you create must be placed in the $CDS_HOME/deployment/deployment-name/conf directory.
To register an adapter that you wrote, add a statement in the $CDS_HOME/deployment/deployment-name/conf/SubmissionVerifierAdapters.xml file. If the adapter requires values in a property file, specify the name of the file in the property-file attribute. The property file must be in the $CDS_HOME/deployment/deployment-name/conf directory.
The following code example shows the registration statements for a sample adapter named MyValidationAdapter that requires a property file named MyValidation.properties.
<adapter id="MyValidationAdapter" name="sample.package.MyValidationAdapter" propertyfile="MyValidation.properties"/> |
Workflows provided with Content Delivery Server are defined in the $CDS_HOME/deployment/deployment-name/conf/SubmissionVerifierWorkflows.xml file. Predefined workflows are available for the following types of content:
You can use these workflows as provided, or modify them as needed. For example, if you do not want to perform an action provided in a workflow, such as API filtering, comment out the step for that action. To add steps to a workflow or create a new workflow, see Section 14.3, Creating a Workflow. If you want to execute a workflow for content other than that specified by the default criteria, change the criteria as described in Section 14.4, Specifying Workflow Criteria.
Note - The SubmissionVerifierWorkflows.xml file must be saved as UTF-8. Make sure that the editor that you use supports this format. |
Content Delivery Server supports Java applications that use the MIDP 1.0 or MIDP 2.0 library. A default workflow is provided for use with most Java applications. A workflow for signing Java applications not protected by a CDS DRM agent is also provided.
The default workflow for Java applications performs API filtering, stores the content, and checks if the content is to be published automatically. If no DRM method is used to protect the content, the content is stored in its original form. If a CDS DRM agent is used to protect the content, the workflow instruments the MIDlet. For MIDP 2.0 MIDlets, the workflow also adds any needed permissions to the MIDlet-Permissions and MIDlet-Permissions-Opt attributes and signs the MIDlet.
Disable an action by commenting out the associated step. For example, if you do not want to perform API filtering, comment out step 2 of the workflow.
Do not comment out the step named AddingDerivedEdition. This step stores the version of the content that subscribers download and is required.
To sign applications, a keystore file that contains the private key and trusted certificate for your installation is required. Use the keytool utility provided with the JDK software to create this file. You must specify RSA for the keyalg parameter. See the JDK software documentation for information.
If a CDS DRM agent is used to protect the content, you must set the following properties in the $CDS_HOME/deployment/deployment-name/conf/cdsdrmagent.properties file:
If you do not use a CDS DRM agent to protect content and have a need to sign MIDP 2.0 MIDlets, an alternate version of the workflow for Java applications is provided. To use this workflow, you must create criteria as described in Section 14.4, Specifying Workflow Criteria that identifies the content that you want processed by this wokflow. The criteria for this workflow must precede the criteria for the default workflow for Java applications in the file.
The workflow for signed applications requires a keystore file that contains the private key and trusted certificate for your installation. Use the keytool utility provided with the JDK software to create this file. You must specify RSA for the keyalg parameter. See the JDK software documentation for information.
Edit the Signed Java Application Workflow in the SubmissionVerifierWorkflows.xml file and provide the fully qualified path and file name of the keystore file as the value for the MIDletSigning.KeyStoreFilePath in step 3 of the workflow. You must also provide values for the MIDletSigning.KeyStorePassword, MIDletSigning.KeyAlias, and MIDletSigning.KeyPassword properties. See Section 14.2.1.1, Default Workflow for Java Applications for information on these properties.
Content Delivery Server supports iAppli applications that use the DoJa library. The default workflow for iAppli applications performs API filtering, stores the content in its original form, and checks if the content is to be published automatically.
Disable an action by commenting out the associated step. Do not comment out the step named AddingDerivedEdition. This step stores the version of the content that subscribers download and is required.
The workflow for externally hosted copyrighted content identifies content that must not be cached by Content Delivery Server because of copyright restrictions. This workflow creates an entry in the catalog for the content, ensures that only the metadata is stored for the content, and checks if the content is to be published automatically.
Disable an action by commenting out the associated step. The first two steps in this workflow are required. Do not comment out the step named AddingDerivedEdition or the step named PreventingCopies.
If you want Content Delivery Server to accept this type of content, remove the beginning and ending comment statements from the criteria named isCopyrighted that specifies execution of the workflow named Copyrighted External Content Workflow.
Any content except for Java applications and iAppli applications can be marked as copyrighted. To specify the content for which this workflow is executed, set the criteria as described in Section 14.4, Specifying Workflow Criteria.
The default workflow is executed for all content that doesn’t match the criteria for any other workflow. The default workflow stores the content in its original form and checks if the content is to be published automatically.
Do not comment out the step named AddingDerivedEdition. This step stores the version of the content that subscribers download and is required.
A submission verifier workflow describes the steps taken to validate and protect content submitted to Content Delivery Server. The following code example shows the workflow for externally hosted copyrighted content.
Each workflow that you define requires the following items:
If your workflow creates more than one edition, the edition delivered to the subscriber depends on the capabilities of the device. If more than one edition matches the device, the last edition created that matches is the one delivered. For example, if steps 2, 5, and 7 in your workflow create unique editions of the content and the device is capable of running the editions created in steps 2 and 7, the edition created in step 7 is delivered.
To automatically publish content based on rules defined in the $CDS_HOME/deployment/deployment-name/conf/AutoPublishRules.properties file, include a step that executes AutoPublishAdapter. See Section 1.7, Setting Up Automatic Publishing for information on setting up the rules.
Add your workflow to the $CDS_HOME/deployment/deployment-name/conf/SubmissionVerifierWorkflows.xml file. See Section 14.4, Specifying Workflow Criteria to specify the criteria for which your workflow is executed.
The adapter AddCapabilityAdapter can be used to add required device capabilities to content during the verification process. For example, you can use this adapter to add the bit rate that a device is capable of handling for MP3 files.
The following code sample shows a workflow step that uses this adapter.
This step must appear before the AddDerivedEditionAdapter step so that the values from this step can be added to the derived edition. Otherwise, the values are never saved.
The adapter ExternalToInternalAdapter can be used to convert externally hosted content that was submitted through the Content Aggregator Interface to local content.
The following code sample shows a workflow step that uses this adapter.
This step must appear before the AddDerivedEditionAdapter step so that the conversion can be propagated to the derived edition. Otherwise, the values are never saved.
The adapter ProcessOmaDrmMessageAdapter can be used to accept content that is prewrapped with OMA DRM 1.0 protection and packaged in a DRM message. This adapter adds the MIME type of the protected content as a required device capability.
The following code sample shows a workflow step and criteria that use this adapter.
The adapter SetEditionWeightAdapter can be used to specify the edition weight for an edition of content. Edition weight can be used during capability matching to determine which edition is delivered to a device that matches multiple editions of content. If multiple editions match a device, the edition with the highest edition weight is delivered.
The following code sample shows a workflow step that uses this adapter.
This step must appear before the AddDerivedEditionAdapter step so that the values from this step can be added to the derived edition. Otherwise, the values are never saved.
Each workflow must have at least one set of criteria that identifies the content for which the workflow is executed. This criteria is defined with the workflows in the $CDS_HOME/deployment/deployment-name/conf/SubmissionVerifierWorkflows.xml file.
Only one workflow is executed for each item of content. The workflow executed is determined by the first set of criteria that the content matches, so the order of criteria is important. If more than one criterion is specified in a set of criteria, all criterion must be met for the content to be considered a match.
CODE EXAMPLE 14-7 shows sample criteria for the workflow for externally hosted copyrighted content.
Edit the criterion for an existing set of criteria or create additional sets of criteria to identify the content that you want to be processed by a workflow. For each new set of criteria:
Use any combination of the following attributes as the criterion in a set of criteria. The workflow is executed if content matches all items specified.
Copyright © 2008, Sun Microsystems, Inc. All Rights Reserved.