servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r650484 - in /servicemix/sandbox/gertv/smx-sling: ./ servicemix-audit-jcr/ servicemix-audit-jcr/src/ servicemix-audit-jcr/src/main/ servicemix-audit-jcr/src/main/java/ servicemix-audit-jcr/src/main/java/org/ servicemix-audit-jcr/src/main/ja...
Date Tue, 22 Apr 2008 12:40:38 GMT
Author: gertv
Date: Tue Apr 22 05:40:26 2008
New Revision: 650484

URL: http://svn.apache.org/viewvc?rev=650484&view=rev
Log:
Initial commit of sample Sling console

Added:
    servicemix/sandbox/gertv/smx-sling/README.TXT
    servicemix/sandbox/gertv/smx-sling/pom.xml
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/   (with props)
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/pom.xml
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/JcrAuditor.java
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/SlingAuditor.java
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/test/
    servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/test/java/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/   (with props)
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/pom.xml
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/dashboard/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/dashboard/html.esp
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/html.esp
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/tr.esp
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchanges/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchanges/html.esp
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/normalizedmessage/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/normalizedmessage/div.esp
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/servicemix.json
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/theme/
    servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/theme/master.css

Added: servicemix/sandbox/gertv/smx-sling/README.TXT
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/README.TXT?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/README.TXT (added)
+++ servicemix/sandbox/gertv/smx-sling/README.TXT Tue Apr 22 05:40:26 2008
@@ -0,0 +1,34 @@
+Just my personal try-out for building a Sling-based message archiving and management solution
for ServiceMix.
+
+Step-by-step
+------------
+
+1. Build the project using "mvn install" as usual
+
+2. Get and build Apache Sling 
+
+3. Start Apache Sling in an empty directory with 
+   java -jar ~/.m2/repository/org/apache/sling/org.apache.sling.launchpad.app/2.0.0-incubator-SNAPSHOT/org.apache.sling.launchpad.app-2.0.0-incubator-SNAPSHOT.jar
+
+4. Connect to the Sling Management console at http://localhost:8080/system/console and upload/start
the servicemix-sling-console bundle.
+   When the bundle is installed, connect to http://localhost:8080/servicemix.html to see
the ServiceMix dashboard page (don't mind the layout, I'm not a web designer ;) ).
+
+5. Add the Sling auditor to the ServiceMix classpath by copying these jars to lib/optional
+   - jackrabbit-jcr-commons-1.5-SNAPSHOT.jar
+   - jackrabbit-jcr-rmi-1.5-SNAPSHOT.jar
+   - jcr-1.0.jar
+   - servicemix-audit-jcr-1.0-SNAPSHOT.jar
+
+6. Reconfigure ServiceMix
+   - add <bean class="org.apache.servicemix.audit.jcr.SlingAuditor"/> to the <services/>
section in conf/servicemix.xml
+   - change the rmi.port in conf/servicemix.properties to avoid the conflict with the Sling
RMI registry
+
+
+TODO
+----
+A lot, but these come to mind...
+- asynchronous archival in JCR instead of blocking message delivery
+- 
+
+
+

Added: servicemix/sandbox/gertv/smx-sling/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/pom.xml?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/pom.xml (added)
+++ servicemix/sandbox/gertv/smx-sling/pom.xml Tue Apr 22 05:40:26 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.servicemix.smx-sling</groupId>
+  <artifactId>parent</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>SMX-Sling</name>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+  	  <configuration>
+  	    <source>1.5</source>
+  	    <target>1.5</target>
+  	  </configuration>
+       </plugin>
+    </plugins>
+  </build>
+  <properties>
+    <servicemix-version>3.3-SNAPSHOT</servicemix-version>
+    <sling-version>2.0.0-incubator-SNAPSHOT</sling-version>
+  </properties>
+  <modules>
+    <module>servicemix-audit-jcr</module>
+    <module>servicemix-sling-console</module>
+  </modules>
+</project>

Propchange: servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 22 05:40:26 2008
@@ -0,0 +1,4 @@
+.project
+.settings
+.classpath
+target

