Saturday, July 19, 2014

Removing Default Types from WSO2 Enterprise Store

WSO2ES shipped with default store items of types 'Gadgets','E-Books' and 'WebSites'.

When you are building your own store using wso2es, you may need to remove default items and related menus from both the store and publiser. Here's the guide to do this.

Removing from Store- Front Office
  • Delete unwanted <asset-type> folders from 
'ES_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets/' directory.
  • Remove unwanted entries from 
'/ES_HOME/repository/deployment/server/jaggeryapps/store/config/store-tenant.json'
"assets": ["gadget", "site", "ebook"]
ex: if you need site only
    "assets": ["site"]
  • If you have started the server earlier, you will have to remove these entries from registry by editing '/_system/config/store/configs/store.json' using the management console.
  • Now remove the 
Removing from Publisher- Back Office
  • Delete unwanted <asset-type>.json's from
'/ES_HOME/repository/deployment/server/jaggeryapps/publisher/config/ext/' directory.
  • Edit following two code snippets of
'/ES_HOME/repository/deployment/server/jaggeryapps/publisher/config/publisher-tenant.json' to remove unwanted entries.
            
"collections": ["gadgets", "sites", "ebooks"]

ex: if you need site only
           "collections": ["sites"]

&
           "defaultAssets": {
                      "root":"/config/defaults",
                      "assetData": [{
                                                "type": "gadgets",
                                                "ignore":["agricultural-land", "intro-gadget-1", "intro-gadget-2", "gadget-template-explorer",  "gadget-explorer", "co2-emission", "electric-power",  "energy-use", "greenhouse-gas"]},
                      {
                        "type": "ebooks"},
                      {
                         "type": "sites" }]}

ex: if you need site only
           "defaultAssets": {
                      "root":"/config/defaults",
                      "assetData": [{"type": "sites"}]}
  • If you have started the server earlier, you will have to do the changes to registry by editing
'/_system/config/publisher/configs/publisher.json' using the management console.


  • Edit
'ES_HOME/repository/deployment/server/jaggeryapps/publisher/controllers/index_router.jag' to set the landing page to preferred asset-type.      
response.sendRedirect('/publisher/assets/gadget/');

ex: if you need site
            response.sendRedirect('/publisher/assets/site/');          
                      
Restart the server and here you go!
Read More
Designed ByBlogger Templates