Monday, October 7, 2013

Integration with other third-party service

The below list of questions will help you to get some high level overview of how to integrate
your application with other third party services and also will help you what are all the question's
we may need to ask to third party provider
  • Do you have any kind of web interface where we can test web methods by passing sample data?
  • How many ways we can integrate your product in to our application? ( Web-methods, REST API's, JavaScript api's, ODATA etc )
  • Does all API's support all functionality’s?
  • Limitations of your product?
  • Do you have any web interface, where we can do basic/limited operations like creating test user's, checking reports etc...
  • Who will provide secret token? Can we generate secret key by following client side web interface?
  • Any limitation on web service API’s calls count? Will you charge if the request count exceeds?
  • Do we need to send username and password along with web service request or username, password and secret token is enough?
  • Will you charge any amount? if we raise a request to create new user or modify something etc... ?
  • What kind of output does your application returns?
        • JSON
        • XML
        • Encrypted IMAGE
        • IFrame contains html
  • If the output is html, does it support all browsers?
  • What kind of authentication mechanism, do we need to follow while using web-service?
  • If authentication mechanism is basic then do we need to make SSL requests?
  • Does your application supports SSL?
  • Does your web-service supports generating entity classes?
  • How can we identify whether the request is succeed or not?
  • Is there any time-out applied for web-service calls?
  • If we are not able to access your web-service url, what are all the things do we need to check, do you have any trouble-shooting document?
  • Do we need to do any kind of encryption while passing parameters to server?

Wednesday, October 2, 2013

CMS Best Practices

Don't include JQuery libs at component level

I have seen so many people who include JQuery libs at component level, the disadvantage of including at component level is for each and every component the system will make request to server to download JQuery libs and it may lead to page performance

Sometimes we get lot of undefined JavaScript errors because of loading multiple versions of JQuery libs


Maintaining central location, I suggest create client libs and include at Basetemplate level, if new version comes just update client libs

In some scenarios the system will force you to include at component level, in such cases use JQuery.noConflict () option to avoid conflicts

Consider that the AEM also provides JQuery libs, some functionality which is depending on particular version of JQuery then download into your clientlibs; otherwise try to utilize OOTB JQuery Libs

Don’t deploy CSS or JS files in to production

Is it right approach deploying CSS, JavaScript files as part of deployment package in “Content Management System”?

Why,  because I have seen some people who came from traditional web development and no knowledge on CMS trying to deploy css and js files through package and finally mess up entire environment like overriding content of css and js files of content authors

How can we handle this situation, in any CMS you can find two types of content one is static content and another one is dynamic content

Dynamic content:

The content which you think it changes frequently by content author or admin’s need to be handled by content deployment or replication or page activation

Ex: Style sheets, images, text etc…

Normally, the content authors or site admin’s performs this action

Static content:

The content which you think it will not change in future need to be deployed as package such as style sheets, images, JavaScript files etc…
This is the developer job and the developer includes this content into package and deploys into a respective environment


Don’t include css and js files in your deployment package, if you feel the content author is going to modify it, keep it in central location which can be accessible by content authors as well as developers

Normally in SharePoint you can do this by placing style sheets in style library and in CQ5 you can do this by putting in etc/designs folder

Don’t deploy configuration file in to the production environment

The general meaning of configuration file is to change settings of system at any time, but if you deploy your settings through deployment package that may override existing entries which has made by author and the system may go down

I strongly recommend don’t deploy your configuration settings through package which you feel it changes frequently

Always create I18n folder at site level not at component level

Don’t create I18n folder at component level, if you create your I18n folder at component level you may lose certain capabilities,

Suppose in future if you want to create new locale it is very difficult to check entire solution to identify I18n folders, which needs to convert into new locale and which may lead to maintenance issue and moreover there is a chance for duplicate entries

These duplicate entries may override existing ones and you need to spend lot of time to debug the issue

Always use locale copy while creating new website

Don’t create web site by simply creating pages in hierarchy manner, it is very difficult to implement MSM

The page nName needs to be in the format of or _, for example en, en_US, en_us, en_GB, en_gb.
•    The supported language code is lower-case, two-letter code as defined by ISO-639-1
•    The supported country code is lower-case or upper-case, two-letter code as defined by ISO 3166

Don’t iterate nodes, try to use Query Builder, if you are performing any search operation

Use Case:

The user shall be able to receive news based on subscribed opt-in's

The Taxonomy for news is

    Therapy area news                                         
    Oncology news       
While registering into site the end user select’s any of news taxonomy keyword either Therapy area or oncology, based on the selection the system will send respective news related email’s to the user

