Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ image:https://api.bintray.com/packages/twcable/aem/Grabbit/images/download.svg[t

* Grabbit Development

** link:{docsDir}/Prerequisites.adoc[Prerequisites]
** link:{docsDir}/GettingStarted.adoc[Getting Started]
** link:{docsDir}/Building.adoc[Building from Source]
** link:{docsDir}/RELEASING.adoc[Releasing A New Version]

Expand Down
4 changes: 4 additions & 0 deletions docs/Prerequisites.adoc → docs/GettingStarted.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
== Getting Started

The JCR 2.0 Specification (JSR-283) is included under docs for quick reference

== Prerequisites

=== Installing Protocol Buffers Compiler
Expand Down
16 changes: 16 additions & 0 deletions docs/Running.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,19 @@ Invalid:
}
```

=== Syncing Users and Groups

Grabbit has support for syncing users and groups. One *important note* about syncing users is that you must take care to avoid syncing the _admin user_.
Jackrabbit will not allow modification of the admin user, so Grabbit will fail on a job that attempts to do so. You can find the path of your admin user
on your data-warehouse instance or other source instance; and add it as an exclude path as so:

```
pathConfigurations :
-
path : /home/groups
-
path : /home/users
excludePaths:
- k/ki9zhpzfe #Admin user
```

Binary file added docs/jcr-spec.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ jcr_version = 2.0
jms_version = 3.1.1
jsr305_version = 2.0.0
logback_version = 1.0.4
oak_version = 1.2.2
objenesis_version = 2.1
protobuf_gradle_plugin_version = 0.9.1
protobuf_version = 2.6.1
scr_annotations_version = 1.7.0
servlet_api_version = 2.5
slf4j_version = 1.7.6
sling_api_version = 2.9.0
sling_base_version = 2.2.2
sling_commons_testing_version = 2.0.12
sling_commons_version = 2.2.0
sling_event_version = 3.1.4
Expand Down
3 changes: 3 additions & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {

// Apache Sling libraries
compile "org.apache.sling:org.apache.sling.api:${sling_api_version}"
compile "org.apache.sling:org.apache.sling.jcr.base:${sling_base_version}"
compile "org.apache.sling:org.apache.sling.jcr.resource:${sling_jcr_resource_version}"

// Apache Felix libraries
Expand All @@ -33,6 +34,8 @@ dependencies {
// Working with the JCR
compile "javax.jcr:jcr:${jcr_version}"
compile "org.apache.jackrabbit:jackrabbit-jcr-commons:${jackrabbit_version}"
compile "org.apache.jackrabbit:jackrabbit-api:${jackrabbit_version}"
compile "org.apache.jackrabbit:oak-core:${oak_version}"
compile "org.apache.sling:org.apache.sling.jcr.api:${sling_commons_version}"

// Logging
Expand Down
5 changes: 4 additions & 1 deletion gradle/packageExclusions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ configurations.cq_package {
exclude group: 'org.apache.felix', module: 'org.osgi.compendium'

exclude group: 'org.apache.commons', module: 'commons-lang3'
exclude group: 'org.apache.jackrabbit', module:'jackrabbit-jcr-commons'
exclude group: 'org.apache.jackrabbit', module: 'jackrabbit-jcr-commons'
exclude group: 'org.apache.jackrabbit', module: 'jackrabbit-api'
exclude group: 'org.apache.jackrabbit', module: 'oak-core'
exclude group: 'commons-io', module: 'commons-io'

//Exclude Apache Sling Libraries
exclude group: 'org.apache.sling', module: 'org.apache.sling.api'
exclude group: 'org.apache.sling', module: 'org.apache.sling.jcr.base'
exclude group: 'org.apache.sling', module:'org.apache.sling.jcr.resource'
exclude group: 'org.apache.sling', module: 'org.apache.sling.jcr.api'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<property>
<name>org.apache.sling.commons.log.names</name>
<value>com.twcable.grabbit.client.batch</value>
<value>com.twcable.grabbit.client</value>
<type>String</type>
</property>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<property>
<name>org.apache.sling.commons.log.names</name>
<value>com.twcable.grabbit.server.batch</value>
<value>com.twcable.grabbit.server</value>
<type>String</type>
</property>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.twcable.grabbit.client.batch.steps.jcrnodes

import com.twcable.grabbit.client.batch.ClientBatchJobContext
import com.twcable.grabbit.proto.NodeProtos
import com.twcable.grabbit.proto.NodeProtos.Node as ProtoNode
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.springframework.batch.item.ItemReader
Expand All @@ -32,11 +33,11 @@ import org.springframework.batch.item.UnexpectedInputException
@Slf4j
@CompileStatic
@SuppressWarnings("GrMethodMayBeStatic")
class JcrNodesReader implements ItemReader<NodeProtos.Node> {
class JcrNodesReader implements ItemReader<ProtoNode> {

@Override
NodeProtos.Node read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {
NodeProtos.Node nodeProto = NodeProtos.Node.parseDelimitedFrom(theInputStream())
ProtoNode nodeProto = ProtoNode.parseDelimitedFrom(theInputStream())
if (!nodeProto) {
log.info "Received all data from Server"
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.twcable.grabbit.client.batch.steps.jcrnodes

import com.twcable.grabbit.client.batch.ClientBatchJobContext
import com.twcable.grabbit.jcr.JcrNodeDecorator
import com.twcable.grabbit.jcr.JCRNodeDecorator
import com.twcable.grabbit.jcr.ProtoNodeDecorator
import com.twcable.grabbit.proto.NodeProtos.Node as ProtoNode
import groovy.transform.CompileStatic
Expand Down Expand Up @@ -88,14 +88,8 @@ class JcrNodesWriter implements ItemWriter<ProtoNode>, ItemWriteListener {
}

private static void writeToJcr(ProtoNode nodeProto, Session session) {
JcrNodeDecorator jcrNode = new ProtoNodeDecorator(nodeProto).writeToJcr(session)
JCRNodeDecorator jcrNode = ProtoNodeDecorator.createFrom(nodeProto).writeToJcr(session)
jcrNode.setLastModified()
// This will processed all mandatory child nodes only
if(nodeProto.mandatoryChildNodeList && nodeProto.mandatoryChildNodeList.size() > 0) {
for(ProtoNode childNode: nodeProto.mandatoryChildNodeList) {
writeToJcr(childNode, session)
}
}
}

private Session theSession() {
Expand Down
Loading