Added: servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/pom.xml?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/pom.xml (added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/pom.xml Tue Apr 22 05:40:26 2008
@@ -0,0 +1,36 @@
+<?xml version="1.0"?><project>
+  <parent>
+    <artifactId>parent</artifactId>
+    <groupId>org.apache.servicemix.smx-sling</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.servicemix.smx-sling</groupId>
+  <artifactId>servicemix-audit-jcr</artifactId>
+  <name>SMX-Sling :: ServiceMix JCR Auditor</name>
+  <version>1.0-SNAPSHOT</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-audit</artifactId>
+      <version>${servicemix-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.jcr</groupId>
+      <artifactId>jcr</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.jcr.jackrabbit.client</artifactId>
+      <version>${sling-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Added: servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/JcrAuditor.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/JcrAuditor.java?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/JcrAuditor.java
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/JcrAuditor.java
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,53 @@
+package org.apache.servicemix.audit.jcr;
+
+import java.net.MalformedURLException;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+
+import javax.jbi.JBIException;
+import javax.jcr.LoginException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory;
+import org.apache.servicemix.jbi.audit.AbstractAuditor;
+
+public abstract class JcrAuditor extends AbstractAuditor {
+	
+	private Repository repository;
+	private ThreadLocal<Session> session = new ThreadLocal<Session>();
+
+	@Override
+	protected void doStart() throws JBIException {
+		super.doStart();
+		ClientRepositoryFactory factory = new ClientRepositoryFactory();
+		try {
+			repository = factory.getRepository("rmi://localhost:1099/jackrabbit");
+		} catch (MalformedURLException e) {
+			throw new JBIException("Unable to connect to JCR repository", e);
+		} catch (ClassCastException e) {
+			throw new JBIException("Unable to connect to JCR repository", e);
+		} catch (RemoteException e) {
+			throw new JBIException("Unable to connect to JCR repository", e);
+		} catch (NotBoundException e) {
+			throw new JBIException("Unable to connect to JCR repository", e);
+		} 
+	}
+	
+	protected Session getSession() throws LoginException, RepositoryException {
+		if (session .get() == null) {
+			Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
+			this.session.set(session);
+		}
+		return session.get();
+	}
+	
+	public String getDescription() {
+		return "ServiceMix JCR Auditor";
+	}
+
+
+
+}

Added: servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/SlingAuditor.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/SlingAuditor.java?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/SlingAuditor.java
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-audit-jcr/src/main/java/org/apache/servicemix/audit/jcr/SlingAuditor.java
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,183 @@
+package org.apache.servicemix.audit.jcr;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.jcr.ItemExistsException;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.ValueFormatException;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.version.VersionException;
+import javax.xml.transform.TransformerException;
+
+import org.apache.jackrabbit.value.DateValue;
+import org.apache.servicemix.jbi.audit.AuditorException;
+import org.apache.servicemix.jbi.event.ExchangeEvent;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.util.MessageUtil;
+
+public class SlingAuditor extends JcrAuditor {
+	
+	//let's time slice our message exchange archive on an hourly basis
+	private static final DateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd hha");
+	
+	private static final String RESOURCE_TYPE = "sling:resourceType";
+	private static final String EXCHANGES_RESOURCE_TYPE = "servicemix/exchanges";
+	
+	private static final SourceTransformer TRANSFORMER = new SourceTransformer();
+	
+	public void exchangeSent(ExchangeEvent event) {
+		try {
+			Node node = getNodeForExchange(event.getExchange());
+			node.setProperty("ExchangeStatus", event.getExchange().getStatus().toString());
+			node.setProperty("Pattern", event.getExchange().getPattern().toString());
+			if (event.getExchange().getEndpoint() !=  null) {
+				node.setProperty("Endpoint", event.getExchange().getEndpoint().getEndpointName());
+			}
+			if (event.getExchange().getService() != null) {
+				node.setProperty("Service", event.getExchange().getService().toString());
+			}
+			for (Object key: event.getExchange().getPropertyNames()) {
+				String name = (String) key;
+				node.setProperty(name, event.getExchange().getProperty(name).toString());
+			}
+			addNormalizedMessages(node, event.getExchange());
+			node.setProperty("Updated", new DateValue(new GregorianCalendar()));
+			getSession().save();
+			System.out.println("Event archived in JCR");
+		} catch (ItemExistsException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (PathNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (VersionException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (ConstraintViolationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (LockException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (RepositoryException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (MessagingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (TransformerException e) {
+			// TODO Auto-generated catch block-
+			e.printStackTrace();
+		}
+	}
+
+	private void addNormalizedMessages(Node node, MessageExchange exchange) throws ItemExistsException,
PathNotFoundException, VersionException, ConstraintViolationException, LockException, MessagingException,
RepositoryException, TransformerException {
+		if (exchange.getMessage("in") != null) {
+			addNormalizedMessages(node, "In", exchange.getMessage("in"));
+		}
+		if (exchange.getMessage("out") != null) {
+			addNormalizedMessages(node, "Out", exchange.getMessage("out"));
+		}
+		if (exchange.getMessage("fault") != null) {
+			addNormalizedMessages(node, "Fault", exchange.getMessage("fault"));
+		}
+	}
+
+	private void addNormalizedMessages(Node parent, String type,
+			NormalizedMessage message) throws ItemExistsException, PathNotFoundException, VersionException,
ConstraintViolationException, LockException, RepositoryException, MessagingException, TransformerException
{
+		if (message != null) {
+			Node node; 
+			try {
+				node = parent.getNode(type);
+			} catch (PathNotFoundException e) {
+				node = parent.addNode(type);
+			}
+			node.setProperty("Content", getNormalizedMessageContent(message));
+			for (Object key: message.getPropertyNames()) {
+				String name = (String) key;
+				node.setProperty(name, message.getProperty(name).toString());
+			}
+			node.setProperty("sling:resourceType", "servicemix/normalizedmessage");
+		}
+	}
+
+	private String getNormalizedMessageContent(NormalizedMessage message) throws MessagingException,
TransformerException {
+		MessageUtil.enableContentRereadability(message);
+		return TRANSFORMER.toString(message.getContent());
+	}
+
+	private Node getNodeForExchange(MessageExchange exchange)
+			throws ItemExistsException, PathNotFoundException,
+			VersionException, ConstraintViolationException, LockException,
+			RepositoryException {
+		Session session = getSession();
+		String id = exchange.getExchangeId().replaceAll(":", "_");
+		Node parent = getBaseNode(session);
+		try {
+			return parent.getNode(id);
+		} catch (PathNotFoundException e) {
+			Node node = parent.addNode(id);
+			node.setProperty("sling:resourceType", "servicemix/exchange");
+			node.setProperty("Created", new DateValue(new GregorianCalendar()));
+			node.addMixin("mix:versionable");
+			return node;
+		}
+	}
+
+	private Node getBaseNode(Session session) throws RepositoryException {
+		Node exchanges = session.getRootNode().getNode("content/servicemix/exchanges");
+		return createOrGet(exchanges, FORMAT.format(new Date()));
+	}
+
+	private synchronized Node createOrGet(Node exchanges, String path) throws ValueFormatException,
VersionException, LockException, ConstraintViolationException, RepositoryException {
+		try {
+			return exchanges.getNode(path);
+		} catch (PathNotFoundException e) {
+			Node node = exchanges.addNode(path);
+			node.setProperty(RESOURCE_TYPE, EXCHANGES_RESOURCE_TYPE);
+			node.setProperty("Created", new DateValue(new GregorianCalendar()));
+			return node;
+		}
+	}
+
+	public String getDescription() {
+		return "ServiceMix Sling Auditor";
+	}
+
+	@Override
+	public int deleteExchangesByIds(String[] arg0) throws AuditorException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public int getExchangeCount() throws AuditorException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public String[] getExchangeIdsByRange(int arg0, int arg1)
+			throws AuditorException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public MessageExchange[] getExchangesByIds(String[] arg0)
+			throws AuditorException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}

Propchange: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 22 05:40:26 2008
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/pom.xml?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/pom.xml (added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/pom.xml Tue Apr 22 05:40:26
2008
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.servicemix.smx-sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.smx-sling</groupId>
+    <artifactId>servicemix-sling-console</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0-SNAPSHOT</version>
+
+    <name>SMX-Sling :: ServiceMix Sling Console</name>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Sling-Initial-Content>
+                            initial-content
+                        </Sling-Initial-Content>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/dashboard/html.esp
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/dashboard/html.esp?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/dashboard/html.esp
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/dashboard/html.esp
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,35 @@
+<html>
+<head>
+<title>ServiceMix :: Dashboard</title>
+<link rel="stylesheet" type="text/css" href="theme/master.css"/>
+</head>
+<body>
+<div id="page">
+<h1>Servicemix :: Dashboard</h1>
+
+<div id="content">
+ <div id="portlet">
+   <h2>Last 15 Message Exchanges</h2>
+   <table>
+   <%
+        var iter = request.resourceResolver.findResources("content/smx/exchanges/* order
by @Created descending",
+                            Packages.javax.jcr.query.Query.XPATH);
+        var i = 0;
+        while (iter.hasNext() && ++i <= 15) {
+           var resource = iter.next();
+           %>
+	   <a href="<%= resource.getPath() + ".html" %>"><%sling.include(resource.getPath()
+ ".tr");%></a>
+<%
+        }
+        %>
+   </table>
+ </div>
+</div>
+
+<div id="sidebar">
+Tasks
+</div>
+
+</div>
+</body>
+</html>

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/html.esp
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/html.esp?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/html.esp
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/html.esp
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,57 @@
+<html>
+<head>
+<title><%= currentNode.getName() %></title>
+<link rel="stylesheet" type="text/css" href="/theme/master.css"/>
+</head>
+<body>
+<div id="page">
+<h1>ServiceMix :: Message Exchange details</h1>
+<div id="content">
+<table>
+<tr>
+<td>Status</td>
+<td><%= currentNode['ExchangeStatus'] %></td>
+</tr>
+<tr>
+<td>MEP</td>
+<td><%= currentNode['Pattern'] %></td>
+</tr>
+<% for (property in currentNode.getProperties()) { 
+  if (property.match("org.apache.servicemix") || property.match("javax.jbi")) { %>
+<tr>
+<td><%= property %></td>
+<td><%= currentNode[property] %></td>
+</tr>
+<% } } %>
+</table>
+
+<% if (currentNode.In) { %>
+<h2>In message</h2>
+<% sling.include(currentNode.In + ".div"); %>
+<%}%>
+<% if (currentNode.Out) { %>
+<h2>Out message</h2>
+<% sling.include(currentNode.Out + ".div"); %>
+<%}%>
+<% if (currentNode.Fault) { %>
+<h2>Fault message</h2>
+<% sling.include(currentNode.Fault + ".div"); %>
+<%}%>
+
+<ul>
+<% history = currentNode.getVersionHistory();
+   out.println(history);
+   versions = history.getAllVersions();
+   out.println(versions);
+   var version = versions.nextVersion();
+   out.println("<li>" + version);
+   while (version) {
+     out.println("<li>" + version);
+     version = versions.nextVersion();
+   }
+ %>
+</div>
+</div>
+</body>
+</html>
+

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/tr.esp
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/tr.esp?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/tr.esp
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchange/tr.esp
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,7 @@
+<tr>
+  <td><a href="<%=currentNode%>.html">+</a></td>
+  <td><%=currentNode['org.apache.servicemix.datestamp'] %></td>
+  <td><%=currentNode.Service == undefined ? "n/a" : currentNode.Service%></td>
+  <td><%=currentNode.Endpoint == undefined ? "n/a" : currentNode.Endpoint%></td>
+  <td><%=currentNode.ExchangeStatus%></td>
+</tr>

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchanges/html.esp
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchanges/html.esp?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchanges/html.esp
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/exchanges/html.esp
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,19 @@
+<html>
+<h1>Welcome</h1>
+<% for (var exchange in currentNode.getChildren()) { %>
+<a href="<%= currentNode[exchange].getPath() %>"><%=exchange%></a>
+<% } %>
+
+<hr/>
+<%
+        var iter = request.resourceResolver.findResources("content/exchanges/* order by @Created
descending",
+                            Packages.javax.jcr.query.Query.XPATH);
+        var i = 0;
+        while (iter.hasNext() && ++i <= 15) {
+           var resource = iter.next();
+           %>
+	   <a href="<%= resource.getPath() + ".html" %>"><%=request.resourceResolver.getResource(resource)%></a>
+<%
+        }
+        %>
+</html>

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/normalizedmessage/div.esp
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/normalizedmessage/div.esp?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/normalizedmessage/div.esp
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/apps/servicemix/normalizedmessage/div.esp
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,5 @@
+<div>
+<pre>
+<%= currentNode.Content.replace(/</g, "&lt;").replace(/>/g, "&gt;") %>
+<pre>
+</div>

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/servicemix.json
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/servicemix.json?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/servicemix.json
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/servicemix.json
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,14 @@
+{
+   "jcr:primaryType":"nt:unstructured",
+   "sling:resourceType":"servicemix/dashboard",
+   
+   "exchanges":{
+      "jcr:primaryType":"nt:unstructured",
+      "sling:resourceType":"servicemix/exchanges"
+   },
+   
+   "navigation":{
+      "jcr:primaryType":"nt:unstructured",
+      "sling:resourceType":"servicemix/navigation"
+   }
+}
\ No newline at end of file

Added: servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/theme/master.css
URL: http://svn.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/theme/master.css?rev=650484&view=auto
==============================================================================
--- servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/theme/master.css
(added)
+++ servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/src/main/resources/initial-content/content/theme/master.css
Tue Apr 22 05:40:26 2008
@@ -0,0 +1,41 @@
+body {
+  font-family: sans-serif;
+}
+
+div#page {
+  margin: 0px auto;
+  width: 1024px;
+  border-left: solid thin blue;
+}
+
+div#content {
+  padding-left: 30px;
+  font-size: 10pt;
+}
+
+div#sidebar {
+  background-color: lightgrey;
+  width: 15%;
+  float: right;
+}
+
+div#portlet {
+  border: solid thin grey;
+  width: 75%;
+  float: left;
+}
+
+h1 {
+  border-bottom: solid thin blue;
+  width: 100%;
+  padding-left: 20px;
+  font-size: 14pt;
+}
+
+h2 {
+  border-bottom: solid thin grey;
+  width: 90%;
+  padding-left: 10px;
+  font-size: 12pt;
+}
+



Mime
View raw message