Here, don’t iterate each and every user node to find out opt-in, try to use query build to avoid performance impact

The sibling nodes should not exceed more than 2k

Keep in mind that the sibling nodes should not exceed more than 2k , under normal circumstances it is fine like simple creating and reading node’s but, if you are  performing any kind of search operation on these nodes this may impact on performance

Don't enable dispatcher level cache in lower environment only enable in production environment

Don’t enable dispatcher level cache in lower environment, if you are planning to do load testing, test it on lower environments either pre-prod or the environment which is similar to your production box

Always make sure the cache should be enabling in production box, initially this may impact on performance but while going forward the performance will increase

Before enabling cache in production box think about your application digital asset size, if the volume of size heavy, then it is better to enable cache ASAP

All environments should be in sink to avoid surprises

Always make sure that the environments should be in sink to avoid last minute surprises, I strongly recommend don’t directly work on production environment if you face some problems in production environment, first fix it in pre-prod environment , then test it in prod author and finally fix  it on publish environment

I recommend first deploy package in author and publish environment then replicate content from author to publish environment, before replication content check all configurations are fine or not

I have seen some people who directly work’s on publish environment and making entire system down, but this is not right approach

Don't do over architecture keep it simple

While developing components don’t do over architecture keep it as simple as possible, sometimes the over architecture may impact on performance, for simple components try to reduce layers

Don't store PII information in cookies

The Personal Identification Information is very important for any client, so don’t store PII information in cookies like user password, social security number etc,..

Try to leverage to use OOTB functionalities

Once you receive requirements from your client first check whether it is feasible with OOTB functionality or not, if it feasible then tries to use OOTB, if it is not feasible then only start developing custom components

Identify Data Model before start developing custom components

Choosing database is not an big difficult just compare relational database features with JavaContentRepository features

Ex :

For some of the requirements demands versioning capability, in such cases the relational database does not support versioning functionality, so we need to think about JCR

Avoid loading unnecessary dependencies in POM files

Try to avoid loading un-necessary jar files through POM entries, identify all required common jar files and create separate module and import that in to other modules

This we can achieve only through user education

Don’t refer untrusted resources

I have seen some components which is directly referring like below code

The best practice is download the .js file to your solution and refer it

Use CDN 

To achieve greater performance, if possible try to implement CDN, but this totally depends on client

Don’t hard code CDN server url while making image, video, file etc… it is very difficult to identify each and every link

Create separate Filter which parse each and every url, if it is a digital asset then redirect to CDN server to download that Digital Asset

Create custom error pages

For any website the custom error pages are mandatory like 500 server error, 404 not found etc… if we directly display as it is then this will directly effect on overall website credit

So always design custom error message pages and apply it


Cross site scripting enable attacker to inject maliculious code in to your system, so don’t forget to encode user inputs before submitting form

Use XSSFilter in CQ5 to validate User entered information

 Know the difference between Sessions

If you see Any CMS there are two sessions one is Admin session and another one is User Session

For read only operations use User sessions and if you are doing some edit and update operations then go with admin sessions

If the requirement is just reading items or nodes and display it on a page then just go with user session

Try to avoid using admin sessions , if  you are obtaining inputs from end user try to store into /content/usergenerated folder in content repository

For just reading nodes and properties use user session slingRequest.getResourceResolver().adaptTo(Session.class)

Thursday, September 12, 2013

Information Architecture Planning


In the current digital-world the amount of data that the company’s are storing in their repositories’ and also dealing is growing day by day and it is very important for any company to efficiently use this data to make company success or failure, for any company the first priority is customer, if the customer is not able to find what he wants in company website then chances are high to loose them, the web sites which helps customers to find what they need quickly and easily will definitely win the customers

How can I describe you as Information Architecture?

I am an information architect and I am responsible for organizing huge amount of data in my company

What client is expecting?

You have received requirements from client to build a new website; you can develop this website with four pages and 10 components and deliver it, but what exactly the client is expecting out of these functionalities? What are the web site goals?

Identifying goals are very simple, assemble all the people who are responsible for making project success, it includes client or peers and ask them to provide order of importance to the content. Collect all suggestions and document everything share it with all stake holders to get approval

This article talks about how efficiently we can organize data

Why do we need to organize data?

Have you ever think why your company is investing lot of money and time on designing and developing intranet portals? What is the return on investment? Can we not design sites without wasting money and time?

The answer for all above questions is yes, we can do only, if you are ready to face below problems

The cost of losing customers:

The site looks very good but day by day, no of hits per day is going down and finally identified that the customer is not able to find what he wants in your portal

