Using the View Editor - adobe-dmeservices/custom-metadata GitHub Wiki

Using the View Editor

  1. Metadata forms are called Views. Views are JSON files that can be edited manually or by using the View Editor. The Custom Metadata Panel ships with an example View that includes many of the available form elements. It references some common metadata schemas and a custom metadata schema for a fictional Pet Rescue organization. You will likely want to adjust the View or create your own from scratch. There are also several additional Views available as starting points, which highlight common Namespaces and their properties.

  2. You can access the View Editor from Settings. You can then edit a specific View by choosing it from the View Editor menu, or you can use the Tab Manager to edit a View for a specific Tab.

    Choosing a View from the list of predefined Views

    Edit a preexisting View for a specific Tab

  3. This opens the View Editor Panel. Once here, you can add metadata fields and/or edit existing metadata fields.

    • To create a new metadata field, click Add Metadata.
    • To access existing metadata fields, click the pencil icon next to the applicable metadata field.

    How to edit a field's details

  4. Once you edit or create a new metadata field, you will be presented with a pop-up like the one below. You must enter values on the Basic tab before you can enter values in other tabs. Note: some common metadata properties have specific structures. Be sure you know what kind of data your desired property will accept before making a field with the Custom Metadata Panel.

    • On the Basic tab, you can must enter the following properties for each Field:

      • Field Type Choose from one of the options described in detail below
      • Display Name The name of the field you want to display in the View when a user selects a file
      • XMP prefix The short name for the XMP namespace in which your property resides. For instance, the Dublin Core namespace has an XMP prefix of dc. When you type, Custom Metadata will pre-fill with prefixes from common namespaces. When you select one from list, the corresponding namespace details will populate in the XMP namespace field
      • XMP namspace The URI that points to the XMP namespace definition in which your property resides. For instance, the Dublin Core namespace has an XMP Namespace URI of http://purl.org/dc/elements/1.1/ When you type, Custom Metadata will pre-fill with URIs from common namespaces. When you select one from list, the corresponding prefix will populate in the XMP prefix field
      • XMP property name The name of the specific metadata property to which you want to write the value of this field. For instance, within the Dublin Core namespace, the property subject is used for the Keywords that have been applied to an asset by Creative Cloud applications.
      • Read Only You can set a field as read only. This will prevent users from entering data into this field.
    • Other tabs may appear, based on the field type. Specific options for each field type are outlined below.

    Managing Field details

  5. In the Field Type Dropdown, a user can select the type of metadata field they would like to create. A user can choose one of the following Field Types:

    AEM Tags

    • AEM Tags is a special case. We have pre-filled the properties for you on the Basic tab. After configuration, your tags will be available for entry in the panel.
    • This panel requires specially formatted JSON, which you will need to get from your AEM instance. You may need to contact your AEM administrator for assistance.
    • For AEM 6.3 and under, this can be found at your_AEM_URL/etc/tags.tagtree.json - For AEM 6.4+, this can be found at your_AEM_URL/content/cq:tags.tagtree.json
    • Copy and paste the JSON from your browser into the Options panel to configure the field options.
    • Users will now have access to the same tags that are configured in AEM.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.
      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Date Fields

    • Date fields allow users to select dates. The date picker will allow users to select a date and time from a calendar. It allows users to type values, and it will attempt to format the text as a date if necessary.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.
      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Multiple Date Fields

    • Multiple Date fields allow users to enter one or more dates. The date picker will allow users to select a date and time from a calendar. It allows users to type values, and it will attempt to format the text as a date if necessary. Multiple Date fields are stored as Ordered Lists, or Sequence. They can optionally be configured to store the values as unordered lists, or Bag.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.
      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Checkbox Fields

    • Checkbox fields allow users to select one of two predefined values.

    • You can configure the values in the Options tab.

    • Checkbox fields require two values, defined as an object. This must include an 'unchecked' state value and a 'checked' state value. In many cases, the unchecked state is "". The selected value will be written to XMP. In the example below, when the user checks the box, the value "True" will be written to XMP, and when the user unchecks the box, the value "False" will be written to XMP.

      {
      	"checked": "True",
      	"unchecked": "False"
      }
      

      In the next example, when a user checks the box, the value "Red" will be written to XMP. When the user unchecks the box, the value will be removed from XMP.

      {
      	"checked": "Red",
      	 "unchecked": ""
      }
      
    • The checkbox will show a dash if there is no defined value for the property and the unchecked value is not an empty string. Additionally, the checkbox will turn red if the set value is not one of the two predefined values.

      Note: Checkboxes in Checkbox Groups behave differently, in that they do not have a value when unchecked.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.

      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Checkbox Groups

    • Checkbox Group fields allow users to select one of many predefined values.

    • You can configure the values in the Options tab.

    • Options must be defined as an array, each entry containing an object with a "label" and a "value". The selected value will be written to XMP. In the example below, if a user chooses option "Two," then "2" will be written to XMP. If the user chooses options "Two" and "Three," then "2" and "3" will be added to the bag in XMP.

      [
      	{
      		"label": "One",
      		"value": "1"
      	},
      	{
      		"label": "Two",
      		"value": "2"
      	},
      	{
      		"label": "Three",
      		"value": "3"
      	}
      ]
      

      Know that the user must take action in order for a value to be written to XMP.

      Note: Checkboxes in Checkbox Groups behave differently than standalone checkboxes, in that they do not have a value when unchecked.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.

      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Dropdown Fields

    • Dropdown fields allow users to select one value from a menu.

    • You can configure the values in the Options tab.

    • Dropdown fields require an array of options. If you enter an array, the menu will display the values and will use those values when it writes XMP. For example,

      ["dog", "cat", "bird"]
      

      You can also provide a label for each item to make it easier to read or if your users are familiar with another term for the value. Format your array to include label and value pairs for each item. The dropdown will show the label in the menu, but it will read and write the value from XMP. For example, this JSON makes a Dropdown for a field called Pet Type that describes the kind of pet in the photo.

      [
      	{ "label": "Doggy", "value": "dog" },
      	{ "label": "Kitty", "value": "cat" },
      	{ "label": "Birdy", "value": "bird"}
      ]
      

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies. For instance, you might want to disable the Breed dropdown until the Pet Type dropdown has a value.

      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

      Filter Options

      You can use Filter Options to specify one field whose value will be used to filter the values in your dropdown. See Filter Options below for more details on setting the Filter Options parent field.

      Filter Options are defined by the parent key. You can use a single text value or an array of acceptable values, and the values must exactly match the values, not the label, from the field you choose in Filter Options.

      For example, if you had a Dropdown field called Pet Type with values "dog", "cat" and "bird", you could make a second field called "breed" that uses Pet Type to filter its options based on the value of pet. When the user selects "cat" as the breed, the menu defined below would show "Maine Coon" and "Other," because those have "cat" in their parent.

      [
      	{
      		"label": "Schnauzer",
      		"value": "schnauzer",
      		"parent": "dog"
      	},
      	{
      		"label": "Maine Coon",
      		"value": "maine_coon",
      		"parent": "cat"
      	},
      	{
      		"label": "Parrot",
      		"value": "parrot",
      		"parent": "bird"
      	},
      	{
      		"label": "Other",
      		"value": "Other",
      		"parent": ["dog", "cat", "bird"]
      	}
      ]
      

    Multi-Dropdown Fields

    • Multi-Dropdown fields allow users to select multiple value from a menu. It is functionally identical from a Dropdown, but it has an additional advanced configuration option: Selection Groups.

    • While this field type expects pre-defined value from its option list, you can enable users to enter their own values outside of the option list. To enable this feature, enable Allow User Defined Values on the Basic tab.

    • See Dropdown for details on basic configuration options, Filter Options and Dependencies.

    • Multi-Dropdown will use a Bag by default to store entries. You can switch between Bag and Seq using the Array Type menu on the Advanced Tab.

      Selection Groups

      You can use Selection Groups to connect one or more items together to make bulk selection easier. Selection Groups are defined by the group key, and they require an array. When a user selects an item, all items whose group matches the selected item's value will also be selected. Selection Groups are common when certain values are usually selected together, such as product families or related items.

      For example, if a user selects "All Dogs" from the dropdown defined below, the value will be all dogs. This will automatically select all of the items with the group that matches all dogs. Groups can contain arrays of values, so items can belong to one or more selection group.

      [
         {
      		"label": "All Dogs",
      		"value": "all dogs",
      		"parent": "dog",
      		"group": ["all dogs"]
      	},
      	{
      		"label": "All Cats",
      		"value": "all cats",
      		"parent": "cat",
      		"group": ["all cats"]
      	},
      	{
      		"label": "Schnauzer",
      		"value": "schnauzer",
      		"parent": "dog",
      		"group": ["all dogs"]
      	},
      	{
      		"label": "Doberman Pinscher",
      		"value": "doberman",
      		"parent": "dog",
      		"group": ["all dogs"]
      	},
      	{
      		"label": "Chinook",
      		"value": "chinook",
      		"parent": "dog",
      		"group": ["all dogs"]
      	},
      	{
      		"label": "Maine Coon",
      		"value": "maine_coon",
      		"parent": "cat",
      		"group": ["all cats"]
      	},
      	{
      		"label": "Persian",
      		"value": "persian",
      		"parent": "cat",
      		"group": ["all cats"]
      	},
      	{
      		"label": "Parrot",
      		"value": "parrot",
      		"parent": "bird",
      		"group": ["all birds"]
      	},
      	{
      		"label": "Chicadee",
      		"value": "chicadee",
      		"parent": "bird",
      		"group": ["all birds"]
      	},
      	{
      		"label": "Other",
      		"value": "Other",
      		"parent": ["dog", "cat", "bird"],
      		"group": ["Other"]
      	}
      ]
      

    Radio Groups

    • Radio Group fields allow users to select one of several predefined values.

    • Radio Groups can appear horizontally or vertically.

    • You can configure the values in the Options tab.

    • Options must be defined as an array, each entry containing an object with a "label" and a "value". The selected value will be written to XMP. In the example below, if a user chooses option "Two," then "2" will be written to XMP.

      [
      	{
      		"label": "One",
      		"value": "1"
      	},
      	{
      		"label": "Two",
      		"value": "2"
      	},
      	{
      		"label": "Three",
      		"value": "3"
      	}
      ]
      

      Know that the user must take action in order for a value to be written to XMP.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.

      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Switch Fields

    • Switch fields allow users to select one of two predefined values.

    • You can set the display orientation of the Switch Group to horzontal or vertical.

    • You can configure the values in the Options tab.

    • Switch fields require two values, defined as an object. This must include an 'unchecked' state value and a 'checked' state value. In many cases, the unchecked state is defined as "". When enabled, the checked value will be written to XMP. In the example below, when a user enables the switch, the value "True" will be written to XMP. When they disable the switch, the value "false" will be written to XMP.

      {
      	"checked": "True",
      	"unchecked": "False"
      }
      

      In the next example, when a user enables the switch, the value "Red" will be written to XMP. When the user disables the switch, the value will be removed from XMP.

      {
      	"checked": "Red",
      	"unchecked": ""
      }
      

      Know that the user must take action in order for a value to be written to XMP, so the disabled value will not appear unless the user actively disables the switch. Additionally, the switch will turn red if the set value is not one of the two predefined values.

      Note: Switches in Switch Groups behave differently, in that they do not have a value when unchecked.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.

      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Switch Groups

    • Switch Group fields allow users to set the value of a property to one or more of several predefined values. Switch Groups store values in an unordered list, or bag.

    • You can configure the values in the Options tab.

    • Switch Group fields must be defined as an array. The selected values will be written to XMP. In the example below, if a user chooses option "Two," then "2" will be written to XMP. If the user chooses options "Two" and "Three," then "2" and "3" will be added to the bag in XMP.

      [
          { label: 'One', value: '1' },
          { label: 'Two', value: '2' },
          { label: 'Three', value: '3' },
      ]
      

      Know that the user must take action in order for a value to be written to XMP.

      Note: Switches in Switch Groups behave differently than standalone Switches, in that they do not have a value when unchecked.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.

      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Text Fields

    • Text fields provide a single free-form text entry for a property.
    • Any text can be included.
    • The form field can display as a single line or multi line field. For multi line, enable the Multi Line option in the Advanced tab.
    • Language Alternatives are supported. To use Language Alternatives, enable Language Alternative in the Advanced Tab.
      • By default, this option will target the Default Language Alternative. You can select one or more specific languages in the Language Alternative(s) option. Single click on an option to enable it, and click on it again to disable it.
      • Custom Metadata will assume the first choice above is the default Language Alternative. You can change it by choosing a different default Language Alternative in the Default Language Alternative dropdown. You can select only one default option.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.
      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.

    Multiple Text

    • Multiple Text fields allow users to create multiple free-form text entries for a property.
    • Any text can be included in any specific entry.
    • By default, these entries will be included in an unordered list, or bag, in the XMP for the designated property.
    • To change the array type, select Seq or Bag from the Array Type menu on the Advanced Tab.
    • The form field can display as a single line or multi line field. For multi line, enable the Multi Line option in the Advanced tab.

      Dependencies

      You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies.
      • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.You can set one or more Dependencies.

    Section Divider

    • Section Divider is used to separate metadata into logical blocks in your form.
    • Dividers only require a Display Name, which will be used as the divider message.
    • Dividers include a rule underneath the Display Name.

    Subection Divider

    • Subsection Divider is used to separate metadata into logical blocks in your form.
    • Subsection Dividers only require a Display Name, which will be used as the divider message.
    • Subsection Dividers have smaller text than Dividers, and they do not display a rule.

    Tags

    • Tags fields let you constrain the values of a property while allowing entry of multiple values. This is commonly used in keywords-like scenarios where you want to limit what tags a user can apply.
    • Tags fields will auto-complete when a user starts typing values. Tags only accepts arrays of text as its Option.
    • Similar to a dropdown, you configure the tag values in the Options tab.
    • While this field type expects pre-defined value from its option list, you can enable users to enter their own values outside of the option list. To enable this feature, enable Allow User Defined Values on the Basic tab.
    • Tags do not support label, parent or group. For example, the following options will constrain the field to the three possible values dog, cat and bird.
      	["dog", "cat", "bird"]
      
  6. As noted above, all field types (except for Section Divider) will require a user to enter metadata namespace details. Here are some helpful tips for identifying common metadata namespace details using File Info:

    • You can find the XMP namespace and prefix in the Raw Data panel. At the top of the Raw Data, there is a list of all of the namespaces defined in the file. These will start with the tag xmlns: and will follow the pattern xmlns:prefix="namespaceURI"
    • In the example shown below, the prefix is dc, and the namespace URI is http://purl.org/dc/elements/1.1
    • You can also find the XMP Property Name in the Raw Data. Property tags have the form <prefix:propertyName>
    • In the example below, the entry for Keywords is highlighted. Keywords uses the property called subject in the namespace whose prefix is dc.
    • It is common to add metadata to a file and then view the resulting formatting in File Info. Record the Namespace URI, Prefix and property for use in your View.

    Raw Data Specifics