Non versioned repositories in BCC Customization







Step 1: Create custom StatesActiviy 
/config/com/my/activity/statesActivities.xml
<generic-activities>

  <activity>
    <id>states</id>
    <resource-bundle>com.my.bcc.WebAppResources</resource-bundle>
    <display-name-resource>states.displayName</display-name-resource>
    <description-resource>states.description</description-resource>
    <destination-page>
      <url>/ControlCenter/index.html</url>
      <clear-context>true</clear-context>
      <acl>Profile$accessRight$statesfull:read;Profile$accessRight$statesread:read</acl>
    </destination-page>
  </activity>


</generic-activities>

Step 2. Create custom activitySource
config/com/my/activity/statesActivitySource.properties

$class=atg.bizui.activity.PortalActivitySource

# The name and description for the activity source entry that appears on the left side of the home page.
activitySourceResourceBundle=com.my.bcc.WebAppResources
activitySourceNameResource=activitySourceName
activitySourceDescriptionResource=activitySourceDescription

# Generic activity definitions
genericActivityDefinitionFiles=/com/my/activity/statesActivities.xml
genericActivityFileModificationInterval=every 300 seconds



# URLs for the create-project page, the main project page, and the task page.
defaultCreateWorkflowURL=/atg/bcc/process?successURL=/AssetManager/assetManager.jsp
defaultProcessURL^=/atg/bizui/activity/PublishingActivitySource.defaultProcessURL
defaultTaskURL=/AssetManager/assetManager.jsp

fallbackPriority=2
displayOrderPriority=30
securityConfiguration=/atg/dynamo/security/SecurityConfiguration
XMLToolsFactory=/atg/dynamo/service/xml/XMLToolsFactory
scheduler=/atg/dynamo/service/Scheduler

Step 3: Register custom ActivitySource in ActivityManager (OOB component).
/config/atg/bizui/activity/ActivityManager.properties

activitySources+=/com/my/activity/statesActivitySource

Step 4: Create separate ViewConfiguration files for each item descriptor (ex: states and cities)
/config/com/my/web/assetmanager/statesViewConfiguration.properties

# Component containing configuration info for the browse view for states.
#
$class=atg.web.assetmanager.configuration.FilterableBrowseListViewConfiguration
$scope=session

# The path to the repository from which to draw the items
repositoryPath=/atg/userprofiling/statesRepository

# The type of items to display
assetTypeName=states

# what types the user is allowed to create in this view
#createableTypesList=user

# how many items to show per page
itemsPerPage=50

/config/com/my/web/assetmanager/citiesViewConfiguration.properties

# Component containing configuration info for the browse view for cities.
#
$class=atg.web.assetmanager.configuration.FilterableBrowseListViewConfiguration
$scope=session

# The path to the repository from which to draw the items
repositoryPath=/atg/userprofiling/statesRepository

# The type of items to display
assetTypeName=city

# what types the user is allowed to create in this view
#createableTypesList=user

# how many items to show per page

itemsPerPage=50

Step 5: Configure Tabs and Buttons in TaskConfiguration.
/config/atg/web/assetmanager/configuration/taskConfiguration.xml


<task-configuration>

  <!-- ===================================================================== -->

  <activity id="editstates" inherit-from="assetManager.defaultEdit">

    <activity-name>
      editstates
    </activity-name>

    <operations>
      <operation>create</operation>
      <operation>duplicate</operation>
      <operation>addToMultiEdit</operation>
    </operations>

    <!-- Define tabs for the left pane -->
    <tabs>
      <tab-order>
        <tab-id>browse</tab-id>
        <tab-id>search</tab-id>
        <tab-id>multiEdit</tab-id>
      </tab-order>
      <initial-tab>
        browse
      </initial-tab>

      <!-- Configure the Browse tab -->
      <tab id="browse">
        <display-name-resource>
          assetManager.tab.browse
        </display-name-resource>
        <page>
          /browse/browseTab.jsp
        </page>
        <views>
          <view-order>
            <view-id>editstates.state</view-id>
            <view-id> editstates.city</view-id>
          </view-order>
          <initial-view>
            editstates.state
          </initial-view>

          <view id="editstates.state">
            <resource-bundle>
              com.my.bcc.WebAppResources
            </resource-bundle>
            <display-name-resource>
              editstates.browseTab.view.state
            </display-name-resource>
            <configuration>
              /com/my/web/assetmanager/statesViewConfiguration
            </configuration>
            <page>
              /browse/list.jsp
            </page>
          </view>

          <view id="editstates.city">
            <resource-bundle>
              com.my.bcc.WebAppResources
            </resource-bundle>
            <display-name-resource>
              editstates.browseTab.view.city
            </display-name-resource>
            <configuration>
              /com/my/web/assetmanager/citiesViewConfiguration
            </configuration>
            <page>
              /browse/list.jsp
            </page>
          </view>
        </views>
      </tab>
      <!-- Configure the Search tab -->
      <tab id="search">
        <display-name-resource>
          assetManager.tab.search
        </display-name-resource>
        <page>
          /search/searchTab.jsp
        </page>
        <views>
          <initial-view>
            form
          </initial-view>
          <view id="form">
            <page>
              /search/searchForm.jsp
            </page>
            <item-types>
              <item-type>/atg/userprofiling/statesRepository:state</item-type>
              <item-type>/atg/userprofiling/statesRepository:city</item-type>
            </item-types>
          </view>
          <view id="results">
            <page>
              /search/searchResults.jsp
            </page>
            <operations>
              <!-- users/orgs/roles don't need link or unlink -->
              <operation combine="remove">link</operation>
              <operation combine="remove">unlink</operation>
            </operations>
          </view>
        </views>
      </tab>


      <!-- Configure the Multi Edit tab with input form and results views -->
      <tab id="multiEdit">
        <display-name-resource>
          assetManager.tab.multiEdit
        </display-name-resource>
        <page>
          /multiEdit/multiEditTab.jsp
        </page>
        <operations>
          <!-- Disallow addToMultiEdit, and add the multiEdit operations -->
          <operation combine="remove">addToMultiEdit</operation>
          <operation>removeFromMultiEdit</operation>
          <operation>stepEdit</operation>
          <operation>applyToAll</operation>
          <operation>listEdit</operation>
        </operations>
        <configuration>
          /atg/web/assetmanager/configuration/MultiEditTabConfiguration
        </configuration>
      </tab>

    </tabs>

  </activity>

</task-configuration>

Step 6: Create control center application service for states.
/config/my/remote/controlcenter/service/states.xml

<applications>
  <application id="states">
    <resource-bundle>
      com.my.bcc.WebAppResources
    </resource-bundle>
    <display-name-resource>
      states.displayName
    </display-name-resource>
    <destination-page>
      <url>
        /AssetManager/assetManager.jsp
      </url>
      <query-parameter key="project" value="-1"/>
      <query-parameter key="activity" value="states"/>
    </destination-page>
    <acl>Profile$accessRight$statesfull:read;Profile$accessRight$statesread:read</acl>
    <initializer>
    </initializer>
    <sort-priority>
      30
    </sort-priority>
    <category>
      yourProjectExtras
    </category>
  </application>
</applications>

Step 7: Register custom services created in previous step in ApplicationConfigurationManager.
/config/atg/remote/controlcenter/service/ApplicationConfigurationManager.properties

applicationFiles+=/my/remote/controlcenter/service/states.xml

Step 8: create resource bundle.
/src/my/webui/WebAppResources.properties 

editstates.displayName=Manage states
editstates.description=Manage states
editstates.browseTab.view.state=state
assetManager.tab.browse=Browse
assetManager.tab.search=Search
activitySourceName=Non-Versioned
activitySourceDescription=Non-Versioned


Step 9: update disabledTypes  property with states repository in PublishingService

Path :  /config/atg/remote/assetmanager/epub/service/PublishingService.properties

disabledTypes+=\
/atg/userprofiling/statesRepository:*

Step 10: update  initialRepositories property with statesRepository  in  config/atg/registry/ContentRepositories.properties

Path: config/atg/registry/ContentRepositories.properties


initialRepositories+=\
/atg/userprofiling/statesRepository

Step 11: Point datasource to Non_versioned DB (Production Core) for states repository

dataSource=/atg/dynamo/service/jdbc/JTDataSource_production

Step 12. Execute below scrips for adding ACL

if you observe step1 and 6, new ACl's (marked in red) are added
Only the users who has these roles will be able to manage these items.

INSERT INTO dpi_access_right (access_right_id, right_type, right_scope, version, name, description, display_name) VALUES ('statesfull', 1, 1, 1, 'statesfull', 'Gives full access to all states items', 'States Full Access');
INSERT INTO dpi_access_right (access_right_id, right_type, right_scope, version, name, description, display_name) VALUES ('statesread', 1, 1, 1, 'statesread', 'Gives read-only access to all States items', 'States Read-Only Access');

References


http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGContentAdminProgGuide/html/s0604accesstogenericactivities01.html
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGBCCAdminGuide/html/s0807implementinganewlistview01.html
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGBCCAdminGuide/html/s0901customizingtheuiforspecifictasks01.html
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGBCCAdminGuide/html/s0903howthetaskconfigurationfileispro01.html
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGBCCAdminGuide/html/s0906creatinganddefiningataskconfigur01.html
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGBCCAdminGuide/html/s1001appendixtagsinataskconfiguration01.html
              

Comments

Popular posts from this blog

how to generate classes from swagger

How to create new user/account in BCC