Author: tyrell
Date: Thu Feb 28 21:45:52 2008
New Revision: 14333
Log:
Fixing MASHUP-699
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
Thu Feb 28 21:45:52 2008
@@ -23,12 +23,14 @@
import org.wso2.mashup.utils.QueryResults;
import org.wso2.mashup.webapp.userprofile.User;
import org.wso2.registry.ActionConstants;
+import org.wso2.registry.Collection;
+import org.wso2.registry.CollectionImpl;
import org.wso2.registry.LogEntry;
import org.wso2.registry.Registry;
import org.wso2.registry.RegistryConstants;
import org.wso2.registry.RegistryException;
import org.wso2.registry.Resource;
-import org.wso2.registry.announcement.Announcement;
+import org.wso2.registry.ResourceImpl;
import org.wso2.registry.jdbc.JDBCRegistry;
import org.wso2.registry.secure.SecureRegistry;
import org.wso2.registry.users.AccessControlAdmin;
@@ -37,7 +39,6 @@
import org.wso2.registry.users.UserStoreException;
import org.wso2.registry.users.UserStoreReader;
import org.wso2.registry.users.accesscontrol.AuthorizingRealmConfig;
-
import org.wso2.utils.ServerConfiguration;
import org.wso2.wsas.ServerManager;
@@ -504,14 +505,12 @@
userStoreAdmin.addUserToRole(userName, MashupConstants.EVERYONE_ROLE);
// Create a resource collection for the new user.
- Resource userCollection = new Resource();
- userCollection.setDirectory(true);
+ Collection userCollection = registry.newCollection();
registry.put("/users/" + userName, userCollection);
controlAdmin.authorizeUser(userName, "/users/" + userName,
ActionConstants.PUT);
controlAdmin.authorizeUser(userName, "/users/" + userName,
ActionConstants.GET);
- Resource mashupCollection = new Resource();
- mashupCollection.setDirectory(true);
+ Collection mashupCollection = registry.newCollection();
registry.put(MashupConstants.ALL_MASHUPS_PATH + "/" + userName,
mashupCollection);
controlAdmin.authorizeUser(userName, MashupConstants.ALL_MASHUPS_PATH,
ActionConstants.GET);
@@ -548,7 +547,7 @@
new String[] { });
// Add profile as a new registry resource.
- Resource userProfile = new Resource();
+ ResourceImpl userProfile = new ResourceImpl();
userProfile.setContent(user.serializeUserProfile().getBytes());
registry.put(profilePath, userProfile);
Modified:
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
---
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
(original)
+++
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
Thu Feb 28 21:45:52 2008
@@ -20,9 +20,23 @@
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.deployment.*;
+import org.apache.axis2.deployment.Deployer;
+import org.apache.axis2.deployment.DeploymentConstants;
+import org.apache.axis2.deployment.DeploymentEngine;
+import org.apache.axis2.deployment.DeploymentErrorMsgs;
+import org.apache.axis2.deployment.DeploymentException;
+import org.apache.axis2.deployment.DescriptionBuilder;
import org.apache.axis2.deployment.repository.util.DeploymentFileData;
-import org.apache.axis2.description.*;
+import org.apache.axis2.description.AxisBinding;
+import org.apache.axis2.description.AxisBindingOperation;
+import org.apache.axis2.description.AxisEndpoint;
+import org.apache.axis2.description.AxisMessage;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.WSDL2Constants;
import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.i18n.Messages;
@@ -34,6 +48,10 @@
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.Scriptable;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.SchedulerFactory;
+import org.quartz.impl.StdSchedulerFactory;
import org.wso2.javascript.rhino.JavaScriptEngine;
import org.wso2.javascript.rhino.JavaScriptEngineConstants;
import org.wso2.javascript.rhino.JavaScriptEngineUtils;
@@ -43,7 +61,13 @@
import org.wso2.mashup.realm.wsas.WSASRegistryRealm;
import org.wso2.mashup.utils.MashupUtils;
import org.wso2.mashup.webapp.utils.RegistryUtils;
-import org.wso2.registry.*;
+import org.wso2.registry.ActionConstants;
+import org.wso2.registry.Collection;
+import org.wso2.registry.Registry;
+import org.wso2.registry.RegistryConstants;
+import org.wso2.registry.RegistryException;
+import org.wso2.registry.Resource;
+import org.wso2.registry.ResourceImpl;
import org.wso2.registry.jdbc.JDBCRegistry;
import org.wso2.registry.jdbc.utils.RegistryDataSource;
import org.wso2.registry.secure.SecureRegistry;
@@ -53,20 +77,28 @@
import org.wso2.registry.users.UserStoreException;
import org.wso2.registry.users.accesscontrol.AccessControlConstants;
import org.wso2.registry.users.def.DefaultRealmConfig;
-
import org.wso2.utils.ServerConfiguration;
import org.wso2.wsas.ServerConstants;
import org.wso2.wsas.admin.service.UserAdmin;
-import org.quartz.Scheduler;
-import org.quartz.SchedulerException;
-import org.quartz.SchedulerFactory;
-import org.quartz.impl.StdSchedulerFactory;
import javax.xml.namespace.QName;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
/**
* This is a custom Axis2 deployer written for deploying JavaScript services.
@@ -480,7 +512,7 @@
RegistryUtils.createSecureRegistry(username, registry,
realm);
// create a content resource
- Resource resource1 = new Resource();
+ ResourceImpl resource1 = new ResourceImpl();
resource1.setAuthorUserName(username);
FileInputStream fis = new FileInputStream(file);
@@ -771,8 +803,7 @@
if
(!registry.resourceExists(MashupConstants.QUERYSTORE_QUERY_PATH)) {
// add queries to generate user profiles
- Resource queryCollection = new Resource();
- queryCollection.setDirectory(true);
+ Collection queryCollection = registry.newCollection();
registry.put(MashupConstants.QUERYSTORE_QUERY_PATH,
queryCollection);
// All mashups query
@@ -814,24 +845,19 @@
RegistryConstants.RESOURCES_RESULT_TYPE
);
- Resource usersCollection = new Resource();
- usersCollection.setDirectory(true);
- registry.put("/users", queryCollection);
-
- Resource profileCollection = new Resource();
- profileCollection.setDirectory(true);
- registry.put("/users/profile", queryCollection);
-
- Resource systemCollection = new Resource();
- systemCollection.setDirectory(true);
- registry.put("/system", queryCollection);
-
- Resource queriesCollection = new Resource();
- queriesCollection.setDirectory(true);
- registry.put("/system/queries", queryCollection);
+ Collection usersCollection = registry.newCollection();
+ registry.put("/users", usersCollection);
+
+ Collection profileCollection = registry.newCollection();
+ registry.put("/users/profile", profileCollection);
+
+ Collection systemCollection = registry.newCollection();
+ registry.put("/system", systemCollection);
+
+ ResourceImpl queriesCollection = new ResourceImpl();
+ registry.put("/system/queries", queriesCollection);
- Resource mashupsResource = new Resource();
- mashupsResource.setDirectory(true);
+ ResourceImpl mashupsResource = new ResourceImpl();
registry.put("/mashups", mashupsResource);
// This query accepts a resource path, a username, and a tag
name, and returns the resource path if that user applied that tag to the
resource.
@@ -1006,7 +1032,7 @@
private static void addQuery(Registry registry, String path, String sql,
String type)
throws RegistryException {
- Resource q = new Resource();
+ ResourceImpl q = new ResourceImpl();
q.setContent(sql);
q.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
q.setProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME, type);
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev