Custom output workflow?

Is it possible to add a custom item to the list of default output workflow statuses in Tridion, e.g. add 'Archived' to compliment the default items 'Draft,' 'Released,' etc. The idea would be to programmatically set this workflow status on specific outputs using the publicationoutput create or setmetadata API calls.

Parents Reply
  • Hi Jered, thanks for your reply. We are investigating the possibility of archiving output binary data to save DB space. We would like some way of indicating to the output owner (the writer) that an output's data has been archived. The workflow status is quite visible and could have worked well. A custom metadata field could also work but would only be visible via the output's properties (it might also be added to the columns displayed under the Output tab in Pub Manager, but not in the web client I believe). If we were to use a custom metadata field, is this something we could add ourselves, our would we require SDL to assist?

Children
  • Hey Barra,

    In this case, I would suggest to create a custom metadata field to indicate if the output format can be archived or not. A checkbox should do the trick. 

    Before you continue, please make sure you have a recent backup in place (both DB and Server). Also I haven't fully tested the scripts :)

    Creating the Database Field

    You will need to create a database setup script that will add the custom field into the database. Recommended is to save the setup script in Infoshare\App\Database\Common\DatabaseIndependent\Examples\TestFields

    XML Script example:

    <?xml version="1.0" encoding="utf-8"?>
    <setup version="2.0">
    <cardtypes>
    <cardtype element="CTPUBLICATIONOUTPUT">
    <fielddefinition>
    <cardtypefield element="FCUSTARCHIVE" />
    </fielddefinition>
    </cardtype>
    </cardtypes>
    <fields>
    <field element="FCUSTARCHIVE" issystem="false" isbasic="true" ismandatory="false" isindexable="true">
    <label>Archive Output</label>
    <description>Checkbox to indicate that the output can be archived.</description>
    <typelov element="BOOLEAN" ismultivalue="false"/>
    </field>
    </fields>
    </setup>

    You also need to create a PowerShell Script. However you can duplicate one of the Sample PowerShell scripts already in the Examples\TestFields folder. Rename the PowerShell so that it matches your XML setup script. 

    Execute the PowerShell script to add the field to the Database. Once the field is successfully added, it is recommended to recycle the IIS appPools and Com+ Services.

    Updating the Metadata Config:

    The easiest approach is to search for the Group Definition Draft Comments as this is usually applicable for all output formats: <ishfrmgroup id="PublicationOutput.DraftOptionsGroup">

    Next Duplicate the field definition: <ishfrmfield name="PublicationOutput.IncludeMetadataField" And change it with the correct labels and Field Name as you have used in the Setup script.

    If you use Version 13 or higher, the MetadataConfig will also control the webclient.

    Adding the field to the Webclient Display

    In PM you can select the fields you want to display, however the webclient is still a "static" layout. If you want to display the field in the webclient, you need to modify the 'Display in list' files.

    You can find them under  Infoshare\Web\Author\ASP\XSL\PublicationDisplay.xml

    Make sure you add the field under <LNG-VERSION> otherwise it will not be able to display the value. Since it is a Boolean field, it will only display a True of False word.

    Removing Publication Outputs

    Now that you have added the fields and the output owners have been able to set the Archive checkbox, you can query the system for output formats. I would suggest to filter your query to include all output formats that have been set to Archive, but where the Publication State is not "To be Published" Or "Released" Although you can remove To Be Published, it will not clean up much data. Released Outputs cannot be removed from the system. 

  • Hi Jered, many thanks for the detailed answer. We haven't tried it yet but I think this should serve our purpose. 

    regards,

    Barra