Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

 The following section describes the ways in which you can customize the subscription process.

Customizing the subscription process for a specific asset type

Follow the instructions below to change the default subscription button from "Bookmark" to "Subscribe" for the gadgets asset type:

For more information on asset extensions, see Introduction to Asset Extensions.

  1. Define the new partials.

    1. Navigate to the <ES_HOME>/repository/deployment/server/jaggeryapps/store/themes/store/partials directory. 

    2. Make a copy of the following default partials, which WSO2 ES uses to control the subscription text. 

      • process-asset-text.hbs - This defines the caption of the subscription process button before a user subscribes to it on the details asset page. The default value for this is Bookmark.
      • processed-asset-text.hbs - This defines the caption of the subscription process button after a user has subscribed to it on the details asset page. The default value for this is Bookmarked.
    3. Update the process-asset-text.hbs file as follows and save the file:

      <i class="fw fw-bookmark"></i>
      <span class="main-bookmark" data-processing=" Adding..." data-success="Successfully bookmarked the asset" data-error="Failed to bookmark this asset!">
      {{t "Subscribe"}}
      <span class="sub-bookmark"></span>
      </span>

      The tags mentioned in the above code block are explained as follows:

      • data-processing - This defines text that is displayed while subscribing to an asset.
      • data-success - This defines text that is displayed when successfully subscribing to an asset.
      • data-error - This defines text that is displayed when subscribing to an asset fails.
    4. Update the processed-asset-text.hbs file as follows and save the file.

      <i class="fa fa-star"></i>
      <span class="main-bookmark" data-processing=" Removing..." data-success="Successfully removed the bookmark from asset" data-error="Failed to un-bookmark this asset!">
      {{t "Subscribed"}}
      <span class="sub-bookmark"></span>
      </span> 

      The tags mentioned in the above code block are explained as follows:

      • data-processing - This defines text that is displayed while unsubscribing from an asset.
      • data-success - This defines text that is displayed when successfully unsubscribing from an asset.
      • data-error - This defines text that is displayed when unsubscribing to an asset fails.
  2. Deploy the new partials.
    1. Navigate to the <ES_HOME>/repository/deployment/server/jaggeryapps /store/extensions/assets/gadget directory to apply the customization of the subscription process to the gadget asset type.
    2. Create the  /themes/store/partials directory within the latter mentioned /gadget directory.
      This folder structure forms the shell for the asset extension
    3. Move the updated partial files into the <ES_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/gadget/themes/store/partials directory.
  3. Verify whether you were able to change the subscription process successfully in the Store

Customizing the subscription process globally

For more information on app extensions, see Introduction to App Extensions.

 

Follow the instructions below to change the default subscription button from "Bookmark" to "Subscribe" so that it will apply for all the asset types:

  1. Create the shell of an app extension in the Store. For more information, see Creating the Shell of an App Extension.
  2. Add the following dependency in the app.js, to override the default implementation, and save the file.

    app.dependencies = ['store_common'];
  3. Make a copy of the following two default partials into the <ES_HOME>/repository/deployment/server/jaggeryapps/store/themes/store/partials directory. 

    • process-asset-text.hbs - This defines the caption of the subscription process button before a user subscribes to it on the details asset page. The default value for this is Bookmark.
    • processed-asset-text.hbs - This defines the caption of the subscription process button after a user has subscribed to it on the details asset page. The default value for this is Bookmarked.
  4. Move the copied partial files into the <ES_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/<APP_EXTENSION_NAME>/themes/store/partials directory.

  5. Update the process-asset-text.hbs file as follows and save the file.

    <span id="main-bookmark">
    {{t "Subscribe"}}
    <span class="sub-bookmark"></span>
    </span>
  6. Update the processed-asset-text.hbs file as follows and save the file.

    <span id="main-bookmark">
    {{t "Subscribed"}}
    <span class="sub-bookmark"></span>
    </span> 
  7. Restart the ES server.

  8. Verify whether you were able to change the subscription process successfully in the Store

Verifying the subscription process customization

Follow the instructions below to verify whether you were able to change the subscription process successfully:

  1. Sign into the Store.
  2. Click Gadgets in the left navigator menu.
  3. Click on an asset. The asset details page appears.
  4. Click on the Subscribe button. The caption of the Subscribe button changes to Subscribed.
  5. If you need to verify whether the subscription process has successfully taken place globally, repeat steps 2 to 6. 
  • No labels