[jboss-svn-commits] JBL Code SVN: r12225 - in labs/jbossesb/trunk/product: core/listeners/tests/src/org/jboss/soa/esb/actions/converters and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed May 30 04:51:49 EDT 2007


Author: beve
Date: 2007-05-30 04:51:49 -0400 (Wed, 30 May 2007)
New Revision: 12225

Added:
   labs/jbossesb/trunk/product/lib/ext/commons-logging-1.0.4.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-commons-0.9-SNAPSHOT.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-core-0.9-SNAPSHOT.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-javabean-0.3-SNAPSHOT.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-misc-0.2.1.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-scripting-0.1.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-templating-0.2.1.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-tinak-0.8.jar
Removed:
   labs/jbossesb/trunk/product/lib/ext/milyn-commons-0.8.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-core-0.8.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-javabean-0.2.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-misc-0.2.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-scripting-0.1-SNAPSHOT.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-smooks-templating-0.2.jar
   labs/jbossesb/trunk/product/lib/ext/milyn-tinak-0.7.1.jar
Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/SmooksTransformer.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/smooks-test.cdrl
   labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/SmooksUtils.java
   labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java
   labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java
Log:
Work done for Jira: http://jira.jboss.com/jira/browse/JBESB-584 "Upgrade JBossESB from Smooks v0.8 to v0.9"


Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/SmooksTransformer.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/SmooksTransformer.java	2007-05-30 08:24:00 UTC (rev 12224)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/SmooksTransformer.java	2007-05-30 08:51:49 UTC (rev 12225)
@@ -24,7 +24,6 @@
 
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
-import java.io.CharArrayWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -56,12 +55,15 @@
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.services.transform.TransformationException;
 import org.jboss.soa.esb.services.transform.TransformationService;
-import org.milyn.SmooksStandalone;
-import org.milyn.container.standalone.StandaloneContainerRequest;
+import org.milyn.Smooks;
+import org.milyn.SmooksUtil;
+import org.milyn.container.standalone.StandaloneExecutionContext;
 import org.milyn.device.ident.UnknownDeviceException;
 import org.milyn.javabean.BeanAccessor;
+import org.milyn.profile.DefaultProfileSet;
+import org.milyn.profile.ProfileStore;
+import org.milyn.profile.UnknownProfileMemberException;
 import org.milyn.resource.URIResourceLocator;
-import org.w3c.dom.Node;
 
 /**
  * Smooks Transformer.
@@ -126,7 +128,7 @@
 	public static final String TO_TYPE = "to-type";
 	
     private static Logger logger = Logger.getLogger(SmooksTransformer.class);
-    private SmooksStandalone smooks;
+    private Smooks smooks;
 	private ConfigurationUpdateListener updateListener;
     private String defaultMessageFromType;
     private String defaultMessageFrom;
@@ -203,25 +205,20 @@
         	if(payload instanceof String) {
 	            byte[] messageBytes = null;
 	            String transformedMessage;
-	        	String messageUseragent;
+	        	String messageProfile;
 	            
 	            // Register the message useragent with Smooks (if not already registered)...
-	        	messageUseragent = registerMessageUseragent(message);
+	        	messageProfile = registerMessageProfile(message);
 	            
                 messageBytes = ((String)payload).getBytes("UTF-8");
 	
 	            long start = System.currentTimeMillis();
-	            StandaloneContainerRequest request;
-	            Node filterResult;
-	            CharArrayWriter serializeBuffer = new CharArrayWriter(((String)payload).length());
+	            StandaloneExecutionContext request;
 	            
 	            // Filter and Serialise...
-	            request = smooks.createRequest(messageUseragent, null);
-	            filterResult = smooks.filter(request, new ByteArrayInputStream(messageBytes));
-	            smooks.serialize(request, filterResult, serializeBuffer);
+	            request = smooks.createExecutionContext( messageProfile );
+	            transformedMessage = SmooksUtil.filterAndSerialize( request, new ByteArrayInputStream( messageBytes), smooks );
 	            
-	            transformedMessage = serializeBuffer.toString();
-	            
 	            // Javabean cartridge resources may have extract data from the message and populated some beans.
 	            // Get them and stick them on the message - so they can be accessed by downstream actions...
 	            HashMap beanHash = BeanAccessor.getBeans(request);
@@ -231,7 +228,7 @@
 	            
 	            if(logger.isDebugEnabled()) {
 	            	long timeTaken = System.currentTimeMillis() - start;
-	            	logger.debug("Transformed message for useragent [" + messageUseragent + "]. Time taken: " 
+	            	logger.debug("Transformed message for useragent [" + messageProfile + "]. Time taken: " 
 	            			+ timeTaken + ".  Message in:\n[" + payload.toString()+ "].  \nMessage out:\n[" + transformedMessage + "].");
 	            }
 	            
@@ -247,6 +244,7 @@
 	            		+ sClass + "].  Returning message untransformed.");
 	        }
     	} catch(Throwable thrown) {
+    		thrown.printStackTrace();
     		throw new ActionProcessingException("Message transformation failed.", thrown);
     	}
         
@@ -257,14 +255,14 @@
     }
 
     /**
-	 * Register the Message Exchange as a useragent within Smooks.
+	 * Register the Message Exchange as a profile within Smooks.
 	 * @param message The message.
-	 * @return The Smooks "usragent" string that uniquely identifies the message flow associated
+	 * @return The Smooks "profile" string that uniquely identifies the message flow associated
 	 * with the message.
 	 * @throws ActionProcessingException Failed to register the message flow for the message.
 	 */
