Monday, February 13, 2017

AEM Content Intelligence

This plug-in helps content authors to tag content automatically based on the content. This plugin is intelligent enough to detect language entered by authors and analyze the content by using Apache Natural Language processing tool. This is a powerful feature for content authors to structure content based on the auto created tags. Content authors do not need to tag pages manually.  

This plugin uses the machine learning algorithm to detect 3 different entities:
·         Person
·         Location
·         Organization

So, once an author create content then this plugin will analyze and extract the content based on the above 3 criteria.
After text analyzation is complete, then this plugin will create SPARQL query to get the recognized entities from DBPedia which is again based on Semantics web technology.

After extracting the entities, this plugin will auto create tags and associate those tags to the newly created page. This also create links to Wikipedia for the recognized entities. This is another powerful feature that site visitor will get to know more information about the entities.

Demo video is available here: https://www.youtube.com/watch?v=aohXk0ar90Q

Now let’s see how this plugin works:
The starting point of this plugin is TextProcessor.java which implements SlingPostProcessor

TextProcessor.java detects the language from DetectLanguage.java. The default languages which are configured “English” and “Dutch”. LanguageConfigurationService OSGI service provides the supported languages that the plugin can handle. Admin has to configure this service through Admin console. 

Once the language is detected then it calls OSGI service OpenNlp.java. This OSGI service is intelligent to initialize models (person/location/organization) based on the detected language. Now the models(which are of type person/location/organization) , gets the input from another OSGI service called FileProvider.java

The way FileProvider service works is interesting. The Activator class instantiate FileBundleInstaller class and it listen to all the bundles and filter out only the required bundles which meets the criteria “Data-files”. Whenever any bundle is uploaded with headers as “Data-files” then FileBundleInstaller registers that bundle which provides the backed for data extraction. The advantage of doing is that, we do not need to configure physical file path.

SPARQL.java file executes the query against DBPedia to get the required entities and returns inform of HashMap which then further processed by AEM using TagManager API to creates tags and update page properties.  

Monday, October 7, 2013

LDAP integration Adobe CQ


Today we'll learn how to integrate LDAP with Adobe CQ5

1. First we need to setup LDAP directory server. In this article we'll use Apache Directory server. Download Apache Directory server for Window machine from here. Once it is done then install. Installation is very straight forward.

2. Once installation is completed then setup new server and select 1.5.3 version. And enter name as you like.



3. select the server and click on create new connection.
4. Now create a user.
Select ou=users -> Right click New -> New Entry -> Create Entry from Scratch. Select as per below



Click on Finish.

5. Now we need to create password. Right click -> New Attribute -> Select userPassword from dropdown and click finish. A new window will come up and enter password as you like. You should use this password later when login to CQ.









6. Nest step is to create ldap_login.conf. Create a directory with the name as conf under CQ installation directory.

com.day.crx {
   com.day.crx.core.CRXLoginModule sufficient;
   com.day.crx.security.ldap.LDAPLoginModule required
              principal_provider.class="com.day.crx.security.ldap.principals.LDAPPrincipalProvider"
              host="localhost"
              port="10389"
              secure="false"
              authDn="uid=admin,ou=system"
              authPw="secret"
              userRoot="ou=users,ou=system"
     userIdAttribute="uid"
     userFilter="(objectClass=*)"
              groupRoot="ou=groups, o=example"
              groupMembershipAttribute="uniquemember"
              autocreate="create"
              autocreate.user.membership="contributor"
              autocreate.user.mail="rep:e-mail"
              autocreate.user.cn="rep:fullname"
              autocreate.group.description="description"
              autocreate.group.mail="rep:e-mail"
              autocreate.group.cn="rep:fullname"
              autocreate.path="direct"
              cache.expiration="600"
              cache.maxsize="100";
};

5.  Next step is to modify repository.xml. Here we need to remove the below entry from repository.xml -

<LoginModule class="com.day.crx.core.CRXLoginModule">
            <param name="anonymousId" value="anonymous"/>
            <param name="adminId" value="admin"/>
            <param name="tokenExpiration" value="43200000"/>
        </LoginModule>

6. Now the last step is to start CQ. Start CQ with below command line

java -Djava.security.auth.login.config=crx-quickstart/conf/ldap_login.conf -XX:MaxPermSize=128m -Xmx512M -jar cq5-author-4502.jar

Once CQ is started then you will not be able to see newly created user in users list when you are logged in as admin. This user only be available after you try login first time with the credentials you entered while creating user in ApacheDS.