33 Using Workspaces in Developer Tools

Developer Tools stores resources exported from an integrated WebCenter Sites instance. The storage structures for each type of resource such as assets, code-based resources, attribute editor, and asset type is different. Continue reading to know how each storage structure is designed.

For information about using workspaces in Developer Tools to store resources, see these topics:

33.1 Introduction to Workspaces

A workspace is a disk-based repository of serialized WebCenter Sites data that represents resources from either the workspace's WebCenter Sites instance or another instance's workspace. Workspaces can store any type of WebCenter Sites resource including assets, flex families, sites, and so on. Each workspace is associated with one WebCenter Sites instance.

By default, Eclipse provides each WebCenter Sites instance with a main Developer Tools workspace (located in the Eclipse project folder) that is used for continuous development when working in the Eclipse IDE. Custom workspaces can be created by advanced developers using the Developer Tools command line interface. See Using Developer Tools Command Line Interface (CLI). Custom workspaces can be used for special projects, such as creating modules.

With the use of a version control system (such as Subversion) or a shared file system, resources stored on one workspace can be exchanged with other workspaces. Any resource exported from a WebCenter Sites instance into the associated workspace can be copied to another WebCenter Sites instance's workspace. This makes the resource available for import into the second workspace's associated WebCenter Sites instance. For more information about sharing resources between different workspaces, see Integrating Developer Tools Workspaces with Version Control Systems.

33.2 Workspace Structure

All workspaces have the same structure. The main Developer Tools workspace is the only visible workspace in the Eclipse project folder.

Workspaces are created under the export/envision folder inside the WebCenter Sites installation directory. The main Developer Tools workspace is located under the export/envision/cs_workspace folder.

Each resource contained in a workspace is stored as a single file or several interrelated files. The main file for each resource ends in .main.xml and contains resource-specific metadata. This main file also contains links to other files associated with the resource (such as an attached document, a JSP file, or a blob). This enables each resource to be fully self-contained, if all of a resource's associated files are stored in the workspace. Otherwise, the resource is incomplete.

Multiple files of a resource are listed in the bottom section of the .main.xml file as storable0, storable1, and so on. The associated files of any given resource have similar names. This way, all of a resource's associated files appear together, except ElementCatalog entries which are stored separately to preserve their original root path.

The location of a resource's files in the workspace depends on the type of resource. The workspace is divided into the following sections:

  • src/_metadata: The metadata section of a given resource which contains assets, asset types, sites, roles, and so on. In addition, legacy XML code is stored under the ELEMENTS/ subfolder.

  • src/jsp/cs_deployed: This section stores a resource's JSP file under its proper path.

Because workspaces have a highly consistent structure, resources from one workspace can be copied to another. As with all file system copy operations, ensure you are not overwriting files that have the same name.

33.3 Asset Storage Structure

Assets are stored under folders named src/_metadata/ASSET/asset type.

Under this structure, there is a two-level hash-based hierarchy, which contains asset data. The name of the asset file is based on the asset name and its fw_uid value. If the asset includes attached documents or blobs, then the file name is based on the asset name, attribute name, fw_uid value, and the name of the document or blob (if any).

For example, a Document_C asset named FSII IES_Manual.pdf contains an attached document called IES_MDPlayer_Manual.pdf. Therefore, this asset is stored as two separate files:

  • The first is the .main.xml file, which contains the asset's metadata and links to the files associated with the asset:

    .src/_metadata/ASSET/Document_C/8/0/FSII IES_MDPlayer_
        Manual.pdf(aa0b47b5-f558-49d4-a6ac2ee012d1b75).main.xml
    

  • The second is the actual document, which is a PDF file in this example:

    .src/_metadata/ASSET/Document_C/8/0/FSII IES_MDPlayer_
        Manual.pdf.FSIIDocumentFile(aa0b47b5-f558-49d4-8a6a-
        c2ee012d1b75).IES_MDPlayer_Manual.pdf
    

Note:

Because all file names of the asset are based on the asset's name, renaming the asset also renames the file. If you are tracking the asset in a VCS, then delete the file with the old name.

33.4 Code-Based Resource Storage Structure

Templates, CSElements, and ElementCatalog entries are stored under the storage path required by their code elements.

The JSP files associated with code-based resources are stored in the workspace under src/jsp/cs_deployed, and the XML elements are stored under src/_metadata/ELEMENTS. The metadata files of code-based resources are stored under the same name as the resource's JSP with the appended .main.xml extension. Therefore, the code-based resource's metadata, JSP, and XML files are grouped together in the workspace.

33.5 Attribute Editor Storage Structure

Attribute editors are tracked as assets, but also have implicit references to a set of ElementCatalog entries. An attribute editor's ElementCatalog entries are tracked independently.

For example, the TextArea editor uses the OpenMarket/Gator/AttributeTypes/TEXTAREA ElementCatalog entry, which is registered as a dependency. Developer Tools maintains the following files for the TextArea editor:

  • The .main.xml file:

    src/_metadata/ASSET/AttrTypes/9/10/TextArea(e64f983d-9c7c-489baedb-
        476d56f8121e).main.xml
    
  • The urlxml metadata file:

    src/_metadata/ASSET/AttrTypes/9/10/TextArea.urlxml(e64f983d-9c7c-
        489b-aedb-476d56f8121e).1095346398911.txt
    
  • The ElementCatalog entry, tracked as an independent resource:

    • The .main.xml file of the ElementCatalog entry:

    src/_metadata/ELEMENTS/OpenMarket/Gator/AttributeTypes/TEXTAREA
           .xml.main.xml
    
    • The attribute editor's element code:

       src/_metadata/ELEMENTS/OpenMarket/Gator/AttributeTypes/
           TEXTAREA.xml
    

33.6 Asset Type Storage Structure

Asset types have a main metadata part and a set of elements.

For example, the following is the structure of a Page asset type:

  • The main metadata of the page is stored in the .main.xml file:

    src/_metadata/Asset_Type/Page(b8d8ae9-14cc-4554-b80e-0c22e39a3ec8).main.xml
    
  • The associated elements are tracked independently (each element has its own .main.xml file):

    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        SearchForm.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        CheckDelete.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        ContentForm.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        ContentDetails.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        LoadSiteTree.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        IndexReplace.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        LoadTree.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        IndexAdd.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        SearchForm.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        IndexReplace.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        PreviewPage.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        LoadTree.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        PreUpdate.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        Tile.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        SimpleSearch.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        SimpleSearch.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        ContentForm.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        AppendSelectDetailsSE.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        LoadSiteTree.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        AppendSelectDetails.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        ManageSchVars.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        PreviewPage.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        CheckDelete.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        ManageSchVars.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/
        Page/PreUpdate.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        AppendSelectDetails.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        IndexCreateVerity.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        ContentDetails.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        PostUpdate.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        IndexAdd.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        IndexCreateVerity.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        Tile.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        AppendSelectDetailsSE.xml.main.xml
    src/_metadata/ELEMENTS/OpenMarket/Xcelerate/AssetType/Page/
        PostUpdate.xml.main.xml