With the Developer Tools kit you are able to reuse and share resources in the form of modules. Modules are workspaces that are not site-specific and contain resources such as Templates, flex families, and ElementCatalog entries. Unlike the standard export/import functionality where assets are added to sites using natural mappings, modules typically utilize site overriding so they can be imported into any site you designate.
Topics:
Artie has a flex family with a flex definition that he wants to reuse in other sites. He also has a Template asset associated with the flex definition. In the following scenario, Artie creates a module containing these resources.
This scenario uses the command line interface to create a module containing the resources Artie and his team developed in Using Developer Tools to Manage and Exchange Resources.
Note:
To use the command line interface, Artie must specify the user name and password of a general administrator in each command he executes. This user must be a member of the RestAdmin
group. In this scenario, Artie uses fwadmin/xceladmin
.
See the following sections:
Artie uses the command line interface to browse his WebCenter Sites instance. He uses the resources=@ALL_ASSETS
and the fromSites=Acceptance
selectors to list all the assets of the Acceptance site. The command Artie uses is listcs
, which lists all the resources on his WebCenter Sites instance.
Command:
${sites-shared}/config/export/envision/cs_workspace$ java - Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line.jar http://<host>:<port>/ <context>/ContentServer username=fwadmin password=xceladmin resources=@ALL_ASSETS fromSites=Acceptance cmd=listcs
Output:
Resource Type ||| Resource Id ||| Name ||| Description ||| Modified On -------------------------------------------------------------------------------- Author_CD ||| 1297720502271 ||| fictionAuthor (status=ED) ||| authors who write fiction ||| 2011-02-17 15:10:41 Author_A ||| 1297720502260 ||| authorName (status=ED) ||| author name ||| 2011-02-17 14:46:40 Author_A ||| 1297720502265 ||| authorBio (status=ED) ||| author biography ||| 2011-02-17 14:46:40 Author_A ||| 1297720502289 ||| 1297720502289 (status=VO) ||| author birthplace ||| 2011-02-17 15:12:35 Author_A ||| 1297720502293 ||| DOB (status=PL) ||| date of birth ||| 2011-02-17 14:46:40 Author_A ||| 1297720502305 ||| birthPlace (status=PL) ||| place of birth ||| 2011-02-17 15:10:22 Template ||| 1297720502331 ||| welcome (Typeless, status=ED) ||| welcome page ||| 2011-02-17 23:18:18
Artie notes that there are five Author_A
flex attribute instances (one of which is voided), one Author_CD
flex definition, and a Template asset.
Artie further uses the command line interface to browse for any start menu items that are assigned to the Acceptance site.
Command:
${sites-shared}/config/export/envision/cs_workspace$ java - Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line.jar http://<host>:<port>/ <context>/ContentServer username=fwadmin password=xceladmin resources=@STARTMENU:* fromSites=Acceptance cmd=listcs
Output:
Resource Type ||| Resource Id ||| Name ||| Description ||| Modified On -------------------------------------------------------------------------------- @STARTMENU ||| 1297720502206 ||| Find Author ||| null ||| - @STARTMENU ||| 1297720502214 ||| Find Author Attribute ||| null ||| - @STARTMENU ||| 1297720502222 ||| Find Author Definition ||| null ||| - @STARTMENU ||| 1297720502230 ||| Find Author Filter ||| null ||| - @STARTMENU ||| 1297720502238 ||| Find Author Parent ||| null ||| - @STARTMENU ||| 1297720502246 ||| Find Author Parent Def ||| null ||| - @STARTMENU ||| 1297720494070 ||| Find CSElement, FirstSiteII ||| Find CSElement ||| - @STARTMENU ||| 1297720494086 ||| Find Page, FirstSiteII ||| Find Page ||| - @STARTMENU ||| 1297720494078 ||| Find SiteEntry, FirstSiteII ||| Find SiteEntry ||| - @STARTMENU ||| 1297720494066 ||| Find Template, FirstSiteII ||| Find Template ||| - @STARTMENU ||| 1297720502210 ||| New Author ||| null ||| - @STARTMENU ||| 1297720502218 ||| New Author Attribute ||| null ||| - @STARTMENU ||| 1297720502226 ||| New Author Definition ||| null ||| - @STARTMENU ||| 1297720502234 ||| New Author Filter ||| null ||| - @STARTMENU ||| 1297720502242 ||| New Author Parent ||| null ||| - @STARTMENU ||| 1297720502250 ||| New Author Parent Def ||| null ||| - @STARTMENU ||| 1297720501427 ||| New CSElement ||| null ||| - @STARTMENU ||| 1297720494052 ||| New Page, FirstSiteII ||| New Page ||| - @STARTMENU ||| 1297720501431 ||| New SiteEntry ||| null ||| - @STARTMENU ||| 1297720501435 ||| New Template ||| null ||| -
Before he creates a module, Artie first exports all resources into a particular workspace.
Artie wants to create a module using all of the resources listed in List the Resources in the WebCenter Sites Instance and List Start Menu Items. He runs the following command to export all of the resources, at one time, into the specified workspace:
Command:
${sites-shared}/config/export/envision/cs_workspace$ java - Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line.jar http://<host>:<port>/ <context>/ContentServer username=fwadmin password=xceladmin resources=@STARTMENU:*;@ALL_ASSETS fromSites=Acceptance cmd=export datastore=authorModule
Output:
*** Exporting batch 1298385511005 Exporting ASSETDATA Author_CD:1297720502271 (batch 1298385511005) Exporting ASSETDATA Author_A:1297720502260 (batch 1298385511005) Exporting ASSET_TYPE Author_A (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/LoadSiteTree (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/AppendSelectDetails (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/AppendSelectDetailsSE (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/IndexAdd (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/IndexReplace (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/IndexCreateVerity (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/ContentDetails (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/ContentForm (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/PostUpdate (batch 1298385511005) Exporting ELEMENTCATALOG OpenMarket/Xcelerate/AssetType/Author_A/PreUpdate (batch 1298385511005) ...
All asset types for the flex family are included in the export. In addition, all elements belonging to those types are included as well. This information, although not usually modified, is necessary to make the module Artie is creating reusable on other WebCenter Sites instances.
Artie inspects the authorModule workspace on his file system.
Artie notes that the Template asset, flex family members, asset types, and start menu items were all exported to the workspace on his file system.
Artie is just one step away from importing the authorModule to a WebCenter Sites instance.
Artie creates a .zip
file archive of the authorModule workspace and saves it.