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 .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ repositories {
}
}

testCompile 'com.twcable.jackalope:jackalope:3.0.2'
testCompile 'com.twcable.jackalope:jackalope:4.0.0'
```

# Releasing
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# RELEASE NOTES

## 4.0.0
* Updated to support AEM 6.2, from AEM 6.0

## 3.0.2

Bug fixes:
Expand Down
14 changes: 5 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@ repositories {
}
}

sourceCompatibility = '1.7'
targetCompatibility = '1.7'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'


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.2.0:apis"

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.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# suppress inspection "UnusedProperty" for whole file
description = Provides a convenient way of stubbing out Sling and the JCR
group = com.twcable.jackalope
version = 3.0.2
version = 4.0.0
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
15 changes: 15 additions & 0 deletions src/main/java/com/twcable/jackalope/impl/cq/AssetImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public Rendition getRendition(String s) {
return null;
}

@Override
public Rendition getImagePreviewRendition() {
throw new UnsupportedOperationException();
}


@Override
public Rendition getOriginal() {
Expand Down Expand Up @@ -191,6 +196,16 @@ public boolean isBatchMode() {
return false;
}

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

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


@Override
public String getMetadataValue(String s) {
Expand Down
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 @@ -218,6 +218,18 @@ public Calendar getOffTime() {
}


@Override
public Calendar getDeleted() {
return this.getProperties().get("deleted", Calendar.class);
}


@Override
public String getDeletedBy() {
return this.getProperties().get("deletedBy", String.class);
}


@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 @@ -115,4 +115,9 @@ public Session loginService(String s, String s1) throws LoginException, Reposito
return session;
}

@Override
public Session impersonateFromService(String s, Credentials credentials, String s1) throws LoginException, RepositoryException {
throw new UnsupportedOperationException();
}

}
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 @@ -129,6 +129,11 @@ public Iterator<Resource> listChildren(Resource parent) {
return parent.listChildren();
}

@Override
public Resource getParent(@Nonnull Resource resource) {
return resource.getParent();
}


@Override
public Iterable<Resource> getChildren(Resource resource) {
Expand Down Expand Up @@ -295,6 +300,16 @@ public boolean isResourceType(Resource resource, String resourceType) {
public void refresh() {
}

@Override
public Resource copy(String s, String s1) throws PersistenceException {
throw new UnsupportedOperationException();
}

@Override
public Resource move(String s, String s1) throws PersistenceException {
throw new UnsupportedOperationException();
}


@Override
@SuppressWarnings("unchecked")
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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import com.twcable.jackalope.impl.jcr.RepositoryImpl;
import org.apache.sling.jcr.api.SlingRepository;

import javax.jcr.Credentials;
import javax.jcr.LoginException;
import javax.jcr.RepositoryException;
import javax.jcr.Session;

Expand All @@ -35,4 +37,9 @@ public Session loginAdministrative(String workspace) throws RepositoryException
return login();
}

@Override
public Session impersonateFromService(String s, Credentials credentials, String s1) throws LoginException, RepositoryException {
throw new UnsupportedOperationException();
}

}