CMS Integration
JSDN supports content management system (CMS) based Store home and catalog.
The content management system allows the customers to control and manage the content as they want and make store home interface highly flexible and customizable. The JSDN provides a pre-built Drupal based Store home template as an option at Store level.
Local Setup
- CMS Code - Download it from UAT/Production Server Apache - /usr/local/apache2/htdocs/jamcracker.jsdn/cms
- DB dump - Create the DB in local postgres server with the DB dump from UAT/Production. You can check the which DB it is connecting to and the access details in the following file. /usr/local/apache2/htdocs/jamcracker.jsdn/cms/sites/default/settings.php
- Enable CURL, openssl & soap in local server if not enabled.
Once the prerequisites are ready, change the DB connection details in the settings.php to connect to the local PG DB and do the following steps.
- Add the below host entry
127.0.0.1 store.sourcestore.com
- Access the URL http://store.sourcestore.com/user/login
- Log into the system using your credentials. If you do not have your credentials, please contact our support team.
Navigate to Structure > Domains and Edit the domain and change the URL from store.<storename>.com to a local store name and select http instead of HTTPS.
- \cms\src\sites\all\modules\custom\extauth\extauth.module
Edit the above file and hardcode the store URL for the variable $jsdnURL
e.g.: $jsdnURL="https://store.<storename>.com";
- Copy the following file from JSDN and keep in
CMS
https://store.<storename>.com/jsdn/web2/mustache_templates/menu_template.mst
in CMS location:
\cms\sites\all\modules\custom\jsdn_common\menu_template.mst
And update the following in this file.
Line No. 7 Change to - <li class="top"><a href="#" onclick="javascript:openPopup(' https://store.vouclicar.com {{URL}}',{{Window}})">{{{label}}}</a>
Line No 27 Change to - <a href="#" onclick="javascript:openPopup(' https://store.<storename>.com {{URL}}',{{Window}})">{{{label}}}</a>
Line No 53 & 59 prepend https://store.<storename>.com with {{baseURL}}
- Edit jsdn-common-render-jsdn-menu.tpl.php file
in
\cms\src\sites\all\modules\custom\jsdn_common
Line No. 28 change to
url: '/cms/sites/all/modules/custom/jsdn_common/menu_template.mst',
- Edit jsdnapi.module file in \cms\src\sites\all\modules\custom\jsdnapi\ Change $url with " https://store.<storename>.com " in all the "return jsdnapi_api_call(" assurances
Key Integration Points
The following are the key integration points / scenarios between CMS and JSDN:
Initiate login from CMS
The Drupal login form is modified to submit the form to JSDN Login action. The extauth module handles this action and once the login is validated, JSDN will send the authToken, Menu JSON, Profile JSON & Help URL.
Using these details, extauth module will register/update the user in Drupal Database and login the user to CMS.
Initiate login from JSDN
Login can be initiated from JSDN. If the store is CMS store, after the user is logging in JSDN, the system will send the Menu JSON, Profile JSON etc., to a CMS exposed URL - /jsdnLogin. This URL is configured in ppconfig/cms.properties file cms.login.url.
Login from JSDN is handled by the same extauth module. This jsdnLoginurl will receive the data and create/update the user as per the information sent by JSDN and create the CMS session.
Service Offers and Pricing in CMS
A new Content Type in Drupal called Product Page is created for representing JSDN service. The Service ID is one of the fields in Product Page.
The Display Suite module is used to manage the display of Service Details page.
The below API will be used the get the offers & pricing by passing the service code.
<<storeURL>>/api/1.0/catalog/getServiceDetails/<<service code>>
Add to Cart
As part of Service Offers and Pricing in CMS implementation, the Add to Cart button will be displayed for the service offer. The following deeplink will add this service offer to the shopping cart in JSDN.
<<storeURL>>/jsdn/deeplink/addItemToCart.action?offerCode=<<offercode>>&<<offercode>>.fromBuy=true
Switch Language
While switching between languages in CMS, a JSDN action to set the language in JSDN session is to be called. The JSDN module in Drupal will take care of this functionality.
<<storeURL>>/jsdn/store/saveSelectedLanguageForStore.action?langCode=<<language code>>
Sign Up
A link with the class jsdn-register will redirect the page to the JSDN registration page. As part of theme, common.js file will take care of this.
<<storeURL>>/jsdn/register/cmsSelfRegister.action?fromSelfRegistration=true
Launch Online Help
The Help link in footer will launch the Online Help in JSDN. A link with the id jsdnHelp will launch the help. The JavaScript method to do this is in common.js as part of the theme.
For guest help - <<storeURL>>/jsdnguest/<<language code>>/index.html
For Logged in User - The URL is received as part of Login JSON
Feedback Link
Same like #6 & #7, a link with id jsdnFeedback will redirect the page to the JSDN feedback page.
<<storeURL>>/jsdn/footer/feedback.action
Links/Menu within JSDN that leads to Catalog
If the store is configured as CMS store, JSDN will redirect the catalog menu in JSDN to the URL /catalog that is configured as part of cms.properties in ppconfig.
Forgot Password PopUp
The showForgotPassword JavaScript method in common.js file will launch the Forgot Password pop-up from CMS.
<<storeURL>>/jsdn/users/showForgotPassword.action?from=cms
Building JSDN Menus in CMS
As part of JSDN - CMS login integration, JSDN will provide the Menu JSON, which contains Main Menu & Profile Menu. extauth module will keep the JSON in session. The Drupal Block called "Render JSDN menu based on the JSON" in the Header region will generate the menus based on this JSON using Mustache Javascript template.
Activate JSDN Session from CMS
While log in from CMS, the JSDN will send the authToken in the JSON file. extauth module will receive the token and store in session. This token will be posted to the following action from the browser to activate the JSDN session.
<<storeURL>>/jsdn/login/doCMSPostLogin.action
Post parameter - authToken
Main Modules used in JSDN
The following are the modules mainly used to build the JSDN CMS Catalogue
- AddThis - For Social Sharing
- Fivestar - For Service Rating
- Domain - To Achieve multi-tenancy
- Display Suite - To Display Service Details Page
- Facet API - For Search Facets in Catalog
- Panels - For Home Page
- i18n - For Multi Lingual Feature
Creating New Store in CMS
To create a new store in CMS, perform the following steps:
- Enter the store.sourcestore.comURL in your web browser.
- Login as Drupal administrator.
- Navigate to Structure > Domains > Create Domain menu and create the domain.
- Navigate back to the Domain List, edit newly created domain, and access the Settings tab.
- Provide appropriate Site Name.
- Configure Site front-page "home" and save domain settings.
- Access Theme tab and click the Configure link of JSDN Default Theme.
- Upload the store logo in 'Logo Image Settings' and click Save.
- Access the store URL.
Enable/Disable Pre-Login Display of Offers
To enable or disable the display of offers for a user who has not logged in (guest user), perform the following steps:
- Login as Drupal administrator.
- Navigate to People > Permissionsmenu.
- Find the permission, "jsdn offer display" and enable/disable for "anonymous user”.
How to Create or Edit Service Attributes
To create or edit the service attributes, perform the following steps:
- Enter the store.sourcestore.com URL in your web browser.
- To create/edit the service attributes like Category, Provider or IaaS attributes.
- Navigate to Structure > Taxonomymenu.
- Click on List Terms link against the attribute.
- You can add/edit the terms here.
How to tag the service as New, Featured, Popular, Discount, Trial
To tag the service as new, featured, popular, discount, trial, perform the following steps:
- Enter the store.sourcestore.com URL in your web browser.
- Login as Drupal administrator and edit the service.
- Navigate to Tags field.
- Add the values comma separated - Featured, Popular, New, Discount, Trial.
Edit Service in CMS
To edit a service, perform the following steps:
- Enter the store.sourcestore.comURL in your web browser.
- Login as Drupal administrator.
- Navigate to Content menu.
- Filter the page by selecting Type "Product Page.”
- Edit the Service& click Save.
Approval of Comments
The moderator or administrator can approve the comments given for a service. To approve the given comments, perform the following steps:
- Enter the store.sourcestore.comURL in your web browser.
- Login as Drupal administrator.
- Navigate to Content > Reviews > Unapproved Comments menu.
- Approve the comments.