[Carbon-dev] svn commit r31334 - trunk/carbon-components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices

sumedha at wso2.com sumedha at wso2.com
Mon Feb 23 14:01:23 PST 2009


Author: sumedha
Date: Mon Feb 23 14:01:22 2009
New Revision: 31334
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=31334

Log:
modified operation name construction for REST calls

Modified:
   trunk/carbon-components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/DBUtils.java

Modified: trunk/carbon-components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/DBUtils.java
URL: http://wso2.org/svn/browse/wso2/trunk/carbon-components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/DBUtils.java?rev=31334&r1=31333&r2=31334&view=diff
==============================================================================
--- trunk/carbon-components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/DBUtils.java	(original)
+++ trunk/carbon-components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/DBUtils.java	Mon Feb 23 14:01:22 2009
@@ -98,11 +98,13 @@
 			operationElement.getFirstChildWithName(new QName("call-query"));
 		String operationName = "";
 		if("resource".equals(operationElement.getLocalName())){
-			String pathWithoutSlashes = 
-				operationElement.getAttributeValue(new QName("path")).replaceAll("/", "_");
-			
+			String path = operationElement.getAttributeValue(new QName("path"));
 			String method = operationElement.getAttributeValue(new QName("method"));
-			String tmpOpName = "_" + method + pathWithoutSlashes;
+			
+			String pathWithoutSlashes = path.replaceAll("/", "_");
+            String pathWithoutLeftBraces = pathWithoutSlashes.replaceAll("\\{", "");
+            String pathWithoutRightBraces = pathWithoutLeftBraces.replaceAll("\\}", "");                    
+			String tmpOpName = "_" + method + pathWithoutRightBraces;			
 			operationName = tmpOpName.toLowerCase();
 		}else{
 			operationName = operationElement.getAttributeValue(new QName("name"));			



More information about the Carbon-dev mailing list