-	private String registerMessageUseragent(Message message) throws ActionProcessingException {
-		String messageUseragent;
+	private String registerMessageProfile(Message message) throws ActionProcessingException {
+		String messageProfile;
     	String messageFromType;
         String messageFrom;
         String messageToType;
@@ -280,22 +278,23 @@
 		
 		// Construct the message useragent string for use with Smooks.  This is basically the 
 		// name of the Message Exchange on which transformations are to be performed...
-        messageUseragent = getMessageUseragentString(messageFromType, messageFrom, messageToType, messageTo);
+        messageProfile = getMessageProfileString(messageFromType, messageFrom, messageToType, messageTo);
         
         // Register this message flow if it isn't already registered...
         try {
-        	smooks.getSession(messageUseragent);
-        } catch(UnknownDeviceException e) {
-        	String[] profiles = getMessageUseragentProfiles(messageFromType, messageFrom, messageToType, messageTo);
+        	ProfileStore profileStore = smooks.getApplicationContext().getProfileStore();
+        	profileStore.getProfileSet(messageProfile);
+        } catch(UnknownProfileMemberException e) {
+        	String[] profiles = getMessageProfiles(messageFromType, messageFrom, messageToType, messageTo);
         	
             synchronized (SmooksTransformer.class) {
 		        // Register the message flow within the Smooks context....
-	        	logger.info("Registering JBoss ESB Message-Exchange as Smooks Useragent: [" + messageUseragent + "].  Profiles: [" + Arrays.asList(profiles) + "]");
-		        smooks.registerUseragent(messageUseragent, profiles);
+	        	logger.info("Registering JBoss ESB Message-Exchange as Smooks Profile: [" + messageProfile + "].  Profiles: [" + Arrays.asList(profiles) + "]");
+	        	SmooksUtil.registerProfileSet(DefaultProfileSet.create( messageProfile, profiles ), smooks);
             }
         }
         
-		return messageUseragent;
+		return messageProfile;
 	}
 
     /**
@@ -306,7 +305,7 @@
 	 * @param messageTo The Message Exchange Participant name for the message target.
 	 * @return The list of profiles.
 	 */
-	protected static String[] getMessageUseragentProfiles(String messageFromType, String messageFrom, String messageToType, String messageTo) {
+	protected static String[] getMessageProfiles(String messageFromType, String messageFrom, String messageToType, String messageTo) {
 		List<String> profiles = new ArrayList<String>();
 		String[] profileArray;
 		
@@ -330,14 +329,14 @@
 	}
 
 	/**
-	 * Construct the Smooks useragent string based on the supplied message flow properties.
+	 * Construct the Smooks profile string based on the supplied message flow properties.
 	 * @param messageFromType The type string for the message source.
 	 * @param messageFrom The EPR string for the message source.
 	 * @param messageToType The type string for the message target.
 	 * @param messageTo The EPR srting for the message target.
-	 * @return Smooks useragent string for the message flow.
+	 * @return Smooks profile string for the message flow.
 	 */
-	protected static String getMessageUseragentString(String messageFromType, String messageFrom, String messageToType, String messageTo) {
+	protected static String getMessageProfileString(String messageFromType, String messageFrom, String messageToType, String messageTo) {
 		StringBuffer string = new StringBuffer();
 		
 		if(messageFromType != null) {
@@ -390,12 +389,15 @@
         // Initialise the local SmooksStandalone instance.  This "local" reference is
         // used because we are using on the "global" smooks variable reference to controll
         // access to this synchronisation block ...
-        smooks = new SmooksStandalone("UTF-8");
+//        smooks = new SmooksStandalone("UTF-8");
+        smooks = new Smooks();
 
         try {
             BufferedReader configReader = new BufferedReader(new InputStreamReader(configListStream));
-            smooks.getContext().getStore().load(configReader);
+            StandaloneExecutionContext context = smooks.createExecutionContext();
+            context.getContext().getStore().load(configReader );
         } catch (Exception e) {
+        	e.printStackTrace();
             smooks = null;
             throw new ActionLifecycleException("Smooks configuration load failed.", e);
         } finally {
@@ -419,7 +421,7 @@
      * Clears the internal static smooks instance.
      */
     public void reset() {
-    	SmooksStandalone instance = smooks;
+    	Smooks instance = smooks;
     	
         synchronized (SmooksTransformer.class) {
         	if(smooks == instance) {

Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/smooks-test.cdrl
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/smooks-test.cdrl	2007-05-30 08:24:00 UTC (rev 12224)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/smooks-test.cdrl	2007-05-30 08:51:49 UTC (rev 12225)
@@ -1,28 +1,29 @@
-<?xml version='1.0'?>
-<!DOCTYPE smooks-resource-list PUBLIC '-//MILYN//DTD SMOOKS 1.0//EN' 'http://milyn.org/dtd/smooksres-list-1.0.dtd'>
+<?xml version="1.0"?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
 
-<smooks-resource-list>
-
 	<!-- 
 		"Acme-Order-XML" messages going from "Acme" to "AcmePartner1" 
 	-->
-	<smooks-resource useragent="from-type:Acme-Order-XML AND from:Acme AND to-type:Partner1-Order-XML AND to:AcmePartner1" selector="ddd" path="org.milyn.cdres.trans.RenameElementTU">
+	<resource-config target-profile="from-type:Acme-Order-XML AND from:Acme AND to-type:Partner1-Order-XML AND to:AcmePartner1" selector="ddd">
+		<resource>org.milyn.cdres.trans.RenameElementTU</resource>
 		<param name="replacementElement">b</param>
-	</smooks-resource>
+	</resource-config>
 
 	<!-- 
 		"Acme-Order-XML" messages going from "Acme" to "AcmePartner2" 
 	-->
-	<smooks-resource useragent="from-type:Acme-Order-XML AND from:Acme AND to-type:Partner2-Order-XML AND to:AcmePartner2" selector="ddd" path="org.milyn.cdres.trans.RenameElementTU">
+	<resource-config target-profile="from-type:Acme-Order-XML AND from:Acme AND to-type:Partner2-Order-XML AND to:AcmePartner2" selector="ddd">
+		<resource>org.milyn.cdres.trans.RenameElementTU</resource>
 		<param name="replacementElement">c</param>
-	</smooks-resource>
+	</resource-config>
 
 	<!-- 
 		"Acme-Order-XML" messages going from "Acme" to anywhere
 	-->
-	<smooks-resource useragent="from-type:Acme-Order-XML AND from:Acme" selector="a" path="org.milyn.cdres.trans.RenameElementTU">
+	<resource-config target-profile="from-type:Acme-Order-XML AND from:Acme" selector="a" >
+		<resource>org.milyn.cdres.trans.RenameElementTU</resource>
 		<param name="replacementElement">x</param>
-	</smooks-resource>
+	</resource-config>
 
 </smooks-resource-list>
 

Added: labs/jbossesb/trunk/product/lib/ext/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/commons-logging-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-commons-0.8.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/lib/ext/milyn-commons-0.9-SNAPSHOT.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-commons-0.9-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-core-0.8.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-core-0.9-SNAPSHOT.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-core-0.9-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-javabean-0.2.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-javabean-0.3-SNAPSHOT.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-javabean-0.3-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-misc-0.2.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-misc-0.2.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-misc-0.2.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-scripting-0.1-SNAPSHOT.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-scripting-0.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-scripting-0.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-templating-0.2.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-templating-0.2.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-smooks-templating-0.2.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/lib/ext/milyn-tinak-0.7.1.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/lib/ext/milyn-tinak-0.8.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/milyn-tinak-0.8.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/SmooksUtils.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/SmooksUtils.java	2007-05-30 08:24:00 UTC (rev 12224)
+++ labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/SmooksUtils.java	2007-05-30 08:51:49 UTC (rev 12225)
@@ -28,9 +28,12 @@
 import java.util.Map.Entry;
 
 import org.jboss.soa.esb.admin.console.exchange.MessageExchange;
-import org.milyn.SmooksStandalone;
+import org.milyn.Smooks;
+import org.milyn.SmooksUtil;
 import org.milyn.cdr.SmooksResourceConfiguration;
-import org.milyn.container.standalone.StandaloneContainerSession;
+import org.milyn.container.standalone.StandaloneExecutionContext;
+import org.milyn.profile.DefaultProfileSet;
+import org.milyn.profile.ProfileStore;
 
 /**
  * <a href="http://milyn.codehaus.org/Smooks">Milyn Smooks</a> utility methods
@@ -55,26 +58,28 @@
 	 * @return List of transformation resources targeted at the supplied message exchange.
 	 */
 	public static List<TransformationResource> getMessageExchangeConfigs(MessageExchange messageExchange, List<TransformationResource> allResourceConfigs) {
-		SmooksStandalone smooks = new SmooksStandalone("UTF-8");
-		String messageUAString = "JBossESBMessage"; // Doesn't really matter what this string is because of how we're using it here!
-		StandaloneContainerSession messageUASession;
+		Smooks smooks = new Smooks();
+		String messageProfileString = "JBossESBMessage"; // Doesn't really matter what this string is because of how we're using it here!
+		StandaloneExecutionContext execContext;
 		Map messageExchangeConfigsMap;
 		List<TransformationResource> messageExchangeConfigsList = new ArrayList<TransformationResource>();;
 		
 		// Register all the configurations on the context...
 		for(TransformationResource resourceConfig : allResourceConfigs) {
-			smooks.registerResource(DBLinkedSmooksResourceConfiguration.getInstance(resourceConfig));
+			SmooksUtil.registerResource(DBLinkedSmooksResourceConfiguration.getInstance(resourceConfig), smooks);
 		}
 		
 		// Capture the message exchange properties as useragent profiles...
 		String[] profilesArray = getMessageExchangeProfiles(messageExchange);
 
 		// Create and register a message useragent with the message exchange profiles ...
-		smooks.registerUseragent(messageUAString, profilesArray);
-		messageUASession = smooks.getSession(messageUAString);
+		SmooksUtil.registerProfileSet(DefaultProfileSet.create( messageProfileString, profilesArray ), smooks);
+    	ProfileStore profileStore = smooks.getApplicationContext().getProfileStore();
+    	profileStore.getProfileSet(messageProfileString);
+		execContext = smooks.createExecutionContext(messageProfileString);
 		
 		// Filter out the configurations for the message session...
-		messageExchangeConfigsMap = messageUASession.getDeliveryConfig().getSmooksResourceConfigurations();
+		messageExchangeConfigsMap = execContext.getDeliveryConfig().getSmooksResourceConfigurations();
 		Iterator mapIterator = messageExchangeConfigsMap.entrySet().iterator();
 		while(mapIterator.hasNext()) {
 			Entry mapEntry = (Entry)mapIterator.next();

Modified: labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java	2007-05-30 08:24:00 UTC (rev 12224)
+++ labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java	2007-05-30 08:51:49 UTC (rev 12225)
@@ -43,8 +43,11 @@
 import org.jboss.soa.esb.admin.console.SeamViewIdStack;
 import org.jboss.soa.esb.admin.console.exchange.MessageExchange;
 import org.jboss.soa.esb.admin.console.exchange.SelectMessageExchangeAction;
+import org.milyn.Smooks;
 import org.milyn.SmooksException;
-import org.milyn.SmooksStandalone;
+import org.milyn.SmooksUtil;
+import org.milyn.profile.DefaultProfileSet;
+import org.milyn.profile.ProfileStore;
 import org.xml.sax.SAXException;
 
 /**
@@ -82,13 +85,13 @@
 	}
 	
 	public void applyResources() throws UnsupportedEncodingException {
-        SmooksStandalone smooks = new SmooksStandalone("UTF-8");
+        Smooks smooks = new Smooks();
         ByteArrayInputStream config = new ByteArrayInputStream(SmooksResourceList.getList(entityManager).getBytes("UTF-8"));
         ByteArrayInputStream input = new ByteArrayInputStream(testView.getInput().getBytes("UTF-8"));
         MessageExchange exchange = SelectMessageExchangeAction.getMessageExchange();
         
         try {
-			smooks.registerResources("Console Resources", config);
+        	SmooksUtil.registerResources("Console Resources", config, smooks);
 		} catch (Throwable t) {
 			logger.error("Error loading transformation resources.", t);
 			testView.setOutput("Error Loading Transformation Resources...\n\n" + t.getClass().getName() + ": " + t.getMessage() + "\n\nCheck Java console.");
@@ -97,11 +100,13 @@
 		
         try {
         	String[] profiles = exchange.getUseragentProfiles();
+    		SmooksUtil.registerProfileSet(DefaultProfileSet.create( exchange.getExchangeUseragentString(), profiles), smooks);
         	
         	if(profiles == null || profiles.length == 0) {
-        		smooks.registerUseragent(exchange.getExchangeUseragentString());
+	        	ProfileStore profileStore = smooks.getApplicationContext().getProfileStore();
+	        	profileStore.getProfileSet(exchange.getExchangeUseragentString());
         	} else {
-        		smooks.registerUseragent(exchange.getExchangeUseragentString(), profiles);
+	        	SmooksUtil.registerProfileSet(DefaultProfileSet.create(exchange.getExchangeUseragentString(), profiles ), smooks);
         	}
 		} catch (Throwable t) {
 			logger.error("Error registering Smooks message profiles.", t);
@@ -110,7 +115,7 @@
 		}
 		
         try {
-        	String output = smooks.filterAndSerialize(exchange.getExchangeUseragentString(), input);        	
+        	String output = SmooksUtil.filterAndSerialize(smooks.createExecutionContext(),input, smooks );
         	testView.setOutput(format(output));
 		} catch (Throwable t) {
 			logger.error("Error in applying Transformation/Analysis resources to message.", t);

Modified: labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java	2007-05-30 08:24:00 UTC (rev 12224)
+++ labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java	2007-05-30 08:51:49 UTC (rev 12225)
@@ -47,9 +47,9 @@
 import org.jboss.soa.esb.admin.console.transform.TransformationResource;
 import org.jboss.soa.esb.admin.console.transform.TransformationResourceParameter;
 import org.milyn.cdr.Parameter;
+import org.milyn.cdr.ProfileTargetingExpression;
 import org.milyn.cdr.SmooksResourceConfiguration;
 import org.milyn.cdr.SmooksResourceConfigurationList;
-import org.milyn.cdr.UseragentExpression;
 import org.milyn.cdr.XMLConfigDigester;
 import org.xml.sax.SAXException;
 
@@ -131,10 +131,10 @@
 	private TransformationResource toTransformationResource(SmooksResourceConfiguration configuration) {
 		TransformationResource resource = new TransformationResource();
 		
-		resource.setUseragent(getUseragentString(configuration.getUseragentExpressions()));
+		resource.setUseragent(getUseragentString(configuration.getProfileTargetingExpressions()));
 		resource.setSelector(configuration.getSelector());
-		resource.setPath(configuration.getPath());
-		resource.setNamespace(configuration.getNamespaceURI());
+		resource.setPath(configuration.getResource());
+		resource.setNamespace(configuration.getSelectorNamespaceURI());
 		
 		List smooksParams = configuration.getParameters();
 		resource.setParameters(new ArrayList<TransformationResourceParameter>());
@@ -170,12 +170,12 @@
 	}
 
 	
-	private String getUseragentString(UseragentExpression[] useragentExpressions) {
+	private String getUseragentString(ProfileTargetingExpression[] profileTargetingExpressions) {
 		StringBuffer string = new StringBuffer();
 		
-		for(int i = 0; i < useragentExpressions.length; i++) {
-			string.append(useragentExpressions[i].getExpression());
-			if(i < (useragentExpressions.length - 1)) {
+		for(int i = 0; i < profileTargetingExpressions.length; i++) {
+			string.append(profileTargetingExpressions[i].getExpression());
+			if(i < (profileTargetingExpressions.length - 1)) {
 				string.append(", ");
 			}
 		}




More information about the jboss-svn-commits mailing list