Author: keith
Date: Thu Jan 17 22:57:27 2008
New Revision: 12457
Log:
Moving to registry SNAHSHOT, Updating permissions to make it work
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
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
trunk/mashup/java/modules/www/mashup.jsp
trunk/mashup/java/pom.xml
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
Thu Jan 17 22:57:27 2008
@@ -127,7 +127,7 @@
secureRegistry.applyTag("/mashups/samples/exchangeRate",
"webservicex.net");
secureRegistry.applyTag("/mashups/samples/exchangeRate",
"WSRequest");
- secureRegistry.applyTag("/mashups/samples/exchangeRage", "sample");
+ secureRegistry.applyTag("/mashups/samples/exchangeRate", "sample");
secureRegistry.applyTag("/mashups/samples/formulaFlicks",
"YouTube");
secureRegistry.applyTag("/mashups/samples/formulaFlicks", "rss");
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 Jan 17 22:57:27 2008
@@ -356,7 +356,14 @@
}
qResults.setResultCount(shownResults);
} else {
- Resource resultsCollection = registry.executeQuery(queryPath,
params);
+ Map paramsMap = null;
+ if (params != null) {
+ paramsMap = new HashMap(params.length);
+ for (int i =0; i < params.length; i++) {
+ paramsMap.put(new Integer(i+1).toString(), params[i]);
+ }
+ }
+ Resource resultsCollection = registry.executeQuery(queryPath,
paramsMap);
String[] resultPaths = (String[]) resultsCollection.getContent();
qResults.setResultCount(resultPaths.length);
@@ -458,14 +465,14 @@
Resource userCollection = new Resource();
userCollection.setDirectory(true);
registry.put("/users/" + userName, userCollection);
- controlAdmin.authorizeUser(userName, "/users/" + userName,
UserManagerConstants.EDIT);
+ controlAdmin.authorizeUser(userName, "/users/" + userName,
ActionConstants.PUT);
+ controlAdmin.authorizeUser(userName, "/users/" + userName,
ActionConstants.GET);
Resource mashupCollection = new Resource();
mashupCollection.setDirectory(true);
registry.put(MashupConstants.ALL_MASHUPS_PATH + "/" + userName,
mashupCollection);
- controlAdmin.authorizeUser(userName, MashupConstants.ALL_MASHUPS_PATH +
- "/" + userName, ActionConstants.GET);
+ controlAdmin.authorizeUser(userName, MashupConstants.ALL_MASHUPS_PATH
, ActionConstants.GET);
controlAdmin.authorizeUser(userName, MashupConstants.ALL_MASHUPS_PATH +
"/" + userName, ActionConstants.PUT);
controlAdmin.authorizeUser(userName, MashupConstants.ALL_MASHUPS_PATH +
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 Jan 17 22:57:27 2008
@@ -20,23 +20,9 @@
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
-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.*;
import org.apache.axis2.deployment.repository.util.DeploymentFileData;
-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.*;
import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.i18n.Messages;
@@ -61,40 +47,21 @@
import org.wso2.mashup.realm.wsas.WSASRegistryRealm;
import org.wso2.mashup.utils.MashupUtils;
import org.wso2.mashup.webapp.utils.RegistryUtils;
-import org.wso2.registry.Registry;
-import org.wso2.registry.RegistryConstants;
-import org.wso2.registry.RegistryException;
-import org.wso2.registry.Resource;
+import org.wso2.registry.*;
import org.wso2.registry.jdbc.JDBCRegistry;
import org.wso2.registry.jdbc.utils.RegistryDataSource;
import org.wso2.registry.secure.SecureRegistry;
-import org.wso2.usermanager.AccessControlAdmin;
-import org.wso2.usermanager.Realm;
-import org.wso2.usermanager.UserManagerConstants;
-import org.wso2.usermanager.UserManagerException;
-import org.wso2.usermanager.UserStoreAdmin;
+import org.wso2.usermanager.*;
import org.wso2.usermanager.readwrite.DefaultRealmConfig;
import org.wso2.utils.ServerConfiguration;
import org.wso2.wsas.ServerConstants;
import org.wso2.wsas.admin.service.UserAdmin;
import javax.xml.namespace.QName;
-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.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
+import java.util.*;
/**
* This is a custom Axis2 deployer written for deploying JavaScript services.
@@ -717,6 +684,8 @@
us.addUser(MashupConstants.SHARED_USER,
MashupConstants.SHARED_USER_PASSWORD);
us.addRole(RegistryConstants.ADMIN_ROLE);
us.addRole(RegistryConstants.EVERYONE_ROLE);
+ // Assign system user the 'admin' role.
+ us.addUserToRole(MashupConstants.SYSTEM_USER,
RegistryConstants.ADMIN_ROLE);
}
createPrimary =
Boolean.parseBoolean(serverConfig.getFirstProperty(MashupConstants.PRIMARY_USER_CONFIG
+ "." +
@@ -883,6 +852,15 @@
UserManagerConstants.USER_PERMISSION_RESOURCE,
UserManagerConstants.DELETE);
+ ac.authorizeRole(RegistryConstants.ADMIN_ROLE,
RegistryConstants.ROOT_PATH, ActionConstants.GET);
+ ac.authorizeRole(RegistryConstants.ADMIN_ROLE,
RegistryConstants.ROOT_PATH, ActionConstants.PUT);
+ ac.authorizeRole(RegistryConstants.ADMIN_ROLE,
RegistryConstants.ROOT_PATH, ActionConstants.DELETE);
+ ac.authorizeRole(RegistryConstants.ADMIN_ROLE,
RegistryConstants.ROOT_PATH,
+
UserManagerConstants.AUTHORIZE);
+
+ ac.authorizeRole(RegistryConstants.EVERYONE_ROLE,
RegistryConstants.ROOT_PATH, ActionConstants.GET);
+ ac.authorizeRole(RegistryConstants.EVERYONE_ROLE,
RegistryConstants.ROOT_PATH, ActionConstants.GET);
+
ac.authorizeRole(RegistryConstants.EVERYONE_ROLE,
UserManagerConstants.USER_RESOURCE,
UserManagerConstants.READ);
ac.authorizeRole(RegistryConstants.EVERYONE_ROLE,
@@ -911,8 +889,6 @@
// Create the system user profile.
RegistryUtils.createUser(secureRegistry, realm,
MashupConstants.SYSTEM_USER,
"System", "none", "System User");
- // Assign system user the 'admin' role.
- us.addUserToRole(MashupConstants.SYSTEM_USER,
RegistryConstants.ADMIN_ROLE);
// Create the 'Samples' user and profile.
RegistryUtils.createUser(secureRegistry, realm,
MashupConstants.SAMPLES_USER,
Modified: trunk/mashup/java/modules/www/mashup.jsp
==============================================================================
--- trunk/mashup/java/modules/www/mashup.jsp (original)
+++ trunk/mashup/java/modules/www/mashup.jsp Thu Jan 17 22:57:27 2008
@@ -447,14 +447,14 @@
<tr>
<td>
-
<nobr><%=QueryParamUtils.friendlyDate(c[i].getCommentedTime())%>
+ <nobr><%=QueryParamUtils.friendlyDate(c[i].getTime())%>
</nobr>
</td>
- <td><a href="user.jsp?name=<%=c[i].getCommentedUser()%>"><%=
RegistryUtils
- .getFullName(request, c[i].getCommentedUser())
%> (<%=c[i]
- .getCommentedUser()%>)
+ <td><a href="user.jsp?name=<%=c[i].getUser()%>"><%=
RegistryUtils
+ .getFullName(request, c[i].getUser()) %> (<%=c[i]
+ .getUser()%>)
</a></td>
- <td><%= c[i].getCommentText() %>
+ <td><%= c[i].getText() %>
</td>
<!-- todo: add delete comment controls (when appropriate)
todo: fix commented timezone -->
Modified: trunk/mashup/java/pom.xml
==============================================================================
--- trunk/mashup/java/pom.xml (original)
+++ trunk/mashup/java/pom.xml Thu Jan 17 22:57:27 2008
@@ -1199,7 +1199,7 @@
<log4j.version>1.2.13</log4j.version>
<jdic.version>0.9.1</jdic.version>
<wso2-monitor.version>SNAPSHOT</wso2-monitor.version>
- <wso2registry.core.version>0.1-SNAPSHOT</wso2registry.core.version>
+ <wso2registry.core.version>SNAPSHOT</wso2registry.core.version>
<usermanager.version>SNAPSHOT</usermanager.version>
<user.verification.version>SNAPSHOT</user.verification.version>
<identity.version>1.0</identity.version>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev