DNA SVN: r1268 - trunk.
by dna-commits@lists.jboss.org
Author: elvisisking
Date: 2009-09-24 16:03:40 -0400 (Thu, 24 Sep 2009)
New Revision: 1268
Modified:
trunk/pom.xml
Log:
Moving projects from eclipse branch to trunk
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-24 19:53:36 UTC (rev 1267)
+++ trunk/pom.xml 2009-09-24 20:03:40 UTC (rev 1268)
@@ -136,6 +136,7 @@
<!--module>extensions/dna-common-jdbc</module-->
<!--module>extensions/dna-connector-jdbc-metadata</module-->
<module>web/dna-web-jcr-rest</module>
+ <module>web/dna-web-jcr-rest-client</module>
<module>web/dna-web-jcr-rest-war</module>
</modules>
<properties>
@@ -959,4 +960,4 @@
<url>file://${jboss.repository.root}</url>
</repository>
</distributionManagement>
-</project>
\ No newline at end of file
+</project>
14 years, 7 months
DNA SVN: r1267 - trunk/dna-search.
by dna-commits@lists.jboss.org
Author: elvisisking
Date: 2009-09-24 15:53:36 -0400 (Thu, 24 Sep 2009)
New Revision: 1267
Modified:
trunk/dna-search/
Log:
Added svn:ignore for target folder
Property changes on: trunk/dna-search
___________________________________________________________________
Name: svn:ignore
+ target
14 years, 7 months
DNA SVN: r1266 - in trunk/tools: org.jboss.dna.eclipse.jcr.rest.client.updatesite and 1 other directories.
by dna-commits@lists.jboss.org
Author: elvisisking
Date: 2009-09-24 15:50:59 -0400 (Thu, 24 Sep 2009)
New Revision: 1266
Added:
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/.project
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/AUTHORS.txt
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/LEGAL.txt
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/build.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.xml
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/.project
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/dnaRestClientUpdateSite.v20090819.zip
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/dnaRestClientUpdateSite.v20090922.zip
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/index.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/site.xml
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.css
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.xsl
Log:
Moving from branch eclipse to trunk/tools
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/.project
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/.project (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/.project 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.dna.eclipse.jcr.rest.client.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/AUTHORS.txt
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/AUTHORS.txt (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/AUTHORS.txt 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1 @@
+Dan Florian (dflorian(a)redhat.com)
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/AUTHORS.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/LEGAL.txt
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/LEGAL.txt (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/LEGAL.txt 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,6 @@
+The DNA Eclipse JCR REST Client (http://www.jboss.org/dna/) is copyright 2000-2009 MetaMatrix, Inc. and Red Hat, Inc.
+
+This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which is
+available at http://www.eclipse.org/legal/epl-v10.html.
+
+Some portions may be licensed to Red Hat, Inc. under one or more contributor license agreements.
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/LEGAL.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/build.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/build.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/build.properties 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,6 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ LEGAL.txt,\
+ AUTHORS.txt,\
+ feature.png
+src.includes = LEGAL.txt
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.properties 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,20 @@
+# JBoss, Home of Professional Open Source.
+#
+# See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+#
+# See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+copyright = \
+JBoss DNA JCR REST Eclipse Client (http://www.jboss.org/dna/) is copyright of Red Hat, Inc.
+
+license = \
+This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which is \
+available at http://www.eclipse.org/legal/epl-v10.html.\
+\n\n\
+Some portions may be licensed to Red Hat, Inc. under one or more contributor license agreements.
+
+# Feature Information Page properties
+description = The JBoss DNA JCR REST Eclipse Client provides a resource publishing and unpublishing capability to DNA repositories.
+
+# Feature Overview Page properties
+featureName = JBoss DNA JCR REST Eclipse Client
+featureProvider = Red Hat, Inc.
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.xml
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.xml (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.xml 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.dna.eclipse.jcr.rest.client.feature"
+ label="%featureName"
+ version="1.0.0.v20090819"
+ image="feature.png"
+ provider-name="%featureProvider"
+ plugin="org.jboss.dna.eclipse.jcr.rest.client">
+
+<!-- NOTE: above image is found in the branding plugin -->
+
+ <description url="http://www.jboss.org/dna/">
+ %description
+ </description>
+
+ <copyright url="http://www.jboss.org/dna/">
+ %copyright
+ </copyright>
+
+ <license url="http://www.jboss.org/dna/license">
+ %license
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.core.resources"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.dna.eclipse.jcr.rest.client"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="true"/>
+
+</feature>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/.project
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/.project (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/.project 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.dna.eclipse.jcr.rest.client.updatesite</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.UpdateSiteBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.UpdateSiteNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/dnaRestClientUpdateSite.v20090819.zip
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/dnaRestClientUpdateSite.v20090819.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/dnaRestClientUpdateSite.v20090922.zip
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/dnaRestClientUpdateSite.v20090922.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/index.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/index.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/index.html 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,60 @@
+<html>
+<head>
+<title>org.jboss.dna.web.jcr.rest.client.swt.updatesite</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<style>@import url("web/site.css");</style>
+<script type="text/javascript">
+ var returnval = 0;
+ var stylesheet, xmlFile, cache, doc;
+ function init(){
+ // NSCP 7.1+ / Mozilla 1.4.1+ / Safari
+ // Use the standard DOM Level 2 technique, if it is supported
+ if (document.implementation && document.implementation.createDocument) {
+ xmlFile = document.implementation.createDocument("", "", null);
+ stylesheet = document.implementation.createDocument("", "", null);
+ if (xmlFile.load){
+ xmlFile.load("site.xml");
+ stylesheet.load("web/site.xsl");
+ } else {
+ alert("Document could not be loaded by browser.");
+ }
+ xmlFile.addEventListener("load", transform, false);
+ stylesheet.addEventListener("load", transform, false);
+ }
+ //IE 6.0+ solution
+ else if (window.ActiveXObject) {
+ xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0");
+ xmlFile.async = false;
+ xmlFile.load("site.xml");
+ stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0");
+ stylesheet.async = false;
+ stylesheet.load("web/site.xsl");
+ cache = new ActiveXObject("msxml2.XSLTemplate.3.0");
+ cache.stylesheet = stylesheet;
+ transformData();
+ }
+ }
+ // separate transformation function for IE 6.0+
+ function transformData(){
+ var processor = cache.createProcessor();
+ processor.input = xmlFile;
+ processor.transform();
+ data.innerHTML = processor.output;
+ }
+ // separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+
+ function transform(){
+ returnval+=1;
+ if (returnval==2){
+ var processor = new XSLTProcessor();
+ processor.importStylesheet(stylesheet);
+ doc = processor.transformToDocument(xmlFile);
+ document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
+ }
+ }
+</script>
+</head>
+<body onload="init();">
+<!--[insert static HTML here]-->
+<div id="data"><!-- this is where the transformed data goes --></div>
+</body>
+</html>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/site.xml
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/site.xml (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/site.xml 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <feature url="features/org.jboss.dna.eclipse.jcr.rest.client.feature_1.0.0.v20090922.jar" id="org.jboss.dna.eclipse.jcr.rest.client.feature" version="1.0.0.v20090922"/>
+</site>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/site.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.css
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.css (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.css 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,12 @@
+<STYLE type="text/css">
+td.spacer {padding-bottom: 10px; padding-top: 10px;}
+.title { font-family: sans-serif; color: #99AACC;}
+.bodyText { font-family: sans-serif; font-size: 9pt; color:#000000; }
+.sub-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white;}
+.log-text {font-family: sans-serif; font-style: normal; font-weight: lighter; font-size: 8pt; color:black;}
+.big-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white; border-top:10px solid white;}
+.light-row {background:#FFFFFF}
+.dark-row {background:#EEEEFF}
+.header {background:#99AADD}
+#indent {word-wrap : break-word;width :300px;text-indent:10px;}
+</STYLE>
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.xsl
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.xsl (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.xsl 2009-09-24 19:50:59 UTC (rev 1266)
@@ -0,0 +1,214 @@
+<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl="urn:schemas-microsoft-com:xslt">
+<xsl:output method="html" encoding="UTF-8"/>
+<xsl:key name="cat" match="category" use="@name"/>
+<xsl:template match="/">
+<xsl:for-each select="site">
+ <html>
+ <head>
+ <title>org.jboss.dna.web.jcr.rest.client.swt.updatesite</title>
+ <style>@import url("web/site.css");</style>
+ </head>
+ <body>
+ <h1 class="title">org.jboss.dna.web.jcr.rest.client.swt.updatesite</h1>
+ <p class="bodyText"><xsl:value-of select="description"/></p>
+ <table width="100%" border="0" cellspacing="1" cellpadding="2">
+ <xsl:for-each select="category-def">
+ <xsl:sort select="@label" order="ascending" case-order="upper-first"/>
+ <xsl:sort select="@name" order="ascending" case-order="upper-first"/>
+ <xsl:if test="count(key('cat',@name)) != 0">
+ <tr class="header">
+ <td class="sub-header" width="30%">
+ <xsl:value-of select="@name"/>
+ </td>
+ <td class="sub-header" width="70%">
+ <xsl:value-of select="@label"/>
+ </td>
+ </tr>
+ <xsl:for-each select="key('cat',@name)">
+ <xsl:sort select="ancestor::feature//@version" order="ascending"/>
+ <xsl:sort select="ancestor::feature//@id" order="ascending" case-order="upper-first"/>
+ <tr>
+ <xsl:choose>
+ <xsl:when test="(position() mod 2 = 1)">
+ <xsl:attribute name="class">dark-row</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">light-row</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td class="log-text" id="indent">
+ <xsl:choose>
+ <xsl:when test="ancestor::feature//@label">
+ <a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@label"/></a>
+ <br/>
+ <div id="indent">
+ (<xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/>)
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ <br />
+ </td>
+ <td>
+ <table>
+ <xsl:if test="ancestor::feature//@os">
+ <tr><td class="log-text" id="indent">Operating Systems:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@os"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="ancestor::feature//@ws">
+ <tr><td class="log-text" id="indent">Windows Systems:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@ws"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="ancestor::feature//@nl">
+ <tr><td class="log-text" id="indent">Languages:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@nl"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="ancestor::feature//@arch">
+ <tr><td class="log-text" id="indent">Architecture:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@arch"/></td>
+ </tr>
+ </xsl:if>
+ </table>
+ </td>
+ </tr>
+ </xsl:for-each>
+ <tr><td class="spacer"><br/></td><td class="spacer"><br/></td></tr>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count(feature) > count(feature/category)">
+ <tr class="header">
+ <td class="sub-header" colspan="2">
+ Uncategorized
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="function-available('msxsl:node-set')">
+ <xsl:variable name="rtf-nodes">
+ <xsl:for-each select="feature[not(category)]">
+ <xsl:sort select="@id" order="ascending" case-order="upper-first"/>
+ <xsl:sort select="@version" order="ascending" />
+ <xsl:value-of select="."/>
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="myNodeSet" select="msxsl:node-set($rtf-nodes)/*"/>
+ <xsl:for-each select="$myNodeSet">
+ <tr>
+ <xsl:choose>
+ <xsl:when test="position() mod 2 = 1">
+ <xsl:attribute name="class">dark-row</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">light-row</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td class="log-text" id="indent">
+ <xsl:choose>
+ <xsl:when test="@label">
+ <a href="{@url}"><xsl:value-of select="@label"/></a>
+ <br />
+ <div id="indent">
+ (<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>)
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ <br /><br />
+ </td>
+ <td>
+ <table>
+ <xsl:if test="@os">
+ <tr><td class="log-text" id="indent">Operating Systems:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@os"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="@ws">
+ <tr><td class="log-text" id="indent">Windows Systems:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@ws"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="@nl">
+ <tr><td class="log-text" id="indent">Languages:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@nl"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="@arch">
+ <tr><td class="log-text" id="indent">Architecture:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@arch"/></td>
+ </tr>
+ </xsl:if>
+ </table>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="feature[not(category)]">
+ <xsl:sort select="@id" order="ascending" case-order="upper-first"/>
+ <xsl:sort select="@version" order="ascending" />
+ <tr>
+ <xsl:choose>
+ <xsl:when test="count(preceding-sibling::feature[not(category)]) mod 2 = 1">
+ <xsl:attribute name="class">dark-row</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">light-row</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td class="log-text" id="indent">
+ <xsl:choose>
+ <xsl:when test="@label">
+ <a href="{@url}"><xsl:value-of select="@label"/></a>
+ <br />
+ <div id="indent">
+ (<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>)
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ <br /><br />
+ </td>
+ <td>
+ <table>
+ <xsl:if test="@os">
+ <tr><td class="log-text" id="indent">Operating Systems:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@os"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="@ws">
+ <tr><td class="log-text" id="indent">Windows Systems:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@ws"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="@nl">
+ <tr><td class="log-text" id="indent">Languages:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@nl"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="@arch">
+ <tr><td class="log-text" id="indent">Architecture:</td>
+ <td class="log-text" id="indent"><xsl:value-of select="@arch"/></td>
+ </tr>
+ </xsl:if>
+ </table>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
+ </body>
+ </html>
+</xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/web/site.xsl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
DNA SVN: r1265 - trunk/web/dna-web-jcr-rest-client.
by dna-commits@lists.jboss.org
Author: elvisisking
Date: 2009-09-24 15:47:18 -0400 (Thu, 24 Sep 2009)
New Revision: 1265
Modified:
trunk/web/dna-web-jcr-rest-client/
Log:
Added svn:ignore for target folder
Property changes on: trunk/web/dna-web-jcr-rest-client
___________________________________________________________________
Name: svn:ignore
+ target
14 years, 7 months
DNA SVN: r1260 - in trunk/tools/org.jboss.dna.eclipse.jcr.rest.client: .settings and 22 other directories.
by dna-commits@lists.jboss.org
Author: elvisisking
Date: 2009-09-24 15:23:00 -0400 (Thu, 24 Sep 2009)
New Revision: 1260
Added:
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.classpath
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.project
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.settings/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.settings/org.eclipse.jdt.core.prefs
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/AUTHORS.txt
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/LEGAL.txt
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/META-INF/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/META-INF/MANIFEST.MF
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.ini
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.mappings
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/build.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/dna-web-jcr-rest-client-0.7-SNAPSHOT-jar-with-dependencies.jar
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/dna-web-jcr-rest-client-0.7-SNAPSHOT-sources.jar
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaConsole.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaPreferencesDialog.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaServerView.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaToc.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishDialog.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishedLocationsDialog.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ResourceContextMenu.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ServerDialog.html
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/helpContexts.xml
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/DnaConsole.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/DnaPreferencesDialog.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/NewFilteredFileExtension.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/NewFilteredFolderName.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/OperationDialog.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/PublishDialog.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/PublishedLocationsDialog.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ResourceDnaContextMenu.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerDialog.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerView.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerViewContextMenu.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/collapse_all.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/delete_server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/edit_server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/new_server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/refresh.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/toc.xml
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/feature.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/checkmark.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/repository.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/workspace.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/blank.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/collapse_all.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/delete_server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/dna_icon_16x.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/edit_server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/error_overlay.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/new_server.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/publish.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/published_overlay.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/refresh.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/unpublish.png
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/wizards/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/wizards/dna_wizard_banner.gif
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.xml
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/log4j.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Activator.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/DnaResourceHelper.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/IUiConstants.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Utils.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/BasePublishingAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/DeleteServerAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/EditServerAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/NewServerAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/PublishAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ReconnectToServerAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ShowPublishedLocationsAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/UnpublishAction.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/package-info.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/DeleteServerDialog.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/PublishedLocationsDialog.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/package-info.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/PublishJob.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/ReconnectJob.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLogger.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLoggerFactory.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/StaticLoggerBinder.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/package-info.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/DnaPreferencePage.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFileExtensionEditor.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFoldersEditor.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/NewItemDialog.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PrefUtils.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PublishingFileFilter.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/dnaPrefs.properties
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaContentProvider.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaMessageConsole.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/ServerView.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/package-info.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishPage.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishWizard.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerPage.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerWizard.java
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/package-info.java
Log:
Moving from branch eclipse to trunk/tools
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.classpath
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.classpath (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.classpath 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="dna-web-jcr-rest-client-0.7-SNAPSHOT-jar-with-dependencies.jar" sourcepath="dna-web-jcr-rest-client-0.7-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.project
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.project (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.project 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.dna.eclipse.jcr.rest.client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.settings/org.eclipse.jdt.core.prefs 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,20 @@
+#Wed Jul 01 08:14:43 CDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/AUTHORS.txt
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/AUTHORS.txt (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/AUTHORS.txt 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1 @@
+Dan Florian (dflorian(a)redhat.com)
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/AUTHORS.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/LEGAL.txt
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/LEGAL.txt (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/LEGAL.txt 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,6 @@
+The DNA REST Eclipse SWT Client (http://www.jboss.org/dna/) is copyright 2000-2009 MetaMatrix, Inc. and Red Hat, Inc.
+
+This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which is
+available at http://www.eclipse.org/legal/epl-v10.html.
+
+Some portions may be licensed to Red Hat, Inc. under one or more contributor license agreements.
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/LEGAL.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/META-INF/MANIFEST.MF (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/META-INF/MANIFEST.MF 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.jboss.dna.eclipse.jcr.rest.client;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.dna.eclipse.jcr.rest.client.Activator
+Bundle-Vendor: %bundleVendor
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui.console,
+ org.eclipse.jface.text,
+ org.eclipse.debug.ui
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: dna-web-jcr-rest-client-0.7-SNAPSHOT-jar-with-dependencies.jar,
+ jcrRestClient.jar
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.ini
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.ini (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.ini 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,21 @@
+# JBoss, Home of Professional Open Source.
+#
+# See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+#
+# See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+aboutImage=icons/views/dna_icon_16x.png
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=feature.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.ini
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.mappings
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.mappings (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.mappings 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,3 @@
+#Thu Feb 26 11:28:46 CST 2009
+1=
+0=3126
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.properties 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,15 @@
+# JBoss, Home of Professional Open Source.
+#
+# See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+#
+# See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+
+featureText=DNA REST Client\n\
+Version: 1.0\n\
+\n\
+(c) 2000-2009 MetaMatrix, Inc. and Red Hat, Inc.\n\
+\n\
+Visit http://www.jboss.org/dna/
+
+featureName=DNA REST Client
+
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/about.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/build.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/build.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/build.properties 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,25 @@
+# JBoss, Home of Professional Open Source.
+#
+# See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+#
+# See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+bin.includes = META-INF/,\
+ plugin.properties,\
+ icons/,\
+ plugin.xml,\
+ LEGAL.txt,\
+ AUTHORS.txt,\
+ src/log4j.properties,\
+ docs/helpContexts.xml,\
+ docs/,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ feature.png,\
+ dna-web-jcr-rest-client-0.7-SNAPSHOT-jar-with-dependencies.jar,\
+ jcrRestClient.jar
+src.includes = src/,\
+ LEGAL.txt
+jars.compile.order = jcrRestClient.jar
+source.jcrRestClient.jar = src/
+output.jcrRestClient.jar = bin/
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/dna-web-jcr-rest-client-0.7-SNAPSHOT-jar-with-dependencies.jar
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/dna-web-jcr-rest-client-0.7-SNAPSHOT-jar-with-dependencies.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/dna-web-jcr-rest-client-0.7-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/dna-web-jcr-rest-client-0.7-SNAPSHOT-sources.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaConsole.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaConsole.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaConsole.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,52 @@
+<h2>DNA Console</h2>
+
+<p>The <i>DNA Console</i> is shown in the <i>Workbench Console</i> view. Entries show the status and outcome of the publishing or unpublishing operations.</p>
+
+<p>Here is what the <i>DNA Console</i> looks like:</p>
+
+<img src="images/DnaConsole.png" border="0" alt="">
+
+<p>There are view toolbar buttons to clear the console, scroll lock, pin the console, display a different console, and to open another <i>DNA Console</i>.</p>
+
+<h3>Console Message Entries</h3>
+
+<p>For each operation there is an entry at the start of the operation that identifies the job number, operation type, number of files involved in the operation, server, repository, and workspace. There is another entry at the end of the operation that identifies the job number, operation type, and how long the operation took. Inbetween these entries are entries for each file involved in the operation. The file entry takes on the form of a job number, message prefix, and message. The message consists of an operation type, eclipse workspace path, and the URL of the DNA repository for that file. The URL is a hyperlink that opens that file in the default or last used editor for that file.</p>
+
+<p>Here are the file entry message prefixes:</p>
+
+<table border="1">
+<tr>
+ <td align="center"><strong>++</strong> </td>
+ <td>if the file was successfully published (uploaded)</td>
+</tr>
+<tr>
+ <td align="center"><strong>--</strong> </td>
+ <td>if the file was successfully unpublished (removed)</td>
+</tr>
+<tr>
+ <td align="center"><strong>ERROR</strong> </td>
+ <td>if there was an error publishing or unpublishing the file</td>
+</tr>
+<tr>
+ <td align="center"><strong>INFO</strong> </td>
+ <td>if there was an informational message publishing or unpublishing the file</td>
+</tr>
+<tr>
+ <td align="center"><strong>WARN</strong> </td>
+ <td>if there is a warning when publishing or unpublishing a file (like trying to unpublish a file that was never unpublished)</td>
+</tr>
+</table>
+
+<h3>Operations</h3>
+
+<p>Each publishing or unpublishing operation can be run "in the background" so you don't have to wait around until an operation is finished. Simply click "Run in Background" on the operation dialog. This dialog identifies the operation type, the job number, and the operations progress. You can also cancel the operation using this dialog.</p>
+
+<p>Here is what the <i>Operation Dialog</i> looks like:</p>
+
+<img src="images/OperationDialog.png" border="0" alt="">
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publishing and Unpublishing Dialog</a></li>
+</ul>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaConsole.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaPreferencesDialog.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaPreferencesDialog.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaPreferencesDialog.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,26 @@
+<h2>DNA Preferences Page</h2>
+
+<p>The <i>DNA Preferences Page</i> provides settings that control what files are included in publishing and unpublishing operations. A publishing operation occurs when the selected files in your local workspace are uploaded to a specific DNA repository workspace. While an unpublishing operation occurs when the selected files in your local workspace are removed from a specific DNA repository workspace. The <i>Filtered File Extensions</i> preference and the <i>Filtered Folder Names</i> preference each provide a way to filter out certain files from these operations.</p>
+
+<p>Here is what the <i>DNA Preferences Page</i> looks like:</p>
+
+<img src="images/DnaPreferencesDialog.png" border="0" alt="">
+
+<h3>Filtered File Extensions Preference</h3>
+
+The <i>Filtered File Extensions</i> preference provides a way to construct a list of file extensions. If a file has an extension that matches one of these file extensions it will not be involved in either a publishing or unpublishing operation. To add a file extension simply click on the <code>New...</code> button to display the following dialog:
+
+<p><img src="images/NewFilteredFileExtension.png" border="0" alt=""></p>
+
+<h3>Filtered Folder Names Preference</h3>
+
+The <i>Filtered File Names</i> preference provides a way to construct a list of folder names. If a file is contained in a folder, or has an ancestor folder, with a name that matches one of these folder names it will not be involved in either a publishing or unpublishing operation. To add a folder name simply click on the <code>New...</code> button to display the following dialog:
+
+<p><img src="images/NewFilteredFolderName.png" border="0" alt=""></p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publish/Unpublish Dialog</a></li>
+<li><a href="ResourceContextMenu.html">Resource DNA Context Menu</a></li>
+</ul>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaPreferencesDialog.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaServerView.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaServerView.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaServerView.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,17 @@
+<h2>Server View</h2>
+
+<p>The <i>DNA Server View</i> displays the registered servers hosting DNA repositories. For each server, the repositories and repository workspaces are also displayed. There are view toolbar buttons to create a new server (<img src="images/new_server.gif" border="0" alt="">), edit a selected server's properties (<img src="images/edit_server.gif" border="0" alt="">), discard one or more selected servers (<img src="images/delete_server.gif" border="0" alt="">), reconnect to a selected server (<img src="images/refresh.gif" border="0" alt="">), and collapse all servers so that their repositories and workspaces can't be seen (<img src="images/collapse_all.gif" border="0" alt="">). If a connection to a server cannot be established that server icon will be decorated with an error overlay image.</p>
+
+<p>Here is what the <i>DNA Server View</i> looks like:</p>
+
+<img src="images/ServerView.png" border="0" alt="">
+
+<p>The view's context menu includes the new server, edit server properties, discard server, and reconnect to server actions. Here is what the DNA Server View context menu looks like:</p>
+
+<img src="images/ServerViewContextMenu.png" border="0" alt="">
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="ServerDialog.html">Server Dialog</a></li>
+</ul>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaServerView.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaToc.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaToc.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaToc.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,11 @@
+<h2>DNA Publishing</h2>
+
+<ul>
+<li><a href="PublishDialog.html">Publish/Unpublish Dialog</a></li>
+<li><a href="ServerDialog.html">Server Dialog</a></li>
+<li><a href="DnaServerView.html">Server View</a></li>
+<li><a href="DnaConsole.html">DNA Message Console</a></li>
+<li><a href="PublishedLocationsDialog.html">Published Locations Dialog</a></li>
+<li><a href="ResourceContextMenu.html">Resource Context Menu</a></li>
+<li><a href="DnaPreferencesDialog.html">DNA Preferences Page</a></li>
+</ul>
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/DnaToc.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishDialog.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishDialog.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishDialog.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,46 @@
+<h2>Publish/Unpublish Dialog</h2>
+
+<p>The <i>DNA Publish/Unpublish Dialog</i> is used to publish or unpublish workspace selected files and folders to/from DNA repository workspaces. When publishing, the selected files will be uploaded to the selected DNA repository workspace. When unpublishing, the selected files will be removed from the selected DNA repository workspace (if they exist there). The <a href="DnaPreferencesDialog.html">DNA Preferences Page</a> allows you to filter out files contained within the selection based on their file extensions or by the name of the folder, or ancestor folder, they are contained within.</p>
+
+<p>Here is what the <i>DNA Publish/Unpublish Dialog</i> looks like:</p>
+
+<img src="images/PublishDialog.png" border="0" alt="">
+
+<p>The dialog consists of the following controls:</p>
+
+<table border="1">
+<tr>
+ <td align="right"><strong>Server Combo</strong> </td>
+ <td>allows selection of a registered server</td>
+</tr>
+<tr>
+ <td align="right"><strong>New Server Button</strong> </td>
+ <td>use to create and register a new server that is hosting a DNA repository</td>
+</tr>
+<tr>
+ <td align="right"><strong>Repository Combo</strong> </td>
+ <td>allows selection of a repository found hosted on the selected server</td>
+</tr>
+<tr>
+ <td align="right"><strong>Workspace Combo</strong> </td>
+ <td>allows selection of a workspace of the selected repository</td>
+</tr>
+<tr>
+ <td align="right"><strong>Resources List</strong> </td>
+ <td>a list of all the selected files that will be published or unpublished</td>
+</tr>
+<tr>
+ <td align="right"><strong>Recurse Checkbox</strong> </td>
+ <td>when checked will recursively select all files within any selected folders</td>
+</tr>
+</table>
+
+<p>A server must be selected before a repository can be selected. Likewise, a repository must be selected before a workspace can be selected. The message area at the top of the dialog will indicate the type of operation (publish or unpublish) and if there is any missing information. Once the workspace has been selected the 'Finish' button will be enabled and the operation can be executed. These operations can be run in the background so that multiple operations can be run at the same time. The DNA Message Console displays output from the operations.</p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="ServerDialog.html">Server Dialog</a></li>
+<li><a href="DnaConsole.html">DNA Message Console</a></li>
+<li><a href="DnaPreferencesDialog.html">DNA Preferences Page</a></li>
+</ul>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishDialog.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishedLocationsDialog.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishedLocationsDialog.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishedLocationsDialog.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,15 @@
+<h2>Published Locations Dialog</h2>
+
+<p>The <i>Published Locations Dialog</i> identifies all the DNA workspaces the selected file has been published to from this Eclipse workspace.</p>
+
+<p>Here is what the <i>Published Locations Dialog</i> looks like:</p>
+
+<img src="images/PublishedLocationsDialog.png" border="0" alt="">
+
+<p>The table data identifies, for each workspace, the server URL, user, repository name, workspace name, and published URL. A button to copy the published URL of the selected row to the system clipboard is also available.</p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publish/Unpublish Dialog</a></li>
+</ul>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/PublishedLocationsDialog.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ResourceContextMenu.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ResourceContextMenu.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ResourceContextMenu.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,16 @@
+<h2>Resource Context Menu</h2>
+
+<p>The <i>Resource Context Menu</i> consists of these actions: publish, unpublish, and show published locations. The publish and unpublish actions will be enabled when one or more resources (i.e, project, folder, or file) in the workspace are selected. When publishing, the selected resources will be uploaded to a DNA repository workspace. When unpublishing, the selected resources will be removed from a selected DNA repository workspace (if they exist there). If a resource has already been published using the current Eclipse workspace, the show published locations action will be enabled.</p>
+
+<p>Here is what the <i>Resource Context Menu</i> looks like:</p>
+
+<img src="images/ResourceDnaContextMenu.png" border="0" alt="">
+
+<p>Files can be filtered out of publishing and unpublishing operations even though they have been selected. Use the <a href="DnaPreferencesDialog.html">DNA Preferences Page</a> to filter out files contained within the selection based on their file extensions or by the name of the folder, or ancestor folder, they are contained within. </p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publishing and Unpublishing Dialog</a></li>
+<li><a href="DnaPreferenceDialog.html">DNA Preferences Dialog</a></li>
+</ul>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ResourceContextMenu.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ServerDialog.html
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ServerDialog.html (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ServerDialog.html 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,41 @@
+<h2>Server Dialog</h2>
+
+<p>The <i>DNA Server Dialog</i> is used to create and register new servers that host DNA repositories. This dialog is also used to edit an existing server's properties.</p>
+
+<p>Here is what the <i>DNA Server Dialog</i> looks like:</p>
+
+<img src="images/ServerDialog.png" border="0" alt="">
+
+<p>The dialog consists of the following controls:</p>
+
+<table border="1">
+<tr>
+ <td align="right"><strong>URL Field</strong> </td>
+ <td>enter the server URL where one or more DNA repositories are hosted</td>
+</tr>
+<tr>
+ <td align="right"><strong>User Field</strong> </td>
+ <td>enter the name of the user that will be used when logging in to the server</td>
+</tr>
+<tr>
+ <td align="right"><strong>Password Field</strong> </td>
+ <td>enter the password to use when logging in to the server</td>
+</tr>
+<tr>
+ <td align="right"><strong>Save Password Checkbox</strong> </td>
+ <td>when checked, all the server properties (including the password) will be saved to a file on the local machine</td>
+</tr>
+<tr>
+ <td align="right"><strong>Test Server Connection Button</strong> </td>
+ <td>when clicked will try and connect to the server</td>
+</tr>
+</table>
+
+<p>Once all server properties have been entered the 'Finish' button will be enabled and the new server can be created or the existing server's properties can be modified. You can display the Server Dialog from the Server View and from the Publish/Unpublish Dialog.</p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="DnaServerView.html">Server View</a></li>
+<li><a href="PublishDialog.html">Publishing and Unpublishing Dialog</a></li>
+</ul>
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/ServerDialog.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/helpContexts.xml
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/helpContexts.xml (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/helpContexts.xml 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,34 @@
+<!--
+ JBoss, Home of Professional Open Source.
+
+ See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+
+ See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+-->
+<contexts>
+ <context id="serverViewHelpContext" title="DNA Server View">
+ <description>Ther DNA Server View shows all registered servers and their repositories and workspaces.</description>
+ <topic href="docs/DnaServerView.html" label="DNA Server View"/>
+ <topic href="docs/ServerDialog.html" label="Server Dialog"/>
+ </context>
+ <context id="serverDialogHelpContext" title="Server Dialog">
+ <description>The DNA Server Dialog allows you to edit or create a server that hosts one or more DNA repositories.</description>
+ <topic href="docs/ServerDialog.html" label="Server Dialog"/>
+ <topic href="docs/DnaServerView.html" label="DNA Server View"/>
+ </context>
+ <context id="publishDialogHelpContext" title="DNA Publish and Unpublish Dialog Help">
+ <description>The DNA Publish/Unpublish Dialog uploads or removes selected resources from a selected DNA server.</description>
+ <topic href="docs/PublishDialog.html" label="Publish/Unpublish Dialog"/>
+ <topic href="docs/ServerDialog.html" label="Create a new server"/>
+ <topic href="docs/DnaPreferencesDialog.html" label="DNA Preferences"/>
+ </context>
+ <context id="preferencesHelpContext" title="DNA Preferences Dialog Help">
+ <description>The DNA Preferences Dialog allows you to identify file extensions and folder names that should not be involved in publishing operations.</description>
+ <topic href="docs/DnaPreferencesDialog.html" label="DNA Preferences"/>
+ <topic href="docs/PublishDialog.html" label="Publish/Unpublish Dialog"/>
+ </context>
+ <context id="dnaConsoleHelpContext" title="DNA Message Console">
+ <description>The DNA Message Console contains the output from the publishing and unpublishing operations.</description>
+ <topic href="docs/DnaConsole.html" label="DNA Message Console"/>
+ </context>
+</contexts>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/helpContexts.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/DnaConsole.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/DnaConsole.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/DnaPreferencesDialog.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/DnaPreferencesDialog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/NewFilteredFileExtension.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/NewFilteredFileExtension.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/NewFilteredFolderName.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/NewFilteredFolderName.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/OperationDialog.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/OperationDialog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/PublishDialog.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/PublishDialog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/PublishedLocationsDialog.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/PublishedLocationsDialog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ResourceDnaContextMenu.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ResourceDnaContextMenu.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerDialog.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerDialog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerView.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerView.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerViewContextMenu.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/ServerViewContextMenu.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/collapse_all.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/collapse_all.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/delete_server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/delete_server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/edit_server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/edit_server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/new_server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/new_server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/refresh.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/images/refresh.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/toc.xml
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/toc.xml (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/toc.xml 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,9 @@
+<toc label="DNA Publishing">
+ <topic label="Publishing/Unpublishing Dialog" href="docs/PublishDialog.html"/>
+ <topic label="Server View" href="docs/DnaServerView.html"/>
+ <topic label="Server Dialog" href="docs/ServerDialog.html"/>
+ <topic label="DNA Console" href="docs/DnaConsole.html"/>
+ <topic label="Published Locations Dialog" href="docs/PublishedLocationsDialog.html"/>
+ <topic label="Resource Context Menu" href="docs/ResourceContextMenu.html"/>
+ <topic label="DNA Preferences Dialog" href="docs/DnaPreferencesDialog.html"/>
+</toc>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/docs/toc.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/feature.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/feature.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/checkmark.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/checkmark.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/repository.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/repository.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/workspace.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/objects/workspace.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/blank.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/blank.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/collapse_all.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/collapse_all.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/delete_server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/delete_server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/dna_icon_16x.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/dna_icon_16x.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/edit_server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/edit_server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/error_overlay.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/error_overlay.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/new_server.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/new_server.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/publish.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/publish.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/published_overlay.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/published_overlay.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/refresh.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/refresh.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/unpublish.png
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/views/unpublish.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/wizards/dna_wizard_banner.gif
===================================================================
(Binary files differ)
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/icons/wizards/dna_wizard_banner.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.properties 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,33 @@
+#
+# JBoss DNA (http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of
+# individual contributors.
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+bundleName = DNA Eclipse Publishing UI Plug-in
+bundleVendor = Red Hat, Inc.
+contextMenu.label = DNA
+decorator.description = Decorates DNA objects in the Server View
+decorator.label = DNA Server View Decorator
+dnaCategory = DNA
+publishAction.label = Publish
+serverView = DNA Servers
+showPublishedLocationsAction.label = Show Published Locations
+unpublishAction.label = Unpublish
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.xml
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.xml (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.xml 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+<!-- Define the IResource object contribution actions to all popup menus -->
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="org.jboss.dna.eclipse.jcr.rest.client.iresourcepopupmenucontribution"
+ objectClass="org.eclipse.core.resources.IResource">
+ <menu
+ id="org.jboss.dna.eclipse.jcr.rest.client.contextMenu"
+ label="%contextMenu.label"
+ path="additions">
+ <separator
+ name="dna">
+ </separator>
+ </menu>
+
+ <!-- Show Published Locations action -->
+ <action
+ id="org.jboss.dna.eclipse.jcr.rest.client.showPublishedLocationsAction"
+ label="%showPublishedLocationsAction.label"
+ class="org.jboss.dna.eclipse.jcr.rest.client.actions.ShowPublishedLocationsAction"
+ icon="icons/views/blank.gif"
+ menubarPath="org.jboss.dna.eclipse.jcr.rest.client.contextMenu/group1"
+ enablesFor="1">
+ <enablement>
+ <and>
+ <objectClass name="org.eclipse.core.resources.IFile" />
+ <objectState name="persistentProperty" value="org.jboss.dna.eclipse.jcr.rest.client.publishedIn" />
+ </and>
+ </enablement>
+ </action>
+
+ <!-- Unpublish action -->
+ <action
+ id="org.jboss.dna.eclipse.jcr.rest.client.unpublishAction"
+ label="%unpublishAction.label"
+ class="org.jboss.dna.eclipse.jcr.rest.client.actions.UnpublishAction"
+ icon="icons/views/unpublish.png"
+ menubarPath="org.jboss.dna.eclipse.jcr.rest.client.contextMenu/group1"
+ enablesFor="*">
+ <enablement>
+ <or>
+ <objectClass name="org.eclipse.core.resources.IFile" />
+ <objectClass name="org.eclipse.core.resources.IFolder" />
+ <and>
+ <objectClass name="org.eclipse.core.resources.IProject" />
+ <objectState name="open" value="true" />
+ </and>
+ </or>
+ </enablement>
+ </action>
+
+ <!-- Publish action -->
+ <action
+ id="org.jboss.dna.eclipse.jcr.rest.client.publishAction"
+ label="%publishAction.label"
+ class="org.jboss.dna.eclipse.jcr.rest.client.actions.PublishAction"
+ icon="icons/views/publish.png"
+ menubarPath="org.jboss.dna.eclipse.jcr.rest.client.contextMenu/group1"
+ enablesFor="*">
+ <enablement>
+ <or>
+ <objectClass name="org.eclipse.core.resources.IFile" />
+ <objectClass name="org.eclipse.core.resources.IFolder" />
+ <and>
+ <objectClass name="org.eclipse.core.resources.IProject" />
+ <objectState name="open" value="true" />
+ </and>
+ </or>
+ </enablement>
+ </action>
+ </objectContribution>
+ </extension>
+
+<!-- View extensions -->
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="org.jboss.dna"
+ name="%dnaCategory">
+ </category>
+
+ <!-- Repository view -->
+ <view
+ id="serverView"
+ name="%serverView"
+ category="org.jboss.dna"
+ class="org.jboss.dna.eclipse.jcr.rest.client.views.ServerView"
+ fastViewWidthRatio="0.25"
+ icon="icons/objects/server.gif">
+ </view>
+ </extension>
+
+<!-- Server view decorator -->
+ <extension
+ point="org.eclipse.ui.decorators">
+ <decorator
+ lightweight="true"
+ location="BOTTOM_LEFT"
+ adaptable="true"
+ label="%decorator.label"
+ state="true"
+ class="org.jboss.dna.eclipse.jcr.rest.client.views.DnaContentProvider"
+ id="org.jboss.dna.eclipse.jcr.rest.client.dnaDecorator">
+ <description>
+ %decorator.description
+ </description>
+ <enablement>
+ <or>
+ <objectClass
+ name="org.jboss.dna.web.jcr.rest.client.domain.IDnaObject">
+ </objectClass>
+ <objectClass
+ name="org.eclipse.core.resources.IFile">
+ </objectClass>
+ </or>
+ </enablement>
+ </decorator>
+ </extension>
+
+<!-- Context Help -->
+ <extension point="org.eclipse.help.contexts">
+ <contexts file="docs/helpContexts.xml" />
+ </extension>
+
+<!-- Help Table of Contents -->
+ <extension point="org.eclipse.help.toc">
+ <toc file="docs/toc.xml" primary="true" />
+ </extension>
+
+<!-- Preference Page -->
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%dnaCategory"
+ class="org.jboss.dna.eclipse.jcr.rest.client.preferences.DnaPreferencePage"
+ id="dnaPreferencePage">
+ </page>
+ </extension>
+</plugin>
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/log4j.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/log4j.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/log4j.properties 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,40 @@
+#
+# JBoss DNA (http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of
+# individual contributors.
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+# Root logger option
+log4j.rootLogger=TRACE, LOGFILE, CONSOLE
+
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=eclipse.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=TRACE
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+# CONSOLE
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.Threshold=TRACE
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/log4j.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Activator.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Activator.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Activator.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,279 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.log4j.BasicConfigurator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.IDnaObject;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The <code>Activator</code> controls the plug-in life cycle, provides utility functions, and keeps track of the
+ * {@link ServerManager}.
+ */
+public final class Activator extends AbstractUIPlugin implements IUiConstants {
+
+ // ===========================================================================================================================
+ // Class Fields
+ // ===========================================================================================================================
+
+ /**
+ * The shared plugin instance.
+ */
+ private static Activator plugin;
+
+ // ===========================================================================================================================
+ // Class Methods
+ // ===========================================================================================================================
+
+ /**
+ * @return the shared instance or <code>null</code> if not constructed
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The image used when the requested image cannot be found.
+ */
+ private Image missingImage;
+
+ /**
+ * The manager in charge of the server registry.
+ */
+ private ServerManager serverMgr;
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * @param key the plugin relative path to the image (never <code>null</code>)
+ * @return the image or an image indicating the requested image could not be found
+ */
+ private ImageDescriptor createImageDescriptor( String key ) {
+ CheckArg.isNotNull(key, "key"); //$NON-NLS-1$
+
+ try {
+ URL url = new URL(getBundle().getEntry("/").toString() + key); //$NON-NLS-1$
+ return ImageDescriptor.createFromURL(url);
+ } catch (final MalformedURLException e) {
+ log(new Status(Severity.ERROR, RestClientI18n.missingImage.text(key), e));
+ return null;
+ }
+ }
+
+ /**
+ * @return the image to use when a requested image cannot be found
+ */
+ private Image getMissingImage() {
+ if (this.missingImage == null) {
+ this.missingImage = ImageDescriptor.getMissingImageDescriptor().createImage();
+ }
+
+ return this.missingImage;
+ }
+
+ /**
+ * @param imageId the shared image identifier (never <code>null</code>)
+ * @return the image or an image indicating the requested image could not be found
+ * @see ISharedImages
+ */
+ public Image getSharedImage( String imageId ) {
+ CheckArg.isNotNull(imageId, "imageId"); //$NON-NLS-1$
+ Image result = PlatformUI.getWorkbench().getSharedImages().getImage(imageId);
+ return ((result == null) ? getMissingImage() : result);
+ }
+
+ /**
+ * @param imageId the shared image identifier (never <code>null</code>)
+ * @return the image descriptor or a descriptor indicating the requested descriptor could not be found
+ * @see ISharedImages
+ */
+ public ImageDescriptor getSharedImageDescriptor( String imageId ) {
+ CheckArg.isNotNull(imageId, "imageId"); //$NON-NLS-1$
+ ImageDescriptor result = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imageId);
+
+ if (result != null) {
+ return result;
+ }
+
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+
+ /**
+ * @param object the object whose image is being requested (domain object or plugin-relative path)
+ * @return the image or <code>null</code> if not found
+ */
+ public Image getImage( Object object ) {
+ String key = null;
+
+ if (object instanceof Workspace) {
+ key = WORKSPACE_IMAGE;
+ } else if (object instanceof Repository) {
+ key = REPOSITORY_IMAGE;
+ } else if (object instanceof Server) {
+ key = SERVER_IMAGE;
+ } else if (object instanceof IDnaObject) {
+ // should have an icon for every business object
+ assert false;
+ } else if (object instanceof String) {
+ key = (String)object;
+ }
+
+ if (key != null) {
+ ImageRegistry registry = getImageRegistry();
+ Image image = registry.get(key);
+
+ if (image == null) {
+ ImageDescriptor descriptor = createImageDescriptor(key);
+
+ if (descriptor == null) {
+ return getMissingImage();
+ }
+
+ image = descriptor.createImage();
+ registry.put(key, image);
+ }
+
+ return image;
+ }
+
+ return null;
+ }
+
+ /**
+ * @param object the object whose image descriptor is being requested
+ * @return the image descriptor or <code>null</code> if not found
+ */
+ public ImageDescriptor getImageDescriptor( Object object ) {
+ String key = null;
+
+ if (object instanceof Workspace) {
+ key = WORKSPACE_IMAGE;
+ } else if (object instanceof Repository) {
+ key = REPOSITORY_IMAGE;
+ } else if (object instanceof Server) {
+ key = SERVER_IMAGE;
+ } else if (object instanceof IDnaObject) {
+ // should have an icon for every business object
+ assert false;
+ } else if (object instanceof String) {
+ key = (String)object;
+ }
+
+ if (key != null) {
+ ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, ((String)object));
+ return ((descriptor == null) ? ImageDescriptor.getMissingImageDescriptor() : descriptor);
+ }
+
+ return null;
+ }
+
+ /**
+ * @return the server manager or <code>null</code> if activator has not been initialized or started
+ * @see #start(BundleContext)
+ */
+ public ServerManager getServerManager() {
+ return this.serverMgr;
+ }
+
+ /**
+ * @param status the status being logged (never <code>null</code>)
+ */
+ public void log( Status status ) {
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
+ IStatus eclipseStatus = new org.eclipse.core.runtime.Status(Utils.convertSeverity(status.getSeverity()),
+ IUiConstants.PLUGIN_ID, status.getMessage(),
+ status.getException());
+ getLog().log(eclipseStatus);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start( BundleContext context ) throws Exception {
+ BasicConfigurator.configure();
+
+ super.start(context);
+ plugin = this;
+
+ this.serverMgr = new ServerManager(getStateLocation().toFile().getAbsolutePath());
+ Status status = this.serverMgr.restoreState();
+
+ // problem restoring server registry
+ if (!status.isOk()) {
+ log(status);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop( BundleContext context ) throws Exception {
+ if (missingImage != null) {
+ missingImage.dispose();
+ }
+
+ if (this.serverMgr != null) {
+ Status status = this.serverMgr.saveState();
+
+ if (!status.isOk()) {
+ log(status);
+ }
+
+ this.serverMgr = null;
+ }
+
+ super.stop(context);
+
+ plugin = null;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/DnaResourceHelper.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/DnaResourceHelper.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/DnaResourceHelper.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,246 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>DnaResourceHelper</code> knows how to get and set the property on a resource that indicates it has been published to
+ * one or more workspaces.
+ */
+public final class DnaResourceHelper {
+
+ // ===========================================================================================================================
+ // Constants
+ // ===========================================================================================================================
+
+ /**
+ * Delimiter between a workspace's properties.
+ */
+ private static final String ID_DELIM = "$"; //$NON-NLS-1$
+
+ /**
+ * Delimiter between workspaces.
+ */
+ private static final String DELIM = "|"; //$NON-NLS-1$
+
+ /**
+ * The name of the persisted file property indicating if the resource has been published. This property will only exist if the
+ * file has been published to at least one DNA repository. The value of the property is a list of DNA repository workspaces
+ * where this file has been published.
+ */
+ private static QualifiedName PUBLISHED_RESOURCE_PROPERTY = new QualifiedName(IUiConstants.PLUGIN_ID, "publishedIn"); //$NON-NLS-1$
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The server manager used by the helper to obtain workspaces.
+ */
+ private final ServerManager serverManager;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param serverManager the server manager used by this helper (never <code>null</code>)
+ */
+ public DnaResourceHelper( ServerManager serverManager ) {
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
+ this.serverManager = serverManager;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * @param file the file that was just published
+ * @param workspace the workspace where the file was published
+ * @throws Exception if there is a problem setting the property
+ */
+ public void addPublishedProperty( IFile file,
+ Workspace workspace ) throws Exception {
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+
+ Set<Workspace> workspaces = getPublishedOnWorkspaces(file);
+ workspaces.add(workspace);
+
+ // set new value
+ setPublishedOnPropertyValue(file, workspaces);
+ }
+
+ /**
+ * @param workspaces the workspaces used to create the property value
+ * @return the property value
+ */
+ private String createPublishedPropertyValue( Set<Workspace> workspaces ) {
+ StringBuilder value = new StringBuilder();
+
+ for (Workspace workspace : workspaces) {
+ value.append(createWorkspaceId(workspace)).append(DELIM);
+ }
+
+ return value.toString();
+ }
+
+ /**
+ * @param workspace the workspace whose identifier is being created
+ * @return the ID
+ */
+ private String createWorkspaceId( Workspace workspace ) {
+ StringBuilder result = new StringBuilder();
+ result.append(workspace.getServer().getUrl()).append(ID_DELIM).append(workspace.getServer().getUser()).append(ID_DELIM);
+ result.append(workspace.getRepository().getName()).append(ID_DELIM);
+ result.append(workspace.getName());
+
+ return result.toString();
+ }
+
+ /**
+ * @param file the file whose <code>Workspace</code>s it has been published on is being requested (never <code>null</code>)
+ * @return the workspaces (never <code>null</code>)
+ * @throws Exception if there is a problem reading one of the file's persistent properties or a problem with the server
+ * manager
+ */
+ public Set<Workspace> getPublishedOnWorkspaces( IFile file ) throws Exception {
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+
+ Set<Workspace> publishedOnWorkspaces = null;
+ String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
+
+ if (value == null) {
+ publishedOnWorkspaces = new HashSet<Workspace>(1);
+ } else {
+ StringTokenizer wsTokenizer = new StringTokenizer(value, DELIM);
+ publishedOnWorkspaces = new HashSet<Workspace>(wsTokenizer.countTokens());
+
+ while (wsTokenizer.hasMoreTokens()) {
+ StringTokenizer propsTokenizer = new StringTokenizer(wsTokenizer.nextToken(), ID_DELIM);
+
+ PARSE_WORKSPACE: while (propsTokenizer.hasMoreTokens()) {
+ String url = propsTokenizer.nextToken();
+ String user = propsTokenizer.nextToken();
+ Server server = this.serverManager.findServer(url, user);
+
+ if ((server != null) && this.serverManager.ping(server).isOk()) {
+ Collection<Repository> repositories = this.serverManager.getRepositories(server);
+
+ if (!repositories.isEmpty()) {
+ String repositoryName = propsTokenizer.nextToken();
+
+ for (Repository repository : repositories) {
+ if (repository.getName().equals(repositoryName)) {
+ Collection<Workspace> workspaces = this.serverManager.getWorkspaces(repository);
+
+ if (!workspaces.isEmpty()) {
+ String workspaceName = propsTokenizer.nextToken();
+
+ for (Workspace workspace : workspaces) {
+ if (workspace.getName().equals(workspaceName)) {
+ publishedOnWorkspaces.add(workspace);
+ break PARSE_WORKSPACE;
+ }
+ }
+ }
+
+ }
+ }
+ }
+ } else {
+ // this will remove workspace as being one that the file has been published on
+ break PARSE_WORKSPACE;
+ }
+ }
+ }
+ }
+
+ return publishedOnWorkspaces;
+ }
+
+ /**
+ * @param file the file whose published status is being requested (never <code>null</code>)
+ * @return <code>true</code> if the file has been published to any DNA repository
+ */
+ public boolean isPublished( IFile file ) {
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+
+ try {
+ return !getPublishedOnWorkspaces(file).isEmpty();
+ } catch (Exception e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
+ }
+
+ return false;
+ }
+
+ /**
+ * @param file the file that was just unpublished
+ * @param workspace the workspace where the file was unpublished
+ * @throws Exception if there is a problem setting the property
+ */
+ public void removePublishedProperty( IFile file,
+ Workspace workspace ) throws Exception {
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+
+ Set<Workspace> workspaces = getPublishedOnWorkspaces(file);
+ workspaces.remove(workspace);
+
+ // set new value
+ setPublishedOnPropertyValue(file, workspaces);
+ }
+
+ /**
+ * @param file the file whose property is being set
+ * @param workspaces the workspaces the file has been published to or <code>null</code> if the file has not been published
+ * @throws CoreException if there was a problem setting the property
+ */
+ private void setPublishedOnPropertyValue( IFile file,
+ Set<Workspace> workspaces ) throws CoreException {
+ if ((workspaces == null) || workspaces.isEmpty()) {
+ file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, null);
+ } else {
+ String value = createPublishedPropertyValue(workspaces);
+ file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, value);
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/DnaResourceHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/IUiConstants.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/IUiConstants.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/IUiConstants.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,124 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client;
+
+public interface IUiConstants {
+
+ /**
+ * The Plug-in's identifier.
+ */
+ String PLUGIN_ID = "org.jboss.dna.eclipse.jcr.rest.client"; //$NON-NLS-1$
+
+ String ICON_FOLDER = "icons/"; //$NON-NLS-1$
+
+ //
+ // /icons/objects/
+ //
+
+ String OBJECT_ICONS_FOLDER = ICON_FOLDER + "objects/"; //$NON-NLS-1$
+
+ String CHECKMARK_IMAGE = OBJECT_ICONS_FOLDER + "checkmark.gif"; //$NON-NLS-1$
+
+ String REPOSITORY_IMAGE = OBJECT_ICONS_FOLDER + "repository.gif"; //$NON-NLS-1$
+
+ String SERVER_IMAGE = OBJECT_ICONS_FOLDER + "server.gif"; //$NON-NLS-1$
+
+ String WORKSPACE_IMAGE = OBJECT_ICONS_FOLDER + "workspace.gif"; //$NON-NLS-1$
+
+ //
+ // /icons/views/
+ //
+
+ String VIEWS_ICON_FOLDER = ICON_FOLDER + "views/"; //$NON-NLS-1$
+
+ String BLANK_IMAGE = VIEWS_ICON_FOLDER + "blank.gif"; //$NON-NLS-1$
+
+ String COLLAPSE_ALL_IMAGE = VIEWS_ICON_FOLDER + "collapse_all.gif"; //$NON-NLS-1$
+
+ String DELETE_SERVER_IMAGE = VIEWS_ICON_FOLDER + "delete_server.gif"; //$NON-NLS-1$
+
+ String DNA_IMAGE_16x = VIEWS_ICON_FOLDER + "dna_icon_16x.png"; //$NON-NLS-1$
+
+ String EDIT_SERVER_IMAGE = VIEWS_ICON_FOLDER + "edit_server.gif"; //$NON-NLS-1$
+
+ String ERROR_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "error_overlay.gif"; //$NON-NLS-1$
+
+ String NEW_SERVER_IMAGE = VIEWS_ICON_FOLDER + "new_server.gif"; //$NON-NLS-1$
+
+ String PUBLISH_IMAGE = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
+
+ String PUBLISHED_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "published_overlay.png"; //$NON-NLS-1$
+
+ String REFRESH_IMAGE = VIEWS_ICON_FOLDER + "refresh.gif"; //$NON-NLS-1$
+
+ String UNPUBLISH_IMAGE = VIEWS_ICON_FOLDER + "unpublish.png"; //$NON-NLS-1$
+
+ //
+ // /icons/wizards/
+ //
+
+ String WIZARD_ICONS_FOLDER = ICON_FOLDER + "wizards/"; //$NON-NLS-1$
+
+ String DNA_WIZARD_BANNER_IMAGE = WIZARD_ICONS_FOLDER + "dna_wizard_banner.gif"; //$NON-NLS-1$
+
+ //
+ // Help Contexts
+ //
+
+ String HELP_CONTEXT_PREFIX = PLUGIN_ID + '.';
+
+ String DNA_CONSOLE_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "dnaConsoleHelpContext"; //$NON-NLS-1$
+
+ String PREFERENCE_PAGE_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "preferencesHelpContext"; //$NON-NLS-1$
+
+ String PUBLISH_DIALOG_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "publishDialogHelpContext"; //$NON-NLS-1$
+
+ String SERVER_DIALOG_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "serverDialogHelpContext"; //$NON-NLS-1$
+
+ String SERVER_VIEW_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "serverViewHelpContext"; //$NON-NLS-1$
+
+ //
+ // Jobs
+ //
+
+ /**
+ * The <code>Job</code> framework job family for the DNA publishing and unpublishing operations.
+ */
+ String DNA_PUBLISHING_JOB_FAMILY = "dna.publishing.job.family"; //$NON-NLS-1$
+
+ //
+ // Preferences
+ //
+
+ /**
+ * A preference for a list of file extensions that will not be part of publishing operations.
+ */
+ String FILTERED_FILE_EXTENSIONS_PREFERENCE = "dna.preference.filteredFileExtensions"; //$NON-NLS-1$
+
+ /**
+ * A preference for a list of folder names whose contents will not be part of publishing operations.
+ */
+ String FILTERED_FOLDER_NAMES_PREFERENCE = "dna.preference.filteredFolderNames"; //$NON-NLS-1$
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/IUiConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,193 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client;
+
+import org.jboss.dna.common.i18n.I18n;
+
+/**
+ * The <code>RestClientI18n</code> class provides localized messages.
+ */
+public final class RestClientI18n {
+
+ public static I18n basePublishingActionPublishingWizardErrorMsg;
+ public static I18n basePublishingActionUnpublishingWizardErrorMsg;
+
+ public static I18n collapseActionToolTip;
+
+ public static I18n deleteServerActionText;
+ public static I18n deleteServerActionToolTip;
+
+ public static I18n deleteServerDialogErrorsOccurredMsg;
+ public static I18n deleteServerDialogMultipleServersMsg;
+ public static I18n deleteServerDialogOneServerMsg;
+ public static I18n deleteServerDialogTitle;
+
+ public static I18n dnaConsoleName;
+ public static I18n dnaConsoleProblemCreatingHyperlinkMsg;
+ public static I18n dnaConsoleFilePathNotFoundMsg;
+
+ public static I18n dnaPreferencePageDescription;
+ public static I18n dnaPreferencePageFilteredFileExtensionsLabel;
+ public static I18n dnaPreferencePageFilteredFolderNamesLabel;
+ public static I18n dnaPreferencePageMessage;
+ public static I18n dnaPreferencePageTitle;
+
+ public static I18n editServerActionText;
+ public static I18n editServerActionToolTip;
+
+ public static I18n errorDialogTitle;
+
+ public static I18n missingImage;
+
+ public static I18n newFilteredFileExtensionDialogLabel;
+ public static I18n newFilteredFileExtensionDialogTitle;
+
+ public static I18n newFilteredFolderNameDialogLabel;
+ public static I18n newFilteredFolderNameDialogTitle;
+
+ public static I18n newServerActionText;
+ public static I18n newServerActionToolTip;
+
+ public static I18n prefUtilsPropertyFileNotFound;
+ public static I18n prefUtilsPropertyNotFound;
+
+ public static I18n publishedLocationsDialogCopyUrlButton;
+ public static I18n publishedLocationsDialogCopyUrlButtonToolTip;
+ public static I18n publishedLocationsDialogErrorObtainingUrlMsg;
+ public static I18n publishedLocationsDialogFileUrlColumnHeader;
+ public static I18n publishedLocationsDialogMsg;
+ public static I18n publishedLocationsDialogRepositoryColumnHeader;
+ public static I18n publishedLocationsDialogServerUrlColumnHeader;
+ public static I18n publishedLocationsDialogTitle;
+ public static I18n publishedLocationsDialogUserColumnHeader;
+ public static I18n publishedLocationsDialogWorkspaceColumnHeader;
+
+ public static I18n publishedResourcePropertyErrorMsg;
+
+ public static I18n publishJobCanceled;
+ public static I18n publishJobDurationMsg;
+ public static I18n publishJobDurationNoHoursMsg;
+ public static I18n publishJobDurationNoHoursNoMinutesMsg;
+ public static I18n publishJobDurationShortMsg;
+ public static I18n publishJobPublish;
+ public static I18n publishJobPublishCanceledMsg;
+ public static I18n publishJobPublishFile;
+ public static I18n publishJobPublishFileFailed;
+ public static I18n publishJobPublishFileInfo;
+ public static I18n publishJobPublishFileWarning;
+ public static I18n publishJobPublishFinishedMsg;
+ public static I18n publishJobPublishName;
+ public static I18n publishJobPublishTaskName;
+ public static I18n publishJobUnexpectedErrorMsg;
+ public static I18n publishJobUnpublish;
+ public static I18n publishJobUnpublishCanceledMsg;
+ public static I18n publishJobUnpublishFile;
+ public static I18n publishJobUnpublishFileFailed;
+ public static I18n publishJobUnpublishFileInfo;
+ public static I18n publishJobUnpublishFileWarning;
+ public static I18n publishJobUnpublishFinishedMsg;
+ public static I18n publishJobUnpublishName;
+ public static I18n publishJobUnpublishTaskName;
+
+ public static I18n publishPagePublishTitle;
+ public static I18n publishPageLocationGroupTitle;
+ public static I18n publishPageMissingRepositoryStatusMsg;
+ public static I18n publishPageMissingServerStatusMsg;
+ public static I18n publishPageMissingWorkspaceStatusMsg;
+ public static I18n publishPageNewServerButton;
+ public static I18n publishPageNoAvailableRepositoriesStatusMsg;
+ public static I18n publishPageNoAvailableServersStatusMsg;
+ public static I18n publishPageNoAvailableWorkspacesStatusMsg;
+ public static I18n publishPageNoResourcesToPublishStatusMsg;
+ public static I18n publishPageNoResourcesToUnpublishStatusMsg;
+ public static I18n publishPagePublishOkStatusMsg;
+ public static I18n publishPagePublishResourcesLabel;
+ public static I18n publishPageRecurseCheckBox;
+ public static I18n publishPageRecurseCheckBoxToolTip;
+ public static I18n publishPageRecurseProcessingErrorMsg;
+ public static I18n publishPageRepositoryLabel;
+ public static I18n publishPageRepositoryToolTip;
+ public static I18n publishPageServerLabel;
+ public static I18n publishPageServerToolTip;
+ public static I18n publishPageUnpublishOkStatusMsg;
+ public static I18n publishPageUnpublishResourcesLabel;
+ public static I18n publishPageUnpublishTitle;
+ public static I18n publishPageWorkspaceLabel;
+ public static I18n publishPageWorkspacePublishToolTip;
+ public static I18n publishPageWorkspaceUnpublishToolTip;
+
+ public static I18n publishWizardPublishErrorMsg;
+ public static I18n publishWizardPublishTitle;
+ public static I18n publishWizardUnpublishTitle;
+ public static I18n publishWizardUnpublishErrorMsg;
+
+ public static I18n reconnectJobTaskName;
+
+ public static I18n serverManagerGetRepositoriesExceptionMsg;
+ public static I18n serverManagerGetWorkspacesExceptionMsg;
+
+ public static I18n serverPageAuthenticationGroupTitle;
+ public static I18n serverPageInvalidServerProperties;
+ public static I18n serverPageOkStatusMsg;
+ public static I18n serverPagePasswordLabel;
+ public static I18n serverPagePasswordToolTip;
+ public static I18n serverPageSavePasswordButton;
+ public static I18n serverPageSavePasswordLabel;
+ public static I18n serverPageSavePasswordToolTip;
+ public static I18n serverPageTestConnectionLabel;
+ public static I18n serverPageTestConnectionButton;
+ public static I18n serverPageTestConnectionButtonToolTip;
+ public static I18n serverPageTestConnectionDialogFailureMsg;
+ public static I18n serverPageTestConnectionDialogTitle;
+ public static I18n serverPageTestConnectionDialogSuccessMsg;
+ public static I18n serverPageTitle;
+ public static I18n serverPageUrlLabel;
+ public static I18n serverPageUrlToolTip;
+ public static I18n serverPageUserLabel;
+ public static I18n serverPageUserToolTip;
+
+ public static I18n serverReconnectActionText;
+ public static I18n serverReconnectActionToolTip;
+
+ public static I18n serverViewToolTip;
+
+ public static I18n serverWizardEditServerErrorMsg;
+ public static I18n serverWizardEditServerTitle;
+ public static I18n serverWizardNewServerErrorMsg;
+ public static I18n serverWizardNewServerTitle;
+
+ public static I18n showPublishedLocationsErrorMsg;
+
+ public static I18n testServerActionText;
+ public static I18n testServerActionToolTip;
+
+ static {
+ try {
+ I18n.initialize(RestClientI18n.class);
+ } catch (Exception e) {
+ System.err.println(e);
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.properties 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,174 @@
+#
+# JBoss DNA (http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of
+# individual contributors.
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+basePublishingActionPublishingWizardErrorMsg = Unexpected error running the publishing wizard. See log for more details.
+basePublishingActionUnpublishingWizardErrorMsg = Unexpected error running the unpublishing wizard. See log for more details.
+
+collapseActionToolTip = Collapse All
+
+deleteServerActionText = Discard
+deleteServerActionToolTip = Delete server from the server registry
+
+deleteServerDialogErrorsOccurredMsg = There were errors deleting servers from the server registry. See log for more details.
+deleteServerDialogMultipleServersMsg = Are you sure you want to delete these {0} servers?
+deleteServerDialogOneServerMsg = Are you sure you want to delete the server with URL of "{0}" and user "{1}?"
+deleteServerDialogTitle = Confirm Delete Server
+
+editServerActionText = Server Properties
+editServerActionToolTip = Edit server properties
+
+dnaConsoleName = DNA
+dnaConsoleProblemCreatingHyperlinkMsg = Unexpected problem creating hyperlink in DNA Console view
+dnaConsoleFilePathNotFoundMsg = A hyperlink could not be created in the DNA Message Console because the file path of "{0}" could not be found.
+
+dnaPreferencePageDescription = Add or remove filtered file extensions and folder names. Files with a matching file extension or files that are contained in a folder with a matching name will NOT be published to or unpublished from DNA repositories.
+dnaPreferencePageFilteredFileExtensionsLabel = Filtered File Extensions:
+dnaPreferencePageFilteredFolderNamesLabel = Filtered Folder Names:
+dnaPreferencePageMessage = DNA
+dnaPreferencePageTitle = DNA Preferences
+
+errorDialogTitle = Error
+
+missingImage = The following image cannot be found "{0}"
+
+newFilteredFileExtensionDialogLabel = File extension:
+newFilteredFileExtensionDialogTitle = New Filtered File Extension
+
+newFilteredFolderNameDialogLabel = Folder name:
+newFilteredFolderNameDialogTitle = New Filtered Folder Name
+
+newServerActionText = New Server
+newServerActionToolTip = Create a new server
+
+prefUtilsPropertyFileNotFound = The "{0}" property preference file is missing or could not be loaded. All property default values will be used.
+prefUtilsPropertyNotFound = The "{0}" property is missing. Default value of "{1}" will be used.
+
+publishedLocationsDialogCopyUrlButton = Copy URL
+publishedLocationsDialogCopyUrlButtonToolTip = Copy to the clipboard the selected workspace URL where the file is published
+publishedLocationsDialogErrorObtainingUrlMsg = Error obtaining URL
+publishedLocationsDialogFileUrlColumnHeader = Published URL
+publishedLocationsDialogMsg = The file "{0}" has been published to the following DNA workspaces:
+publishedLocationsDialogRepositoryColumnHeader = Repository
+publishedLocationsDialogServerUrlColumnHeader = Server URL
+publishedLocationsDialogTitle = Published Locations
+publishedLocationsDialogUserColumnHeader = User
+publishedLocationsDialogWorkspaceColumnHeader = Workspace
+
+publishedResourcePropertyErrorMsg = Error obtaining the "published" property from the resource "{0}"
+
+publishJobCanceled = Job {0} was canceled. See log for details.
+publishJobDurationMsg = {0} hour(s), {1} minute(s), {2} second(s)
+publishJobDurationNoHoursMsg = {0} minute(s), {1} second(s)
+publishJobDurationNoHoursNoMinutesMsg = {0} second(s)
+publishJobDurationShortMsg = less than 1 second
+publishJobPublish = [{0}] Publishing {4} file(s) to server "{1}" (repository "{2}", workspace "{3}") ...
+publishJobPublishCanceledMsg = [{0}] Publishing was canceled after {1} file(s) out of {2} were processed. Elapsed time: {3}.\n
+publishJobPublishFile = [{0}] + Published file "{1}" to URL "<em>{2}</em>"
+publishJobPublishFileFailed = [{0}] -- ERROR -- Publishing file "{1}" generated an ERROR message. See log.
+publishJobPublishFileInfo = [{0}] -- INFO -- Publishing file "{1}" generated an INFO message. See log.
+publishJobPublishFileWarning = [{0}] -- WARNING -- Publishing file "{1}" generated a WARNING message. See log.
+publishJobPublishFinishedMsg = [{0}] Done publishing. Elapsed time: {1}.\n
+publishJobPublishName = DNA Publish [{0}]
+publishJobPublishTaskName = Publishing resources [{0}]
+publishJobUnexpectedErrorMsg = Unexpected error occurred. See log for more details.
+publishJobUnpublish = [{0}] Unpublishing {4} file(s) from server "{1}" (repository "{2}", workspace "{3}") ...
+publishJobUnpublishCanceledMsg = [{0}] Unublishing was canceled after {1} file(s) out of {2} were processed. Elapsed time: {3}.\n
+publishJobUnpublishFile = [{0}] - Unpublished file "{1}"
+publishJobUnpublishFileFailed = [{0}] -- ERROR -- Unpublishing file "{0}" generated an ERROR message. See log.
+publishJobUnpublishFileInfo = [{0}] -- INFO -- Unpublishing file "{1}" generated an INFO message. See log.
+publishJobUnpublishFileWarning = [{0}] -- WARN -- Unpublishing file "{1}" generated a WARNING message. See log.
+publishJobUnpublishFinishedMsg = [{0}] Done unpublishing. Elapsed time: {1}. \n
+publishJobUnpublishName = DNA Unpublish [{0}]
+publishJobUnpublishTaskName = Unpublishing resources [{0}]
+
+publishPagePublishTitle = Publish the selected resources
+publishPageLocationGroupTitle = Location
+publishPageMissingRepositoryStatusMsg = A repository must be selected
+publishPageMissingServerStatusMsg = A server must be selected
+publishPageMissingWorkspaceStatusMsg = A workspace must be selected
+publishPageNewServerButton = New...
+publishPageNoAvailableRepositoriesStatusMsg = There are no repositories available on that server
+publishPageNoAvailableServersStatusMsg = A server must be created first
+publishPageNoAvailableWorkspacesStatusMsg = There are no workspaces available on that server and repository
+publishPageNoResourcesToPublishStatusMsg = There are no files that can be published
+publishPageNoResourcesToUnpublishStatusMsg = There are no files that can be unpublished
+publishPagePublishOkStatusMsg = Choose the server, repository, and workspace where the resources will be published. Click "Finish" to execute the publish operation.
+publishPagePublishResourcesLabel = These resources will be uploaded to the specified DNA workspace:
+publishPageRecurseCheckBox = Recurse folders and projects
+publishPageRecurseCheckBoxToolTip = Add all files under folders recursively under selected projects and folders
+publishPageRecurseProcessingErrorMsg = Unexpected error processing resources. See log for more details.
+publishPageRepositoryLabel = Repository:
+publishPageRepositoryToolTip = The repository where the workspace is located
+publishPageServerLabel = Server:
+publishPageServerToolTip = The server where the repository is located
+publishPageUnpublishOkStatusMsg = Choose the server, repository, and workspace where the resources will be unpublished. Click "Finish" to execute the unpublish operation.
+publishPageUnpublishResourcesLabel = These resources will be removed from the specified DNA workspace:
+publishPageUnpublishTitle = Unpublish the selected resources
+publishPageWorkspaceLabel = Workspace:
+publishPageWorkspacePublishToolTip = The workspace where the resources are being published
+publishPageWorkspaceUnpublishToolTip = The workspace where the resources are being unpublished
+
+publishWizardPublishErrorMsg = Error Publishing
+publishWizardPublishTitle = Publish
+publishWizardUnpublishErrorMsg = Error Unpublishing
+publishWizardUnpublishTitle = Unpublish
+
+reconnectJobTaskName = Connecting to server "{0}"
+
+serverReconnectActionText = Reconnect
+serverReconnectActionToolTip = Reconnect to the selected server
+
+serverManagerGetRepositoriesExceptionMsg = There was a problem obtaining repositories for the server "{0}."
+serverManagerGetWorkspacesExceptionMsg = There was a problem obtaining workspaces for repository "{0}."
+
+serverPageAuthenticationGroupTitle = Authentication
+serverPageInvalidServerProperties = Cannot construct a server because all server properties are not valid
+serverPageOkStatusMsg = Define the server information where the DNA repositories are located.
+serverPagePasswordLabel = Password:
+serverPagePasswordToolTip = The password used to authenticate the user when connecting to the server
+serverPageSavePasswordButton = Save password
+serverPageSavePasswordLabel = Saved secret data is stored on your computer in a file that's difficult, but not impossible, for an intruder to read.
+serverPageSavePasswordToolTip = Indicates if the clear text password should be stored on the local file system
+serverPageTestConnectionLabel = Validate server connection:
+serverPageTestConnectionButton = Test
+serverPageTestConnectionButtonToolTip = Try to establish a connection to the server
+serverPageTestConnectionDialogFailureMsg = Unable to connect using the specified server properties. The server properties could be invalid or the server may be offline.
+serverPageTestConnectionDialogTitle = Test Server Connection
+serverPageTestConnectionDialogSuccessMsg = Successfully connected using the specified server properties.
+serverPageTitle = Enter Server Information
+serverPageUrlLabel = URL:
+serverPageUrlToolTip = The URL used to connect to the server
+serverPageUserLabel = User:
+serverPageUserToolTip = The user login used when connecting to the server
+
+serverViewToolTip = Manages the DNA server registry
+
+serverWizardEditServerErrorMsg = There were errors editing a server. See log for more details.
+serverWizardEditServerTitle = Edit Server
+serverWizardNewServerErrorMsg = There were errors creating a new server. See log for more details.
+serverWizardNewServerTitle = New Server
+
+showPublishedLocationsErrorMsg = Unexpected problem showing published on locations. See log for more details.
+
+testServerActionText = Connect
+testServerActionToolTip = Connect to the server identified by the abover URL, user, and password
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/RestClientI18n.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Utils.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Utils.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Utils.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,223 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.PLUGIN_ID;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+
+public final class Utils {
+
+ // ===========================================================================================================================
+ // Class Methods
+ // ===========================================================================================================================
+
+ /**
+ * @param tokens the tokens being combined into one value
+ * @param delimiter the character inserted to separate each token
+ * @return the tokens separated by the delimiter
+ */
+ public static String combineTokens( String[] tokens,
+ char delimiter ) {
+ CheckArg.isNotNull(tokens, "tokens"); //$NON-NLS-1$
+ StringBuilder value = new StringBuilder();
+
+ for (String token : tokens) {
+ value.append(token).append(delimiter);
+ }
+
+ return value.toString();
+ }
+
+ /**
+ * Sizes the shell to the minimum of it's current size or the width and height display percentages.
+ *
+ * @param shell the shell being resized (if necessary) and located
+ * @param widthPercentage a number between 1 and 100 indicating a percentage of the screen size (defaults to 50 if bad value)
+ * @param heightPercentage a number between 1 and 100 indicating a percentage of the screen size (defaults to 50 if bad value)
+ */
+ public static void centerAndSizeShellRelativeToDisplay( Shell shell,
+ int widthPercentage,
+ int heightPercentage ) {
+ if ((widthPercentage < 1) || (widthPercentage > 100)) {
+ widthPercentage = 50;
+ }
+
+ if ((heightPercentage < 1) || (heightPercentage > 100)) {
+ heightPercentage = 50;
+ }
+
+ // size
+ Rectangle shellBounds = shell.getBounds();
+ Rectangle displayBounds = shell.getDisplay().getClientArea();
+ int scaledWidth = displayBounds.width * widthPercentage / 100;
+ int scaledHeight = displayBounds.height * heightPercentage / 100;
+ shell.setSize(Math.min(scaledWidth, shellBounds.width), Math.min(scaledHeight, shellBounds.height));
+ Point size = shell.getSize();
+
+ // center
+ int excessX = displayBounds.width - size.x;
+ int excessY = displayBounds.height - size.y;
+ int x = displayBounds.x + (excessX / 2);
+ int y = displayBounds.y + (excessY / 2);
+
+ shell.setLocation(x, y);
+ }
+
+ /**
+ * Converts the non-Eclipse status severity to an Eclipse severity level. An {@link Status.Severity#UNKNOWN unknown status} is
+ * converted to {@link IStatus#CANCEL cancel}.
+ *
+ * @param severity the eclipse status severity level
+ * @return the converted severity level (never <code>null</code>)
+ * @see IStatus
+ */
+ public static int convertSeverity( Severity severity ) {
+ if (severity == Severity.OK) return IStatus.OK;
+ if (severity == Severity.ERROR) return IStatus.ERROR;
+ if (severity == Severity.WARNING) return IStatus.WARNING;
+ if (severity == Severity.INFO) return IStatus.INFO;
+ return IStatus.CANCEL;
+ }
+
+ /**
+ * Converts the Eclipse status severity level to a non-Eclipse severity.
+ *
+ * @param severity the eclipse status severity level
+ * @return the converted severity level (never <code>null</code>)
+ * @see IStatus
+ */
+ public static Severity convertSeverity( int severity ) {
+ if (severity == IStatus.OK) return Severity.OK;
+ if (severity == IStatus.ERROR) return Severity.ERROR;
+ if (severity == IStatus.WARNING) return Severity.WARNING;
+ if (severity == IStatus.INFO) return Severity.INFO;
+ return Severity.UNKNOWN;
+ }
+
+ /**
+ * @param status the status being converted (never <code>null</code>)
+ * @return the Eclipse status object (never <code>null</code>)
+ */
+ public static IStatus convert( Status status ) {
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
+ return new org.eclipse.core.runtime.Status(convertSeverity(status.getSeverity()), PLUGIN_ID, status.getMessage(),
+ status.getException());
+ }
+
+ /**
+ * The OK status does not have an image.
+ *
+ * @param status the status whose image is being requested (never <code>null</code>)
+ * @return the image or <code>null</code> if no associated image for the status severity
+ */
+ public static Image getImage( Status status ) {
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
+ String imageId = null;
+
+ if (status.isError()) {
+ imageId = ISharedImages.IMG_OBJS_ERROR_TSK;
+ } else if (status.isInfo()) {
+ imageId = ISharedImages.IMG_OBJS_INFO_TSK;
+ } else if (status.isWarning()) {
+ imageId = ISharedImages.IMG_OBJS_WARN_TSK;
+ }
+
+ if (imageId != null) {
+ return Activator.getDefault().getSharedImage(imageId);
+ }
+
+ return null;
+ }
+
+ /**
+ * @param string the string whose tokens are being requested (may be <code>null</code>)
+ * @param delimiters the delimiters that separate the tokens (never <code>null</code>)
+ * @param removeDuplicates a flag indicating if duplicate tokens should be removed
+ * @return the tokens (never <code>null</code>)
+ */
+ public static String[] getTokens( String string,
+ String delimiters,
+ boolean removeDuplicates ) {
+ CheckArg.isNotNull(delimiters, "delimiters"); //$NON-NLS-1$
+
+ if (string == null) {
+ return new String[0];
+ }
+
+ Collection<String> tokens = removeDuplicates ? new TreeSet<String>() : new ArrayList<String>();
+ StringTokenizer st = new StringTokenizer(string, delimiters);
+
+ while (st.hasMoreTokens()) {
+ tokens.add(st.nextToken());
+ }
+
+ return tokens.toArray(new String[tokens.size()]);
+ }
+
+ /**
+ * The image can be used to decorate an existing image.
+ *
+ * @param status the status whose image overlay is being requested (never <code>null</code>)
+ * @return the image descriptor or <code>null</code> if none found for the status severity
+ */
+ public static ImageDescriptor getOverlayImage( Status status ) {
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
+ String imageId = null;
+
+ if (status.isError()) {
+ imageId = IUiConstants.ERROR_OVERLAY_IMAGE;
+ }
+
+ if (imageId != null) {
+ return Activator.getDefault().getImageDescriptor(imageId);
+ }
+
+ return null;
+ }
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * Don't allow construction.
+ */
+ public Utils() {
+ // nothing to do
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/Utils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/BasePublishingAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/BasePublishingAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/BasePublishingAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,164 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.PublishJob.Type;
+import org.jboss.dna.eclipse.jcr.rest.client.wizards.PublishWizard;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+
+/**
+ * The <code>BasePublishingAction</code> is a base class for all publishing actions.
+ */
+public abstract class BasePublishingAction implements IObjectActionDelegate {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The current workspace selection.
+ */
+ private IStructuredSelection selection;
+
+ /**
+ * The active part's Shell.
+ */
+ private Shell shell;
+
+ /**
+ * Indicates if this is a publishing or unpublishing action.
+ */
+ private final Type type;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param type indicates the type of action
+ */
+ public BasePublishingAction( Type type ) {
+ this.type = type;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ @Override
+ @SuppressWarnings( "unchecked" )
+ public void run( IAction action ) {
+ assert (this.selection != null);
+ assert (!this.selection.isEmpty());
+
+ List<IResource> resources;
+
+ if (this.selection.size() == 1) {
+ resources = Collections.singletonList((IResource)this.selection.getFirstElement());
+ } else {
+ resources = this.selection.toList();
+ }
+
+ // run wizard
+ try {
+ WizardDialog dialog = new WizardDialog(shell, new PublishWizard(this.type, resources,
+ Activator.getDefault().getServerManager())) {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
+ */
+ @Override
+ protected void initializeBounds() {
+ super.initializeBounds();
+ getShell().setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
+ Utils.centerAndSizeShellRelativeToDisplay(getShell(), 75, 75);
+ }
+ };
+
+ dialog.open();
+ } catch (CoreException e) {
+ String msg = null;
+
+ if (this.type == Type.PUBLISH) {
+ msg = RestClientI18n.basePublishingActionPublishingWizardErrorMsg.text();
+ } else {
+ msg = RestClientI18n.basePublishingActionUnpublishingWizardErrorMsg.text();
+ }
+
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ MessageDialog.openError(this.shell, RestClientI18n.errorDialogTitle.text(), msg);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void selectionChanged( IAction action,
+ ISelection selection ) {
+ if (selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection)selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
+ */
+ @Override
+ public void setActivePart( IAction action,
+ IWorkbenchPart targetPart ) {
+ this.shell = targetPart.getSite().getShell();
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/BasePublishingAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/DeleteServerAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/DeleteServerAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/DeleteServerAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,151 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DELETE_SERVER_IMAGE;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.dialogs.DeleteServerDialog;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>DeleteServerAction</code> deletes one or more servers from the server registry.
+ */
+public final class DeleteServerAction extends BaseSelectionListenerAction {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The server manager used to delete servers.
+ */
+ private final ServerManager serverManager;
+
+ /**
+ * The servers being deleted (never <code>null</code>).
+ */
+ private final List<Server> serversToDelete;
+
+ /**
+ * The shell used to display the delete confirmation dialog.
+ */
+ private final Shell shell;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param shell the parent shell used to display the confirmation dialog
+ * @param serverManager the server manager to use when deleting servers
+ */
+ public DeleteServerAction( Shell shell,
+ ServerManager serverManager ) {
+ super(RestClientI18n.deleteServerActionText.text());
+ setToolTipText(RestClientI18n.deleteServerActionToolTip.text());
+ setImageDescriptor(Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE));
+ setEnabled(false);
+
+ this.serversToDelete = new ArrayList<Server>(5);
+ this.shell = shell;
+ this.serverManager = serverManager;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ Dialog dialog = new DeleteServerDialog(this.shell, this.serversToDelete);
+
+ if (dialog.open() == Window.OK) {
+ boolean errorsOccurred = false;
+
+ for (Server server : this.serversToDelete) {
+ Status status = this.serverManager.removeServer(server);
+
+ if (!status.isOk()) {
+ Activator.getDefault().log(status);
+
+ if (status.isError()) {
+ errorsOccurred = true;
+ }
+ }
+ }
+
+ if (errorsOccurred) {
+ MessageDialog.openError(this.shell,
+ RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.deleteServerDialogErrorsOccurredMsg.text());
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ @Override
+ protected boolean updateSelection( IStructuredSelection selection ) {
+ // reset selected server collection
+ this.serversToDelete.clear();
+
+ // disable if empty selection
+ if (selection.isEmpty()) {
+ return false;
+ }
+
+ // disable if one non-server is found
+ for (Object obj : selection.toArray()) {
+ if (obj instanceof Server) {
+ this.serversToDelete.add((Server)obj);
+ } else {
+ this.serversToDelete.clear();
+ return false;
+ }
+ }
+
+ // enable since all objects are servers
+ return true;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/DeleteServerAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/EditServerAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/EditServerAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/EditServerAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,135 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.EDIT_SERVER_IMAGE;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.wizards.ServerWizard;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>EditServerAction</code> runs a UI that allows {@link Server server} properties to be changed.
+ */
+public final class EditServerAction extends BaseSelectionListenerAction {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The selected server being edited.
+ */
+ private Server serverBeingEdited;
+
+ /**
+ * The server manager used to create and edit servers.
+ */
+ private final ServerManager serverManager;
+
+ /**
+ * The shell used to display the dialog that edits and creates servers.
+ */
+ private final Shell shell;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param shell the parent shell used to display the dialog
+ * @param serverManager the server manager to use when creating and editing servers
+ */
+ public EditServerAction( Shell shell,
+ ServerManager serverManager ) {
+ super(RestClientI18n.editServerActionText.text());
+ setToolTipText(RestClientI18n.editServerActionToolTip.text());
+ setImageDescriptor(Activator.getDefault().getImageDescriptor(EDIT_SERVER_IMAGE));
+ setEnabled(false);
+
+ this.shell = shell;
+ this.serverManager = serverManager;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ ServerWizard wizard = new ServerWizard(this.serverManager, this.serverBeingEdited);
+ WizardDialog dialog = new WizardDialog(this.shell, wizard) {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.WizardDialog#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell( Shell newShell ) {
+ super.configureShell(newShell);
+ newShell.setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
+ }
+ };
+
+ dialog.open();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ @Override
+ protected boolean updateSelection( IStructuredSelection selection ) {
+ // disable if empty selection or multiple objects selected
+ if (selection.isEmpty() || (selection.size() > 1)) {
+ this.serverBeingEdited = null;
+ return false;
+ }
+
+ Object obj = selection.getFirstElement();
+
+ // enable if server is selected
+ if (obj instanceof Server) {
+ this.serverBeingEdited = (Server)obj;
+ return true;
+ }
+
+ // disable if non-server is selected
+ this.serverBeingEdited = null;
+ return false;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/EditServerAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/NewServerAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/NewServerAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/NewServerAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,102 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.NEW_SERVER_IMAGE;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.wizards.ServerWizard;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>NewServerAction</code> runs a UI that allows the user to create a new {@link Server server}.
+ */
+public final class NewServerAction extends Action {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The server manager used to create and edit servers.
+ */
+ private final ServerManager serverManager;
+
+ /**
+ * The shell used to display the dialog that edits and creates servers.
+ */
+ private final Shell shell;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param shell the parent shell used to display the dialog
+ * @param serverManager the server manager to use when creating and editing servers
+ */
+ public NewServerAction( Shell shell,
+ ServerManager serverManager ) {
+ super(RestClientI18n.newServerActionText.text());
+ setToolTipText(RestClientI18n.newServerActionToolTip.text());
+ setImageDescriptor(Activator.getDefault().getImageDescriptor(NEW_SERVER_IMAGE));
+
+ this.shell = shell;
+ this.serverManager = serverManager;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ ServerWizard wizard = new ServerWizard(this.serverManager);
+ WizardDialog dialog = new WizardDialog(this.shell, wizard) {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.WizardDialog#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell( Shell newShell ) {
+ super.configureShell(newShell);
+ newShell.setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
+ }
+ };
+
+ dialog.open();
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/NewServerAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/PublishAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/PublishAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/PublishAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,42 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.PublishJob.Type;
+
+/**
+ * The <code>PublishAction</code> controls the publishing of one or more {@link org.eclipse.core.resources.IResource}s to a DNA
+ * repository.
+ */
+public final class PublishAction extends BasePublishingAction {
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ public PublishAction() {
+ super(Type.PUBLISH);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/PublishAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ReconnectToServerAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ReconnectToServerAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ReconnectToServerAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,143 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.REFRESH_IMAGE;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.ReconnectJob;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>ReconnectToServerAction</code> tries to reconnect to a selected server.
+ */
+public final class ReconnectToServerAction extends BaseSelectionListenerAction {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The server view tree viewer.
+ */
+ private final TreeViewer viewer;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param viewer the server view tree viewer
+ */
+ public ReconnectToServerAction( TreeViewer viewer ) {
+ super(RestClientI18n.serverReconnectActionText.text());
+ setToolTipText(RestClientI18n.serverReconnectActionToolTip.text());
+ setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE));
+ setEnabled(false);
+
+ this.viewer = viewer;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * @return the view's tree viewer
+ */
+ StructuredViewer getViewer() {
+ return this.viewer;
+ }
+
+ /**
+ * @param server the server being connected to
+ */
+ void refresh( final Server server ) {
+ final Display display = this.viewer.getControl().getDisplay();
+
+ if (!display.isDisposed()) {
+ // make sure we are in the UI thread
+ display.asyncExec(new Runnable() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ getViewer().refresh(server);
+ }
+ });
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ final Server server = (Server)getStructuredSelection().getFirstElement();
+ final ReconnectJob job = new ReconnectJob(server);
+
+ // add listener so we can refresh tree
+ job.addJobChangeListener(new JobChangeAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.jobs.JobChangeAdapter#done(org.eclipse.core.runtime.jobs.IJobChangeEvent)
+ */
+ @Override
+ public void done( IJobChangeEvent event ) {
+ refresh(server);
+ job.removeJobChangeListener(this);
+ }
+ });
+
+ // run job in own thread not in the UI thread
+ Thread t = new Thread();
+ t.run();
+ job.setThread(t);
+ job.schedule();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ @Override
+ protected boolean updateSelection( IStructuredSelection selection ) {
+ return ((selection.size() == 1) && (selection.getFirstElement() instanceof Server));
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ReconnectToServerAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ShowPublishedLocationsAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ShowPublishedLocationsAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ShowPublishedLocationsAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,132 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DELETE_SERVER_IMAGE;
+import java.util.Set;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.DnaResourceHelper;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.dialogs.PublishedLocationsDialog;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>PublishAction</code> controls the publishing of one or more {@link org.eclipse.core.resources.IResource}s to a DNA
+ * repository.
+ */
+public final class ShowPublishedLocationsAction extends Action implements IObjectActionDelegate {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The current workspace selection.
+ */
+ private IStructuredSelection selection;
+
+ /**
+ * The active part's Shell.
+ */
+ private Shell shell;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ public ShowPublishedLocationsAction() {
+ super(RestClientI18n.deleteServerActionText.text(), Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE));
+ setToolTipText(RestClientI18n.deleteServerActionToolTip.text());
+ setEnabled(false);
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ @Override
+ public void run( IAction action ) {
+ assert ((this.selection != null) && (this.selection.size() == 1));
+ assert (this.selection.getFirstElement() instanceof IFile);
+
+ // open dialog
+ ServerManager serverManager = Activator.getDefault().getServerManager();
+ DnaResourceHelper resourceHelper = new DnaResourceHelper(serverManager);
+
+ try {
+ Set<Workspace> workspaces = resourceHelper.getPublishedOnWorkspaces((IFile)this.selection.getFirstElement());
+ new PublishedLocationsDialog(this.shell, serverManager, (IFile)this.selection.getFirstElement(), workspaces).open();
+ } catch (Exception e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.showPublishedLocationsErrorMsg.text(), e));
+ MessageDialog.openError(this.shell,
+ RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.showPublishedLocationsErrorMsg.text());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void selectionChanged( IAction action,
+ ISelection selection ) {
+ if (selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection)selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
+ */
+ @Override
+ public void setActivePart( IAction action,
+ IWorkbenchPart targetPart ) {
+ this.shell = targetPart.getSite().getShell();
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/ShowPublishedLocationsAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/UnpublishAction.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/UnpublishAction.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/UnpublishAction.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,42 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
+
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.PublishJob.Type;
+
+/**
+ * The <code>UnpublishAction</code> controls the unpublishing of one or more {@link org.eclipse.core.resources.IResource}s from a
+ * DNA repository.
+ */
+public final class UnpublishAction extends BasePublishingAction {
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ public UnpublishAction() {
+ super(Type.UNPUBLISH);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/UnpublishAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/package-info.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/package-info.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/package-info.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,27 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * The JBoss DNA REST Client Eclipse actions package defines the actions used to publish, unpublish, and manage the server registry.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.actions;
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/actions/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/DeleteServerDialog.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/DeleteServerDialog.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/DeleteServerDialog.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,137 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.dialogs;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import java.util.Collection;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+import org.jboss.dna.web.jcr.rest.client.domain.IDnaObject;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>DeleteServerDialog</code> class provides a UI for deleting a {@link Server server}.
+ */
+public final class DeleteServerDialog extends MessageDialog {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * Collection of servers which will be deleted.
+ */
+ private final Collection<Server> serversBeingDeleted;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param parentShell the dialog parent
+ * @param serversBeingDeleted the servers being deleted (may not be <code>null</code>)
+ */
+ public DeleteServerDialog( Shell parentShell,
+ Collection<Server> serversBeingDeleted ) {
+ super(parentShell, RestClientI18n.deleteServerDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x), null,
+ MessageDialog.QUESTION, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0);
+
+ CheckArg.isNotNull(serversBeingDeleted, "serversBeingDeleted"); //$NON-NLS-1$
+ this.serversBeingDeleted = serversBeingDeleted;
+
+ // make sure dialog is resizable
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.MessageDialog#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell( Shell shell ) {
+ super.configureShell(shell);
+
+ // now set message
+ String msg;
+
+ if (this.serversBeingDeleted.size() == 1) {
+ Server server = this.serversBeingDeleted.iterator().next();
+ msg = RestClientI18n.deleteServerDialogOneServerMsg.text(server.getName(), server.getUser());
+ } else {
+ msg = RestClientI18n.deleteServerDialogMultipleServersMsg.text(this.serversBeingDeleted.size());
+ }
+
+ this.message = msg;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createCustomArea( Composite parent ) {
+ if (this.serversBeingDeleted.size() != 1) {
+ List serverList = new List(parent, SWT.NONE);
+ serverList.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ GridData gd = new GridData(SWT.LEFT, SWT.CENTER, true, true);
+ gd.horizontalIndent = 40;
+ serverList.setLayoutData(gd);
+
+ for (IDnaObject server : this.serversBeingDeleted) {
+ serverList.add(server.getName());
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
+ */
+ @Override
+ protected void initializeBounds() {
+ super.initializeBounds();
+ Utils.centerAndSizeShellRelativeToDisplay(getShell(), 75, 75);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/DeleteServerDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/PublishedLocationsDialog.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/PublishedLocationsDialog.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/PublishedLocationsDialog.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,464 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.dialogs;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.BLANK_IMAGE;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.REPOSITORY_IMAGE;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.SERVER_IMAGE;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.WORKSPACE_IMAGE;
+import java.io.File;
+import java.util.Collection;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>PublishedLocationsDialog</code> class provides a UI for viewing a list of {@link Server servers} a selected file has
+ * been published to.
+ */
+public final class PublishedLocationsDialog extends MessageDialog {
+
+ // ===========================================================================================================================
+ // Constants
+ // ===========================================================================================================================
+
+ /**
+ * The column index of the server URL.
+ */
+ private static final int SERVER_URL_COL = 0;
+
+ /**
+ * The column index of the server user.
+ */
+ private static final int USER_COL = 1;
+
+ /**
+ * The column index of the repository name.
+ */
+ private static final int REPOSITORY_COL = 2;
+
+ /**
+ * The column index of the workspace name.
+ */
+ private static final int WORKSPACE_COL = 3;
+
+ /**
+ * The column index of the URL where the file was published.
+ */
+ private static final int FILE_URL_COL = 4;
+
+ /**
+ * The column indexes of all columns.
+ */
+ private static final int[] COLUMNS = {SERVER_URL_COL, USER_COL, REPOSITORY_COL, WORKSPACE_COL, FILE_URL_COL};
+
+ /**
+ * The column headers.
+ */
+ private static final String[] HEADERS = {RestClientI18n.publishedLocationsDialogServerUrlColumnHeader.text(),
+ RestClientI18n.publishedLocationsDialogUserColumnHeader.text(),
+ RestClientI18n.publishedLocationsDialogRepositoryColumnHeader.text(),
+ RestClientI18n.publishedLocationsDialogWorkspaceColumnHeader.text(),
+ RestClientI18n.publishedLocationsDialogFileUrlColumnHeader.text(),};
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The button that copies the file URL to the clipboard.
+ */
+ private Button btnCopy;
+
+ /**
+ * The file whose workspaces it was published to is being displayed by this dialog.
+ */
+ private final IFile file;
+
+ /**
+ * The server manager who can obtain the URL for the file at each of the workspaces.
+ */
+ private final ServerManager serverManager;
+
+ /**
+ * The viewer of the table holding the published locations.
+ */
+ private TableViewer viewer;
+
+ /**
+ * Collection of workspaces the selected file has been published to.
+ */
+ private final Collection<Workspace> workspaces;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param parentShell the dialog parent
+ * @param serverManager the server manager that this dialog will get URLs from (never <code>null</code>)
+ * @param file the file whose workspaces it has been published on is being requested (never <code>null</code>)
+ * @param workspaces the workspaces (never <code>null</code>)
+ */
+ public PublishedLocationsDialog( Shell parentShell,
+ ServerManager serverManager,
+ IFile file,
+ Collection<Workspace> workspaces ) {
+ super(parentShell, RestClientI18n.publishedLocationsDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x),
+ RestClientI18n.publishedLocationsDialogMsg.text(file.getFullPath()), MessageDialog.INFORMATION,
+ new String[] {IDialogConstants.OK_LABEL}, 0);
+
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ CheckArg.isNotNull(workspaces, "workspaces"); //$NON-NLS-1$
+
+ this.file = file;
+ this.serverManager = serverManager;
+ this.workspaces = workspaces;
+
+ // make sure dialog is resizable
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createCustomArea( Composite parent ) {
+ // layout consists of a panel that contains a table and a button
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout(2, false));
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ //
+ // construct table
+ //
+
+ this.viewer = new TableViewer(panel, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ LocationsTableProvider provider = new LocationsTableProvider();
+ this.viewer.setLabelProvider(provider);
+ this.viewer.setContentProvider(provider);
+ this.viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged( SelectionChangedEvent e ) {
+ handleTableSelection();
+ }
+ });
+
+ // configure table
+ Table table = this.viewer.getTable();
+ table.setLayout(new TableLayout());
+ table.setLayoutData(new GridData(GridData.FILL_BOTH));
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ // create columns
+ for (int numCols = COLUMNS.length, i = 0; i < numCols; ++i) {
+ TableColumn column = new TableColumn(table, SWT.LEFT);
+ column.setText(HEADERS[i]);
+
+ // set image
+ Image image = null;
+
+ if ((i == SERVER_URL_COL) || (i == USER_COL)) {
+ image = Activator.getDefault().getImage(SERVER_IMAGE);
+ } else if (i == REPOSITORY_COL) {
+ image = Activator.getDefault().getImage(REPOSITORY_IMAGE);
+ } else if (i == WORKSPACE_COL) {
+ image = Activator.getDefault().getImage(WORKSPACE_IMAGE);
+ } else {
+ image = Activator.getDefault().getImage(BLANK_IMAGE);
+ }
+
+ column.setImage(image);
+ }
+
+ // populate the table
+ this.viewer.setInput(this);
+
+ // size columns
+ for (TableColumn column : table.getColumns()) {
+ column.pack();
+ column.setWidth(column.getWidth() + 10);
+ }
+
+ //
+ // construct button
+ //
+
+ this.btnCopy = new Button(panel, SWT.PUSH);
+ this.btnCopy.setText(RestClientI18n.publishedLocationsDialogCopyUrlButton.text());
+ this.btnCopy.setToolTipText(RestClientI18n.publishedLocationsDialogCopyUrlButtonToolTip.text());
+ this.btnCopy.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleCopyUrl();
+ }
+ });
+
+ return panel;
+ }
+
+ /**
+ * @return the file system file this dialog is showing the published locations of (never <code>null</code>)
+ */
+ private File getFile() {
+ return this.file.getLocation().toFile();
+ }
+
+ /**
+ * This path does not include the name of the file.
+ *
+ * @return the path the file was published (never <code>null</code>)
+ */
+ private String getPath() {
+ return this.file.getParent().getFullPath().toString();
+ }
+
+ /**
+ * @param workspace the workspace where the file was published
+ * @return the URL where the file was published
+ */
+ String getPublishedAtUrl( Workspace workspace ) {
+ try {
+ return this.serverManager.getUrl(getFile(), getPath(), workspace).toString();
+ } catch (Exception e) {
+ String message = RestClientI18n.publishedLocationsDialogErrorObtainingUrlMsg.text();
+ Activator.getDefault().log(new Status(Severity.ERROR, message, e));
+ return message;
+ }
+
+ }
+
+ /**
+ * @return the workspaces the file has been published to (never <code>null</code>)
+ */
+ Object[] getWorkspaces() {
+ return this.workspaces.toArray();
+ }
+
+ /**
+ * Handler for when the copy URL button is clicked.
+ */
+ void handleCopyUrl() {
+ Workspace workspace = (Workspace)((IStructuredSelection)this.viewer.getSelection()).getFirstElement();
+ String url = getPublishedAtUrl(workspace);
+ Clipboard clipboard = new Clipboard(Display.getCurrent());
+ clipboard.setContents(new Object[] {url}, new Transfer[] {TextTransfer.getInstance()});
+ }
+
+ /**
+ * Handler for when a table row is selected.
+ */
+ void handleTableSelection() {
+ IStructuredSelection selection = (IStructuredSelection)this.viewer.getSelection();
+ boolean enable = (selection.size() == 1);
+
+ if (this.btnCopy.getEnabled() != enable) {
+ this.btnCopy.setEnabled(enable);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
+ */
+ @Override
+ protected void initializeBounds() {
+ super.initializeBounds();
+ Utils.centerAndSizeShellRelativeToDisplay(getShell(), 75, 75);
+ }
+
+ // ===========================================================================================================================
+ // Inner Class
+ // ===========================================================================================================================
+
+ /**
+ * The <code>LocationsTableProvider</code> provides content, labels, and images for the table.
+ */
+ class LocationsTableProvider implements IStructuredContentProvider, ITableLabelProvider {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void addListener( ILabelProviderListener listener ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ @Override
+ public Image getColumnImage( Object element,
+ int columnIndex ) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ @Override
+ public String getColumnText( Object element,
+ int columnIndex ) {
+ Workspace workspace = (Workspace)element;
+
+ if (columnIndex == SERVER_URL_COL) {
+ return workspace.getServer().getUrl();
+ }
+
+ if (columnIndex == USER_COL) {
+ return workspace.getServer().getUser();
+ }
+
+ if (columnIndex == REPOSITORY_COL) {
+ return workspace.getRepository().getName();
+ }
+
+ if (columnIndex == WORKSPACE_COL) {
+ return workspace.getName();
+ }
+
+ if (columnIndex == FILE_URL_COL) {
+ return getPublishedAtUrl(workspace);
+ }
+
+ // should never get here
+ assert false;
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements( Object inputElement ) {
+ return getWorkspaces();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object,
+ * java.lang.Object)
+ */
+ @Override
+ public void inputChanged( Viewer viewer,
+ Object oldInput,
+ Object newInput ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ */
+ @Override
+ public boolean isLabelProperty( Object element,
+ String property ) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void removeListener( ILabelProviderListener listener ) {
+ // nothing to do
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/PublishedLocationsDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/package-info.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/package-info.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/package-info.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,28 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * The JBoss DNA REST Client Eclipse dialogs package defines the Eclipse dialogs used to publish, unpublish, and manage the
+ * server registry.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.dialogs;
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/dialogs/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/PublishJob.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/PublishJob.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/PublishJob.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,365 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.jobs;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_PUBLISHING_JOB_FAMILY;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.PLUGIN_ID;
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.Job;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.DnaResourceHelper;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.views.DnaContentProvider;
+import org.jboss.dna.eclipse.jcr.rest.client.views.DnaMessageConsole;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>PublishJob</code> publishes or unpublishes one or more files using the {@link ServerManager}.
+ */
+public final class PublishJob extends Job {
+
+ // ===========================================================================================================================
+ // Constants
+ // ===========================================================================================================================
+
+ /**
+ * The job type.
+ */
+ public enum Type {
+ /**
+ * Indicates a publish job.
+ */
+ PUBLISH,
+
+ /**
+ * Indicates an unpublish job.
+ */
+ UNPUBLISH
+ }
+
+ /**
+ * A unique job identifier given to each publishing/unpublishing job.
+ */
+ private static final AtomicInteger JOB_ID = new AtomicInteger(1);
+
+ // ===========================================================================================================================
+ // Class Methods
+ // ===========================================================================================================================
+
+ /**
+ * @param type the job type (never <code>null</code>)
+ * @param jobId the job identifier
+ * @return the job name
+ */
+ private static String getJobName( Type type,
+ int jobId ) {
+ CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
+
+ if (Type.PUBLISH == type) {
+ return RestClientI18n.publishJobPublishName.text(jobId);
+ }
+
+ // unpublish
+ return RestClientI18n.publishJobUnpublishName.text(jobId);
+ }
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The files being published or unpublished.
+ */
+ private final List<IFile> files;
+
+ /**
+ * The unique job identifier.
+ */
+ private final int jobId;
+
+ /**
+ * The job type.
+ */
+ private final Type type;
+
+ /**
+ * The workspace to use when publishing or unpublishing.
+ */
+ private final Workspace workspace;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param type the job type (never <code>null</code>)
+ * @param files the files being published or unpublished (never <code>null</code>)
+ * @param workspace the workspace to use when publishing or unpublishing (never <code>null</code>)
+ */
+ public PublishJob( Type type,
+ List<IFile> files,
+ Workspace workspace ) {
+ super(getJobName(type, JOB_ID.incrementAndGet()));
+
+ CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
+
+ this.type = type;
+ this.files = files;
+ this.workspace = workspace;
+ this.jobId = JOB_ID.get();
+
+ setUser(true); // allow user to run in background
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
+ */
+ @Override
+ public boolean belongsTo( Object family ) {
+ return DNA_PUBLISHING_JOB_FAMILY.equals(family);
+ }
+
+ /**
+ * @return the server manager
+ */
+ private ServerManager getServerManager() {
+ return Activator.getDefault().getServerManager();
+ }
+
+ /**
+ * @return <code>true</code> if a publishing job
+ */
+ private boolean isPublishing() {
+ return (this.type == Type.PUBLISH);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run( IProgressMonitor monitor ) {
+ assert (this.workspace != null);
+ long startTime = System.currentTimeMillis();
+ boolean canceled = false;
+ int numProcessed = 0;
+
+ try {
+ int fileCount = this.files.size();
+ String name = (isPublishing() ? RestClientI18n.publishJobPublishTaskName.text(this.jobId)
+ : RestClientI18n.publishJobUnpublishTaskName.text(this.jobId));
+ monitor.beginTask(name, fileCount);
+ monitor.setTaskName(name);
+
+ String serverUrl = this.workspace.getServer().getUrl();
+ String repositoryName = this.workspace.getRepository().getName();
+ String workspaceName = this.workspace.getName();
+
+ // write initial message to console
+ if (isPublishing()) {
+ DnaMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
+ serverUrl,
+ repositoryName,
+ workspaceName,
+ fileCount));
+ } else {
+ DnaMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
+ serverUrl,
+ repositoryName,
+ workspaceName,
+ fileCount));
+ }
+
+ DnaResourceHelper resourceHelper = new DnaResourceHelper(getServerManager());
+
+ // process the files
+ for (IFile eclipseFile : this.files) {
+ if (monitor.isCanceled()) {
+ canceled = true;
+ throw new InterruptedException(RestClientI18n.publishJobCanceled.text(jobId));
+ }
+
+ File file = eclipseFile.getLocation().toFile();
+ String path = eclipseFile.getParent().getFullPath().toString();
+ Status status = null;
+
+ if (isPublishing()) {
+ status = getServerManager().publish(this.workspace, path, file);
+
+ // set persistent property on resource indicating it has been published
+ if (!status.isError()) {
+ resourceHelper.addPublishedProperty(eclipseFile, workspace);
+ DnaContentProvider decorator = DnaContentProvider.getDecorator();
+
+ if (decorator != null) {
+ // decorator.refresh(eclipseFile);
+ }
+ }
+ } else {
+ status = getServerManager().unpublish(this.workspace, path, file);
+
+ // clear persistent property on resource indicating it has been unpublished
+ if (!status.isError()) {
+ resourceHelper.removePublishedProperty(eclipseFile, workspace);
+ DnaContentProvider decorator = DnaContentProvider.getDecorator();
+
+ if (decorator != null) {
+ // decorator.refresh(eclipseFile);
+ }
+ }
+ }
+
+ ++numProcessed;
+ monitor.worked(1);
+
+ // write outcome message to console
+ if (isPublishing() && status.isOk()) {
+ URL url = getServerManager().getUrl(file, path, this.workspace);
+ writeToConsole(eclipseFile, url, status);
+ } else {
+ writeToConsole(eclipseFile, null, status);
+ }
+ }
+
+ return org.eclipse.core.runtime.Status.OK_STATUS;
+ } catch (Exception e) {
+ String msg = null;
+
+ if (e instanceof InterruptedException) {
+ msg = e.getLocalizedMessage();
+ } else {
+ msg = RestClientI18n.publishJobUnexpectedErrorMsg.text();
+ }
+
+ return new org.eclipse.core.runtime.Status(IStatus.INFO, PLUGIN_ID, msg, e);
+ } finally {
+ monitor.done();
+
+ // add operation completed message
+ String duration;
+ long milliseconds = (System.currentTimeMillis() - startTime);
+ long hours = milliseconds / (1000 * 60 * 60);
+ long minutes = (milliseconds % (1000 * 60 * 60)) / (1000 * 60);
+ long seconds = ((milliseconds % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
+
+ if (hours > 0) {
+ duration = RestClientI18n.publishJobDurationMsg.text(hours, minutes, seconds);
+ } else if (minutes > 0) {
+ duration = RestClientI18n.publishJobDurationNoHoursMsg.text(minutes, seconds);
+ } else if (seconds > 0) {
+ duration = RestClientI18n.publishJobDurationNoHoursNoMinutesMsg.text(seconds);
+ } else {
+ duration = RestClientI18n.publishJobDurationShortMsg.text();
+ }
+
+ if (canceled) {
+ if (isPublishing()) {
+ DnaMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
+ numProcessed,
+ this.files.size(),
+ duration));
+ } else {
+ DnaMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
+ numProcessed,
+ this.files.size(),
+ duration));
+ }
+ } else {
+ if (isPublishing()) {
+ DnaMessageConsole.writeln(RestClientI18n.publishJobPublishFinishedMsg.text(this.jobId, duration));
+ } else {
+ DnaMessageConsole.writeln(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.jobId, duration));
+ }
+ }
+ }
+ }
+
+ /**
+ * Create a hyperlink in console.
+ *
+ * @param file the file involved in the publishing operation
+ * @param url the destination file URL or <code>null</code>
+ * @param status the status of the publishing operation
+ */
+ private void writeToConsole( final IFile file,
+ URL url,
+ Status status ) {
+ String message = null;
+
+ if (status.isOk()) {
+ if (isPublishing()) {
+ message = RestClientI18n.publishJobPublishFile.text(this.jobId, file.getFullPath(), url.toString());
+ } else {
+ message = RestClientI18n.publishJobUnpublishFile.text(this.jobId, file.getFullPath());
+ }
+ } else if (status.isError()) {
+ if (isPublishing()) {
+ message = RestClientI18n.publishJobPublishFileFailed.text(this.jobId, file.getFullPath());
+ } else {
+ message = RestClientI18n.publishJobUnpublishFileFailed.text(this.jobId, file.getFullPath());
+ }
+
+ // log
+ Activator.getDefault().log(status);
+ } else if (status.isWarning()) {
+ if (isPublishing()) {
+ message = RestClientI18n.publishJobPublishFileWarning.text(this.jobId, file.getFullPath());
+ } else {
+ message = RestClientI18n.publishJobUnpublishFileWarning.text(this.jobId, file.getFullPath());
+ }
+
+ // log
+ Activator.getDefault().log(status);
+ } else {
+ if (isPublishing()) {
+ message = RestClientI18n.publishJobPublishFileInfo.text(this.jobId, file.getFullPath());
+ } else {
+ message = RestClientI18n.publishJobUnpublishFileInfo.text(this.jobId, file.getFullPath());
+ }
+
+ // log
+ Activator.getDefault().log(status);
+ }
+
+ // write to console creating a hyperlink
+ DnaMessageConsole.writeln(message, file);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/PublishJob.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/ReconnectJob.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/ReconnectJob.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/ReconnectJob.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,113 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.jobs;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_PUBLISHING_JOB_FAMILY;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.PLUGIN_ID;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.reconnectJobTaskName;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.Job;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>ReconnectJob</code> attempts to reconnect to the selected {@link Server server(s)}.
+ */
+public final class ReconnectJob extends Job {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The server being reconnected to.
+ */
+ private final Server server;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param server the server being connected to (never <code>null</code>)
+ */
+ public ReconnectJob( Server server ) {
+ super(reconnectJobTaskName.text(server.getShortDescription()));
+ this.server = server;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
+ */
+ @Override
+ public boolean belongsTo( Object family ) {
+ return DNA_PUBLISHING_JOB_FAMILY.equals(family);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run( IProgressMonitor monitor ) {
+ IStatus result = null;
+ ServerManager serverManager = Activator.getDefault().getServerManager();
+
+ try {
+ String taskName = reconnectJobTaskName.text(this.server.getShortDescription());
+ monitor.beginTask(taskName, 1);
+ monitor.setTaskName(taskName);
+ Status status = serverManager.ping(this.server);
+ result = Utils.convert(status);
+ } catch (Exception e) {
+ String msg = null;
+
+ if (e instanceof InterruptedException) {
+ msg = e.getLocalizedMessage();
+ } else {
+ msg = RestClientI18n.publishJobUnexpectedErrorMsg.text();
+ }
+
+ result = new org.eclipse.core.runtime.Status(IStatus.ERROR, PLUGIN_ID, msg, e);
+ } finally {
+ monitor.done();
+ done(result);
+ }
+
+ return result;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/jobs/ReconnectJob.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLogger.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLogger.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLogger.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,759 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.log;
+
+import java.text.MessageFormat;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.jboss.dna.eclipse.jcr.rest.client.IUiConstants;
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+
+/**
+ * The <code>EclipseLogger</code> class provides an <code>org.slf4j.Logger</code> implementation that uses the Eclipse logger.
+ */
+public final class EclipseLogger implements Logger {
+
+ // ===========================================================================================================================
+ // Class Fields
+ // ===========================================================================================================================
+
+ private static ILog LOGGER = Platform.getLog(Platform.getBundle(IUiConstants.PLUGIN_ID));
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ private String name;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ EclipseLogger( String name ) {
+ this.name = name;
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(java.lang.String)
+ */
+ @Override
+ public void debug( String message ) {
+ if (isDebugEnabled()) info(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void debug( String pattern,
+ Object arg ) {
+ if (isDebugEnabled()) info(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void debug( String pattern,
+ Object[] arguments ) {
+ if (isDebugEnabled()) info(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void debug( String message,
+ Throwable e ) {
+ if (isDebugEnabled()) info(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String)
+ */
+ @Override
+ public void debug( Marker marker,
+ String message ) {
+ debug(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void debug( String pattern,
+ Object arg1,
+ Object arg2 ) {
+ if (isDebugEnabled()) info(pattern, arg1, arg2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void debug( Marker marker,
+ String pattern,
+ Object arg ) {
+ debug(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void debug( Marker marker,
+ String pattern,
+ Object[] arguments ) {
+ debug(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void debug( Marker marker,
+ String message,
+ Throwable e ) {
+ debug(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void debug( Marker marker,
+ String pattern,
+ Object arg1,
+ Object arg2 ) {
+ debug(pattern, arg1, arg2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(java.lang.String)
+ */
+ @Override
+ public void error( String message ) {
+ if (isErrorEnabled()) LOGGER.log(new Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, message, null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void error( String pattern,
+ Object arg ) {
+ if (isErrorEnabled()) LOGGER.log(new Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern, arg),
+ null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void error( String pattern,
+ Object[] arguments ) {
+ if (isErrorEnabled()) LOGGER.log(new Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern,
+ arguments), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void error( String message,
+ Throwable e ) {
+ if (isErrorEnabled()) LOGGER.log(new Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, message, e));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String)
+ */
+ @Override
+ public void error( Marker marker,
+ String message ) {
+ error(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void error( String pattern,
+ Object arg1,
+ Object arg2 ) {
+ if (isErrorEnabled()) LOGGER.log(new Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern,
+ arg1,
+ arg2), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void error( Marker marker,
+ String pattern,
+ Object arg ) {
+ error(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void error( Marker marker,
+ String pattern,
+ Object[] arguments ) {
+ error(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void error( Marker marker,
+ String message,
+ Throwable e ) {
+ error(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void error( Marker marker,
+ String pattern,
+ Object arg1,
+ Object arg2 ) {
+ error(pattern, arg1, arg2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#getName()
+ */
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(java.lang.String)
+ */
+ @Override
+ public void info( String message ) {
+ if (isInfoEnabled()) LOGGER.log(new Status(IStatus.INFO, IUiConstants.PLUGIN_ID, message, null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void info( String pattern,
+ Object arg ) {
+ if (isInfoEnabled()) LOGGER.log(new Status(IStatus.INFO, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern, arg), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void info( String pattern,
+ Object[] arguments ) {
+ if (isInfoEnabled()) LOGGER.log(new Status(IStatus.INFO, IUiConstants.PLUGIN_ID,
+ MessageFormat.format(pattern, arguments), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void info( String message,
+ Throwable e ) {
+ if (isInfoEnabled()) LOGGER.log(new Status(IStatus.INFO, IUiConstants.PLUGIN_ID, message, e));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String)
+ */
+ @Override
+ public void info( Marker marker,
+ String message ) {
+ info(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void info( String pattern,
+ Object arg1,
+ Object arg2 ) {
+ if (isInfoEnabled()) LOGGER.log(new Status(IStatus.INFO, IUiConstants.PLUGIN_ID,
+ MessageFormat.format(pattern, arg1, arg2), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void info( Marker marker,
+ String pattern,
+ Object arg ) {
+ info(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void info( Marker marker,
+ String pattern,
+ Object[] arguments ) {
+ info(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void info( Marker marker,
+ String message,
+ Throwable e ) {
+ info(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void info( Marker marker,
+ String pattern,
+ Object arg1,
+ Object arg2 ) {
+ info(pattern, arg1, arg2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isDebugEnabled()
+ */
+ @Override
+ public boolean isDebugEnabled() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isDebugEnabled(org.slf4j.Marker)
+ */
+ @Override
+ public boolean isDebugEnabled( Marker marker ) {
+ return isDebugEnabled();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isErrorEnabled()
+ */
+ @Override
+ public boolean isErrorEnabled() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isErrorEnabled(org.slf4j.Marker)
+ */
+ @Override
+ public boolean isErrorEnabled( Marker marker ) {
+ return isErrorEnabled();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isInfoEnabled()
+ */
+ @Override
+ public boolean isInfoEnabled() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isInfoEnabled(org.slf4j.Marker)
+ */
+ @Override
+ public boolean isInfoEnabled( Marker marker ) {
+ return isInfoEnabled();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isTraceEnabled()
+ */
+ @Override
+ public boolean isTraceEnabled() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isTraceEnabled(org.slf4j.Marker)
+ */
+ @Override
+ public boolean isTraceEnabled( Marker marker ) {
+ return isTraceEnabled();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isWarnEnabled()
+ */
+ @Override
+ public boolean isWarnEnabled() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#isWarnEnabled(org.slf4j.Marker)
+ */
+ @Override
+ public boolean isWarnEnabled( Marker marker ) {
+ return isWarnEnabled();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(java.lang.String)
+ */
+ @Override
+ public void trace( String message ) {
+ if (isTraceEnabled()) info(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void trace( String pattern,
+ Object arg ) {
+ if (isTraceEnabled()) info(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void trace( String pattern,
+ Object[] arguments ) {
+ if (isTraceEnabled()) info(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void trace( String message,
+ Throwable e ) {
+ if (isTraceEnabled()) info(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String)
+ */
+ @Override
+ public void trace( Marker marker,
+ String message ) {
+ trace(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void trace( String pattern,
+ Object arg1,
+ Object arg2 ) {
+ if (isTraceEnabled()) info(pattern, arg1, arg2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void trace( Marker marker,
+ String pattern,
+ Object arg ) {
+ trace(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void trace( Marker marker,
+ String pattern,
+ Object[] arguments ) {
+ trace(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void trace( Marker marker,
+ String message,
+ Throwable e ) {
+ trace(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void trace( Marker marker,
+ String pattern,
+ Object arg1,
+ Object arg2 ) {
+ trace(pattern, arg1, arg2);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(java.lang.String)
+ */
+ @Override
+ public void warn( String message ) {
+ if (isWarnEnabled()) LOGGER.log(new Status(IStatus.WARNING, IUiConstants.PLUGIN_ID, message, null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void warn( String pattern,
+ Object arg ) {
+ if (isWarnEnabled()) LOGGER.log(new Status(IStatus.WARNING, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern, arg),
+ null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void warn( String pattern,
+ Object[] arguments ) {
+ if (isWarnEnabled()) LOGGER.log(new Status(IStatus.WARNING, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern,
+ arguments), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void warn( String message,
+ Throwable e ) {
+ if (isWarnEnabled()) LOGGER.log(new Status(IStatus.WARNING, IUiConstants.PLUGIN_ID, message, e));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String)
+ */
+ @Override
+ public void warn( Marker marker,
+ String message ) {
+ warn(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void warn( String pattern,
+ Object arg1,
+ Object arg2 ) {
+ if (isWarnEnabled()) LOGGER.log(new Status(IStatus.WARNING, IUiConstants.PLUGIN_ID, MessageFormat.format(pattern,
+ arg1,
+ arg2), null));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void warn( Marker marker,
+ String pattern,
+ Object arg ) {
+ warn(pattern, arg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object[])
+ */
+ @Override
+ public void warn( Marker marker,
+ String pattern,
+ Object[] arguments ) {
+ warn(pattern, arguments);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+ */
+ @Override
+ public void warn( Marker marker,
+ String message,
+ Throwable e ) {
+ warn(message, e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void warn( Marker marker,
+ String pattern,
+ Object arg1,
+ Object arg2 ) {
+ warn(pattern, arg1, arg2);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLoggerFactory.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLoggerFactory.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLoggerFactory.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,88 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.log;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.slf4j.ILoggerFactory;
+import org.slf4j.Logger;
+
+public final class EclipseLoggerFactory implements ILoggerFactory {
+
+ // ===========================================================================================================================
+ // Class Fields
+ // ===========================================================================================================================
+
+ /**
+ * The shared instance of the factory.
+ */
+ static final EclipseLoggerFactory INSTANCE = new EclipseLoggerFactory();
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * Map of loggers keyed by logger name.
+ */
+ private Map<String, Logger> loggerMap;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * Constructs the factory.
+ */
+ public EclipseLoggerFactory() {
+ this.loggerMap = new HashMap<String, Logger>();
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.ILoggerFactory#getLogger(java.lang.String)
+ */
+ @Override
+ public Logger getLogger( String name ) {
+ Logger logger = null;
+
+ // protect against concurrent access of the loggerMap
+ synchronized (this) {
+ logger = this.loggerMap.get(name);
+
+ if (logger == null) {
+ logger = new EclipseLogger(name);
+ this.loggerMap.put(name, logger);
+ }
+ }
+
+ return logger;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/EclipseLoggerFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/StaticLoggerBinder.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/StaticLoggerBinder.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/StaticLoggerBinder.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,89 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.log;
+
+import org.slf4j.ILoggerFactory;
+import org.slf4j.spi.LoggerFactoryBinder;
+
+public final class StaticLoggerBinder implements LoggerFactoryBinder {
+
+ // ===========================================================================================================================
+ // Class Fields
+ // ===========================================================================================================================
+
+ /**
+ * The class name of the logger factory.
+ */
+ private static final String LOGGER_FACTORY_CLASS_NAME = EclipseLoggerFactory.class.getName();
+
+ /**
+ * The unique instance of this class.
+ */
+ private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
+
+ // ===========================================================================================================================
+ // Class Methods
+ // ===========================================================================================================================
+
+ /**
+ * @return the static instance of the logger
+ */
+ public static final StaticLoggerBinder getSingleton() {
+ return SINGLETON;
+ }
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The logger factory used.
+ */
+ private final ILoggerFactory loggerFactory = new EclipseLoggerFactory();
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactory()
+ */
+ @Override
+ public ILoggerFactory getLoggerFactory() {
+ return this.loggerFactory;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactoryClassStr()
+ */
+ @Override
+ public String getLoggerFactoryClassStr() {
+ return LOGGER_FACTORY_CLASS_NAME;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/log/StaticLoggerBinder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/package-info.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/package-info.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/package-info.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,27 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * The JBoss DNA REST Client Eclipse plugin is a UI that interfaces with the non-UI DNA REST client Maven project.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client;
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/DnaPreferencePage.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/DnaPreferencePage.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/DnaPreferencePage.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,185 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.preferences;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.PREFERENCE_PAGE_HELP_CONTEXT;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.dnaPreferencePageDescription;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.dnaPreferencePageMessage;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.dnaPreferencePageTitle;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+
+/**
+ * The <code>DnaPreferencePage</code> is the UI for managing all DNA-related preferences.
+ */
+public final class DnaPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The editor used to manage the list of filtered file extensions.
+ */
+ private FilteredFileExtensionEditor extensionsEditor;
+
+ /**
+ * The editor used to manage the list of filtered folder names.
+ */
+ private FilteredFoldersEditor foldersEditor;
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents( Composite parent ) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout(2, false));
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // create the filtered extensions editor
+ this.extensionsEditor = new FilteredFileExtensionEditor(panel);
+ this.extensionsEditor.setPreferenceStore(getPreferenceStore());
+ this.extensionsEditor.getListControl(panel).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // populate the extensions editor
+ this.extensionsEditor.load();
+
+ // create the filtered folders editor
+ this.foldersEditor = new FilteredFoldersEditor(panel);
+ this.foldersEditor.setPreferenceStore(getPreferenceStore());
+ this.foldersEditor.getListControl(panel).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // populate the folders editor
+ this.foldersEditor.load();
+
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(panel, PREFERENCE_PAGE_HELP_CONTEXT);
+
+ return panel;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return dnaPreferencePageDescription.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getImage()
+ */
+ @Override
+ public Image getImage() {
+ return Activator.getDefault().getImage(DNA_IMAGE_16x);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getMessage()
+ */
+ @Override
+ public String getMessage() {
+ return dnaPreferencePageMessage.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore()
+ */
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ return PrefUtils.getPreferenceStore();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getTitle()
+ */
+ @Override
+ public String getTitle() {
+ return dnaPreferencePageTitle.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init( IWorkbench workbench ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ @Override
+ protected void performDefaults() {
+ this.extensionsEditor.loadDefault();
+ this.foldersEditor.loadDefault();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ this.extensionsEditor.store();
+ this.foldersEditor.store();
+ return super.performOk();
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/DnaPreferencePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFileExtensionEditor.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFileExtensionEditor.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFileExtensionEditor.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,113 @@
+package org.jboss.dna.eclipse.jcr.rest.client.preferences;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.FILTERED_FILE_EXTENSIONS_PREFERENCE;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.dnaPreferencePageFilteredFileExtensionsLabel;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.newFilteredFileExtensionDialogLabel;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.newFilteredFileExtensionDialogTitle;
+import static org.jboss.dna.eclipse.jcr.rest.client.preferences.PrefUtils.FILE_EXT_DELIMITER;
+import static org.jboss.dna.eclipse.jcr.rest.client.preferences.PrefUtils.FILE_EXT_INVALID_CHARS;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.TreeSet;
+import org.eclipse.jface.preference.ListEditor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+
+/**
+ * The <code>FilteredFileExtensionEditor</code> is an editor for managing a set of filtered file extensions.
+ */
+public final class FilteredFileExtensionEditor extends ListEditor implements VerifyListener {
+
+ // =======================================================================================================================
+ // Fields
+ // =======================================================================================================================
+
+ /**
+ * The current set of file extensions.
+ */
+ private final Set<String> extensions;
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * @param parent the parent control
+ */
+ public FilteredFileExtensionEditor( Composite parent ) {
+ super(FILTERED_FILE_EXTENSIONS_PREFERENCE, dnaPreferencePageFilteredFileExtensionsLabel.text(), parent);
+ this.extensions = new TreeSet<String>();
+ }
+
+ // =======================================================================================================================
+ // Methods
+ // =======================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.ListEditor#createList(java.lang.String[])
+ */
+ @Override
+ protected String createList( String[] items ) {
+ return Utils.combineTokens(items, FILE_EXT_DELIMITER);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.ListEditor#getNewInputObject()
+ */
+ @Override
+ protected String getNewInputObject() {
+ NewItemDialog dialog = new NewItemDialog(getShell(), newFilteredFileExtensionDialogTitle.text(),
+ newFilteredFileExtensionDialogLabel.text(), this);
+
+ if (dialog.open() == Window.OK) {
+ String extension = dialog.getNewItem();
+
+ // add new extension
+ if (extension != null) {
+ this.extensions.add(extension);
+ return extension;
+ }
+ }
+
+ // user canceled dialog
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String)
+ */
+ @Override
+ protected String[] parseString( String stringList ) {
+ String[] values = Utils.getTokens(stringList, Character.toString(FILE_EXT_DELIMITER), true);
+
+ this.extensions.clear();
+ this.extensions.addAll(Arrays.asList(values));
+
+ return values;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
+ public void verifyText( VerifyEvent event ) {
+ for (char c : FILE_EXT_INVALID_CHARS.toCharArray()) {
+ if (c == event.character) {
+ event.doit = false;
+ break;
+ }
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFileExtensionEditor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFoldersEditor.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFoldersEditor.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFoldersEditor.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,113 @@
+package org.jboss.dna.eclipse.jcr.rest.client.preferences;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.FILTERED_FOLDER_NAMES_PREFERENCE;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.dnaPreferencePageFilteredFolderNamesLabel;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.newFilteredFolderNameDialogLabel;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.newFilteredFolderNameDialogTitle;
+import static org.jboss.dna.eclipse.jcr.rest.client.preferences.PrefUtils.FOLDER_NAME_DELIMITER;
+import static org.jboss.dna.eclipse.jcr.rest.client.preferences.PrefUtils.FOLDER_NAME_INVALID_CHARS;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.TreeSet;
+import org.eclipse.jface.preference.ListEditor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+
+/**
+ * The <code>FilteredFoldersEditor</code> is an editor for managing a set of folder names.
+ */
+public final class FilteredFoldersEditor extends ListEditor implements VerifyListener {
+
+ // =======================================================================================================================
+ // Fields
+ // =======================================================================================================================
+
+ /**
+ * The current set of folder names.
+ */
+ private final Set<String> folderNames;
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * @param parent the parent control
+ */
+ public FilteredFoldersEditor( Composite parent ) {
+ super(FILTERED_FOLDER_NAMES_PREFERENCE, dnaPreferencePageFilteredFolderNamesLabel.text(), parent);
+ this.folderNames = new TreeSet<String>();
+ }
+
+ // =======================================================================================================================
+ // Methods
+ // =======================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.ListEditor#createList(java.lang.String[])
+ */
+ @Override
+ protected String createList( String[] items ) {
+ return Utils.combineTokens(items, FOLDER_NAME_DELIMITER);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.ListEditor#getNewInputObject()
+ */
+ @Override
+ protected String getNewInputObject() {
+ NewItemDialog dialog = new NewItemDialog(getShell(), newFilteredFolderNameDialogTitle.text(),
+ newFilteredFolderNameDialogLabel.text(), this);
+
+ if (dialog.open() == Window.OK) {
+ String folderName = dialog.getNewItem();
+
+ // add new folder name
+ if (folderName != null) {
+ this.folderNames.add(folderName);
+ return folderName;
+ }
+ }
+
+ // user canceled dialog
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String)
+ */
+ @Override
+ protected String[] parseString( String stringList ) {
+ String[] values = Utils.getTokens(stringList, Character.toString(FOLDER_NAME_DELIMITER), true);
+
+ this.folderNames.clear();
+ this.folderNames.addAll(Arrays.asList(values));
+
+ return values;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
+ public void verifyText( VerifyEvent event ) {
+ for (char c : FOLDER_NAME_INVALID_CHARS.toCharArray()) {
+ if (c == event.character) {
+ event.doit = false;
+ break;
+ }
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/FilteredFoldersEditor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/NewItemDialog.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/NewItemDialog.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/NewItemDialog.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,179 @@
+package org.jboss.dna.eclipse.jcr.rest.client.preferences;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.dna.common.util.CheckArg;
+
+/**
+ * A <code>NewItemDialog</code> allows the user to enter a new file extension or new folder name that they wish to be filtered out
+ * of all publishing operations.
+ */
+public final class NewItemDialog extends Dialog implements ModifyListener {
+
+ // =======================================================================================================================
+ // Fields
+ // =======================================================================================================================
+
+ /**
+ * The label describing the new item.
+ */
+ private final String label;
+
+ /**
+ * The contents of the new item text field.
+ */
+ private String newItem;
+
+ /**
+ * The dialog title.
+ */
+ private final String title;
+
+ /**
+ * The listener verifying input characters.
+ */
+ private final VerifyListener verifyListener;
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * @param parentShell the parent shell (may be <code>null</code>)
+ * @param title the localized dialog title (never <code>null</code>)
+ * @param label the localized label (never <code>null</code>)
+ * @param verifyListener a listener that validates input characters (may be <code>null</code>)
+ */
+ public NewItemDialog( Shell parentShell,
+ String title,
+ String label,
+ VerifyListener verifyListener ) {
+ super(parentShell);
+
+ CheckArg.isNotNull(title, "title"); //$NON-NLS-1$
+ CheckArg.isNotNull(label, "label"); //$NON-NLS-1$
+
+ this.title = title;
+ this.label = label;
+ this.verifyListener = verifyListener;
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ // =======================================================================================================================
+ // Methods
+ // =======================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell( Shell newShell ) {
+ newShell.setText(this.title);
+ super.configureShell(newShell);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButton(org.eclipse.swt.widgets.Composite, int, java.lang.String, boolean)
+ */
+ @Override
+ protected Button createButton( Composite parent,
+ int id,
+ String label,
+ boolean defaultButton ) {
+ Button button = super.createButton(parent, id, label, defaultButton);
+
+ // disable OK button initially
+ if (id == OK) {
+ button.setEnabled(false);
+ }
+
+ return button;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea( Composite parent ) {
+ Composite panel = (Composite)super.createDialogArea(parent);
+ Composite pnlEditor = new Composite(panel, SWT.NONE);
+ pnlEditor.setLayout(new GridLayout(2, false));
+ pnlEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label label = new Label(pnlEditor, SWT.NONE);
+ label.setText(this.label);
+
+ Text textField = new Text(pnlEditor, SWT.BORDER);
+ textField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+ textField.addModifyListener(this);
+
+ // add listener if necessary
+ if (this.verifyListener != null) {
+ textField.addVerifyListener(this.verifyListener);
+ }
+
+ return panel;
+ }
+
+ /**
+ * @return the new item or <code>null</code> if the dialog was canceled
+ */
+ public String getNewItem() {
+ if (getReturnCode() == OK) {
+ return this.newItem;
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
+ */
+ @Override
+ protected void initializeBounds() {
+ super.initializeBounds();
+
+ // resize shell to be twice the width needed for the title (without this the title maybe cropped)
+ int width = (2 * convertWidthInCharsToPixels(this.title.length()));
+ Rectangle rectangle = getShell().getBounds();
+ getShell().setBounds(rectangle.x, rectangle.y, width, rectangle.height);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent event ) {
+ // disable OK button if text field does not have any characters
+ this.newItem = ((Text)event.widget).getText();
+ boolean enable = (this.newItem.length() != 0);
+
+ if (getButton(OK).getEnabled() != enable) {
+ getButton(OK).setEnabled(enable);
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/NewItemDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PrefUtils.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PrefUtils.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PrefUtils.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,236 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.preferences;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.FILTERED_FILE_EXTENSIONS_PREFERENCE;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.FILTERED_FOLDER_NAMES_PREFERENCE;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.prefUtilsPropertyFileNotFound;
+import static org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n.prefUtilsPropertyNotFound;
+import java.io.InputStream;
+import java.util.Properties;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+
+/**
+ * The <code>PrefUtils</code> class provides common utilities relating to preferences. This class assumes the Eclipse runtime
+ * platform is running.
+ */
+public final class PrefUtils {
+
+ // =======================================================================================================================
+ // Constants
+ // =======================================================================================================================
+
+ /**
+ * The name of the properties file located in this package.
+ */
+ private static final String PREFERENCES_FILE = "dnaPrefs.properties"; //$NON-NLS-1$
+
+ /**
+ * The preference name for the delimiter that separates filtered file extensions when the preference value is stored.
+ */
+ private static final String FILE_EXT_DELIMITER_PREF_NAME = "fileExtension.delimiter"; //$NON-NLS-1$
+
+ /**
+ * The delimiter that separates filtered file extensions when the preference value is stored.
+ */
+ public static final char FILE_EXT_DELIMITER;
+
+ /**
+ * The preference name for characters that are <strong>NOT</strong> allowed to appear in a file extension.
+ */
+ private static final String FILE_EXT_INVALID_CHARS_PREF_NAME = "fileExtension.invalidChars"; //$NON-NLS-1$
+
+ /**
+ * The characters that are <strong>NOT</strong> allowed to appear in a file extension.
+ */
+ public static final String FILE_EXT_INVALID_CHARS;
+
+ /**
+ * The preference name for the delimiter that separates filtered folder names when the preference value is stored.
+ */
+ private static final String FOLDER_NAME_DELIMITER_PREF_NAME = "folderName.delimiter"; //$NON-NLS-1$
+
+ /**
+ * The delimiter that separates filtered folder names when the preference value is stored.
+ */
+ public static final char FOLDER_NAME_DELIMITER;
+
+ /**
+ * The preference name for characters that are <strong>NOT</strong> allowed to appear in a folder name.
+ */
+ private static final String FOLDER_NAME_INVALID_CHARS_PREF_NAME = "folderName.invalidChars"; //$NON-NLS-1$
+
+ /**
+ * The characters that are <strong>NOT</strong> allowed to appear in a folder name.
+ */
+ public static final String FOLDER_NAME_INVALID_CHARS;
+
+ // =======================================================================================================================
+ // Class Initializer
+ // =======================================================================================================================
+
+ static {
+ InputStream is = null;
+ Properties preferenceProperties = new Properties();
+
+ // get the properties file
+ try {
+ is = PrefUtils.class.getResourceAsStream(PREFERENCES_FILE);
+ } catch (Exception e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
+ }
+
+ if (is == null) {
+ Activator.getDefault().log(new Status(Severity.ERROR, prefUtilsPropertyFileNotFound.text(), null));
+ } else {
+ // load the properties file
+ try {
+ preferenceProperties.load(is);
+ } catch (Exception e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
+ } finally {
+ try {
+ is.close();
+ } catch (Exception e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
+ }
+ }
+ }
+
+ // file extensions delimiter
+ String temp = preferenceProperties.getProperty(FILE_EXT_DELIMITER_PREF_NAME);
+
+ if ((temp != null) && (temp.length() > 0)) {
+ FILE_EXT_DELIMITER = temp.charAt(0);
+ } else {
+ // make sure preference has a value
+ FILE_EXT_DELIMITER = ',';
+ Activator.getDefault().log(new Status(Severity.ERROR, prefUtilsPropertyNotFound.text(FILE_EXT_DELIMITER_PREF_NAME),
+ null));
+ }
+
+ // file extension invalid characters
+ temp = preferenceProperties.getProperty(FILE_EXT_INVALID_CHARS_PREF_NAME);
+
+ if ((temp != null) && (temp.length() > 0)) {
+ FILE_EXT_INVALID_CHARS = temp;
+ } else {
+ // make sure preference has a value
+ FILE_EXT_INVALID_CHARS = "*?<>|/\\:;."; //$NON-NLS-1$
+ Activator.getDefault().log(new Status(Severity.ERROR,
+ prefUtilsPropertyNotFound.text(FILE_EXT_INVALID_CHARS_PREF_NAME), null));
+ }
+
+ // folder names delimiter
+ temp = preferenceProperties.getProperty(FOLDER_NAME_DELIMITER_PREF_NAME);
+
+ if ((temp != null) && (temp.length() > 0)) {
+ FOLDER_NAME_DELIMITER = temp.charAt(0);
+ } else {
+ // make sure preference has a value
+ FOLDER_NAME_DELIMITER = ',';
+ Activator.getDefault().log(new Status(Severity.ERROR,
+ prefUtilsPropertyNotFound.text(FOLDER_NAME_DELIMITER_PREF_NAME), null));
+ }
+
+ // folder name invalid characters
+ temp = preferenceProperties.getProperty(FOLDER_NAME_INVALID_CHARS_PREF_NAME);
+
+ if ((temp != null) && (temp.length() > 0)) {
+ FOLDER_NAME_INVALID_CHARS = temp;
+ } else {
+ // make sure preference has a value
+ FOLDER_NAME_INVALID_CHARS = "*?<>|/\\:;"; //$NON-NLS-1$
+ Activator.getDefault().log(new Status(Severity.ERROR,
+ prefUtilsPropertyNotFound.text(FOLDER_NAME_INVALID_CHARS_PREF_NAME), null));
+ }
+ }
+
+ // =======================================================================================================================
+ // Class Methods
+ // =======================================================================================================================
+
+ /**
+ * @return the file extensions being filtered out of publishing operations (never null)
+ */
+ public static String[] getFilteredFileExtensions() {
+ return getListPropertyValue(FILTERED_FILE_EXTENSIONS_PREFERENCE, FILE_EXT_DELIMITER, true);
+ }
+
+ /**
+ * @return the folder names being filtered out of publishing operations (never null)
+ */
+ public static String[] getFilteredFolderNames() {
+ return getListPropertyValue(FILTERED_FOLDER_NAMES_PREFERENCE, FOLDER_NAME_DELIMITER, true);
+ }
+
+ /**
+ * @param propertyId the property name whose list values are being requested
+ * @param delimiter the character separating the items in the property value
+ * @param removeDuplicates a flag indicating if duplicate items should be removed
+ * @return the property value items (never <code>null</code>)
+ */
+ public static String[] getListPropertyValue( String propertyId,
+ char delimiter,
+ boolean removeDuplicates ) {
+ CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
+ return Utils.getTokens(getPreferenceStore().getString(propertyId), Character.toString(delimiter), removeDuplicates);
+ }
+
+ /**
+ * @return the plugin preference store
+ */
+ public static IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ /**
+ * @param propertyId the property name being set (never <code>null</code>)
+ * @param items the items used to create the property value (never <code>null</code>)
+ * @param delimiter the character to use to separate the items
+ */
+ public static void setListPropertyValue( String propertyId,
+ String[] items,
+ char delimiter ) {
+ CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
+ CheckArg.isNotNull(items, "items"); //$NON-NLS-1$
+ getPreferenceStore().setValue(propertyId, Utils.combineTokens(items, delimiter));
+ }
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * Don't allow construction.
+ */
+ private PrefUtils() {
+ // nothing to do
+ }
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PrefUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PublishingFileFilter.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PublishingFileFilter.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PublishingFileFilter.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,105 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.preferences;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.jboss.dna.common.util.CheckArg;
+
+/**
+ * The <code>PublishingFileFilter</code> is a file filter that uses the DNA preferences when filtering files.
+ */
+public final class PublishingFileFilter {
+
+ // =======================================================================================================================
+ // Fields
+ // =======================================================================================================================
+
+ /**
+ * The file extensions that should not be involved in publishing operations.
+ */
+ private final String[] filteredFileExtensions;
+
+ /**
+ * The folder names that should not be involved in publishing operations.
+ */
+ private final String[] filteredFolderNames;
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * Construct a filter using the current DNA preferences.
+ */
+ public PublishingFileFilter() {
+ this.filteredFileExtensions = PrefUtils.getFilteredFileExtensions();
+ this.filteredFolderNames = PrefUtils.getFilteredFolderNames();
+ }
+
+ // =======================================================================================================================
+ // Methods
+ // =======================================================================================================================
+
+ /**
+ * @param resource the resource being tested (never <code>null</code>)
+ * @return <code>true</code> if the resource should be included (i.e., it is not filtered out)
+ */
+ public boolean accept( IResource resource ) {
+ CheckArg.isNotNull(resource, "resource"); //$NON-NLS-1$
+
+ if (resource instanceof IFolder) {
+ String name = resource.getName();
+
+ // see if folder name has been filtered
+ for (String filteredName : this.filteredFolderNames) {
+ if (filteredName.equals(name)) {
+ return false;
+ }
+ }
+
+ // check parent
+ if (resource.getParent() != null) {
+ return accept(resource.getParent());
+ }
+ } else if (resource instanceof IFile) {
+ // see if file extension has been filtered
+ for (String extension : this.filteredFileExtensions) {
+ if (resource.getFullPath().toString().endsWith('.' + extension)) {
+ return false;
+ }
+ }
+
+ // check parent
+ if (resource.getParent() != null) {
+ return accept(resource.getParent());
+ }
+ }
+
+ // must be project
+ return true;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/PublishingFileFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/dnaPrefs.properties
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/dnaPrefs.properties (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/dnaPrefs.properties 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,32 @@
+#
+# JBoss DNA (http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of
+# individual contributors.
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+# This properties file is read in by PrefUtils. The delimiter values are used when the preference values are stored and the
+# valid character values are used by the editors when they validate user input.
+
+fileExtension.delimiter = ,
+fileExtension.invalidChars = *?<>|/\:;.
+
+folderName.delimiter = ,
+folderName.invalidChars = *?<>|/\:;
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/preferences/dnaPrefs.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaContentProvider.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaContentProvider.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaContentProvider.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,339 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.views;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.PUBLISHED_OVERLAY_IMAGE;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.DnaResourceHelper;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.Utils;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.IDnaObject;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>DnaContentProvider</code> is a content and label provider for DNA repositories.
+ */
+public final class DnaContentProvider extends ColumnLabelProvider implements ILightweightLabelDecorator, ITreeContentProvider {
+
+ // ===========================================================================================================================
+ // Constants
+ // ===========================================================================================================================
+
+ /**
+ * The decorator ID.
+ */
+ private static final String ID = "org.jboss.dna.eclipse.jcr.rest.client.dnaDecorator"; //$NON-NLS-1$
+
+ // ===========================================================================================================================
+ // Class Methods
+ // ===========================================================================================================================
+
+ /**
+ * @return the DNA decorator
+ */
+ public static DnaContentProvider getDecorator() {
+ IDecoratorManager decoratorMgr = Activator.getDefault().getWorkbench().getDecoratorManager();
+
+ if (decoratorMgr.getEnabled(ID)) {
+ return (DnaContentProvider)decoratorMgr.getBaseLabelProvider(ID);
+ }
+
+ return null;
+ }
+
+ // ===========================================dnaDecorator================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The server manager where the server registry is managed.
+ */
+ private ServerManager serverManager;
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void addListener( ILabelProviderListener listener ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object, org.eclipse.jface.viewers.IDecoration)
+ */
+ @Override
+ public void decorate( final Object element,
+ IDecoration decoration ) {
+ ImageDescriptor overlay = null;
+ final Display display = Display.getDefault();
+
+ if (display.isDisposed()) {
+ return;
+ }
+
+ // must be an IDnaObject
+ if (getServerManager() != null) {
+ if (element instanceof Server) {
+ Status status = getServerManager().ping((Server)element);
+ overlay = Utils.getOverlayImage(status);
+ } else if ((element instanceof IFile) && new DnaResourceHelper(getServerManager()).isPublished((IFile)element)) {
+ overlay = Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
+ }
+
+ if (overlay != null) {
+ decoration.addOverlay(overlay);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren( Object parentElement ) {
+ assert (parentElement instanceof IDnaObject);
+
+ if (getServerManager() != null) {
+ try {
+ if ((parentElement instanceof Server) && getServerManager().ping((Server)parentElement).isOk()) {
+ return getServerManager().getRepositories((Server)parentElement).toArray();
+ }
+ } catch (Exception e) {
+ String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(((Server)parentElement).getShortDescription());
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+
+ try {
+ if (parentElement instanceof Repository) {
+ return getServerManager().getWorkspaces((Repository)parentElement).toArray();
+ }
+ } catch (Exception e) {
+ String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text();
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
+
+ return new Object[0];
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements( Object inputElement ) {
+ return ((getServerManager() == null) ? new Object[0] : getServerManager().getServers().toArray());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage( Object element ) {
+ return Activator.getDefault().getImage(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ @Override
+ public Object getParent( Object element ) {
+ assert (element instanceof IDnaObject);
+
+ if (element instanceof Workspace) {
+ return ((Workspace)element).getRepository();
+ }
+
+ if (element instanceof Repository) {
+ return ((Repository)element).getServer();
+ }
+
+ // server
+ return null;
+ }
+
+ /**
+ * @return the server manager or <code>null</code>
+ */
+ private ServerManager getServerManager() {
+ if (this.serverManager == null) {
+ this.serverManager = Activator.getDefault().getServerManager();
+ }
+
+ return this.serverManager;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText( Object element ) {
+ assert (element instanceof IDnaObject);
+ return ((IDnaObject)element).getName();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipImage(java.lang.Object)
+ */
+ @Override
+ public Image getToolTipImage( Object object ) {
+ return getImage(object);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
+ */
+ @Override
+ public String getToolTipText( Object element ) {
+ if (element instanceof IDnaObject) {
+ return ((IDnaObject)element).getShortDescription();
+ }
+
+ return super.getToolTipText(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipTimeDisplayed(java.lang.Object)
+ */
+ @Override
+ public int getToolTipTimeDisplayed( Object object ) {
+ return 3000;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren( Object element ) {
+ return getChildren(element).length > 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object,
+ * java.lang.Object)
+ */
+ @Override
+ public void inputChanged( Viewer viewer,
+ Object oldInput,
+ Object newInput ) {
+ // this.viewer = (StructuredViewer)viewer;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ */
+ @Override
+ public boolean isLabelProperty( Object element,
+ String property ) {
+ return false;
+ }
+
+ public void refresh( final Object element ) {
+ final Display display = Display.getDefault();
+
+ if (display.isDisposed()) {
+ return;
+ }
+
+ display.asyncExec(new Runnable() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Runnable#run()
+ */
+ @SuppressWarnings( "synthetic-access" )
+ @Override
+ public void run() {
+ fireLabelProviderChanged(new LabelProviderChangedEvent(DnaContentProvider.this, element));
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void removeListener( ILabelProviderListener listener ) {
+ // nothing to do
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaContentProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaMessageConsole.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaMessageConsole.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaMessageConsole.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,341 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.views;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_IMAGE_16x;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.debug.ui.console.FileLink;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.console.AbstractConsole;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.MessageConsoleStream;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+
+/**
+ * The <code>DnaMessageConsole</code> is a message console view where status of publishing operations are logged. This class
+ * ensures all writes to the console are done in the UI thread.
+ */
+public final class DnaMessageConsole extends MessageConsole {
+
+ // =======================================================================================================================
+ // Constants
+ // =======================================================================================================================
+
+ /**
+ * Start tag for adding emphasis to a message. Tag will appear in a properties file.
+ */
+ private static final String EMPHASIS_START_TAG = "<em>"; //$NON-NLS-1$
+
+ /**
+ * End tag for adding emphasis to a message. Tag will appear in a properties file.
+ */
+ private static final String EMPHASIS_END_TAG = "</em>"; //$NON-NLS-1$
+
+ /**
+ * The identifier and type of the DNA Message Console.
+ */
+ private static final String ID = "org.jboss.dna.eclipse.jcr.rest.client.views.DnaMessageConsole"; //$NON-NLS-1$
+
+ /**
+ * The message console name.
+ */
+ private static final String NAME = RestClientI18n.dnaConsoleName.text();
+
+ // =======================================================================================================================
+ // Class Methods
+ // =======================================================================================================================
+
+ /**
+ * Note: The <code>DnaMessageConsole</code> should <strong>NOT</strong> be cached as the user can open/close/create instances.
+ *
+ * @return the DNA Message Console if available or a new one (never <code>null</code>)
+ */
+ private static DnaMessageConsole getDnaConsole() {
+ DnaMessageConsole console = null;
+ IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
+ IConsole[] consoles = consoleMgr.getConsoles();
+
+ // see if DNA console is open
+ for (int i = 0; i < consoles.length; ++i) {
+ if (NAME.equals(consoles[i].getName())) {
+ console = (DnaMessageConsole)consoles[i];
+ break;
+ }
+ }
+
+ // create DNA console if necessary
+ if (console == null) {
+ console = new DnaMessageConsole();
+ consoleMgr.addConsoles(new IConsole[] {console});
+ }
+
+ return console;
+ }
+
+ /**
+ * Adds a line feed to the console after the message is printed.
+ *
+ * @param message the message being written to the console (never <code>null</code>)
+ */
+ public static void writeln( String message ) {
+ CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
+ writeln(message, null);
+ }
+
+ /**
+ * Adds a line feed to the console after the message is printed.
+ *
+ * @param message the message being written to the console (never <code>null</code>)
+ * @param file the file whose full path, which is contained in the message, will be made into a hyperlink (may be
+ * <code>null</code>)
+ */
+ public static void writeln( String message,
+ IFile file ) {
+ CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
+
+ DnaMessageConsole console = getDnaConsole();
+ console.print(message, true, file);
+ }
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * Prevent construction.
+ */
+ private DnaMessageConsole() {
+ super(NAME, Activator.getDefault().getImageDescriptor(DNA_IMAGE_16x));
+ }
+
+ // =======================================================================================================================
+ // Methods
+ // =======================================================================================================================
+
+ /**
+ * @param message the message being searched for
+ * @param file the file whose full path appears in the message and will become a hyperlink
+ */
+ void addDocumentListener( String message,
+ IFile file ) {
+ getDocument().addDocumentListener(new HyperlinkCreator(message, this, file));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.console.AbstractConsole#getType()
+ */
+ @Override
+ public String getType() {
+ return ID;
+ }
+
+ /**
+ * @param message the message being written to the console (never <code>null</code>)
+ * @param doLineFeedAtEnd a flag indicating if a line feed should be done after writing the message
+ * @param file the file to create a hyperlink for (may be <code>null</code>)
+ */
+ private void print( final String message,
+ final boolean doLineFeedAtEnd,
+ final IFile file ) {
+ final Display display = Display.getDefault();
+ final AbstractConsole console = this;
+
+ if (!display.isDisposed()) {
+ display.asyncExec(new Runnable() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ if (!display.isDisposed()) {
+ // bring focus to this view
+ console.activate();
+
+ // register document listener before writing to console
+ if (file != null) {
+ addDocumentListener(message, file);
+ }
+
+ MessageConsoleStream stream = newMessageStream();
+
+ for (int beginIndex = 0, endIndex = 0, msgLength = message.length(); endIndex < msgLength;) {
+ int startTagIndex = message.indexOf(EMPHASIS_START_TAG, beginIndex);
+ int endTagIndex = ((startTagIndex < 0) ? -1 : message.indexOf(EMPHASIS_END_TAG,
+ startTagIndex
+ + EMPHASIS_START_TAG.length()));
+
+ // ignore tags if both tags are not found
+ if ((endTagIndex < 0) && (startTagIndex >= 0)) {
+ startTagIndex = -1;
+ }
+
+ // determine if in emphasize mode
+ boolean emphasize = (beginIndex == startTagIndex);
+
+ // skip over start tag and set stream to bold font style
+ if (emphasize) {
+ beginIndex += EMPHASIS_START_TAG.length();
+ stream.setFontStyle(SWT.BOLD);
+ endIndex = endTagIndex;
+ } else {
+ stream.setFontStyle(SWT.NORMAL);
+ endIndex = ((startTagIndex < 0) ? msgLength : startTagIndex);
+ }
+
+ // print to console
+ stream.print(message.substring(beginIndex, endIndex));
+
+ // need to construct a new stream as changes to font style seem to only work one time
+ stream = newMessageStream();
+
+ // skip over end tag
+ if (emphasize) {
+ endIndex += EMPHASIS_END_TAG.length();
+ }
+
+ beginIndex = endIndex;
+ }
+
+ if (doLineFeedAtEnd) {
+ stream.println();
+ }
+ }
+ }
+ });
+ }
+ }
+
+ // ===========================================================================================================================
+ // Inner Class
+ // ===========================================================================================================================
+
+ /**
+ * The <code>HyperlinkCreator</code> creates a hyperlink in a DNA Message Console for the first occurrence of the full path of
+ * a specified file.
+ */
+ class HyperlinkCreator implements IDocumentListener {
+
+ // =======================================================================================================================
+ // Fields
+ // =======================================================================================================================
+
+ /**
+ * The console where the message is printed to and the hyperlink will be created.
+ */
+ private final DnaMessageConsole console;
+
+ /**
+ * The file whose full path will become a hyperlink.
+ */
+ private final IFile file;
+
+ /**
+ * The message where the file path is located in.
+ */
+ private final String message;
+
+ // =======================================================================================================================
+ // Constructors
+ // =======================================================================================================================
+
+ /**
+ * @param message the message that contains the full path of the file
+ * @param console the console where the message appears
+ * @param file the file whose full path appears in the message and will become a hyperlink
+ */
+ public HyperlinkCreator( String message,
+ DnaMessageConsole console,
+ IFile file ) {
+ this.message = message.replaceAll("<em>", "").replaceAll("\\Q</em>\\E", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ this.console = console;
+ this.file = file;
+ }
+
+ // =======================================================================================================================
+ // Methods
+ // =======================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+ */
+ @Override
+ public void documentAboutToBeChanged( DocumentEvent arg0 ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
+ */
+ @Override
+ public void documentChanged( DocumentEvent event ) {
+ IDocument document = event.getDocument();
+
+ try {
+ FindReplaceDocumentAdapter finder = new FindReplaceDocumentAdapter(document);
+ IRegion region = finder.find(document.getLength() - 1, this.message, false, true, false, false);
+
+ if (region != null) {
+ String target = this.file.getFullPath().toString();
+ int index = this.message.indexOf(target);
+
+ if (index == -1) {
+ throw new BadLocationException(RestClientI18n.dnaConsoleFilePathNotFoundMsg.text(target));
+ }
+
+ this.console.addHyperlink(new FileLink(file, null, -1, -1, -1), (region.getOffset() + index), target.length());
+
+ // created hyperlink so no need to listen any longer
+ document.removeDocumentListener(this);
+ }
+ } catch (BadLocationException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR,
+ RestClientI18n.dnaConsoleProblemCreatingHyperlinkMsg.text(), e));
+ document.removeDocumentListener(this);
+ }
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/DnaMessageConsole.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/ServerView.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/ServerView.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/ServerView.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,299 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.views;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.COLLAPSE_ALL_IMAGE;
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.SERVER_VIEW_HELP_CONTEXT;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.eclipse.ui.part.ViewPart;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.actions.DeleteServerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.actions.EditServerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.actions.NewServerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.actions.ReconnectToServerAction;
+import org.jboss.dna.web.jcr.rest.client.IServerRegistryListener;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent;
+import org.jboss.dna.web.jcr.rest.client.domain.IDnaObject;
+
+/**
+ * The <code>ServerView</code> shows all defined servers and their DNA repositories.
+ */
+public final class ServerView extends ViewPart implements IServerRegistryListener {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * Collapses all tree nodes.
+ */
+ private IAction collapseAllAction;
+
+ /**
+ * Deletes a server.
+ */
+ private BaseSelectionListenerAction deleteAction;
+
+ /**
+ * Edits a server's properties.
+ */
+ private BaseSelectionListenerAction editAction;
+
+ /**
+ * Creates a new server.
+ */
+ private Action newAction;
+
+ /**
+ * The viewer's content and label provider.
+ */
+ private DnaContentProvider provider;
+
+ /**
+ * Refreshes the server connections.
+ */
+ private ReconnectToServerAction reconnectAction;
+
+ private TreeViewer viewer;
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ private void constructActions() {
+ // the collapse all action is always enabled
+ this.collapseAllAction = new Action() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ getViewer().collapseAll();
+ }
+ };
+
+ this.collapseAllAction.setToolTipText(RestClientI18n.collapseActionToolTip.text());
+ this.collapseAllAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(COLLAPSE_ALL_IMAGE));
+
+ // the reconnect action tries to ping a selected server
+ this.reconnectAction = new ReconnectToServerAction(this.viewer);
+ this.viewer.addSelectionChangedListener(this.reconnectAction);
+
+ // the shell used for dialogs that the actions display
+ Shell shell = this.getSite().getShell();
+
+ // the delete action will delete one or more servers
+ this.deleteAction = new DeleteServerAction(shell, getServerManager());
+ this.viewer.addSelectionChangedListener(this.deleteAction);
+
+ // the edit action is only enabled when one server is selected
+ this.editAction = new EditServerAction(shell, getServerManager());
+ this.viewer.addSelectionChangedListener(this.editAction);
+
+ // the new server action is always enabled
+ this.newAction = new NewServerAction(shell, getServerManager());
+ }
+
+ private void constructContextMenu() {
+ MenuManager menuMgr = new MenuManager();
+ menuMgr.add(this.newAction);
+ menuMgr.add(this.editAction);
+ menuMgr.add(this.deleteAction);
+ menuMgr.add(this.reconnectAction);
+
+ Menu menu = menuMgr.createContextMenu(this.viewer.getTree());
+ this.viewer.getTree().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, this.viewer);
+ }
+
+ private void constructToolBar() {
+ IToolBarManager toolBar = getViewSite().getActionBars().getToolBarManager();
+ toolBar.add(this.newAction);
+ toolBar.add(this.editAction);
+ toolBar.add(this.deleteAction);
+ toolBar.add(this.reconnectAction);
+ toolBar.add(this.collapseAllAction);
+ }
+
+ /**
+ * @param parent the viewer's parent
+ */
+ private void constructTreeViewer( Composite parent ) {
+ this.provider = new DnaContentProvider();
+ this.viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
+
+ this.viewer.setContentProvider(this.provider);
+ ILabelDecorator decorator = Activator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator();
+ this.viewer.setLabelProvider(new DecoratingLabelProvider(this.provider, decorator));
+ ColumnViewerToolTipSupport.enableFor(this.viewer);
+
+ this.viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged( SelectionChangedEvent event ) {
+ handleSelectionChanged(event);
+ }
+ });
+ this.viewer.addDoubleClickListener(new IDoubleClickListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ @Override
+ public void doubleClick( DoubleClickEvent arg0 ) {
+ handleDoubleClick();
+ }
+ });
+
+ // need to call this (doesn't matter what the param is) to bootstrap the provider.
+ this.viewer.setInput(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createPartControl( Composite parent ) {
+ constructTreeViewer(parent);
+ constructActions();
+ constructToolBar();
+ constructContextMenu();
+
+ setTitleToolTip(RestClientI18n.serverViewToolTip.text());
+
+ // register to receive changes to the server registry
+ getServerManager().addRegistryListener(this);
+
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(parent, SERVER_VIEW_HELP_CONTEXT);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ getServerManager().removeRegistryListener(this);
+ super.dispose();
+ }
+
+ /**
+ * @return the server manager being used by this view
+ */
+ private ServerManager getServerManager() {
+ return Activator.getDefault().getServerManager();
+ }
+
+ /**
+ * @return the tree viewer
+ */
+ TreeViewer getViewer() {
+ return this.viewer;
+ }
+
+ /**
+ * Opens a dialog to edit server properties.
+ */
+ void handleDoubleClick() {
+ this.editAction.run();
+ }
+
+ /**
+ * @param event the event being processed
+ */
+ void handleSelectionChanged( SelectionChangedEvent event ) {
+ updateStatusLine((IStructuredSelection)event.getSelection());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.IServerRegistryListener#serverRegistryChanged(org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent)
+ */
+ @Override
+ public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
+ if (event.isNew() || event.isUpdate()) {
+ this.viewer.refresh();
+ } else {
+ this.viewer.remove(event.getServer());
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+ */
+ @Override
+ public void setFocus() {
+ if (!this.viewer.getControl().isDisposed()) {
+ this.viewer.getControl().setFocus();
+ }
+ }
+
+ /**
+ * @param selection the current viewer selection (never <code>null</code>)
+ */
+ private void updateStatusLine( IStructuredSelection selection ) {
+ assert (selection.size() < 2);
+
+ String msg = (selection.isEmpty() ? "" : ((IDnaObject)selection.getFirstElement()).getShortDescription()); //$NON-NLS-1$
+ getViewSite().getActionBars().getStatusLineManager().setMessage(msg);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/ServerView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/package-info.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/package-info.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/package-info.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,28 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * The JBoss DNA REST Client Eclipse views package defines the Eclipse views that are needed to publish, unpublish, and manage
+ * the server registry.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.views;
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/views/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishPage.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishPage.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishPage.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,1009 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.wizards;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.PUBLISH_DIALOG_HELP_CONTEXT;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.actions.NewServerAction;
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.PublishJob.Type;
+import org.jboss.dna.eclipse.jcr.rest.client.preferences.PublishingFileFilter;
+import org.jboss.dna.web.jcr.rest.client.IServerRegistryListener;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>PublishPage</code> is a UI for publishing or unpublishing one or more files to a DNA repository.
+ */
+public final class PublishPage extends WizardPage implements IServerRegistryListener, ModifyListener {
+
+ // ===========================================================================================================================
+ // Constants
+ // ===========================================================================================================================
+
+ /**
+ * The key in the wizard <code>IDialogSettings</code> for the recurse flag.
+ */
+ private static final String RECURSE_KEY = "recurse"; //$NON-NLS-1$
+
+ // ===========================================================================================================================
+ // Class Fields
+ // ===========================================================================================================================
+
+ /**
+ * Indicates if the file filter should be used.
+ */
+ private static boolean filterFiles = true;
+
+ // ===========================================================================================================================
+ // Class Methods
+ // ===========================================================================================================================
+
+ /**
+ * @param container the project or folder whose files are being requested
+ * @param recurse the flag indicating if child containers should be traversed
+ * @param filter the file filter or <code>null</code> if not used
+ * @return the list of files contained in the specified container (never <code>null</code>)
+ * @throws CoreException if there is a problem finding the files
+ */
+ private static List<IFile> findFiles( IContainer container,
+ boolean recurse,
+ PublishingFileFilter filter ) throws CoreException {
+ List<IFile> result = new ArrayList<IFile>();
+
+ for (IResource member : container.members()) {
+ if (recurse && (member instanceof IContainer)) {
+ // don't select closed projects
+ if ((member instanceof IProject) && !((IProject)member).isOpen()) {
+ continue;
+ }
+
+ result.addAll(findFiles((IContainer)member, recurse, filter));
+ } else if ((member instanceof IFile) && ((IFile)member).getLocation().toFile().exists()) {
+ if ((filter == null) || filter.accept(member)) {
+ result.add((IFile)member);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Processes the specified list of files and for (1) each file found adds it to the result and (2) for each project or folder
+ * adds all contained files. For projects and folders processing will be recursive based on saved wizard settings.
+ *
+ * @param resources the resources being processed (never <code>null</code>)
+ * @param recurse the flag indicating if child containers should be traversed
+ * @param filter the file filter or <code>null</code> if not used
+ * @return the files being published or unpublished (never <code>null</code>)
+ * @throws CoreException if there is a problem processing the resources
+ */
+ private static List<IFile> processResources( List<IResource> resources,
+ boolean recurse,
+ PublishingFileFilter filter ) throws CoreException {
+ List<IFile> result = new ArrayList<IFile>();
+
+ // Project Map - the outer map. Its keys are IProjects and its values are a Parent Map
+ // Parent Map - the inner map. Its keys are IContainers (IProject, IFolder) and its values are a list of files
+ Map<IProject, Map<IContainer, List<IFile>>> projectMap = new HashMap<IProject, Map<IContainer, List<IFile>>>();
+
+ // Step 1: Process resources
+ // - For each file make sure there is a project entry and parent entry then add the file to the Parent Map.
+ // - For each folder make sure there is a project entry then add folder entry.
+ // - For each project make sure there is a project entry.
+ //
+ // Step 2: Process maps
+ // - In the Project Map, when the recurse flag is set, entries for projects that have a null value (parent map) will be
+ // traversed finding all child files and them to results.
+ // - In the internal parent map, when the recurse flag is set, entries for parents that have a null value (child
+ // collection) will be traversed finding all child files and add them to results.
+ //
+ // Step 3: Add files from Step 1 to results
+
+ // Step 1 (see above for processing description)
+ for (IResource resource : resources) {
+ IFile file = null;
+ IProject project = null;
+ List<IFile> files = null;
+ Map<IContainer, List<IFile>> parentMap = null;
+
+ // see if resource is filtered
+ if ((filter != null) && !filter.accept(resource)) {
+ continue;
+ }
+
+ if (resource instanceof IFile) {
+ IContainer parent = null; // project or folder
+ file = (IFile)resource;
+ parent = file.getParent();
+ project = file.getProject();
+
+ // make sure there is a project entry
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
+
+ parentMap = projectMap.get(project);
+
+ // make sure there is a parent entry
+ if (parentMap == null) {
+ parentMap = new HashMap<IContainer, List<IFile>>();
+ projectMap.put(project, parentMap);
+ }
+
+ files = parentMap.get(parent);
+
+ // make sure there is a files collection
+ if (files == null) {
+ files = new ArrayList<IFile>();
+ parentMap.put(parent, files);
+ }
+
+ // add file
+ files.add(file);
+ } else if (resource instanceof IFolder) {
+ IFolder folder = (IFolder)resource;
+ project = folder.getProject();
+
+ // make sure there is a project entry
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
+
+ parentMap = projectMap.get(project);
+
+ // make sure there is a folder entry
+ if (parentMap == null) {
+ parentMap = new HashMap<IContainer, List<IFile>>();
+ projectMap.put(project, parentMap);
+ }
+
+ // add folder only if not already there
+ if (!parentMap.containsKey(folder)) {
+ parentMap.put(folder, null);
+ }
+ } else if (resource instanceof IProject) {
+ project = (IProject)resource;
+
+ // if map does not have entry create one
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
+ }
+ }
+
+ // Step 2 (see above for processing description)
+ // Process projects that have nothing under them selected
+ for (IProject project : projectMap.keySet()) {
+ Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
+
+ if (parentMap == null) {
+ result.addAll(findFiles(project, recurse, filter));
+ } else {
+ // process folders with no folder entries
+ for (IContainer folder : parentMap.keySet()) {
+ List<IFile> files = parentMap.get(folder);
+
+ if (files == null) {
+ result.addAll(findFiles(folder, recurse, filter));
+ }
+ }
+ }
+ }
+
+ // Step 3 (see above for processing description)
+ for (IProject project : projectMap.keySet()) {
+ Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
+
+ if (parentMap != null) {
+ for (Entry<IContainer, List<IFile>> entry : parentMap.entrySet()) {
+ if (entry.getValue() != null) {
+ result.addAll(entry.getValue());
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The repository chooser control.
+ */
+ private Combo cbxRepository;
+
+ /**
+ * The server chooser control.
+ */
+ private Combo cbxServer;
+
+ /**
+ * The workspace chooser control.
+ */
+ private Combo cbxWorkspace;
+
+ /**
+ * The files being published or unpublished (never <code>null</code>).
+ */
+ private List<IFile> files;
+
+ /**
+ * The filter used to determine if a file should be included in publishing operations (may be <code>null</code>).
+ */
+ private PublishingFileFilter filter;
+
+ /**
+ * The control containing all the files being published or unpublished.
+ */
+ private org.eclipse.swt.widgets.List lstResources;
+
+ /**
+ * The flag indicating if child containers should be traversed.
+ */
+ private boolean recurse;
+
+ /**
+ * A collection of repositories for the selected server (never <code>null</code>).
+ */
+ private List<Repository> repositories;
+
+ /**
+ * The repository where the workspace is located.
+ */
+ private Repository repository;
+
+ /**
+ * The collection of resources selected by the user to be published or unpublished.
+ */
+ private final List<IResource> resources;
+
+ /**
+ * The server where the repository is located.
+ */
+ private Server server;
+
+ /**
+ * A collection of servers from the server registry (never <code>null</code>).
+ */
+ private List<Server> servers;
+
+ /**
+ * The current validation status.
+ */
+ private Status status;
+
+ /**
+ * Indicates if publishing or unpublishing is being done.
+ */
+ private final Type type;
+
+ /**
+ * The workspace where the resources are being published/unpublished (may be <code>null</code>).
+ */
+ private Workspace workspace;
+
+ /**
+ * A collection of workspaces for the selected server repository (never <code>null</code>).
+ */
+ private List<Workspace> workspaces;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param type indicates if publishing or unpublishing is being done
+ * @param resources the resources being published or unpublished (never <code>null</code>)
+ * @throws CoreException if there is a problem processing the input resources
+ */
+ public PublishPage( Type type,
+ List<IResource> resources ) throws CoreException {
+ super(PublishPage.class.getSimpleName());
+ setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
+ : RestClientI18n.publishPageUnpublishTitle.text());
+ setPageComplete(false);
+
+ this.type = type;
+ this.resources = resources;
+
+ // filter should not be cached as preferences may change
+ this.filter = (filterFiles ? new PublishingFileFilter() : null);
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ private void constructLocationPanel( Composite parent ) {
+ Group pnl = new Group(parent, SWT.NONE);
+ pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
+ pnl.setLayout(new GridLayout(2, false));
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ // row 1: label combobox button
+ // row 2: label combobox
+ // row 3: label combobox
+
+ { // row 1: server row
+ Composite pnlServer = new Composite(pnl, SWT.NONE);
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ pnlServer.setLayout(layout);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd.horizontalSpan = 2;
+ pnlServer.setLayoutData(gd);
+
+ Label lblServer = new Label(pnlServer, SWT.LEFT);
+ lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblServer.setText(RestClientI18n.publishPageServerLabel.text());
+
+ this.cbxServer = new Combo(pnlServer, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxServer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip.text());
+
+ final IAction action = new NewServerAction(this.getShell(), getServerManager());
+ final Button btnNewServer = new Button(pnlServer, SWT.PUSH);
+ btnNewServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
+ btnNewServer.setToolTipText(action.getToolTipText());
+ btnNewServer.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ action.run();
+ }
+ });
+
+ // update page message first time selected to get rid of initial message by forcing validation
+ btnNewServer.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ updateInitialMessage();
+ btnNewServer.removeSelectionListener(this);
+ }
+ });
+ }
+
+ { // row 2: repository row
+ Label lblRepository = new Label(pnl, SWT.LEFT);
+ lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblRepository.setText(RestClientI18n.publishPageRepositoryLabel.text());
+
+ this.cbxRepository = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxRepository.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip.text());
+ }
+
+ { // row 3: workspace row
+ Label lblWorkspace = new Label(pnl, SWT.LEFT);
+ lblWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel.text());
+
+ this.cbxWorkspace = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxWorkspace.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+
+ if (type == Type.PUBLISH) {
+ this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
+ } else {
+ this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
+ }
+ }
+ }
+
+ private void constructResourcesPanel( Composite parent ) {
+ Composite pnl = new Composite(parent, SWT.NONE);
+ pnl.setLayout(new GridLayout());
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // pnl layout:
+ // row 1: lbl
+ // row 2: lstResources
+ // row 3: chkbox
+
+ { // row 1
+ Label lbl = new Label(pnl, SWT.LEFT);
+ lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+
+ if (type == Type.PUBLISH) {
+ lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
+ } else {
+ lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
+ }
+ }
+
+ { // row 2
+ this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.horizontalSpan = 2;
+ this.lstResources.setLayoutData(gd);
+ final org.eclipse.swt.widgets.List finalLst = this.lstResources;
+
+ // update page message first time selected to get rid of initial message by forcing validation
+ this.lstResources.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ // do the very first time to get rid of initial message then remove listener
+ updateInitialMessage();
+ finalLst.removeSelectionListener(this);
+ }
+ });
+
+ // load list with initial files
+ loadFiles();
+ }
+
+ { // row 3
+ final Button chkRecurse = new Button(pnl, SWT.CHECK);
+ chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
+ chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
+ chkRecurse.setSelection(this.recurse);
+ chkRecurse.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleRecurseChanged(chkRecurse.getSelection());
+ }
+ });
+
+ // update page message first time selected to get rid of initial message by forcing validation
+ chkRecurse.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ updateInitialMessage();
+ chkRecurse.removeSelectionListener(this);
+ }
+ });
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl( Composite parent ) {
+ Composite pnlMain = new Composite(parent, SWT.NONE);
+ pnlMain.setLayout(new GridLayout());
+ pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ constructLocationPanel(pnlMain);
+ constructResourcesPanel(pnlMain);
+ setControl(pnlMain);
+
+ // add combobox listeners
+ this.cbxRepository.addModifyListener(this);
+ this.cbxServer.addModifyListener(this);
+ this.cbxWorkspace.addModifyListener(this);
+
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(pnlMain, PUBLISH_DIALOG_HELP_CONTEXT);
+
+ // register to receive server registry events (this will populate the UI)
+ getServerManager().addRegistryListener(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ getServerManager().removeRegistryListener(this);
+ super.dispose();
+ }
+
+ /**
+ * @return the files to publish or unpublish (never <code>null</code>)
+ */
+ public List<IFile> getFiles() {
+ return this.files;
+ }
+
+ /**
+ * Updates the initial page message.
+ */
+ void updateInitialMessage() {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+
+ if (msg.equals(getMessage())) {
+ updateState();
+ }
+ }
+
+ /**
+ * @return the server manager obtained from the wizard
+ */
+ private ServerManager getServerManager() {
+ return ((PublishWizard)getWizard()).getServerManager();
+ }
+
+ /**
+ * @return thw workspace to use when publishing or unpublishing (page must be complete)
+ */
+ public Workspace getWorkspace() {
+ assert isPageComplete();
+ return this.workspace;
+ }
+
+ /**
+ * Saves the recurse setting and reloads the files to be published or unpublished.
+ *
+ * @param selected the flag indicating the new recurse setting
+ */
+ void handleRecurseChanged( boolean selected ) {
+ this.recurse = selected;
+ saveRecurseSetting();
+
+ try {
+ this.files = processResources(this.resources, isRecursing(), filter);
+ loadFiles();
+ } catch (CoreException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+
+ if (getControl().isVisible()) {
+ MessageDialog.openError(getShell(),
+ RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
+ }
+ }
+ }
+
+ /**
+ * Handler for when the repository control value is modified
+ */
+ void handleRepositoryModified() {
+ int index = this.cbxRepository.getSelectionIndex();
+
+ // make sure there is a selection
+ if (index != -1) {
+ this.repository = this.repositories.get(index);
+ }
+
+ // clear loaded workspaces
+ refreshWorkspaces();
+
+ // update page state
+ updateState();
+ }
+
+ /**
+ * Handler for when the server control value is modified
+ */
+ void handleServerModified() {
+ int index = this.cbxServer.getSelectionIndex();
+
+ // make sure there is a selection
+ if (index != -1) {
+ this.server = this.servers.get(index);
+ }
+
+ // need to reload repositories since server changed
+ refreshRepositories();
+
+ // update page state
+ updateState();
+ }
+
+ /**
+ * Handler for when the workspace control value is modified
+ */
+ void handleWorkspaceModified() {
+ int index = this.cbxWorkspace.getSelectionIndex();
+
+ // make sure there is a selection
+ if (index != -1) {
+ this.workspace = this.workspaces.get(index);
+ }
+
+ updateState();
+ }
+
+ /**
+ * @return the flag indicating if resources found recursively under projects and folders should also be published or
+ * unpublished
+ */
+ protected boolean isRecursing() {
+ boolean recurse = true;
+
+ if (getDialogSettings().get(RECURSE_KEY) != null) {
+ recurse = getDialogSettings().getBoolean(RECURSE_KEY);
+ }
+
+ return recurse;
+ }
+
+ /**
+ * Populates the list of files to be published based on the recurse flag and the list of workspace selected resources.
+ * Pre-condition is that {@link #processResources(List, boolean, PublishingFileFilter)} has been called.
+ */
+ private void loadFiles() {
+ this.lstResources.removeAll();
+
+ for (IResource resource : this.files) {
+ this.lstResources.add(resource.getFullPath().toString());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent e ) {
+ if (e.widget == this.cbxServer) {
+ handleServerModified();
+ } else if (e.widget == this.cbxRepository) {
+ handleRepositoryModified();
+ } else if (e.widget == this.cbxRepository) {
+ handleWorkspaceModified();
+ } else {
+ assert false; // should not happen
+ }
+ }
+
+ /**
+ * Refreshes the repository-related fields and controls based on the server registry. This in turn causes the workspaces to
+ * also to be refreshed.
+ */
+ private void refreshRepositories() {
+ this.repository = null;
+
+ if (this.server == null) {
+ this.repositories = Collections.emptyList();
+ } else {
+ try {
+ this.repositories = new ArrayList<Repository>(getServerManager().getRepositories(this.server));
+ } catch (Exception e) {
+ this.repositories = Collections.emptyList();
+ String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server.getShortDescription());
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+
+ if (getControl().isVisible()) {
+ MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(), msg);
+ }
+ }
+ }
+
+ // clear items
+ this.cbxRepository.removeAll();
+
+ // reload
+ if (this.repositories.isEmpty()) {
+ // disable control if necessary
+ if (this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(false);
+ }
+ } else if (this.repositories.size() == 1) {
+ this.repository = this.repositories.get(0);
+ this.cbxRepository.add(this.repository.getName());
+ this.cbxRepository.select(0);
+
+ // enable control if necessary
+ if (!this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(true);
+ }
+ } else {
+ // add an item for each repository
+ for (Repository repository : this.repositories) {
+ this.cbxRepository.add(repository.getName());
+ }
+
+ // enable control if necessary
+ if (!this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(true);
+ }
+ }
+
+ // must reload workspaces
+ refreshWorkspaces();
+ }
+
+ /**
+ * Refreshes the server-related fields and controls based on the server registry. This in turn causes the repositories and
+ * workspaces to also to be refreshed.
+ */
+ void refreshServers() {
+ this.server = null;
+ this.servers = new ArrayList<Server>(getServerManager().getServers());
+
+ // clear server combo
+ this.cbxServer.removeAll();
+
+ if (this.servers.size() == 0) {
+ // disable control if necessary
+ if (this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(false);
+ }
+ } else if (this.servers.size() == 1) {
+ this.server = this.servers.get(0);
+ this.cbxServer.add(this.server.getName());
+ this.cbxServer.select(0);
+
+ // enable control if necessary
+ if (!this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(true);
+ }
+ } else {
+ // add an item for each server
+ for (Server server : this.servers) {
+ this.cbxServer.add(server.getName());
+ }
+
+ // enable control if necessary
+ if (!this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(true);
+ }
+ }
+
+ // must reload repositories
+ refreshRepositories();
+ }
+
+ /**
+ * Refreshes the workspace-related fields and controls based on the server registry.
+ */
+ private void refreshWorkspaces() {
+ this.workspace = null;
+
+ if (this.repository == null) {
+ this.workspaces = Collections.emptyList();
+ } else {
+ try {
+ this.workspaces = new ArrayList<Workspace>(getServerManager().getWorkspaces(this.repository));
+ } catch (Exception e) {
+ this.workspaces = Collections.emptyList();
+ String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text();
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+
+ if (getControl().isVisible()) {
+ MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(), msg);
+ }
+ }
+ }
+
+ // clear items
+ this.cbxWorkspace.removeAll();
+
+ // reload
+ if (this.workspaces.isEmpty()) {
+ // disable control if necessary
+ if (this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(false);
+ }
+ } else if (this.workspaces.size() == 1) {
+ this.workspace = this.workspaces.get(0);
+ this.cbxWorkspace.add(this.workspace.getName());
+ this.cbxWorkspace.select(0);
+
+ // enable control if necessary
+ if (!this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(true);
+ }
+ } else {
+ // add an item for each workspace
+ for (Workspace workspace : this.workspaces) {
+ this.cbxWorkspace.add(workspace.getName());
+ }
+
+ // enable control if necessary
+ if (!this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(true);
+ }
+ }
+ }
+
+ /**
+ * Saves the current recurse value to the wizard <code>IDialogSettings</code>.
+ */
+ protected void saveRecurseSetting() {
+ getDialogSettings().put(RECURSE_KEY, this.recurse);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.IServerRegistryListener#serverRegistryChanged(org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent)
+ */
+ @Override
+ public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
+ // should only be a new server event
+ if (event.isNew()) {
+ refreshServers();
+ updateState();
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
+ @Override
+ public void setVisible( boolean visible ) {
+ super.setVisible(visible);
+
+ if (visible) {
+ // set initial status
+ validate();
+
+ // update OK/Finish button enablement
+ setPageComplete(!this.status.isError());
+
+ // set initial message
+ if (this.status.isOk()) {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ setMessage(msg, IMessageProvider.NONE);
+ } else {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#setWizard(org.eclipse.jface.wizard.IWizard)
+ */
+ @Override
+ public void setWizard( IWizard newWizard ) {
+ super.setWizard(newWizard);
+
+ // need to make sure the wizard has been set on the page since the recurse value is saved in the wizard dialog settings
+ this.recurse = isRecursing();
+
+ try {
+ this.files = processResources(this.resources, this.recurse, this.filter);
+ } catch (CoreException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ }
+ }
+
+ /**
+ * Updates message, message icon, and OK button enablement based on validation results
+ */
+ void updateState() {
+ // get the current state
+ validate();
+
+ // update OK/Finish button enablement
+ setPageComplete(!this.status.isError());
+
+ // update page message
+ if (this.status.isError()) {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ } else {
+ if (this.status.isWarning()) {
+ setMessage(this.status.getMessage(), IMessageProvider.WARNING);
+ } else if (this.status.isInfo()) {
+ setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
+ } else {
+ setMessage(this.status.getMessage(), IMessageProvider.NONE);
+ }
+ }
+ }
+
+ /**
+ * Validates all inputs and sets the validation status.
+ */
+ private void validate() {
+ String msg = null;
+ Severity severity = Severity.ERROR;
+
+ if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
+ : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
+ } else if (this.server == null) {
+ int count = this.cbxServer.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg.text()
+ : RestClientI18n.publishPageMissingServerStatusMsg.text());
+ } else if (this.repository == null) {
+ int count = this.cbxRepository.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text()
+ : RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
+ } else if (this.workspace == null) {
+ int count = this.cbxWorkspace.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text()
+ : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
+ } else {
+ severity = Severity.OK;
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ }
+
+ this.status = new Status(severity, msg, null);
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishWizard.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishWizard.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishWizard.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,150 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.wizards;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_WIZARD_BANNER_IMAGE;
+import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.PublishJob;
+import org.jboss.dna.eclipse.jcr.rest.client.jobs.PublishJob.Type;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>PublishWizard</code> is the wizard that published and unpublishes resources.
+ */
+public final class PublishWizard extends Wizard {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The wizard page containing all the controls that allow publishing/unpublishing of resources.
+ */
+ private final PublishPage page;
+
+ /**
+ * The manager in charge of the server registry.
+ */
+ private final ServerManager serverManager;
+
+ /**
+ * Indicates if the wizard will perform a publishing or unpublishing operation.
+ */
+ private final Type type;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * @param type the publishing or unpublishing indicator (never <code>null</code>)
+ * @param resources the resources being published or unpublished (never <code>null</code>)
+ * @param serverManager the server manager in charge of the server registry (never <code>null</code>)
+ * @throws CoreException if there is a problem processing the resources
+ */
+ public PublishWizard( Type type,
+ List<IResource> resources,
+ ServerManager serverManager ) throws CoreException {
+ CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
+ CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
+
+ this.type = type;
+ this.page = new PublishPage(type, resources);
+ this.serverManager = serverManager;
+
+ setWindowTitle((type == Type.PUBLISH) ? RestClientI18n.publishWizardPublishTitle.text()
+ : RestClientI18n.publishWizardUnpublishTitle.text());
+ setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE));
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ @Override
+ public void addPages() {
+ addPage(this.page);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.Wizard#getDialogSettings()
+ */
+ @Override
+ public IDialogSettings getDialogSettings() {
+ IDialogSettings settings = super.getDialogSettings();
+
+ if (settings == null) {
+ IDialogSettings temp = Activator.getDefault().getDialogSettings();
+ settings = temp.getSection(getClass().getSimpleName());
+
+ if (settings == null) {
+ settings = temp.addNewSection(getClass().getSimpleName());
+ }
+
+ setDialogSettings(settings);
+ }
+
+ return super.getDialogSettings();
+ }
+
+ /**
+ * @return the server manager (never <code>null</code>)
+ */
+ protected ServerManager getServerManager() {
+ return this.serverManager;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ Workspace workspace = this.page.getWorkspace();
+ List<IFile> files = this.page.getFiles();
+ PublishJob job = new PublishJob(this.type, files, workspace);
+ job.schedule();
+
+ return true;
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/PublishWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerPage.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerPage.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerPage.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,494 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.wizards;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.SERVER_DIALOG_HELP_CONTEXT;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.validation.ServerValidator;
+
+/**
+ * The <code>ServerPage</code> is used to create or modify a server.
+ */
+public final class ServerPage extends WizardPage {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * The button used to test the connection to the server. Should only be enabled when server properties are valid.
+ */
+ private Button btnTestConnection;
+
+ /**
+ * The user password needed to login to the server.
+ */
+ private String password;
+
+ /**
+ * Indicates if the password should be persisted.
+ */
+ private boolean savePassword;
+
+ /**
+ * The server being editor or <code>null</code> if creating a new server.
+ */
+ private Server server;
+
+ /**
+ * The current validation status.
+ */
+ private Status status;
+
+ /**
+ * The server URL.
+ */
+ private String url;
+
+ /**
+ * The user needed to login to the server.
+ */
+ private String user;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * Constructs a wizard page that will create a new server.
+ */
+ public ServerPage() {
+ super(ServerPage.class.getSimpleName());
+ setTitle(RestClientI18n.serverPageTitle.text());
+ setPageComplete(false);
+ }
+
+ /**
+ * Constructs a wizard page that edits the specified server's properties.
+ *
+ * @param server the server being edited
+ */
+ public ServerPage( Server server ) {
+ super(ServerPage.class.getSimpleName());
+ setTitle(RestClientI18n.serverPageTitle.text());
+
+ this.server = server;
+ this.url = server.getUrl();
+ this.user = server.getUser();
+ this.password = server.getPassword();
+ this.savePassword = server.isPasswordBeingPersisted();
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ private void constructAuthenticationPanel( Composite parent ) {
+ Group pnl = new Group(parent, SWT.NONE);
+ pnl.setText(RestClientI18n.serverPageAuthenticationGroupTitle.text());
+ pnl.setLayout(new GridLayout(2, false));
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ { // user row
+ Label lblUser = new Label(pnl, SWT.LEFT);
+ lblUser.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblUser.setText(RestClientI18n.serverPageUserLabel.text());
+
+ Text txtUser = new Text(pnl, SWT.BORDER);
+ txtUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ txtUser.setToolTipText(RestClientI18n.serverPageUserToolTip.text());
+
+ // set initial value
+ if (this.user != null) {
+ txtUser.setText(this.user);
+ }
+
+ txtUser.addModifyListener(new ModifyListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent e ) {
+ handleUserModified(((Text)e.widget).getText());
+ }
+ });
+ }
+
+ { // password row
+ Label lblPassword = new Label(pnl, SWT.LEFT);
+ lblPassword.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblPassword.setText(RestClientI18n.serverPagePasswordLabel.text());
+
+ Text txtPassword = new Text(pnl, SWT.BORDER);
+ txtPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ txtPassword.setToolTipText(RestClientI18n.serverPagePasswordToolTip.text());
+ txtPassword.setEchoChar('*');
+
+ // set initial value before hooking up listener
+ if (this.password != null) {
+ txtPassword.setText(this.password);
+ }
+
+ // listener for when value changes
+ txtPassword.addModifyListener(new ModifyListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent e ) {
+ handlePasswordModified(((Text)e.widget).getText());
+ }
+ });
+ }
+
+ { // save button row
+ final Button btn = new Button(pnl, SWT.CHECK | SWT.LEFT);
+ btn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ ((GridData)btn.getLayoutData()).horizontalSpan = 2;
+ btn.setText(RestClientI18n.serverPageSavePasswordButton.text());
+ btn.setToolTipText(RestClientI18n.serverPageSavePasswordToolTip.text());
+
+ // set initial value before hooking up listeners
+ if (this.savePassword) {
+ btn.setSelection(true);
+ }
+
+ // listener for when value changes
+ btn.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleSavePasswordChanged(((Button)e.widget).getSelection());
+ }
+ });
+
+ // update page message first time selected to get rid of initial message by forcing validation
+ btn.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ updateInitialMessage();
+ btn.removeSelectionListener(this);
+ }
+ });
+ }
+
+ { // save password message row
+ Label lblImage = new Label(pnl, SWT.NONE);
+ lblImage.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+ lblImage.setImage(Display.getDefault().getSystemImage(SWT.ICON_INFORMATION));
+
+ StyledText st = new StyledText(pnl, SWT.READ_ONLY | SWT.MULTI | SWT.NO_FOCUS | SWT.WRAP);
+ st.setText(RestClientI18n.serverPageSavePasswordLabel.text());
+ st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ st.setCaret(null);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
+ gd.grabExcessVerticalSpace = false;
+ gd.horizontalIndent = 4;
+ gd.verticalIndent = 8;
+ gd.widthHint = 100;
+ st.setLayoutData(gd);
+ }
+ }
+
+ private void constructTestConnectionPanel( Composite parent ) {
+ Composite pnl = new Composite(parent, SWT.NONE);
+ pnl.setLayout(new GridLayout(2, false));
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label lbl = new Label(pnl, SWT.LEFT);
+ lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lbl.setText(RestClientI18n.serverPageTestConnectionLabel.text());
+
+ this.btnTestConnection = new Button(pnl, SWT.PUSH);
+ this.btnTestConnection.setText(RestClientI18n.serverPageTestConnectionButton.text());
+ this.btnTestConnection.setToolTipText(RestClientI18n.serverPageTestConnectionButtonToolTip.text());
+
+ // add margins to the side of the text
+ GridData gd = new GridData(SWT.LEFT, SWT.CENTER, false, false);
+ int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+ Point minSize = this.btnTestConnection.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
+ gd.widthHint = Math.max(widthHint, minSize.x + 10);
+ this.btnTestConnection.setLayoutData(gd);
+
+ this.btnTestConnection.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleTestConnection();
+ }
+ });
+ }
+
+ private void constructUrlPanel( Composite parent ) {
+ Composite pnl = new Composite(parent, SWT.NONE);
+ pnl.setLayout(new GridLayout(2, false));
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label lblUrl = new Label(pnl, SWT.LEFT);
+ lblUrl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblUrl.setText(RestClientI18n.serverPageUrlLabel.text());
+
+ Text txtUrl = new Text(pnl, SWT.BORDER);
+ txtUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ txtUrl.setToolTipText(RestClientI18n.serverPageUrlToolTip.text());
+
+ // set initial value
+ if (this.url != null) {
+ txtUrl.setText(this.url);
+ }
+
+ txtUrl.addModifyListener(new ModifyListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent e ) {
+ handleUrlModified(((Text)e.widget).getText());
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl( Composite parent ) {
+ Composite pnlMain = new Composite(parent, SWT.NONE);
+ pnlMain.setLayout(new GridLayout());
+ pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ constructUrlPanel(pnlMain);
+ constructAuthenticationPanel(pnlMain);
+ constructTestConnectionPanel(pnlMain);
+ setControl(pnlMain);
+
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(pnlMain, SERVER_DIALOG_HELP_CONTEXT);
+ }
+
+ /**
+ * @return the server represented by the dialog inputs
+ * @throws RuntimeException if called when all inputs are not valid
+ * @see #isPageComplete()
+ */
+ public Server getServer() {
+ if (!this.status.isError()) {
+ return new Server(this.url, this.user, this.password, this.savePassword);
+ }
+
+ // should never be called if error status
+ throw new RuntimeException(RestClientI18n.serverPageInvalidServerProperties.text());
+ }
+
+ /**
+ * @return the server manager obtained from the wizard
+ */
+ ServerManager getServerManager() {
+ return ((ServerWizard)getWizard()).getServerManager();
+ }
+
+ /**
+ * Handler for when the password control value is modified
+ *
+ * @param newPassword the new password value
+ */
+ void handlePasswordModified( String newPassword ) {
+ this.password = newPassword;
+ updateState();
+ }
+
+ /**
+ * @param savePassword <code>true</code> if the password should be persisted on the local file system
+ */
+ void handleSavePasswordChanged( boolean savePassword ) {
+ this.savePassword = savePassword;
+ }
+
+ /**
+ * Tests the connection of the server specified by the properties entered on this page. Precondition is that server properties
+ * are valid.
+ */
+ void handleTestConnection() {
+ final Server server = getServer();
+ final boolean[] success = new boolean[1];
+
+ BusyIndicator.showWhile(null, new Runnable() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ success[0] = getServerManager().ping(server).isOk();
+ }
+ });
+
+ if (success[0]) {
+ MessageDialog.openInformation(getShell(),
+ RestClientI18n.serverPageTestConnectionDialogTitle.text(),
+ RestClientI18n.serverPageTestConnectionDialogSuccessMsg.text());
+ } else {
+ MessageDialog.openError(getShell(),
+ RestClientI18n.serverPageTestConnectionDialogTitle.text(),
+ RestClientI18n.serverPageTestConnectionDialogFailureMsg.text());
+ }
+ }
+
+ /**
+ * Handler for when the URL control value is modified
+ *
+ * @param newUrl the new URL value
+ */
+ void handleUrlModified( String newUrl ) {
+ this.url = newUrl;
+ updateState();
+ }
+
+ /**
+ * Handler for when the user control value is modified
+ *
+ * @param newUser the new user value
+ */
+ void handleUserModified( String newUser ) {
+ this.user = newUser;
+ updateState();
+ }
+
+ /**
+ * If the initial message is being displayed do a validation.
+ */
+ void updateInitialMessage() {
+ if (RestClientI18n.serverPageOkStatusMsg.text().equals(getMessage())) {
+ updateState();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
+ @Override
+ public void setVisible( boolean visible ) {
+ super.setVisible(visible);
+
+ if (visible) {
+ // set initial state
+ validate();
+
+ // set initial message
+ setMessage(RestClientI18n.serverPageOkStatusMsg.text());
+ }
+ }
+
+ /**
+ * Updates message, message icon, and OK button enablement based on validation results
+ */
+ private void updateState() {
+ // get the current status
+ validate();
+
+ // update OK/Finish button and test button enablement
+ setPageComplete(!this.status.isError());
+ this.btnTestConnection.setEnabled(isPageComplete());
+
+ // update message
+ if (this.status.isError()) {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ } else {
+ if (this.status.isWarning()) {
+ setMessage(this.status.getMessage(), IMessageProvider.WARNING);
+ } else if (this.status.isInfo()) {
+ setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
+ } else {
+ setMessage(RestClientI18n.serverPageOkStatusMsg.text());
+ }
+ }
+ }
+
+ /**
+ * Validates all inputs and sets the validation status.
+ */
+ private void validate() {
+ if (this.server == null) {
+ this.status = ServerValidator.isValid(this.url, this.user, this.password, this.savePassword, getServerManager());
+ } else {
+ // make sure all fields are valid without seeing if server exists in registry
+ this.status = ServerValidator.isValid(this.url, this.user, this.password, this.savePassword);
+
+ // if server is valid and is different from what we started with validate and check the registry
+ if (this.status.isOk() && !this.server.hasSameKey(getServer())) {
+ this.status = ServerValidator.isValid(this.url, this.user, this.password, this.savePassword, getServerManager());
+ }
+ }
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerWizard.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerWizard.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerWizard.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,147 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.wizards;
+
+import static org.jboss.dna.eclipse.jcr.rest.client.IUiConstants.DNA_WIZARD_BANNER_IMAGE;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.dna.eclipse.jcr.rest.client.Activator;
+import org.jboss.dna.eclipse.jcr.rest.client.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>ServerWizard</code> is the wizard used to create and edit servers.
+ */
+public final class ServerWizard extends Wizard {
+
+ // ===========================================================================================================================
+ // Fields
+ // ===========================================================================================================================
+
+ /**
+ * Non-<code>null</code> if the wizard is editing an existing server.
+ */
+ private Server existingServer;
+
+ /**
+ * The wizard page containing all the controls that allow editing of server properties.
+ */
+ private final ServerPage page;
+
+ /**
+ * The manager in charge of the server registry.
+ */
+ private final ServerManager serverManager;
+
+ // ===========================================================================================================================
+ // Constructors
+ // ===========================================================================================================================
+
+ /**
+ * Constructs a wizard that creates a new server.
+ *
+ * @param serverManager the server manager in charge of the server registry (never <code>null</code>)
+ */
+ public ServerWizard( ServerManager serverManager ) {
+ this.page = new ServerPage();
+ this.serverManager = serverManager;
+
+ setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE));
+ setWindowTitle(RestClientI18n.serverWizardNewServerTitle.text());
+ }
+
+ /**
+ * Constructs a wizard that edits an existing server.
+ *
+ * @param serverManager the server manager in charge of the server registry (never <code>null</code>)
+ * @param server the server whose properties are being edited (never <code>null</code>)
+ */
+ public ServerWizard( ServerManager serverManager,
+ Server server ) {
+ this.page = new ServerPage(server);
+ this.serverManager = serverManager;
+ this.existingServer = server;
+ setWindowTitle(RestClientI18n.serverWizardEditServerTitle.text());
+ }
+
+ // ===========================================================================================================================
+ // Methods
+ // ===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ @Override
+ public void addPages() {
+ addPage(this.page);
+ }
+
+ /**
+ * @return the server manager (never <code>null</code>)
+ */
+ protected ServerManager getServerManager() {
+ return this.serverManager;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ Status status = Status.OK_STATUS;
+ Server server = this.page.getServer();
+
+ if (this.existingServer == null) {
+ status = this.serverManager.addServer(server);
+
+ if (status.isError()) {
+ MessageDialog.openError(getShell(),
+ RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.serverWizardEditServerErrorMsg.text());
+ }
+ } else if (!this.existingServer.equals(server)) {
+ status = this.serverManager.updateServer(this.existingServer, server);
+
+ if (status.isError()) {
+ MessageDialog.openError(getShell(),
+ RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.serverWizardNewServerErrorMsg.text());
+ }
+ }
+
+ // log if necessary
+ if (!status.isOk()) {
+ Activator.getDefault().log(status);
+ }
+
+ return !status.isError();
+ }
+
+}
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/ServerWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/package-info.java
===================================================================
--- trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/package-info.java (rev 0)
+++ trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/package-info.java 2009-09-24 19:23:00 UTC (rev 1260)
@@ -0,0 +1,28 @@
+/*
+ * JBoss DNA (http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * The JBoss DNA REST Client Eclipse wizards package defines the Eclipse wizards that are needed to publish, unpublish, and manage
+ * the server registry.
+ */
+package org.jboss.dna.eclipse.jcr.rest.client.wizards;
\ No newline at end of file
Property changes on: trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/src/org/jboss/dna/eclipse/jcr/rest/client/wizards/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
DNA SVN: r1259 - trunk/tools.
by dna-commits@lists.jboss.org
Author: elvisisking
Date: 2009-09-24 15:14:18 -0400 (Thu, 24 Sep 2009)
New Revision: 1259
Added:
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.feature/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client.updatesite/
trunk/tools/org.jboss.dna.eclipse.jcr.rest.client/
Log:
Moving from branch eclipse to trunk/tools
14 years, 7 months