C H A P T E R  8

Content Validation Workflows

Content submitted to the 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. Content that does not require special processing must be processed by the default workflow.

The workflows provided with Content Delivery Server are defined in the $CDS_HOME/deployment/deployment-name/conf/SubmissionVerifierWorkflows.xml file.

Workflows are provided for the following types of content:

Use of the workflows provided with the Content Delivery Server is described in the Sun Java System Content Delivery Server Installation Guide. If these workflows do not meet your needs, you can create your own.

This chapter presents the following topics:


8.1 Creating a Content Validation Adapter

A content validation adapter processes the content that is submitted to the Content Delivery Server according to the purpose of the adapter. 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 provided with the Content Delivery Server.


TABLE 8-1 Content Validation Adapters

Adapter

Description

APIFilterAdapter

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.

MIDletValidationAdapter

Validates that the byte stream is a MIDlet application archive file.

CopyrightAdapter

Ensures that copyrighted content is not stored locally.

IAppliValidationAdapter

Validates that the byte stream is an iAppli application archive file.

AddDerivedEditionAdapter

Stores the edition that is published, stocked and downloaded.

MIDletSigningAdapter

Signs the MIDlet.

MIDletPermissionsAdapter

Adds permissions to the MIDlet-Permissions and MIDlet-Permissions-Opt attributes that are needed to run MIDlets that are instrumented with connected DRM agents.

DRMAdapter

Instruments a MIDlet with the DRM agent.

MethodRedirectionAdapter

Redirects certain method calls to methods that provide the special processing required by MIDlets instrumented with DRM agents.


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.

If you create your own adapter, you must register the adapter by adding 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. For example, if you create an adapter named MyValidationAdapter that requires a property file named Validation.properties, add the following statement to the file:


<adapter id="MyValidationAdapter"
    name="sample.package.MyValidationAdapter" 
    propertyfile="Validation.properties"/>


8.2 Creating a Workflow

A workflow describes the steps taken to validate and protect content submitted to the Content Delivery Server. The following code example shows the workflow for externally hosted copyrighted content.


CODE EXAMPLE 8-1 Workflow for Externally Hosted Copyrighted Content
<workflow id="4" name="Copyrighted External Content Workflow" 
          activation="manual">
  <desc>
    This workflow is used to ensure copyrighted external content is not stored
  </desc>
  <step-list>
    <step id="1" name="AddingDerivedEdition" adapter="AddDerivedEditionAdapter">
      <desc>
        This step adds a downloadable edition derived from the original
      </desc>
      <argument-list>
        <argument name="AddDerivedEdition.EditionNameSuffix"
                  kind="indirect" value="editionnamesuffix""/>
        <argument name="AddDerivedEdition.StoreOriginalBytes"
                  kind="direct" value="true"/>
      </argument-list>
    </step>
    <step id="2" name="PreventingCopies" adapter="CopyrightAdapter">
      <desc>
        This step removes any locally stored copies of the content
      </desc>
    </step>
  </step-list>
</workflow>

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.


8.3 Defining Criteria for the Workflow

The workflow that is executed is determined by the criteria defined for the workflow. See the section "Specifying Workflow Criteria" in the Sun Java System Content Delivery Server Installation Guide for information on setting up the criteria for the workflow that you created.