The so called “XML Editor” is a GUI generator that allows to edit XML content in a user friendly way. It is used in various places in the clients, especially for creating dialogs. Since the client and server exchange all information and commands as XML, the XMLEditor is particular useful.

Asset attributes editing dialog

The asset information shown in the previous dialog is derived from the underlying XML as it
comes from the censhare server:

  • Asset XML

<asset actual_revision="0" application="default" ccn="17" content_version="1" corpus:dto_flags="p" created_by="260" creation_date="17.04.2008-06:45:41 +0200" currversion="0" deletion="0" domain="root." domain2="root." has_master_file="1" has_update_geometry="0" id="286200" id_extern="corpus:286200" iscancellation="0" islogo="0" istemplate="0" isweb="0" modified_by="260" modified_date="17.04.2008-06:45:41 +0200" name="Tirol 1.jpg" non_owner_access="0" rowid="AAANlzAAFAAABMdAAA" state="0" storage_state="0" tcn="17" type="picture" version="1" wf_id="140" wf_step="1" wf_target="150">
  <child_asset_rel child_asset="292000" child_currversion="0" corpus:dto_flags="p" deletion="0" has_update_child_geometry="0" has_update_content="0" iscancellation="0" parent_asset="286200" parent_currversion="0" rowid="AAANmwAAFAAABG/AAS" sid="891200" type="0"/>
  <asset_element asset_currversion="0" asset_id="286200" asset_version="1" corpus:dto_flags="p" corpus:first_child_type="1" deletion="0" height_mm="252.94" idx="0" rowid="AAANmRAAFAAAD0LAAC" sid="720320" type="1" version="0" width_mm="380.29"/>
  <storage_item asset_id="286200" asset_version="1" color="rgb" corpus:dto_flags="p" dpi="72" element_idx="0" filelength="10653" filesys_name="assets" height_px="166" key="thumbnail" mimetype="image/jpeg" modified_date="17.04.2008-06:45:46 +0200" relpath="file:12/72/127240.jpg" rowid="AAANo7AAFAAAB0hAA1" sid="1104550" state="0" width_px="250"/>
  <storage_item asset_id="286200" asset_version="1" color="rgb" corpus:dto_flags="p" dpi="72" element_idx="0" filelength="376121" filesys_name="assets" height_px="717" key="master" mimetype="image/jpeg" modified_date="17.04.2008-06:45:40 +0200" original_name="Tirol 1.jpg" original_path="/Users/walbauer/Desktop/IMTest/Tirol 1.jpg" relpath="file:12/72/127238.jpg" rowid="AAANo7AAFAAAB1bAAF" sid="1104530" state="0" width_px="1078"/>
  <storage_item asset_id="286200" asset_version="1" color="rgb" corpus:dto_flags="p" dpi="72" element_idx="0" filelength="162740" filesys_name="assets" height_px="665" key="preview" mimetype="image/jpeg" modified_date="17.04.2008-06:45:45 +0200" relpath="file:12/72/127239.jpg" rowid="AAANo7AAFAAADouAAO" sid="1104540" state="0" width_px="1000"/>
</asset>

The dialog GUI definition is expressed with XML as well. It may look complex at first, but is actually quite easy to create or modify using standard XML editing tools that support schema validation and code completion. Customization can be done without development experience. Localization is supported through standard java properties files.

  • XML editor GUI definition

<cmd xsi:noNamespaceSchemaLocation="http://www.censhare.com/xml/3.0.0/dialogs-schema.xsd">
 
 <xml-info title="${javaclient-dialogs-asset-title}" description="${javaclient-dialogs-asset-description}" localize="true">
   <property-resources>
     <base url="file:module-custom"/>
     <base url="file:module"/>
     <base url="file:../common/module"/>
     <base url="file:../../../common/global"/>
   </property-resources>
 </xml-info>
 
 <cmd-info name="client.javaclient.dialogs-asset" enabled="true">
 </cmd-info>
 
 <xe:part id="dialog_asset_edit_intern" transactional="true">
   <xe:param readonly="false" show_preview="false" show_deadline_calculated="false" show_search_buttons="false"/>
   <xe:group align="down" readonly="=$param@readonly">
     <xe:assetpreview height="200" max-items="10" enabled="=$param@show_preview"/>
     <xe:groupbox caption="${asset-attributes}" font-weight="bold" align="down">
       <xe:editfield label="${asset-name}" label-width="15em" weight-x="1" maxwidth="600" source="@name" data-type="VARCHAR(256)">
         <xe:validate not-empty="true"/>
       </xe:editfield>
       <xe:popupmenu label="${asset-type}" label-width="15em" width="200" source="@type">
         <xe:options source="$cachedtables.asset_typedefs.asset_typedef" label-key="@description" value-key="@asset_type"/>
       </xe:popupmenu>
       <xe:group>
         <xe:popupmenu label="${asset-subtype}" label-width="15em" width="200" source="@subtype">
           <xe:options source="$cachedtables.asset_subtypedefs.asset_subtypedef" label-key="@description" value-key="@asset_subtype">
             <xe:filter source="@asset_type" match-source="$current@type"/>
           </xe:options>
           <xe:listen-to source="@type">
             <xe:change dest="@subtype" value="=null"/>
           </xe:listen-to>
         </xe:popupmenu>
         <xe:deletebutton source="@subtype"/>
       </xe:group>
       <xe:group>
         <xe:popupmenu label="${asset-workflow}" label-width="15em" width="200" source="@wf_id">
           <xe:options source="$filtered_cachedtables.workflows.workflow" label-key="@name" value-key="@id"/>
         </xe:popupmenu>
         <xe:deletebutton source="@wf_id"/>
       </xe:group>
       <xe:popupmenu label="${asset-workflow-step}" label-width="15em" width="200" source="@wf_step">
         <xe:options source="$cachedtables.workflow_steps.workflow_step" label-key="@name" value-key="@wf_step">
           <xe:filter source="@wf_id" match-source="$current@wf_id"/>
         </xe:options>
         <xe:listen-to source="@wf_id" is-key-part="true">
           <xe:change dest="@wf_step" value="=lookup('$filtered_cachedtables.workflows.workflow', '@id', '@wf_id')@def_step"/>
         </xe:listen-to>
       </xe:popupmenu>
       <xe:group>
         <xe:popupmenu label="${asset-workflow-target}" label-width="15em" width="200" source="@wf_target">
           <xe:options source="$filtered_cachedtables.partys.party" label-key="@display_name" value-key="@id"/>
           <xe:listen-to source="@wf_id">
             <xe:listen-to source="@wf_step">
               <xe:change dest="@wf_target" value="=lookup('$cachedtables.workflow_steps.workflow_step', '@wf_id', '@wf_id', '@wf_step', '@wf_step')@def_party" allow-set-null="true"/>
             </xe:listen-to>
           </xe:listen-to>
         </xe:popupmenu>
         <xe:deletebutton source="@wf_target"/>
       </xe:group>
       <xe:editdate label="${asset-deadline-calculated}" label-width="15em" width="200" source="@deadline_calc" readonly="true" enabled="=$param@show_deadline_calculated"/>
       <xe:group>
         <xe:editdate label="${asset-deadline-manual}" label-width="15em" width="200" source="@deadline"/>
         <xe:deletebutton source="@deadline"/>
       </xe:group>
       <xe:popupmenutree label="${asset-domain}" label-width="15em" column-width="11em" source="@domain" hide-root-popup="false" defaultvalue="root.">
         <xe:treeoptions source="$filtered_cachedtables.domains.domain" label-key="@name" value-key="@pathid"/>
       </xe:popupmenutree>
       <xe:popupmenutree label="${asset-domain2}" label-width="15em" column-width="11em" source="@domain2" hide-root-popup="false" defaultvalue="root.">
         <xe:treeoptions source="$filtered_cachedtables.domain2s.domain2" label-key="@name" value-key="@pathid"/>
       </xe:popupmenutree>
       <xe:group>
         <xe:popupmenu label="${asset-language}" label-width="15em" width="200" source="@language">
           <xe:options source="$cachedtables.language_defs.language_def" label-key="@description" value-key="@id"/>
         </xe:popupmenu>
         <xe:deletebutton source="@language"/>
       </xe:group>
       <xe:groupbox caption="${asset-keywords}" minwidth="250" align="down">
         <xe:strut weight-x="1"/>
         <xe:foreach new-caption="${asset-new-keyword}" source="asset_keyword" align="down">
           <xe:identify-children-by key="@keyword"/>
           <xe:inititems>
             <xe:inititem dest="@keyword" value="root."/>
           </xe:inititems>
           <xe:label value="${asset-keyword}" width="15em" source="@keyword"/>
           <xe:deletebutton/>
           <xe:popupmenutree column-width="11em" source="@keyword" hide-root-popup="false">
             <xe:treeoptions source="$filtered_cachedtables.keywords.keyword" label-key="@name" value-key="@pathid"/>
           </xe:popupmenutree>
         </xe:foreach>
       </xe:groupbox>
       <xe:editfield label="${asset-keywords}" label-width="15em" weight-x="1" maxwidth="600" source="@keywords" data-type="VARCHAR(4000)"/>
       <xe:editfield label="${asset-author}" label-width="15em" weight-x="1" maxwidth="600" source="@author" data-type="VARCHAR(128)"/>
       <xe:edittext label="${asset-annotation}" label-align="left-top" label-width="15em" prefwidth="200" maxwidth="800" weight-x="1" weight-y="1" source="@annotation" data-type="VARCHAR(4000)"/>
       <xe:group>
         <xe:popupmenu label="${asset-owner}" label-width="15em" width="200" source="@owner">
           <xe:options source="$filtered_cachedtables.partys.party" label-key="@display_name" value-key="@id"/>
         </xe:popupmenu>
         <xe:deletebutton source="@owner"/>
       </xe:group>
       <xe:popupmenu label="${asset-non-owner-access}" label-width="15em" width="200" source="@non_owner_access" defaultvalue="0" readonly="=@owner=null">
         <xe:options>
           <xe:option label="${asset-non-owner-access-0}" value="0"/>
           <xe:option label="${asset-non-owner-access-1}" value="1"/>
           <xe:option label="${asset-non-owner-access-2}" value="2"/>
         </xe:options>
         <xe:listen-to source="@owner">
           <xe:change condition="=@owner=null" value="0" dest="@non_owner_access"/>
         </xe:listen-to>
       </xe:popupmenu>
       <xe:popupmenu label="${asset-template-type}" label-width="15em" width="200" source="@istemplate">
         <xe:options>
           <xe:option label="${asset-no-template}" value="0"/>
           <xe:option label="${asset-copy-template}" value="1"/>
           <xe:option label="${asset-input-template}" value="2"/>
           <xe:option label="${asset-translation-template}" value="3"/>
           <xe:option label="${asset-output-template}" value="4"/>
         </xe:options>
       </xe:popupmenu>
       <xe:group>
         <xe:editfield label="${asset-usage}" label-width="15em" width="50" source="@max_actual_parent_rels" data-type="INTEGER"/>
         <xe:label value="${asset-max-actual-parent-rels}"/>
       </xe:group>
       <xe:group align="right">
         <xe:label label="Flags" label-width="15em"/>
         <xe:checkbox source="@iscancellation" unchecked-value="0" checked-value="1"/>
         <xe:label label="${asset-cancellation}" label-width="8em"/>
         <xe:checkbox source="@issnapshot" unchecked-value="0" checked-value="1"/>
         <xe:label label="${asset-snapshot}" label-width="8em"/>
         <xe:checkbox source="@isprint" unchecked-value="0" checked-value="1"/>
         <xe:label label="Print" label-width="8em"/>
         <xe:checkbox source="@isweb" unchecked-value="0" checked-value="1"/>
         <xe:label label="Web" label-width="8em"/>
       </xe:group>
       <xe:group>
         <xe:label id="colorpicker_label" value="${asset-color}" width="15em"/>
         <xe:colorpicker width="16" height="16" source="@color"/>
         <xe:deletebutton label-id="colorpicker_label" source="@color"/>
       </xe:group>
       <xe:popupmenu label="${asset-application}" label-width="15em" width="200" source="@application">
         <xe:options source="$cachedtables.asset_applications.asset_application" label-key="@description" value-key="@id"/>
       </xe:popupmenu>
       <xe:group align="right" enabled="=$param@show_search_buttons">
         <xe:button action="asset-search-edit" caption="${asset-search-edit}" label="${asset-search-search}" label-width="15em">
           <xe:readonly-filters>
             <xe:filter source="$search-xml-control@readonly" match="1"/>
           </xe:readonly-filters>
         </xe:button>
         <xe:button action="asset-search-delete" caption="${asset-search-delete}"/>
       </xe:group>
     </xe:groupbox>
   </xe:group>
 </xe:part>
</cmd>