Author: marijan
Date: Mon Sep 17 09:45:45 2012
New Revision: 1386530
URL: http://svn.apache.org/viewvc?rev=1386530&view=rev
Log:
RAVE-695 Create new rave-jcr-ocm module providing JCR based Object Content
Mapping (OCM) support
- include properties
- remove keep uuid option
Modified:
rave/sandbox/content-services/rave-jcr-console/pom.xml
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.html
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.java
Modified: rave/sandbox/content-services/rave-jcr-console/pom.xml
URL:
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-console/pom.xml?rev=1386530&r1=1386529&r2=1386530&view=diff
==============================================================================
--- rave/sandbox/content-services/rave-jcr-console/pom.xml (original)
+++ rave/sandbox/content-services/rave-jcr-console/pom.xml Mon Sep 17 09:45:45
2012
@@ -117,9 +117,11 @@
<includes>
<include>**/*.html</include>
<include>**/*.js</include>
- <include>**/*.png</include>
<include>**/*.css</include>
- <include>**/*.jpg</include>
+ <include>**/*.png</include>
+ <include>**/*.gif</include>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
Modified:
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.html
URL:
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.html?rev=1386530&r1=1386529&r2=1386530&view=diff
==============================================================================
---
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.html
(original)
+++
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.html
Mon Sep 17 09:45:45 2012
@@ -17,22 +17,14 @@
<wicket:extend>
<div wicket:id="message" class="message"/>
<div class="import-properties">
- <p>
- <legend>
- <strong>UUID resolution: </strong>
- </legend>
- <fieldset>
- <select wicket:id="uuidBehaviors"/>
- </fieldset>
- </p>
- <p>
+ <div>
<legend>
<strong>Select file: </strong>
</legend>
- <fieldset>
- <input wicket:id="fileInput" id="upload" type="file"/>
- </fieldset>
- </p>
+ <fieldset>
+ <input wicket:id="fileInput" id="upload" type="file"/>
+ </fieldset>
+ </div>
</div>
</wicket:extend>
</html>
Modified:
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.java
URL:
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.java?rev=1386530&r1=1386529&r2=1386530&view=diff
==============================================================================
---
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.java
(original)
+++
rave/sandbox/content-services/rave-jcr-console/src/main/java/org/apache/rave/jcr/console/dialog/JsonImportDialog.java
Mon Sep 17 09:45:45 2012
@@ -22,11 +22,9 @@ package org.apache.rave.jcr.console.dial
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
-import javax.jcr.ImportUUIDBehavior;
import javax.jcr.InvalidSerializedDataException;
import javax.jcr.ItemExistsException;
import javax.jcr.Node;
@@ -41,12 +39,10 @@ import org.apache.rave.jcr.importing.Imp
import org.apache.rave.jcr.importing.ImportException;
import org.apache.wicket.Session;
import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.upload.FileUpload;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.util.value.IValueMap;
import org.onehippo.jcr.console.engine.dialog.AbstractDialog;
@@ -83,40 +79,24 @@ public class JsonImportDialog extends Ab
}
}
- private final LookupHashMap<Integer, String> uuidOpts = new
LookupHashMap<Integer, String>();
-
private final JcrNodeModel nodeModel;
private FileUploadField fileUploadField;
// hard coded defaults
- private String uuidBehavior = "Create new uuids on import";
private String mergeBehavior = "Disable merging";
private String derefBehavior = "Throw error when not found";
- private void InitMaps() {
- uuidOpts.put(ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING,
"Remove existing node with same uuid");
-
uuidOpts.put(ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING,
"Replace existing node with same uuid");
- uuidOpts.put(ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, "Throw
error on uuid collision");
- uuidOpts.put(ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW, "Create new
uuids on import");
- }
public JsonImportDialog(IModelReference<Node> modelReference) {
this.modelReference = modelReference;
- InitMaps();
this.nodeModel = (JcrNodeModel) modelReference.getModel();
-
- DropDownChoice<String> uuid = new
DropDownChoice<String>("uuidBehaviors", new PropertyModel<String>(this,
"uuidBehavior"), new ArrayList<String>(uuidOpts.values()));
-
- add(uuid.setNullValid(false).setRequired(true));
-
// file upload
setMultiPart(true);
setNonAjaxSubmit();
add(fileUploadField = new FileUploadField("fileInput"));
setOkLabel("import");
- setFocus(uuid);
try {
String path = this.nodeModel.getNode().getPath();
@@ -137,7 +117,6 @@ public class JsonImportDialog extends Ab
protected void onOk() {
final FileUpload upload = fileUploadField.getFileUpload();
- int uuidOpt = uuidOpts.getFirstKey(uuidBehavior);
if (upload != null) {
info("File uploaded. Start import..");
@@ -146,7 +125,7 @@ public class JsonImportDialog extends Ab
try {
InputStream contentStream = new
BufferedInputStream(upload.getInputStream());
String absPath = nodeModel.getNode().getPath();
- log.info("Starting import: importDereferencedXML(" + absPath +
',' + upload.getClientFileName() + ',' + uuidBehavior + ',' + mergeBehavior +
',' + derefBehavior);
+ log.info("Starting import: importDereferencedXML(" + absPath +
',' + upload.getClientFileName() + ',' + ',' + mergeBehavior + ',' +
derefBehavior);
final javax.jcr.Session session = ((UserSession)
Session.get()).getJcrSession();
ContentImporter importer = new ContentImporter(session);
@@ -202,13 +181,6 @@ public class JsonImportDialog extends Ab
return derefBehavior;
}
- public void setUuidBehavior(String uuidBehavior) {
- this.uuidBehavior = uuidBehavior;
- }
-
- public String getUuidBehavior() {
- return uuidBehavior;
- }
@Override
public IValueMap getProperties() {