< Previous | Next >

Contribute to a role

The goal of this exercise is to extend a role by adding a contribution.

  1. Switch to the Authoring perspective if you are not already using it.
  2. Expand my_plug-in until you see the Content Packages node. Right-click this node to create a new content package called "Contribution Test". Save your changes by closing the editor window after you name the new content package.
  3. Right-click the Roles folder and select New > Role.
  4. Use the following attributes for this new role:
    • Name: my_contributing_architect
    Do not close the editor window yet because we have not finished defining this role.
  5. Scroll down the window to the Content Variability section and use the Variability type menu to select Contributes.
  6. Click Select for this section. The Select Dialog: Roles window opens. Choose the base role architect. You will find this in the core.default.role_def.base plug-in.
    role editor: contributing role is software architect
    Click OK to complete the selection. You can now continue using the role editor. The Content Variability section should look like this:
    role editor: variability base set to software architect
  7. Add some sample text to the Brief description and Main description fields.
    • Brief description: Contributing brief description text
    • Main description: Contributing main description text
    These are the text strings that we will look for later in this exercise. Save your changes by closing the role editor.
  8. In the Library view under Configuration, double-click my.basic.configuration to open it.
  9. Click the Plug-in and Package Selection tab. Make sure that base under core > default > role_def package and the method plug-in that we created earlier (my_plug-in) are selected. Save the new configuration by closing the editor window.
  10. Use the configuration selection pull-down menu to select my.basic.configuration.
  11. Switch to the Browsing perspective and then open the Architect role in the configuration panel. It is in the Role Sets > Basic Roles folder. You should see the text that you included in the contributing role appended to the existing brief description of this role at the top of the page. This is how contributing variability works: it appends text to the base element.
    software architect role now shows contributing brief description text
    Note: The Configuration view resolves variability relationships between related plug-ins in a configuration and shows the results as they will be published in a published Web site.
< Previous | Next >