Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build/
*.iws
out/
atlassian-ide-plugin.xml
*.jar
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ repositories {
maven {
url "http://repo.adobe.com/nexus/content/groups/public"
}

// hack to allow getting to a working version of AEM 6.1 uberjar without running afoul of licensing restrictions
flatDir { dirs '.' }
}

sourceCompatibility = '1.7'
Expand All @@ -32,15 +35,13 @@ targetCompatibility = '1.7'
dependencies {

// AEM's new "uber-jar"
compile "com.adobe.aem:aem-api:6.0.0.1", {
exclude group: "org.slf4j", module: "slf4j-simple"
exclude group: "com.adobe.cq.testing", module: "cq-integration-testing"
}
// compile "com.adobe.aem:uber-jar:6.1.0" // broken
compile name: "uberjar-6.1" // install into the top-level dir of project

compile "javax.jcr:jcr:2.0"
compile "com.google.guava:guava:15.0"
compile "org.apache.sling:org.apache.sling.jcr.resource:2.3.8"
compile "org.slf4j:slf4j-api:1.6.6"
compile "org.apache.sling:org.apache.sling.jcr.resource:2.5.0"
compile "org.slf4j:slf4j-api:1.7.6"
compile "javax.servlet:servlet-api:2.5"
compile "commons-io:commons-io:2.4"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Tue Feb 24 15:51:41 MST 2015
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
12 changes: 12 additions & 0 deletions src/main/java/com/twcable/jackalope/impl/cq/PageImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@ public Calendar getOffTime() {
}


@Override
public Calendar getDeleted() {
throw new UnsupportedOperationException();
}


@Override
public String getDeletedBy() {
throw new UnsupportedOperationException();
}


@Override
public String getLastModifiedBy() {
ValueMap properties = getProperties();
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/com/twcable/jackalope/impl/cq/PageManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,63 @@ public Page create(String parentPath, String pageName, String template, String t
@Override
public Page move(Page page, String destination, String beforeName, boolean shallow, boolean resolveConflicts,
String[] adjustRefs) throws WCMException {
return this.move(page, destination, beforeName, shallow, resolveConflicts, adjustRefs, null);
}


/**
* Moves the given page to the new destination and automatically saves the changes.
* If source and destination are equals the page is just ordered.
*
* @param page the page to move
* @param destination the path of the new destination
* @param beforeName the name of the next page. if null the page is ordered at the end.
* @param shallow if true only the page content is moved
* @param resolveConflict if true resolves name conflict if destination already exists.
* @param adjustRefs list of paths to pages that refer to the moved one. those references will be adjusted.
* @param publishRefs list of referencing paths that will be republished.
* @return the new page at the new location
* @throws WCMException if an error during this operation occurs.
*/
@Override
public Page move(Page page, String destination, String beforeName, boolean shallow, boolean resolveConflict,
String[] adjustRefs, String[] publishRefs) throws WCMException {
throw new UnsupportedOperationException();
}


@Override
public Resource move(Resource resource, String destination, String beforeName, boolean shallow, boolean resolveConflicts, String[] adjustRefs) throws WCMException {
return this.move(resource, destination, beforeName, shallow, resolveConflicts, adjustRefs, null);
}


/**
* Moves the given resource to the new destination and automatically saves the changes.
* If source and destination are equals the resource is just ordered.
*
* @param resource the resource to move
* @param destination the path of the new destination
* @param beforeName the name of the next page. if null the page is ordered at the end.
* @param shallow if true only the resource content is moved.
* @param resolveConflict if true resolves name conflict if destination already exists.
* @param adjustRefs list of paths to pages that refer to the moved one. those references will be adjusted.
* @param publishRefs list of referencing paths that will be republished.
* @return the new page at the new location
* @throws WCMException if an error during this operation occurs.
*/
@Override
public Resource move(Resource resource, String destination, String beforeName, boolean shallow, boolean resolveConflict, String[] adjustRefs, String[] publishRefs) throws WCMException {
throw new UnsupportedOperationException();
}


@Override
public Resource copy(CopyOptions copyOptions) throws WCMException {
return copy(copyOptions.resource, copyOptions.destination, copyOptions.beforeName, copyOptions.shallow, copyOptions.resolveConflict, copyOptions.autoSave);
}


@Override
public Page copy(Page page, String destination, String beforeName, boolean shallow, boolean resolveConflict) throws WCMException {
return copy(page, destination, beforeName, shallow, resolveConflict, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceUtil;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.api.wrappers.ModifiableValueMapDecorator;
import org.apache.sling.jcr.resource.JcrModifiablePropertyMap;
import org.apache.sling.jcr.resource.JcrPropertyMap;
import org.apache.sling.jcr.resource.internal.JcrModifiableValueMap;

import javax.jcr.Node;
import javax.jcr.Property;
Expand Down Expand Up @@ -132,7 +132,8 @@ public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
if (type.equals(Node.class)) return (AdapterType)node;
if (type.equals(ValueMap.class) || type.equals(Map.class)) return (AdapterType)new JcrPropertyMap(node);
if (type.equals(PersistableValueMap.class)) return (AdapterType)new JcrModifiablePropertyMap(node);
if (type.equals(ModifiableValueMap.class)) return (AdapterType)new JcrModifiableValueMap(node, null);
if (type.equals(ModifiableValueMap.class))
return (AdapterType)new ModifiableValueMapDecorator(new JcrModifiablePropertyMap(node, null));

if (type.equals(Page.class)) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.jcr.api.SlingRepository;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.util.Map;

Expand All @@ -37,21 +38,31 @@ public SimpleResourceResolverFactory(@Nonnull SlingRepository repository) {
}


@Nonnull
@Override
public ResourceResolver getResourceResolver(Map<String, Object> authenticationInfo) throws LoginException {
return this.resourceResolver;
}


@Nonnull
@Override
public ResourceResolver getAdministrativeResourceResolver(Map<String, Object> authenticationInfo) throws LoginException {
return this.resourceResolver;
}


@Nonnull
@Override
public ResourceResolver getServiceResourceResolver(Map<String, Object> authenticationInfo) throws LoginException {
return this.resourceResolver;
}


@Override
@CheckForNull
public ResourceResolver getThreadResourceResolver() {
return this.resourceResolver;
}

}