Friday, 29 August 2014

Adobe AEM/CQ - cq:Page redirect

Out of the box redirection for cq:Page type settings are as follow:


  • jcr:content
    • redirectTarget | String | /[path]/[to]/[redirect]
    • sling:redirect | Boolean | true
    • sling:redirectStatus | Long | 302
    • sling:resourceType | String | foundation/components/redirect

Thursday, 28 August 2014

Git - when to merge and rebase

http://www.derekgourlay.com/archives/428

" Rebases are how changes should pass from the top of hierarchy downwards and merges are how they flow back upwards. "


Rule of thumb:

  • When pulling changes from origin/master onto your local branch, use rebase.
  • When finishing a feature branch merge the changes back to develop.


Rebase

git pull --rebase
or
git fetch origin
git rebase -p origin/[master]


Merge

git checkout master
git merge [branch]

Monday, 25 August 2014

45 ways to avoid using the word 'very'


“So avoid using the word ‘very’ because it’s lazy. A man is not very tired, he is exhausted. Don’t use very sad, use morose. Language was invented for one reason, boys - to woo women - and, in that endeavor, laziness will not do. It also won’t do in your essays.” 
― N.H. Kleinbaum, Dead Poets Society


Wednesday, 20 August 2014

Adobe AEM/CQ - remove whitespace from generated HTML

http://www.wemblog.com/2014/07/how-to-remove-white-space-from.html

1) trimDirectiveWhitespaces
<%@page  trimDirectiveWhitespaces="true"%>

2) Use
--%><%--
tags to start and end scriplets tag and in between html tag

3) Create your own tag library and using html parser remove white spaces during run time. for that check http://www.cqblueprints.com/tipsandtricks/jsp-custom-tag-lib.html

4) Use Google Page Speed Module at apache.

Friday, 15 August 2014

Cygwin - change home directory after installation

http://stackoverflow.com/questions/1494658/how-can-i-change-my-cygwin-home-folder-after-installation

  1. Go to Control Panel --> System and Security --> System (or press the [WINDOWS]+PAUSE|BREAK] keys)
  2. Click Advanced system settings (located at the left)
  3. Click Environment Variables (toward the bottom)
  4. In the User Variables area click "New…"
  5. For Variable name enter HOME
  6. For Variable value enter %USERPROFILE%
  7. Click OK in all the open dialog boxes to apply this new setting

cp /etc/passwd /etc/passwd.bak
mkpasswd -l -p $(cygpath -H)  > /etc/passwd 
mkpasswd -d -p $(cygpath -H)  >> /etc/passwd 

cp /etc/group /etc/group.bak
mkgroup -l > /etc/group 
mkgroup -d >> /etc/group


Exit Cygwin and start it up again.

Monday, 11 August 2014

Adobe AEM/CQ - setting up Maven POM

Content Package


http://www.wemblog.com/2012/04/how-to-change-package-install-behavior.html

<build>
    <plugins>
      <plugin>
         <groupId>com.day.jcr.vault</groupId>
         <artifactId>content-package-maven-plugin</artifactId>
         <extensions>true</extensions>
         <executions>
             <execution>
                 <goals>
                    <goal>package</goal>
                 </goals>
             </execution>
          </executions>
          <configuration>
             <!-- parameters and values common to all goals, as required -->
          </configuration>
      </plugin>
    </plugins>
</build>

Note:
Need <extensions> in order for <packaging>content-package<packaging> to work

Adobe documentation:
http://docs.adobe.com/docs/en/aem/6-0/develop/how-tos/vlt-mavenplugin.html

Getting the latest content-package-maven-plugin:
http://repo.adobe.com/nexus/content/groups/public/com/day/jcr/vault/content-package-maven-plugin/


Bundle

http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>

Adobe documentation:
http://docs.adobe.com/docs/en/cq/aem-how-tos/development/how-to-build-aem-projects-using-apache-maven.html

Checking the latest version of maven-bundle-plugin:
http://felix.apache.org/downloads.cgi#maven