Skip to main content

Overriding default look and feel of GREG - 5.3.0

Following list explains what are the best approach for different use cases.

1 ) - You created a new asset type, and you need to change the look and feel of the details page in the listing page just for that new asset type.
  • To create a new asset type you need to login to the carbon console (username:admin, password:admin)
  • https://:9443/carbon/
  • Navigate to Extensions > Configure > Artifacts
  • Click "Add new Artifact" link at the bottom of the page.
  • By default in the "Generic Artifact" area "application" asset type is loaded. Note the shortName="applications" in the root node. "applications" is the name of the asset type.
  • Browse in to /repository/deployment/server/jaggeryapps/store/extensions/assets
  • Create a folder with name "applications"
     
  •  Now we can override the files in /repository/deployment/server/jaggeryapps/store/extensions/app/greg-store-defaults
     
  • Since we are overriding the details page we need to override the greg-store-defaults/themes/store/partials/asset.hbs

    Copy the above mentioned file in to the newly created asset extension /repository/deployment/server/jaggeryapps/store/extensions/assets/applications/themes/store/partials/asset.hbs
  • Do a visible change in the new hbs file.
  • View the asset extension is working by browsing to applications details page.
    Note: You need to create a new asset of the new type and log in to the store with admin credentials to view the new assets in store application.
  • Now you will be able to view the changes done.

2 ) -  Do the same change we have done in the above to an existing asset type ( restservice ).
  • We can't override the extensions up to (n) levels. Overriding supports only up to two levels. So we have to change the existing asset extension.
  • You can follow the same steps followed in the above scenario to override the asset details page of "restservice" details page.
3 ) - Change the look and feel of the whole store application.

  • ES store default theme ( css, hbs, js etc..) resides in /repository/deployment/server/jaggeryapps/store/themes/store


    They are override in GREG from "greg-store-defaults" extension. We can't override this extension by creating a new extension since the extension model does not supports ( n ) level overriding. So we have to modify the files in "greg-store-defaults" extension to achieve what we need.


Comments

Popular posts from this blog

Using javascript to Include a html file inside another html file

When there is no server side functionality needed we create the whole site in plain html. Usually these sites have left/right side menu, top header, footer etc.. If the site grows in to 20, 30 pages, it will be a headache to do a simple change like changing footer text. We will have to change each page. If we were using a server side technology like PHP, JSP, etc.., we will have the chance to keep the common areas in the site in different pages and include these parts in each page using a “include” statements. We can do the same thing with the plain old html and javascript. But how? First you need to create the site main layout using divs and give them unique ids. <html> <title>HTML Includes</title> <script language="javascript" src="js/main.js"></script> <script src="js/prototype.js" type="text/javascript"></script> <script language="javascript" xml:space="preserve"> // <

APIM 3.0 - populate multiple apis - bash script

Created a bash script to create, tag and publish multiple APIs. This is useful to populate data for the landing page. #!/bin/bash # get the URL consumer key clientId=$(curl -k -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json https://localhost:9443/client-registration/v0.14/register | jq -r '.clientId') clientSecret=$(curl -k -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json https://localhost:9443/client-registration/v0.14/register | jq -r '.clientSecret') echo $clientId echo $clientSecret encoded=$(echo -ne $clientId:$clientSecret | base64) echo $encoded # get access token accessToken=$(curl -k -d "grant_type=password&username=admin&password=admin&scope=apim:api_view,apim:api_create" -H "Authorization: Basic $encoded" https://localhost:9443/oauth2/token | jq -r '.access_token'