The cost of re-design:

How many dollars do us need to spend, if the site is poorly designed and not meeting your goals and need to re-design entire site
The cost of time:

The employee time is very important for any organization, how much time does your employee spends extra 5minutes per day struggling to find out what he wants? If you don’t have proper intranet portal

Assume that you are working for a big organization and everyday you get hundreds of mails, if you don’t organize your mails properly finally you end-up with wasting time on searching mails

The cost of maintenance:

How much money you spend to maintain technical people or third party providers (Savvies, Rack space etc…) to update single line in your page, there should be some kind of mechanism that the non-technical people also should be able to update the content

In WCM based portals every month we may expect hundreds of pages, how can we handle this situation if we don’t have proper architecture planning?

What is information architecture?

Information architecture talks about organizing your company’s information and website structure by categorizing content logically, priority basis and also ensures that the content is organized in proper structure in each section of web site

The best example for information architecture is Library, because the Library are well-structured and they follow subject oriented approaches, when you get into Library you can see all magazines are placed one side and books are placed other side, in books section you can find clear separation between each and every category, all fiction related information placed one side and all romantic related books are other side

When I was in child hood , I used to go to library to borrow some books for my grand-mother , the librarians used to keep display boards to easily identify books

by writing book information like author, book name etc…on the display board by seeing display boards, I could easily find out what I want

Here, the librarian plays information architecture role, first he will try to find out relationship between each and every books by following label of books or on author’s information and then put it in proper place

Also the librarian tries to find out what kind of information the readers are looking for by interacting with them, based on that he will have a call with library’s organizers and get approvals to purchase new books

Information architecture planning?

When it comes to website design the IA plays with content such as images, videos, files, documents, people, process etc…

Long time back, I was designed and implemented intranet portal for my company on SharePoint content management system while developing this, I used to interact with lot of people to find out what exactly they were expecting, to find out, we used to have regular meetings with respective department heads and create datasheet for every department and shared with respective POC’s as well as all stakeholders

We asked them to prioritize content and give ranking to every user story or paragraph in the datasheet but, sometimes if the client is poor client then we may need to give suggestions based on experience to the client on prioritization of content

Once, we got all the datasheets from respective managers or POC’s , we used to prioritize all and once we got some logical conclusion by analyzing content and identifying audience, we have designed draft version of sitemap and wire-frames to showcase to leads how the website looks like

Identifying the stake-holders?

As an Information Architect you need to identify and clarify all stake holder goals, the stake-holders are the people who define the depth and scope of project, identifying the audiences, determining sensitivity of information, giving approvals on each phase of development and giving functional clarification

Roles include: Senior Managers who give approval for every phase
Content owners, end users, development leads, respective department heads etc…

What are goals?

The world is changing day by day and people come up with new strategy’s to sustain in current market, for that they will ask you to create new site or migrate current site to either in content management system or some other platform

As an information architect you need to find out why they are moving to new platform? To
  • Increase sales
  • Attract more audience
  • Reduce phone calls by providing online support
  • Increase brand value
Getting information from stake-holders is not one day job. The customer’s priorities changes day by day, so you need to have regular meetings with them and try to get what exactly they are expecting and also to get approvals on functional clarifications on certain phases

Target Audience:

The audiences are people who visit your website
  • People who sells items in your site
  • People who purchase items through your site
  • People who maintains content of site
  • Venture capitalist who wants to know about your company etc…
As an IA you need to identify whom the client is targeting who are the primary audience and secondary audience

There is an ecommerce portal which sells products through online; their target audience is men’s and they get few females customers also, but the client says that they have strong male audience , so while designing our website we need to keep this in mind and we need to design our site which targets men’s as primary

Content analysis

Don’t wait for complete information, first start analyzing the content which you already have, interact with your stake holders and decide what should be included in a new site, if you are migrating content from existing site, then analyze the existing content management system, sitemap, total pages and find out what needs to be include and excluded, keep the content that will be only useful to end users, don’t put un necessary information which the end-user really does not want

Next, try to imagine end-user perceptive, once he/she enters into your web site, what you are show casing to them based on client goals is the matter

Normally, digital marketing sites displays top 10 articles or products and special offers etc...On home page

Organizing content:

Once the analysis is completed next step is organizing content, we need to identify the relation between content and also relation between one page to other , if you feel there is a similar content, you can make it as separate group and provide meaning full name, later we need to design navigation structure based on these groups

Making logical groups are very important thing, because while going forward we will apply metadata and labels on this


Before designing sitemap we should try to understand what are all the functionalities, features and what kind of content are going to have in website