Thursday, 13 March 2014

Gmail - hidden ways to filter out emails

http://gmailblog.blogspot.com.au/2008/03/2-hidden-ways-to-get-more-from-your.html

Posted by Robby Stein, Associate Product Marketing Manager

I recently discovered some little-known ways to use your Gmail address that can give you greater control over your inbox and save you some time and headache. When you choose a Gmail address, you actually get more than just "yourusername@gmail.com." Here are two different ways you can modify your Gmail address and still get your mail:

  • Append a plus ("+") sign and any combination of words or numbers after your email address. For example, if your name was hikingfan@gmail.com, you could send mail to hikingfan+friends@gmail.com or hikingfan+mailinglists@gmail.com.
  • Insert one or several dots (".") anywhere in your email address. Gmail doesn't recognize periods as characters in addresses -- we just ignore them. For example, you could tell people your address was hikingfan@gmail.com, hiking.fan@gmail.com or hi.kin.g.fan@gmail.com. (We understand that there has been some confusion about this in the past, but to settle it once and for all, you can indeed receive mail at all the variations with dots.)

For me, the real value in being able to manipulate your email address is that it makes it really easy to filter on those variants. For example you could use hikingfan+bank@gmail.com when you sign up for online banking and then set up a filter to automatically star, archive or label emails addressed to hikingfan+bank. You can also use this when you register for a service and think they might share your information. For example, I added "+donation" when I gave money to a political organization once, and now when I see emails from other groups to that address, I know how they got it. Solution: filtered to auto-delete.

Tuesday, 11 March 2014

Adobe CQ/AEM - CQ dependencies POM

Here is an example of setting up the pom file for CQ dependencies:
http://dev.cqblueprints.com/nexus/content/repositories/releases/com/cqblueprints/cqdependencies/5.6.0/cqdependencies-5.6.0.pom

Obviously you wouldn't include everything in that file - just the ones needed for the project. I believe the order of dependencies matters too.

Wednesday, 5 March 2014

Adobe CQ/AEM - Logging configuration

Here is an example for adding a configuration to log CQ query information:

  1. Open http://localhost:4502/system/console/configMgr and scoll down to "Apache Sling Logging Logger Configuration" and click on it.
  2. In the dialog set the following
    • Log Level to 'Debug
    • Log File to 'logs/query.log'
    • Logger to 'org.apache.jackrabbit.core.query.QueryImpl'
  3. Click on save.
There should be a new entry created under Apache Sling Logging Logger Configuration

Tuesday, 25 February 2014

Adobe AEM/CQ overwriting built-in plugins for richtext editor

Example given here -
to overwrite the built-in link configuration dialog box by adding a field to set a link title:
http://forums.adobe.com/thread/1230814

Very important to compare the code given in the example for changes.

Overview:
  1. Setup in the apps director to create a "widgets" folder with these values
    • jcr:primaryType  = cq:ClientLibraryFolder
    • sling:resourceType = widgets/clientlib
    • categories = cq.wcm.edit
  2. Create a js file that overrides the built-in js plugin, note:
    • Initialize the name of the plugin
    • Register the name to the built-in xtype
    • Uses CQ.form instead of CUI.
  3. Create a js.txt and include the name of js file within



Friday, 21 February 2014

Adobe AEM/CQ seach results


Configure indexing for search:
http://helpx.adobe.com/experience-manager/kb/SearchIndexingConfig.html

Overview:
  1. Create a mapping with index to latest articles
  2. Components can retrieve articles via the mapping
  3. When new articles come in, update the mapping of index at the background
  4. Once the new mapping is complete, replace the mapping

Tuesday, 11 February 2014

Adobe CQ/AEM Query Builder - empty property

So at work, I was faced with a scenario where I have to use the CQ query builder to retrieve a bunch of articles that when they do not have a date property it will be selected along with the ones with date property that does not expire.

A little pseudo-code to show what I mean:

if (!article.hasDate) {
  return true;
} else {
  if (article.date >= now()) {
    return true;
  }
  return false;
}

Here are some articles I found online before I came up with a solution:



Finally, here is what I have in CQ query builder:

path=[path/to/articles]
type=cq:Page
99_property=@jcr:content/cq:template
99_property.value=[apps/path/to/template]
10_group.p.or=true
10_group.1_property=@jcr:content/offTime
10_group.1_property.operation=not
10_group.2_daterange.property=@jcr:content/offTime
10_group.2_daterange.lowerBound=[current-date-or-hardcode-date-for-testing]
10_group.2_daterange.lowerOperation=>=

This is now returning articles that does NOT have the offTime property; also it returns articles that DO have the offTime date and are current.

Wednesday, 5 February 2014

Adobe CQ/AEM package install behaviour - filter.xml

Encountered a problem that whenever a package is deploy / installed, it will overwrite existing content and folder structure that was setup.

Using the filter.xml under META-INF/vault, we can configure it in a way that it keep existing content intact.

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

There are three Modes available:

  1. replace: Normal behavior. Existing content is replaced completly by the imported content, i.e. is overridden or deleted accordingly.
  2. merge: Existing content is not modified, i.e. only new content is added and none is deleted or modified
  3. update: Existing content is only updated but never deleted



Add it under META-INF/vault/filter.xml
<?xml version="1.0" encoding="UTF-8"?>

<workspaceFilter version="1.0">
    <filter root="/content" mode="update"/>
</workspaceFilter>


Advance package filtering include / exclude regular expression

http://aemfaq.blogspot.com.au/2013/04/cq5-package-filter-includeexclude.html

Example META-INF/vault/filter.xml
<?xml version="1.0" encoding="UTF-8"?>

<workspaceFilter version="1.0">
    <filter root="/content" mode="update">
        <include pattern="/content/foo/bar/*"/>
        </filter>
</workspaceFilter>