Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 109,154 Java Programmers for FREE! Ask your question and get quick answers from experts. There are 1,118 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Commons Chains

 
Reply to this topicStart new topic

Commons Chains, question

jmanso5
post 1 Jul, 2008 - 06:31 AM
Post #1


New D.I.C Head

*
Joined: 19 Mar, 2008
Posts: 2

Hello, I'm using Apache Commons Chains to run a series of commands that acomplish a task. My current catalog looks like this:

CODE

<?xml version="1.0" ?>

<!--
  | Configures chains of commands for processing metadata.
  |
  | TODO add configurability to commands ?
  -->
<catalog>
  <!-- Process HFIR TAS metadata. -->
  <chain name="ProcessHfirTasRun">
    <!-- Parse HFIR scan file and add properties to context. -->
    <command className="gov.ornl.sns.translation.process.commands.hfir.ParseScanFile" />
    <!-- Parse HFIR "Proposal" file and add to context. -->
    <command className="gov.ornl.sns.translation.process.commands.hfir.LoadProposalFile" />
    <!-- Generate properties from proposal information for the scan. -->
    <command className="gov.ornl.sns.translation.process.commands.hfir.SetExperimentProperties" />
    <!-- Special processing for some HFIR properties (dates, users). -->
    <command className="gov.ornl.sns.translation.process.commands.hfir.ProcessHfirProperties" />
    <!-- Uses metadata mappings to create DOM. -->
    <command className="gov.ornl.sns.translation.process.commands.CreateMetadataDocument" />
    <!-- Validate DOM against XML schema. -->
    <command className="gov.ornl.sns.translation.process.commands.ValidateMetadataDocument" />
    <!-- Save DOM as file. -->
    <command className="gov.ornl.sns.translation.process.commands.SaveMetadataDocument" />
  </chain>
  <!-- Process HFIR SANS metadata -->
  <chain name="ProcessHfirSansRun">
    <!--  Parse the HFIR sans file and add properties to context -->
    <command className="gov.ornl.sns.translation.process.commands.hfir.ParseSansFile" />
    <!-- Uses metadata mappings to create DOM. -->
    <command className="gov.ornl.sns.translation.process.commands.CreateMetadataDocument" />
    <!-- Validate DOM against XML schema. -->
    <command className="gov.ornl.sns.translation.process.commands.ValidateMetadataDocument" />
    <!-- Save DOM as file. -->
    <command className="gov.ornl.sns.translation.process.commands.SaveMetadataDocument" />
  </chain>
  <!-- Process Tarball Run. -->
  <chain name="ProcessTARBRun">
    <!-- Runs an MD5 checksum to ensure the file wasn't corrupted -->
    <command className="gov.ornl.sns.translation.process.commands.CheckMD5OnFile" />
    <!-- Untar the file -->
    <command className="gov.ornl.sns.translation.process.commands.UntarFile" />
  </chain>
  <chain name="ProcessIPNSRun">
    <!--  Parse the IPNS file and add properties to context -->
    <command className="gov.ornl.sns.translation.process.commands.hfir.ParseIPNSFile" />
    <!-- Uses metadata mappings to create DOM. -->
    <command className="gov.ornl.sns.translation.process.commands.CreateMetadataDocument" />
    <!-- Validate DOM against XML schema. -->
    <command className="gov.ornl.sns.translation.process.commands.ValidateMetadataDocument" />
    <!-- Save DOM as file. -->
    <command className="gov.ornl.sns.translation.process.commands.SaveMetadataDocument" />
  </chain>
</catalog>


As you can see, the Create/Validate/Save Metadata commands are run often and I would like to create a separate chain in this catalog and then just run that chain in each chain above that uses these commands. What is the exact syntax to do that? Thank you for any suggestions.

Joe Mansour
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 9/5/08 05:09PM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month