You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ma...@apache.org on 2012/08/23 16:52:28 UTC
svn commit: r1376516 - in /rave/sandbox/content-services:
rave-jcr-config/src/main/java/org/apache/rave/jcr/importing/
rave-jcr-console/src/ rave-jcr-console/src/main/
rave-jcr-console/src/main/webapp/ rave-jcr-console/src/main/webapp/WEB-INF/
rave-jcr...
Author: marijan
Date: Thu Aug 23 14:52:28 2012
New Revision: 1376516
URL: http://svn.apache.org/viewvc?rev=1376516&view=rev
Log:
RAVE-695 Create new rave-jcr-ocm module providing JCR based Object Content Mapping (OCM) support
- fix compile error
- add java doc session.save() note
Added:
rave/sandbox/content-services/rave-jcr-console/src/
rave/sandbox/content-services/rave-jcr-console/src/main/
rave/sandbox/content-services/rave-jcr-console/src/main/webapp/
rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/
rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml (with props)
rave/sandbox/content-services/rave-jcr-tools/pom.xml (with props)
Modified:
rave/sandbox/content-services/rave-jcr-config/src/main/java/org/apache/rave/jcr/importing/ContentImporter.java
Modified: rave/sandbox/content-services/rave-jcr-config/src/main/java/org/apache/rave/jcr/importing/ContentImporter.java
URL: http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-config/src/main/java/org/apache/rave/jcr/importing/ContentImporter.java?rev=1376516&r1=1376515&r2=1376516&view=diff
==============================================================================
--- rave/sandbox/content-services/rave-jcr-config/src/main/java/org/apache/rave/jcr/importing/ContentImporter.java (original)
+++ rave/sandbox/content-services/rave-jcr-config/src/main/java/org/apache/rave/jcr/importing/ContentImporter.java Thu Aug 23 14:52:28 2012
@@ -116,14 +116,16 @@ public class ContentImporter {
/**
* Import content from a json descriptor.
+ * <p/>
+ * NOTE: call <strong>{@code session.save()}</strong> to persist changes
*
* @param parentPath the path to the node below which to import the content
- * @param nodeName the name of the node to import
- * @param content an input stream containing the json content descriptor
- * @param behavior optional setting specifying what to do when a node already exists
- * @throws IOException when an error related to reading the input stream occurs
- * @throws RepositoryException when an error occurs while reading or writing JCR nodes
- * @throws ImportException when this importer encounters a situation it cannot deal with
+ * @param nodeName the name of the node to import
+ * @param content an input stream containing the json content descriptor
+ * @param behavior optional setting specifying what to do when a node already exists
+ * @throws IOException when an error related to reading the input stream occurs
+ * @throws RepositoryException when an error occurs while reading or writing JCR nodes
+ * @throws ImportException when this importer encounters a situation it cannot deal with
*/
public void importContent(final String parentPath, final String nodeName, final InputStream content, final ImportBehavior behavior) throws IOException, RepositoryException, ImportException {
final ObjectMapper objectMapper = new ObjectMapper();
@@ -141,14 +143,16 @@ public class ContentImporter {
/**
* Import content from a json descriptor.
+ * <p/>
+ * NOTE: call <strong>{@code session.save()}</strong> to persist changes
*
* @param parentPath the path to the node below which to import the content
- * @param nodeName the name of the node to import
- * @param content a string containing the json content descriptor
- * @param behavior optional setting specifying what to do when a node already exists
- * @throws IOException when an error related to reading the input stream occurs
- * @throws RepositoryException when an error occurs while reading or writing JCR nodes
- * @throws ImportException when this importer encounters a situation it cannot deal with
+ * @param nodeName the name of the node to import
+ * @param content a string containing the json content descriptor
+ * @param behavior optional setting specifying what to do when a node already exists
+ * @throws IOException when an error related to reading the input stream occurs
+ * @throws RepositoryException when an error occurs while reading or writing JCR nodes
+ * @throws ImportException when this importer encounters a situation it cannot deal with
*/
public void importContent(final String parentPath, final String nodeName, final String content, final ImportBehavior behavior) throws IOException, RepositoryException, ImportException {
final ObjectMapper objectMapper = new ObjectMapper();
@@ -230,11 +234,11 @@ public class ContentImporter {
String typeHint = null;
final int offset = name.indexOf(':');
- final int offset2 = name.indexOf(':', offset+1);
+ final int offset2 = name.indexOf(':', offset + 1);
if (offset2 != -1) {
// name prefixed with type information
typeHint = name.substring(0, offset2);
- name = name.substring(offset2+1);
+ name = name.substring(offset2 + 1);
}
final int type = getPropertyType(valueNode, typeHint);
@@ -316,7 +320,7 @@ public class ContentImporter {
Node node = resolveReference(valueNode.textValue());
if (node != null && node.isNodeType("mix:referenceable")) {
return valueFactory.createValue(node, type == PropertyType.WEAKREFERENCE);
- } else {
+ } else {
return null;
}
}
@@ -345,7 +349,7 @@ public class ContentImporter {
final int offset = propertyPath.lastIndexOf('/');
final String nodePath = propertyPath.substring(0, offset);
- final String propertyName = propertyPath.substring(offset+1);
+ final String propertyName = propertyPath.substring(offset + 1);
final Collection<String> references = entry.getValue();
final Collection<Value> values = new ArrayList<Value>(references.size());
@@ -375,7 +379,7 @@ public class ContentImporter {
final int offset = propertyPath.lastIndexOf('/');
final String nodePath = propertyPath.substring(0, offset);
- final String propertyName = propertyPath.substring(offset+1);
+ final String propertyName = propertyPath.substring(offset + 1);
final String reference = entry.getValue();
final Node node = resolveReference(reference);
Added: rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml
URL: http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml?rev=1376516&view=auto
==============================================================================
--- rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml (added)
+++ rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml Thu Aug 23 14:52:28 2012
@@ -0,0 +1,469 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2007-2011 Hippo.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<services>
+ <service>
+ <name>console</name>
+ <clusters>
+ <cluster>
+ <name>console</name>
+ <plugins>
+ <plugin>
+ <name>root</name>
+ <map>
+ <entry>
+ <key>extension.center</key>
+ <value>service.center</value>
+ </entry>
+ <entry>
+ <key>wicket.dialog</key>
+ <value>service.dialog</value>
+ </entry>
+ <entry>
+ <key>wicket.extensions</key>
+ <value>extension.top</value>
+ <value>extension.left</value>
+ <value>extension.center</value>
+ </entry>
+ <entry>
+ <key>extension.top</key>
+ <value>service.top</value>
+ </entry>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>extension.left</key>
+ <value>service.left</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.RootPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.root</value>
+ </entry>
+ <entry>
+ <key>yui.config</key>
+ <plugin>
+ <name>yui.config</name>
+ <map>
+ <entry>
+ <key>header.height</key>
+ <value>71</value>
+ </entry>
+ <entry>
+ <key>left.gutter</key>
+ <value>0px 0px 5px 10px</value>
+ </entry>
+ <entry>
+ <key>body.scroll</key>
+ <value>true</value>
+ </entry>
+ <entry>
+ <key>body.gutter</key>
+ <value>0px 10px 5px 0px</value>
+ </entry>
+ <entry>
+ <key>left.width</key>
+ <value>460</value>
+ </entry>
+ <entry>
+ <key>header.gutter</key>
+ <value>0px 10px 0px 10px</value>
+ </entry>
+ <entry>
+ <key>left.resize</key>
+ <value>true</value>
+ </entry>
+ </map>
+ </plugin>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>top</name>
+ <map>
+ <entry>
+ <key>wicket.extensions</key>
+ <value>extension.breadcrumb</value>
+ <value>extension.logout</value>
+ <value>extension.menu</value>
+ <value>extension.check</value>
+ </entry>
+ <entry>
+ <key>extension.logout</key>
+ <value>service.logout</value>
+ </entry>
+ <entry>
+ <key>extension.menu</key>
+ <value>service.menu</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.TopPlugin</value>
+ </entry>
+ <entry>
+ <key>extension.check</key>
+ <value>service.check</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.top</value>
+ </entry>
+ <entry>
+ <key>extension.breadcrumb</key>
+ <value>service.breadcrumb</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>left</name>
+ <map>
+ <entry>
+ <key>extension.sorter</key>
+ <value>service.sorter</value>
+ </entry>
+ <entry>
+ <key>wicket.behavior</key>
+ <value>service.layout.left</value>
+ </entry>
+ <entry>
+ <key>wicket.extensions</key>
+ <value>extension.sorter</value>
+ <value>extension.tree</value>
+ </entry>
+ <entry>
+ <key>wicket.model</key>
+ <value></value>
+ </entry>
+ <entry>
+ <key>extension.tree</key>
+ <value>service.tree</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.LeftPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.left</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>sorter</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.SortMenuPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.sorter</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>tree</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.browser.BrowserPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.tree</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>center</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.editor.EditorPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.center</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>breadcrumb</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.breadcrumb.BreadcrumbPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.breadcrumb</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>menu</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.MenuPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu</value>
+ </entry>
+ <entry>
+ <key>item</key>
+ <value>service.menu.item</value>
+ </entry>
+ <entry>
+ <key>wicket.dialog</key>
+ <value>service.dialog</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>permission</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.permissions.PermissionsPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>references</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.refs.ReferencesPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>xmlimport</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.content.ContentImportPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>xmlexport</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.content.ContentExportPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ <entry>
+ <key>label</key>
+ <value>XML Export</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>checkinout</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.check.CheckInOutPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>cndimport</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.cnd.CndImportPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>cndexport</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.cnd.CndExportPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.menu.item</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>check</name>
+ <map>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.menu.CheckPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.check</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>logout</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value>service.model</value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.plugins.logout.LogoutPlugin</value>
+ </entry>
+ <entry>
+ <key>wicket.id</key>
+ <value>service.logout</value>
+ </entry>
+ <entry>
+ <key>wicket.dialog</key>
+ <value>service.logout.dialog</value>
+ </entry>
+ </map>
+ </plugin>
+ <plugin>
+ <name>browserBehavior</name>
+ <map>
+ <entry>
+ <key>wicket.model</key>
+ <value></value>
+ </entry>
+ <entry>
+ <key>plugin.class</key>
+ <value>org.onehippo.jcr.console.engine.plugins.yui.layout.WireframePlugin</value>
+ </entry>
+ <entry>
+ <key>behavior.id</key>
+ <value>service.layout.left</value>
+ </entry>
+ <entry>
+ <key>yui.config</key>
+ <plugin>
+ <name>yui.config</name>
+ <map>
+ <entry>
+ <key>center</key>
+ <value>id=navigator-center,body=navigator-center-body,scroll=true</value>
+ </entry>
+ <entry>
+ <key>top</key>
+ <value>id=navigator-top,height=24</value>
+ </entry>
+ <entry>
+ <key>linked.with.parent</key>
+ <value>true</value>
+ </entry>
+ <entry>
+ <key>root.id</key>
+ <value>navigator-wrapper</value>
+ </entry>
+ <entry>
+ <key>units</key>
+ <value>top</value>
+ <value>center</value>
+ </entry>
+ </map>
+ </plugin>
+ </entry>
+ </map>
+ </plugin>
+ </plugins>
+ </cluster>
+ </clusters>
+ </service>
+</services>
Propchange: rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: rave/sandbox/content-services/rave-jcr-console/src/main/webapp/WEB-INF/jcr-console.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: rave/sandbox/content-services/rave-jcr-tools/pom.xml
URL: http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-tools/pom.xml?rev=1376516&view=auto
==============================================================================
--- rave/sandbox/content-services/rave-jcr-tools/pom.xml (added)
+++ rave/sandbox/content-services/rave-jcr-tools/pom.xml Thu Aug 23 14:52:28 2012
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.rave.sandbox.jcr</groupId>
+ <artifactId>rave-content-services</artifactId>
+ <version>sandbox-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>rave-jcr-tools</artifactId>
+ <name>Apache Rave :: rave-jcr-service</name>
+ <description>Apache Rave JCR Tools</description>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.rave.sandbox.jcr</groupId>
+ <artifactId>rave-jcr-config</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-core</artifactId>
+ <version>2.4.1</version>
+ </dependency>
+
+ <!-- TEST -->
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <version>${apache.jackrabbit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+
+ <!--
+ Here is a list of database drivers to include in
+ the standalone tool. Uncomment some and/or add
+ your own drivers.
+ -->
+ <!--
+ <dependency>
+ <groupId>com.microsoft</groupId>
+ <artifactId>sqljdbc</artifactId>
+ <version>1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>oracle</groupId>
+ <artifactId>oraclejdbcdriver</artifactId>
+ <version>10.2.0.3.0</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>mysql-connector-java</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.0.3</version>
+ <scope>compile</scope>
+ </dependency>
+ -->
+ </dependencies>
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <index>true</index>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>lib</classpathPrefix>
+ </manifest>
+ <manifestEntries>
+ <Main-Class>
+ org.apache.jackrabbit.tools.importexport.JcrImportExportTool
+ </Main-Class>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/classes/lib
+ </outputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: rave/sandbox/content-services/rave-jcr-tools/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: rave/sandbox/content-services/rave-jcr-tools/pom.xml
------------------------------------------------------------------------------
svn:keywords = Id