Open the menu

    Creating the structure of a component

    Creating the structure of a component requires that this component be at least defined. That is, its definition must be created (even if this may change in the future) and that the component has already been deployed in the environment where its structure will be created.

    The steps of the following example are done in a development environment using the IDE Eclipse. As an example, suppose the following project:

    creation_of_the_structure_of_a_component_000

    It is noted that this project contains a module, defined at its root, and four components:

    • br.com.mycompany.intranet,
    • br.com.mycompany.intranet.news,
    • br.com.mycompany.intranet.news.economy and
    • br.com.mycompany.intranet.news.sports.

    For example, let's assume that the workspace of this project is located at C:\Lumis\LumisPortalProjects\intranet-project\workspace, as shown in the figure below:

    creation_of_the_structure_of_a_component_001

    In order for the component structure to be exported to the correct location, it is necessary to configure the source code folder of the server1. For this, just access Settings > Information > Portal Settings > Environment Settings, as shown in the figure below:

    creation_of_the_structure_of_a_component_002

    After that, just edit the server settings2 and insert the base code path of the server pointing to the workspace folder of the environment, as in the figure below:

    creation_of_the_structure_of_a_component_003

    It is also necessary to define the source path of the components. This path is the relative path to the base code path of the server needed to reach the component folder. In this example, the folder for all components is intranet\src. This path (when necessary) will depend on the layout adopted in the project. In this example, all componentdefinition.xml files were modified by adding the highlighted code snippet in the image below:

    creation_of_the_structure_of_a_component_004

    After the deployment of these components in the portal, they will be displayed in the Component Manager as follows:

    creation_of_the_structure_of_a_component_005

    Once the components are deployed, their structure can be created. Suppose the following structure is created:

    creation_of_the_structure_of_a_component_006

    In this case, it was decided that each component will have its own structure:

    • Component br.com.mycompany.intranet => channel /Portal/Intranet
    • Component br.com.mycompany.intranet.news => channel /Portal/Intranet/News
    • Component br.com.mycompany.intranet.news.economy => channel /Portal/Intranet/Economy
    • Component br.com.mycompany.intranet.news.sports => channel /Portal/Intranet/Sports

    It is necessary to associate the components with their respective channels. To do this, just go to Settings > Deployment and Performance Tuning > Deployment > Components and trigger the "Associate channel" option for each component, as shown in the figure below:

    creation_of_the_structure_of_a_component_007

    This will cause the portal to open the component-channel association screen, as shown in the figure below:

    creation_of_the_structure_of_a_component_008

    Just associate each component with its respective channel. After that, the portal structure can be exported. To do this, just right-click on the channel you want to export in the Portal Studio; in this example, we will export the entire portal, and then click on "Export", as in the figure below:

    creation_of_the_structure_of_a_component_009

    It is important to validate that the selected export type is "Structure", as shown below:

    creation_of_the_structure_of_a_component_010

    The structure export will take into account each component so that its structure is exported to the appropriate location (provided it is already associated with the correct channel). Once the export is complete, you can go to the IDE and refresh the project. This will cause the structures of each component to be revealed in the Project Navigator, as shown in the figure below:

    creation_of_the_structure_of_a_component_011

    As a result, each component already has its exported structure in the appropriate location. In this example, the structure of the component br.com.mycompany.intranet would be located at C:\Lumis\LumisPortalProjects\intranet-project\workspace\intranet\src\br\com\mycompany\intranet\componentfiles\structure.

    Where:

    • C:\Lumis\LumisPortalProjects\intranet-project\workspace is the base source code folder of the server
    • intranet\src is the source code path of the component
    • br\com\mycompany\intranet is the path of the component
    • componentfiles\structure is the subfolder of the structure, within the component

    Generically, the structure of a component will be exported to:

    <server source code folder>[/<component source code path>]/<component path>/componentfiles/structure

    Where:

    • server source code folder: is the folder configured in the Environment Settings or, if not configured, <portal install>/lumisdata/source
    • component source code path: is the path defined in the component, if any.
    • component path: is the path equivalent to the component identifier (ex.: the component br.com.mycompany.intranet has a component path br/com/mycompany/intranet).