This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.sling.adapter.SlingAdaptable; | |
import org.apache.sling.api.resource.Resource; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.jcr.Node; | |
public abstract class MyCustomClass extends SlingAdaptable { | |
protected static final Logger log = LoggerFactory.getLogger(MyCustomClass.class); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Comparator; | |
import javax.jcr.query.Row; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.sling.api.resource.ValueMap; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import com.day.cq.search.Predicate; | |
import com.day.cq.search.eval.AbstractPredicateEvaluator; | |
import com.day.cq.search.eval.EvaluationContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.apache.sling</groupId> | |
<artifactId>org.apache.sling.models.api</artifactId> | |
<version>1.1.0</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.sling</groupId> | |
<artifactId>org.apache.sling.models.impl</artifactId> | |
<version>1.1.0</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Add sling Model dependencies --> | |
<!-- All your existing dependencies --> | |
<dependency> | |
<groupId>org.apache.sling</groupId> | |
<artifactId>org.apache.sling.models.api</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.sling</groupId> | |
<artifactId>org.apache.sling.models.impl</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- All other configuration in your bundle pom --> | |
<plugin> | |
<groupId>org.apache.felix</groupId> | |
<artifactId>maven-bundle-plugin</artifactId> | |
<extensions>true</extensions> | |
<configuration> | |
<instructions> | |
<Export-Package> | |
com.myotherpackages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.inject.Inject; | |
import javax.inject.Named; | |
import javax.jcr.Session; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.resource.ResourceResolver; | |
import org.apache.sling.models.annotations.Default; | |
import org.apache.sling.models.annotations.DefaultInjectionStrategy; | |
import org.apache.sling.models.annotations.Model; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.test.wemblog | |
import javax.servlet.jsp.tagext.BodyContent; | |
import javax.servlet.jsp.tagext.BodyTagSupport; | |
import java.io.IOException; | |
import javax.servlet.jsp.JspWriter; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** | |
* wemblog:removeWhitespace tag removes whitespace between HTML elements | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
import org.apache.felix.scr.annotations.Activate; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.felix.scr.annotations.Properties; | |
import org.apache.felix.scr.annotations.Property; | |
import org.apache.felix.scr.annotations.Reference; | |
import org.apache.felix.scr.annotations.Service; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
import org.apache.sling.api.SlingHttpServletResponse; | |
import org.apache.sling.commons.osgi.OsgiUtil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>com.day.jcr.vault</groupId> | |
<artifactId>content-package-maven-plugin</artifactId> | |
<!--Your other properties and build definition --> | |
<configuration> | |
<!-- All CQ package you want to install as part of your build --> | |
<subPackages> | |
<subPackage> | |
<groupId>YOUR SHARED GROUPID</groupId> | |
<artifactId>YOUR SHARED ARTIFACT</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import javax.jcr.Item; | |
import javax.jcr.Node; | |
import javax.jcr.NodeIterator; | |
import javax.jcr.PathNotFoundException; |