From dna-commits at lists.jboss.org  Tue Aug  4 10:58:57 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Tue, 4 Aug 2009 10:58:57 -0400
Subject: [dna-commits] DNA SVN: r1142 - in trunk:
	dna-common/src/main/java/org/jboss/dna/common/util and 6
	other directories.
Message-ID: <200908041458.n74EwvlO027580@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-04 10:58:56 -0400 (Tue, 04 Aug 2009)
New Revision: 1142

Added:
   trunk/dna-common/src/main/java/org/jboss/dna/common/util/MimeTypeUtil.java
   trunk/dna-common/src/main/resources/org/jboss/dna/mime.types
   trunk/dna-common/src/test/java/org/jboss/dna/common/util/MimeTypeUtilTest.java
Removed:
   trunk/dna-graph/src/main/resources/org/jboss/dna/graph/mime.types
Modified:
   trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
   trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/mimetype/ExtensionBasedMimeTypeDetector.java
   trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties
Log:
DNA-497 Moved the functionality of the extension-based MIME type detector into dna-common, as a new MimeTypeUtil class. The ExtensionBasedMimeTypeDetector was changed to reuse (by subclassing) the functionality, but this allows other components that need the filename-based MIME type functionality to rely upon dna-common.

Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java	2009-07-31 16:52:11 UTC (rev 1141)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java	2009-08-04 14:58:56 UTC (rev 1142)
@@ -88,6 +88,7 @@
     public static I18n pathIsNotAbsolute;
     public static I18n pathIsNotRelative;
     public static I18n requiredToSuppliedParameterMismatch;
+    public static I18n unableToAccessResourceFileFromClassLoader;
 
     static {
         try {

Copied: trunk/dna-common/src/main/java/org/jboss/dna/common/util/MimeTypeUtil.java (from rev 1138, trunk/dna-graph/src/main/java/org/jboss/dna/graph/mimetype/ExtensionBasedMimeTypeDetector.java)
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/util/MimeTypeUtil.java	                        (rev 0)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/util/MimeTypeUtil.java	2009-08-04 14:58:56 UTC (rev 1142)
@@ -0,0 +1,237 @@
+/*
+ * 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.common.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.I18n;
+
+/**
+ * A simple utility that determines an appropriate MIME type by matching the extension of the supplied filename against a set of
+ * known file extensions.
+ * <p>
+ * This utility class may be instantiated to create a new instance with its own set of mappings. If desired, the default mappings
+ * will be loaded using the current thread's {@link Thread#getContextClassLoader() context class loader}, and will be loaded from
+ * the <code>/org/jboss/dna/mime.types</code> file located on the classpath. The {@link #load(InputStream, Map)} method may be
+ * used to load custom mappings (in the standard format) into a {@link Map} instance, which can then be passed to one of the
+ * constructors.
+ * </p>
+ */
+ at Immutable
+public class MimeTypeUtil {
+
+    /**
+     * The default location of the properties file containing the extension patterns to MIME types. Value is "{@value} ".
+     */
+    public static final String MIME_TYPE_EXTENSIONS_RESOURCE_PATH = "org/jboss/dna/mime.types";
+
+    /**
+     * The mapping of extension (which includes the leading '.') to MIME type.
+     */
+    private final Map<String, String> mimeTypesByExtension;
+
+    /**
+     * Create a default instance of the extension-based MIME type detector. The set of extension patterns to MIME-types is loaded
+     * from the "org/jboss/dna/mime.types" classpath resource.
+     */
+    public MimeTypeUtil() {
+        this(null, true);
+    }
+
+    /**
+     * Create an instance of the extension-based MIME type detector by using the supplied mappings. The set of extension patterns
+     * to MIME-types is loaded from the "org/jboss/dna/mime.types" classpath resource, but the supplied extension mappings
+     * override any default mappings.
+     * 
+     * @param extensionsToMimeTypes the mapping of extension patterns to MIME types, which will override the default mappings; may
+     *        be null if the default mappings are to be used
+     */
+    public MimeTypeUtil( Map<String, String> extensionsToMimeTypes ) {
+        this(extensionsToMimeTypes, true);
+    }
+
+    /**
+     * Create an instance of the extension-based MIME type detector by using the supplied mappings. If requested, the set of
+     * extension patterns to MIME-types is loaded from the "org/jboss/dna/mime.types" classpath resource and any supplied
+     * extension mappings override any default mappings.
+     * 
+     * @param extensionsToMimeTypes the mapping of extension patterns to MIME types, which will override the default mappings; may
+     *        be null if the default mappings are to be used
+     * @param initWithDefaults true if the default mappings are to be loaded first, or false if the default mappings are not to be
+     *        used at all
+     */
+    public MimeTypeUtil( Map<String, String> extensionsToMimeTypes,
+                         boolean initWithDefaults ) {
+        Map<String, String> mappings = initWithDefaults ? getDefaultMappings() : new HashMap<String, String>();
+        if (extensionsToMimeTypes != null) {
+            for (Map.Entry<String, String> entry : extensionsToMimeTypes.entrySet()) {
+                String extensionString = entry.getKey();
+                if (extensionString == null) continue;
+                // Lowercase, trime, and remove all leading '.' characters ...
+                extensionString = extensionString.toLowerCase().trim().replaceAll("^.+", "");
+                if (extensionString.length() == 0) continue;
+                String mimeType = entry.getValue();
+                if (mimeType == null) continue;
+                mimeType = entry.getValue().trim();
+                if (mimeType.length() == 0) continue;
+                assert extensionString.length() != 0;
+                assert mimeType.length() != 0;
+                mappings.put(extensionString, mimeType);
+            }
+        }
+        // Now put the mappings into the different maps ...
+        Map<String, String> mappingsByAnyCharExtension = new HashMap<String, String>();
+        for (Map.Entry<String, String> entry : mappings.entrySet()) {
+            String extensionString = entry.getKey();
+            String mimeType = entry.getValue();
+            assert extensionString != null;
+            assert extensionString.length() != 0;
+            assert mimeType != null;
+            assert mimeType.length() != 0;
+            mappingsByAnyCharExtension.put("." + extensionString, mimeType);
+        }
+        mimeTypesByExtension = Collections.unmodifiableMap(mappingsByAnyCharExtension);
+    }
+
+    /**
+     * Load the default extensions from {@link #MIME_TYPE_EXTENSIONS_RESOURCE_PATH}, which can either be a property file or a
+     * tab-delimited *nix-style MIME types file (common in web servers and libraries). If an extension applies to more than one
+     * MIME type, the first one in the file wins.
+     * 
+     * @return the default mappings; never null
+     */
+    protected static Map<String, String> getDefaultMappings() {
+        Map<String, Set<String>> duplicates = new HashMap<String, Set<String>>();
+        return load(Thread.currentThread().getContextClassLoader().getResourceAsStream(MIME_TYPE_EXTENSIONS_RESOURCE_PATH),
+                    duplicates);
+    }
+
+    /**
+     * Load the extensions from the supplied stream, which may provide the contents in the format of property file or a
+     * tab-delimited *nix-style MIME types file (common in web servers and libraries). If an extension applies to more than one
+     * MIME type, the first one in the file wins.
+     * 
+     * @param stream the stream containing the content; may not be null
+     * @param duplicateMimeTypesByExtension a map into which any extension should be placed if there are multiple MIME types that
+     *        apply; may be null if this information is not required
+     * @return the default mappings; never null
+     */
+    public static Map<String, String> load( InputStream stream,
+                                            Map<String, Set<String>> duplicateMimeTypesByExtension ) {
+        CheckArg.isNotNull(stream, "stream");
+        // Create a Regex pattern that can be used for each line. This pattern looks for a mime type
+        // (which may contain no whitespace or '=') followed by an optional whitespace, an optional equals sign,
+        // optionally more whitespace, and finally by a string of one or more extensions.
+        Pattern linePattern = Pattern.compile("\\s*([^\\s=]+)\\s*=?\\s*(.*)");
+        List<String> lines = null;
+        try {
+            String content = IoUtil.read(stream);
+            lines = StringUtil.splitLines(content);
+        } catch (IOException e) {
+            I18n msg = CommonI18n.unableToAccessResourceFileFromClassLoader;
+            Logger.getLogger(MimeTypeUtil.class).warn(e, msg, MIME_TYPE_EXTENSIONS_RESOURCE_PATH);
+        }
+        Map<String, String> mimeTypesByExtension = new HashMap<String, String>();
+        if (lines != null) {
+            for (String line : lines) {
+                line = line.trim();
+                if (line.length() == 0 || line.startsWith("#")) continue;
+                // Apply the pattern to each line ...
+                Matcher matcher = linePattern.matcher(line);
+                if (matcher.matches()) {
+                    String mimeType = matcher.group(1).trim().toLowerCase();
+                    String extensions = matcher.group(2).trim().toLowerCase();
+                    if (extensions.length() != 0) {
+                        // A valid mime type with at least one extension was found, so for each extension ...
+                        for (String extensionString : extensions.split("\\s+")) {
+                            extensionString = extensionString.trim();
+                            if (extensionString.length() != 0) {
+                                // Register the extension with the MIME type ...
+                                String existingMimeType = mimeTypesByExtension.put(extensionString, mimeType);
+                                if (existingMimeType != null) {
+                                    // A MIME type already had this extension, so use the first one ...
+                                    mimeTypesByExtension.put(extensionString, existingMimeType);
+                                    if (duplicateMimeTypesByExtension != null) {
+                                        // And record the duplicate ...
+                                        Set<String> dups = duplicateMimeTypesByExtension.get(extensionString);
+                                        if (dups == null) {
+                                            dups = new HashSet<String>();
+                                            duplicateMimeTypesByExtension.put(extensionString, dups);
+                                        }
+                                        dups.add(existingMimeType);
+                                        dups.add(mimeType);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return mimeTypesByExtension;
+    }
+
+    /**
+     * Returns the MIME-type of a file given the supplied name. If the MIME-type cannot be determined, a <code>null</code> is
+     * returned.
+     * 
+     * @param filename the file name; may be <code>null</code>.
+     * @return The MIME-type of the file, or optionally <code>null</code> if the MIME-type could not be determined.
+     */
+    public String mimeTypeOf( String filename ) {
+        if (filename == null || filename.length() == 0) return null;
+        String trimmedName = filename.trim();
+        if (trimmedName.length() == 0) return null;
+
+        // Find the extension ...
+        int indexOfDelimiter = trimmedName.lastIndexOf('.');
+        if (indexOfDelimiter < 1) return null;
+        String extension = trimmedName.substring(indexOfDelimiter).toLowerCase();
+
+        // Look for a match ...
+        return mimeTypesByExtension.get(extension);
+    }
+
+    /**
+     * Returns the MIME-type of the file using its name. If the MIME-type cannot be determined, a <code>null</code> is returned.
+     * 
+     * @param file the file; may be <code>null</code>.
+     * @return The MIME-type of the file, or optionally <code>null</code> if the MIME-type could not be determined.
+     */
+    public String mimeTypeOf( File file ) {
+        if (file == null) return null;
+        return mimeTypeOf(file.getName());
+    }
+}

Modified: trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
===================================================================
--- trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties	2009-07-31 16:52:11 UTC (rev 1141)
+++ trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties	2009-08-04 14:58:56 UTC (rev 1142)
@@ -77,3 +77,4 @@
 pathIsNotAbsolute = The path {0} is not an absolute path
 pathIsNotRelative = The path {0} is not a relative path
 requiredToSuppliedParameterMismatch = {0} parameter{1} supplied, but {2} parameter{3} required: "{4}" => "{5}"
+unableToAccessResourceFileFromClassLoader = Unable to access "{0}" resource from the class loader

Copied: trunk/dna-common/src/main/resources/org/jboss/dna/mime.types (from rev 1138, trunk/dna-graph/src/main/resources/org/jboss/dna/graph/mime.types)
===================================================================
--- trunk/dna-common/src/main/resources/org/jboss/dna/mime.types	                        (rev 0)
+++ trunk/dna-common/src/main/resources/org/jboss/dna/mime.types	2009-08-04 14:58:56 UTC (rev 1142)
@@ -0,0 +1,1226 @@
+# This file defines the Internet media types and extensions.
+# For more information about Internet media types,
+# please read RFC 2045, 2046, 2047, 2048, and 2077.  The Internet media type
+# registry is at <http://www.iana.org/assignments/media-types/>.
+
+# MIME type                 Extensions
+application/activemessage
+application/andrew-inset            ez
+application/applefile
+application/applixware              aw
+application/atom+xml                atom
+application/atomcat+xml             atomcat
+application/atomicmail
+application/atomsvc+xml             atomsvc
+application/auth-policy+xml
+application/batch-smtp
+application/beep+xml
+application/cals-1840
+application/ccxml+xml               ccxml
+application/cea-2018+xml
+application/cellml+xml
+application/cnrp+xml
+application/commonground
+application/conference-info+xml
+application/cpl+xml
+application/csta+xml
+application/cstadata+xml
+application/cu-seeme                cu
+application/cybercash
+application/davmount+xml            davmount
+application/dca-rft
+application/dec-dx
+application/dialog-info+xml
+application/dicom
+application/dns
+application/dvcs
+application/ecmascript              ecma
+application/edi-consent
+application/edi-x12
+application/edifact
+application/emma+xml                emma
+application/epp+xml
+application/epub+zip                epub
+application/eshop
+application/example
+application/fastinfoset
+application/fastsoap
+application/fits
+application/font-tdpfr              pfr
+application/h224
+application/http
+application/hyperstudio             stk
+application/ibe-key-request+xml
+application/ibe-pkg-reply+xml
+application/ibe-pp-data
+application/iges
+application/im-iscomposing+xml
+application/index
+application/index.cmd
+application/index.obj
+application/index.response
+application/index.vnd
+application/iotp
+application/ipp
+application/isup
+application/java-archive            jar
+application/java-serialized-object      ser
+application/java-vm             class
+application/javascript              js
+application/json                json
+application/kpml-request+xml
+application/kpml-response+xml
+application/lost+xml                lostxml
+application/mac-binhex40            hqx
+application/mac-compactpro          cpt
+application/macwriteii
+application/marc                mrc
+application/mathematica             ma nb mb
+application/mathml+xml              mathml
+application/mbms-associated-procedure-description+xml
+application/mbms-deregister+xml
+application/mbms-envelope+xml
+application/mbms-msk+xml
+application/mbms-msk-response+xml
+application/mbms-protection-description+xml
+application/mbms-reception-report+xml
+application/mbms-register+xml
+application/mbms-register-response+xml
+application/mbms-user-service-description+xml
+application/mbox                mbox
+application/media_control+xml
+application/mediaservercontrol+xml      mscml
+application/mikey
+application/moss-keys
+application/moss-signature
+application/mosskey-data
+application/mosskey-request
+application/mp4                 mp4s
+application/mpeg4-generic
+application/mpeg4-iod
+application/mpeg4-iod-xmt
+application/msword              doc dot
+application/mxf                 mxf
+application/nasdata
+application/news-checkgroups
+application/news-groupinfo
+application/news-transmission
+application/nss
+application/ocsp-request
+application/ocsp-response
+application/octet-stream bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc
+application/oda                 oda
+application/oebps-package+xml           opf
+application/ogg                 ogx
+application/onenote             onetoc onetoc2 onetmp onepkg
+application/parityfec
+application/patch-ops-error+xml         xer
+application/pdf                 pdf
+application/pgp-encrypted           pgp
+application/pgp-keys
+application/pgp-signature           asc sig
+application/pics-rules              prf
+application/pidf+xml
+application/pidf-diff+xml
+application/pkcs10              p10
+application/pkcs7-mime              p7m p7c
+application/pkcs7-signature         p7s
+application/pkix-cert               cer
+application/pkix-crl                crl
+application/pkix-pkipath            pkipath
+application/pkixcmp             pki
+application/pls+xml             pls
+application/poc-settings+xml
+application/postscript              ai eps ps
+application/prs.alvestrand.titrax-sheet
+application/prs.cww             cww
+application/prs.nprend
+application/prs.plucker
+application/qsig
+application/rdf+xml             rdf
+application/reginfo+xml             rif
+application/relax-ng-compact-syntax     rnc
+application/remote-printing
+application/resource-lists+xml          rl
+application/resource-lists-diff+xml     rld
+application/riscos
+application/rlmi+xml
+application/rls-services+xml            rs
+application/rsd+xml             rsd
+application/rss+xml             rss
+application/rtf                 rtf
+application/rtx
+application/samlassertion+xml
+application/samlmetadata+xml
+application/sbml+xml                sbml
+application/scvp-cv-request         scq
+application/scvp-cv-response            scs
+application/scvp-vp-request         spq
+application/scvp-vp-response            spp
+application/sdp                 sdp
+application/set-payment
+application/set-payment-initiation      setpay
+application/set-registration
+application/set-registration-initiation     setreg
+application/sgml
+application/sgml-open-catalog
+application/shf+xml             shf
+application/sieve
+application/simple-filter+xml
+application/simple-message-summary
+application/simplesymbolcontainer
+application/slate
+application/smil
+application/smil+xml                smi smil
+application/soap+fastinfoset
+application/soap+xml
+application/sparql-query            rq
+application/sparql-results+xml          srx
+application/spirits-event+xml
+application/srgs                gram
+application/srgs+xml                grxml
+application/ssml+xml                ssml
+application/timestamp-query
+application/timestamp-reply
+application/tve-trigger
+application/ulpfec
+application/vemmi
+application/vividence.scriptfile
+application/vnd.3gpp.bsf+xml
+application/vnd.3gpp.pic-bw-large       plb
+application/vnd.3gpp.pic-bw-small       psb
+application/vnd.3gpp.pic-bw-var         pvb
+application/vnd.3gpp.sms
+application/vnd.3gpp2.bcmcsinfo+xml
+application/vnd.3gpp2.sms
+application/vnd.3gpp2.tcap          tcap
+application/vnd.3m.post-it-notes        pwn
+application/vnd.accpac.simply.aso       aso
+application/vnd.accpac.simply.imp       imp
+application/vnd.acucobol            acu
+application/vnd.acucorp             atc acutc
+application/vnd.adobe.air-application-installer-package+zip air
+application/vnd.adobe.xdp+xml           xdp
+application/vnd.adobe.xfdf          xfdf
+application/vnd.aether.imp
+application/vnd.airzip.filesecure.azf       azf
+application/vnd.airzip.filesecure.azs       azs
+application/vnd.amazon.ebook            azw
+application/vnd.americandynamics.acc        acc
+application/vnd.amiga.ami           ami
+application/vnd.android.package-archive     apk
+application/vnd.anser-web-certificate-issue-initiation  cii
+application/vnd.anser-web-funds-transfer-initiation fti
+application/vnd.antix.game-component        atx
+application/vnd.apple.installer+xml     mpkg
+application/vnd.arastra.swi         swi
+application/vnd.audiograph          aep
+application/vnd.autopackage
+application/vnd.avistar+xml
+application/vnd.blueice.multipass       mpm
+application/vnd.bluetooth.ep.oob
+application/vnd.bmi             bmi
+application/vnd.businessobjects         rep
+application/vnd.cab-jscript
+application/vnd.canon-cpdl
+application/vnd.canon-lips
+application/vnd.cendio.thinlinc.clientconf
+application/vnd.chemdraw+xml            cdxml
+application/vnd.chipnuts.karaoke-mmd        mmd
+application/vnd.cinderella          cdy
+application/vnd.cirpack.isdn-ext
+application/vnd.claymore            cla
+application/vnd.clonk.c4group           c4g c4d c4f c4p c4u
+application/vnd.commerce-battelle
+application/vnd.commonspace         csp cst
+application/vnd.contact.cmsg            cdbcmsg
+application/vnd.cosmocaller         cmc
+application/vnd.crick.clicker           clkx
+application/vnd.crick.clicker.keyboard      clkk
+application/vnd.crick.clicker.palette       clkp
+application/vnd.crick.clicker.template      clkt
+application/vnd.crick.clicker.wordbank      clkw
+application/vnd.criticaltools.wbs+xml       wbs
+application/vnd.ctc-posml           pml
+application/vnd.ctct.ws+xml
+application/vnd.cups-pdf
+application/vnd.cups-postscript
+application/vnd.cups-ppd            ppd
+application/vnd.cups-raster
+application/vnd.cups-raw
+application/vnd.curl.car            car
+application/vnd.curl.pcurl          pcurl
+application/vnd.cybank
+application/vnd.data-vision.rdz         rdz
+application/vnd.denovo.fcselayout-link      fe_launch
+application/vnd.dir-bi.plate-dl-nosuffix
+application/vnd.dna             dna
+application/vnd.dolby.mlp           mlp
+application/vnd.dolby.mobile.1
+application/vnd.dolby.mobile.2
+application/vnd.dpgraph             dpg
+application/vnd.dreamfactory            dfac
+application/vnd.dvb.esgcontainer
+application/vnd.dvb.ipdcdftnotifaccess
+application/vnd.dvb.ipdcesgaccess
+application/vnd.dvb.ipdcroaming
+application/vnd.dvb.iptv.alfec-base
+application/vnd.dvb.iptv.alfec-enhancement
+application/vnd.dvb.notif-aggregate-root+xml
+application/vnd.dvb.notif-container+xml
+application/vnd.dvb.notif-generic+xml
+application/vnd.dvb.notif-ia-msglist+xml
+application/vnd.dvb.notif-ia-registration-request+xml
+application/vnd.dvb.notif-ia-registration-response+xml
+application/vnd.dvb.notif-init+xml
+application/vnd.dxr
+application/vnd.dynageo             geo
+application/vnd.ecdis-update
+application/vnd.ecowin.chart            mag
+application/vnd.ecowin.filerequest
+application/vnd.ecowin.fileupdate
+application/vnd.ecowin.series
+application/vnd.ecowin.seriesrequest
+application/vnd.ecowin.seriesupdate
+application/vnd.emclient.accessrequest+xml
+application/vnd.enliven             nml
+application/vnd.epson.esf           esf
+application/vnd.epson.msf           msf
+application/vnd.epson.quickanime        qam
+application/vnd.epson.salt          slt
+application/vnd.epson.ssf           ssf
+application/vnd.ericsson.quickcall
+application/vnd.eszigno3+xml            es3 et3
+application/vnd.etsi.aoc+xml
+application/vnd.etsi.cug+xml
+application/vnd.etsi.iptvcommand+xml
+application/vnd.etsi.iptvdiscovery+xml
+application/vnd.etsi.iptvprofile+xml
+application/vnd.etsi.iptvsad-bc+xml
+application/vnd.etsi.iptvsad-cod+xml
+application/vnd.etsi.iptvsad-npvr+xml
+application/vnd.etsi.iptvueprofile+xml
+application/vnd.etsi.mcid+xml
+application/vnd.etsi.sci+xml
+application/vnd.etsi.simservs+xml
+application/vnd.eudora.data
+application/vnd.ezpix-album         ez2
+application/vnd.ezpix-package           ez3
+application/vnd.f-secure.mobile
+application/vnd.fdf             fdf
+application/vnd.fdsn.mseed          mseed
+application/vnd.fdsn.seed           seed dataless
+application/vnd.ffsns
+application/vnd.fints
+application/vnd.flographit          gph
+application/vnd.fluxtime.clip           ftc
+application/vnd.font-fontforge-sfd
+application/vnd.framemaker          fm frame maker book
+application/vnd.frogans.fnc         fnc
+application/vnd.frogans.ltf         ltf
+application/vnd.fsc.weblaunch           fsc
+application/vnd.fujitsu.oasys           oas
+application/vnd.fujitsu.oasys2          oa2
+application/vnd.fujitsu.oasys3          oa3
+application/vnd.fujitsu.oasysgp         fg5
+application/vnd.fujitsu.oasysprs        bh2
+application/vnd.fujixerox.art-ex
+application/vnd.fujixerox.art4
+application/vnd.fujixerox.hbpl
+application/vnd.fujixerox.ddd           ddd
+application/vnd.fujixerox.docuworks     xdw
+application/vnd.fujixerox.docuworks.binder  xbd
+application/vnd.fut-misnet
+application/vnd.fuzzysheet          fzs
+application/vnd.genomatix.tuxedo        txd
+application/vnd.geogebra.file           ggb
+application/vnd.geogebra.tool           ggt
+application/vnd.geometry-explorer       gex gre
+application/vnd.gmx             gmx
+application/vnd.google-earth.kml+xml        kml
+application/vnd.google-earth.kmz        kmz
+application/vnd.grafeq              gqf gqs
+application/vnd.gridmp
+application/vnd.groove-account          gac
+application/vnd.groove-help         ghf
+application/vnd.groove-identity-message     gim
+application/vnd.groove-injector         grv
+application/vnd.groove-tool-message     gtm
+application/vnd.groove-tool-template        tpl
+application/vnd.groove-vcard            vcg
+application/vnd.handheld-entertainment+xml  zmm
+application/vnd.hbci                hbci
+application/vnd.hcl-bireports
+application/vnd.hhe.lesson-player       les
+application/vnd.hp-hpgl             hpgl
+application/vnd.hp-hpid             hpid
+application/vnd.hp-hps              hps
+application/vnd.hp-jlyt             jlt
+application/vnd.hp-pcl              pcl
+application/vnd.hp-pclxl            pclxl
+application/vnd.httphone
+application/vnd.hydrostatix.sof-data        sfd-hdstx
+application/vnd.hzn-3d-crossword        x3d
+application/vnd.ibm.afplinedata
+application/vnd.ibm.electronic-media
+application/vnd.ibm.minipay         mpy
+application/vnd.ibm.modcap          afp listafp list3820
+application/vnd.ibm.rights-management       irm
+application/vnd.ibm.secure-container        sc
+application/vnd.iccprofile          icc icm
+application/vnd.igloader            igl
+application/vnd.immervision-ivp         ivp
+application/vnd.immervision-ivu         ivu
+application/vnd.informedcontrol.rms+xml
+application/vnd.informix-visionary
+application/vnd.intercon.formnet        xpw xpx
+application/vnd.intertrust.digibox
+application/vnd.intertrust.nncp
+application/vnd.intu.qbo            qbo
+application/vnd.intu.qfx            qfx
+application/vnd.iptc.g2.conceptitem+xml
+application/vnd.iptc.g2.knowledgeitem+xml
+application/vnd.iptc.g2.newsitem+xml
+application/vnd.iptc.g2.packageitem+xml
+application/vnd.ipunplugged.rcprofile       rcprofile
+application/vnd.irepository.package+xml     irp
+application/vnd.is-xpr              xpr
+application/vnd.jam             jam
+application/vnd.japannet-directory-service
+application/vnd.japannet-jpnstore-wakeup
+application/vnd.japannet-payment-wakeup
+application/vnd.japannet-registration
+application/vnd.japannet-registration-wakeup
+application/vnd.japannet-setstore-wakeup
+application/vnd.japannet-verification
+application/vnd.japannet-verification-wakeup
+application/vnd.jcp.javame.midlet-rms       rms
+application/vnd.jisp                jisp
+application/vnd.joost.joda-archive      joda
+application/vnd.kahootz             ktz ktr
+application/vnd.kde.karbon          karbon
+application/vnd.kde.kchart          chrt
+application/vnd.kde.kformula            kfo
+application/vnd.kde.kivio           flw
+application/vnd.kde.kontour         kon
+application/vnd.kde.kpresenter          kpr kpt
+application/vnd.kde.kspread         ksp
+application/vnd.kde.kword           kwd kwt
+application/vnd.kenameaapp          htke
+application/vnd.kidspiration            kia
+application/vnd.kinar               kne knp
+application/vnd.koan                skp skd skt skm
+application/vnd.kodak-descriptor        sse
+application/vnd.liberty-request+xml
+application/vnd.llamagraphics.life-balance.desktop  lbd
+application/vnd.llamagraphics.life-balance.exchange+xml lbe
+application/vnd.lotus-1-2-3         123
+application/vnd.lotus-approach          apr
+application/vnd.lotus-freelance         pre
+application/vnd.lotus-notes         nsf
+application/vnd.lotus-organizer         org
+application/vnd.lotus-screencam         scm
+application/vnd.lotus-wordpro           lwp
+application/vnd.macports.portpkg        portpkg
+application/vnd.marlin.drm.actiontoken+xml
+application/vnd.marlin.drm.conftoken+xml
+application/vnd.marlin.drm.license+xml
+application/vnd.marlin.drm.mdcf
+application/vnd.mcd             mcd
+application/vnd.medcalcdata         mc1
+application/vnd.mediastation.cdkey      cdkey
+application/vnd.meridian-slingshot
+application/vnd.mfer                mwf
+application/vnd.mfmp                mfm
+application/vnd.micrografx.flo          flo
+application/vnd.micrografx.igx          igx
+application/vnd.mif             mif
+application/vnd.minisoft-hp3000-save
+application/vnd.mitsubishi.misty-guard.trustweb
+application/vnd.mobius.daf          daf
+application/vnd.mobius.dis          dis
+application/vnd.mobius.mbk          mbk
+application/vnd.mobius.mqy          mqy
+application/vnd.mobius.msl          msl
+application/vnd.mobius.plc          plc
+application/vnd.mobius.txf          txf
+application/vnd.mophun.application      mpn
+application/vnd.mophun.certificate      mpc
+application/vnd.motorola.flexsuite
+application/vnd.motorola.flexsuite.adsi
+application/vnd.motorola.flexsuite.fis
+application/vnd.motorola.flexsuite.gotap
+application/vnd.motorola.flexsuite.kmr
+application/vnd.motorola.flexsuite.ttc
+application/vnd.motorola.flexsuite.wem
+application/vnd.motorola.iprm
+application/vnd.mozilla.xul+xml         xul
+application/vnd.ms-artgalry         cil
+application/vnd.ms-asf              asf
+application/vnd.ms-cab-compressed       cab
+application/vnd.ms-excel            xls xlm xla xlc xlt xlw
+application/vnd.ms-excel.addin.macroenabled.12      xlam
+application/vnd.ms-excel.sheet.binary.macroenabled.12   xlsb
+application/vnd.ms-excel.sheet.macroenabled.12      xlsm
+application/vnd.ms-excel.template.macroenabled.12   xltm
+application/vnd.ms-fontobject           eot
+application/vnd.ms-htmlhelp         chm
+application/vnd.ms-ims              ims
+application/vnd.ms-lrm              lrm
+application/vnd.ms-pki.seccat           cat
+application/vnd.ms-pki.stl          stl
+application/vnd.ms-playready.initiator+xml
+application/vnd.ms-powerpoint           ppt pps pot
+application/vnd.ms-powerpoint.addin.macroenabled.12     ppam
+application/vnd.ms-powerpoint.presentation.macroenabled.12  pptm
+application/vnd.ms-powerpoint.slide.macroenabled.12     sldm
+application/vnd.ms-powerpoint.slideshow.macroenabled.12     ppsm
+application/vnd.ms-powerpoint.template.macroenabled.12      potm
+application/vnd.ms-project          mpp mpt
+application/vnd.ms-tnef
+application/vnd.ms-wmdrm.lic-chlg-req
+application/vnd.ms-wmdrm.lic-resp
+application/vnd.ms-wmdrm.meter-chlg-req
+application/vnd.ms-wmdrm.meter-resp
+application/vnd.ms-word.document.macroenabled.12    docm
+application/vnd.ms-word.template.macroenabled.12    dotm
+application/vnd.ms-works            wps wks wcm wdb
+application/vnd.ms-wpl              wpl
+application/vnd.ms-xpsdocument          xps
+application/vnd.mseq                mseq
+application/vnd.msign
+application/vnd.multiad.creator
+application/vnd.multiad.creator.cif
+application/vnd.music-niff
+application/vnd.musician            mus
+application/vnd.muvee.style         msty
+application/vnd.ncd.control
+application/vnd.ncd.reference
+application/vnd.nervana
+application/vnd.netfpx
+application/vnd.neurolanguage.nlu       nlu
+application/vnd.noblenet-directory      nnd
+application/vnd.noblenet-sealer         nns
+application/vnd.noblenet-web            nnw
+application/vnd.nokia.catalogs
+application/vnd.nokia.conml+wbxml
+application/vnd.nokia.conml+xml
+application/vnd.nokia.isds-radio-presets
+application/vnd.nokia.iptv.config+xml
+application/vnd.nokia.landmark+wbxml
+application/vnd.nokia.landmark+xml
+application/vnd.nokia.landmarkcollection+xml
+application/vnd.nokia.n-gage.ac+xml
+application/vnd.nokia.n-gage.data       ngdat
+application/vnd.nokia.n-gage.symbian.install    n-gage
+application/vnd.nokia.ncd
+application/vnd.nokia.pcd+wbxml
+application/vnd.nokia.pcd+xml
+application/vnd.nokia.radio-preset      rpst
+application/vnd.nokia.radio-presets     rpss
+application/vnd.novadigm.edm            edm
+application/vnd.novadigm.edx            edx
+application/vnd.novadigm.ext            ext
+application/vnd.oasis.opendocument.chart        odc
+application/vnd.oasis.opendocument.chart-template   otc
+application/vnd.oasis.opendocument.database     odb
+application/vnd.oasis.opendocument.formula      odf
+application/vnd.oasis.opendocument.formula-template odft
+application/vnd.oasis.opendocument.graphics     odg
+application/vnd.oasis.opendocument.graphics-template    otg
+application/vnd.oasis.opendocument.image        odi
+application/vnd.oasis.opendocument.image-template   oti
+application/vnd.oasis.opendocument.presentation     odp
+application/vnd.oasis.opendocument.presentation-template otp
+application/vnd.oasis.opendocument.spreadsheet      ods
+application/vnd.oasis.opendocument.spreadsheet-template ots
+application/vnd.oasis.opendocument.text         odt
+application/vnd.oasis.opendocument.text-master      otm
+application/vnd.oasis.opendocument.text-template    ott
+application/vnd.oasis.opendocument.text-web     oth
+application/vnd.obn
+application/vnd.olpc-sugar          xo
+application/vnd.oma-scws-config
+application/vnd.oma-scws-http-request
+application/vnd.oma-scws-http-response
+application/vnd.oma.bcast.associated-procedure-parameter+xml
+application/vnd.oma.bcast.drm-trigger+xml
+application/vnd.oma.bcast.imd+xml
+application/vnd.oma.bcast.ltkm
+application/vnd.oma.bcast.notification+xml
+application/vnd.oma.bcast.provisioningtrigger
+application/vnd.oma.bcast.sgboot
+application/vnd.oma.bcast.sgdd+xml
+application/vnd.oma.bcast.sgdu
+application/vnd.oma.bcast.simple-symbol-container
+application/vnd.oma.bcast.smartcard-trigger+xml
+application/vnd.oma.bcast.sprov+xml
+application/vnd.oma.bcast.stkm
+application/vnd.oma.dcd
+application/vnd.oma.dcdc
+application/vnd.oma.dd2+xml         dd2
+application/vnd.oma.drm.risd+xml
+application/vnd.oma.group-usage-list+xml
+application/vnd.oma.poc.detailed-progress-report+xml
+application/vnd.oma.poc.final-report+xml
+application/vnd.oma.poc.groups+xml
+application/vnd.oma.poc.invocation-descriptor+xml
+application/vnd.oma.poc.optimized-progress-report+xml
+application/vnd.oma.xcap-directory+xml
+application/vnd.omads-email+xml
+application/vnd.omads-file+xml
+application/vnd.omads-folder+xml
+application/vnd.omaloc-supl-init
+application/vnd.openofficeorg.extension     oxt
+application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
+application/vnd.openxmlformats-officedocument.presentationml.slide  sldx
+application/vnd.openxmlformats-officedocument.presentationml.slideshow  ppsx
+application/vnd.openxmlformats-officedocument.presentationml.template   potx
+application/vnd.openxmlformats-officedocument.spreadsheetml.sheet   xlsx
+application/vnd.openxmlformats-officedocument.spreadsheetml.template    xltx
+application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
+application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
+application/vnd.osa.netdeploy
+application/vnd.osgi.bundle
+application/vnd.osgi.dp             dp
+application/vnd.otps.ct-kip+xml
+application/vnd.palm                pdb pqa oprc
+application/vnd.paos.xml
+application/vnd.pg.format           str
+application/vnd.pg.osasli           ei6
+application/vnd.piaccess.application-licence
+application/vnd.picsel              efif
+application/vnd.poc.group-advertisement+xml
+application/vnd.pocketlearn         plf
+application/vnd.powerbuilder6           pbd
+application/vnd.powerbuilder6-s
+application/vnd.powerbuilder7
+application/vnd.powerbuilder7-s
+application/vnd.powerbuilder75
+application/vnd.powerbuilder75-s
+application/vnd.preminet
+application/vnd.previewsystems.box      box
+application/vnd.proteus.magazine        mgz
+application/vnd.publishare-delta-tree       qps
+application/vnd.pvi.ptid1           ptid
+application/vnd.pwg-multiplexed
+application/vnd.pwg-xhtml-print+xml
+application/vnd.qualcomm.brew-app-res
+application/vnd.quark.quarkxpress       qxd qxt qwd qwt qxl qxb
+application/vnd.rapid
+application/vnd.recordare.musicxml      mxl
+application/vnd.recordare.musicxml+xml      musicxml
+application/vnd.renlearn.rlprint
+application/vnd.rim.cod             cod
+application/vnd.rn-realmedia            rm
+application/vnd.route66.link66+xml      link66
+application/vnd.ruckus.download
+application/vnd.s3sms
+application/vnd.sbm.cid
+application/vnd.sbm.mid2
+application/vnd.scribus
+application/vnd.sealed.3df
+application/vnd.sealed.csf
+application/vnd.sealed.doc
+application/vnd.sealed.eml
+application/vnd.sealed.mht
+application/vnd.sealed.net
+application/vnd.sealed.ppt
+application/vnd.sealed.tiff
+application/vnd.sealed.xls
+application/vnd.sealedmedia.softseal.html
+application/vnd.sealedmedia.softseal.pdf
+application/vnd.seemail             see
+application/vnd.sema                sema
+application/vnd.semd                semd
+application/vnd.semf                semf
+application/vnd.shana.informed.formdata     ifm
+application/vnd.shana.informed.formtemplate itp
+application/vnd.shana.informed.interchange  iif
+application/vnd.shana.informed.package      ipk
+application/vnd.simtech-mindmapper      twd twds
+application/vnd.smaf                mmf
+application/vnd.smart.teacher           teacher
+application/vnd.software602.filler.form+xml
+application/vnd.software602.filler.form-xml-zip
+application/vnd.solent.sdkm+xml         sdkm sdkd
+application/vnd.spotfire.dxp            dxp
+application/vnd.spotfire.sfs            sfs
+application/vnd.sss-cod
+application/vnd.sss-dtf
+application/vnd.sss-ntf
+application/vnd.stardivision.calc       sdc
+application/vnd.stardivision.draw       sda
+application/vnd.stardivision.impress        sdd
+application/vnd.stardivision.math       smf
+application/vnd.stardivision.writer     sdw
+application/vnd.stardivision.writer     vor
+application/vnd.stardivision.writer-global  sgl
+application/vnd.street-stream
+application/vnd.sun.xml.calc            sxc
+application/vnd.sun.xml.calc.template       stc
+application/vnd.sun.xml.draw            sxd
+application/vnd.sun.xml.draw.template       std
+application/vnd.sun.xml.impress         sxi
+application/vnd.sun.xml.impress.template    sti
+application/vnd.sun.xml.math            sxm
+application/vnd.sun.xml.writer          sxw
+application/vnd.sun.xml.writer.global       sxg
+application/vnd.sun.xml.writer.template     stw
+application/vnd.sun.wadl+xml
+application/vnd.sus-calendar            sus susp
+application/vnd.svd             svd
+application/vnd.swiftview-ics
+application/vnd.symbian.install         sis sisx
+application/vnd.syncml+xml          xsm
+application/vnd.syncml.dm+wbxml         bdm
+application/vnd.syncml.dm+xml           xdm
+application/vnd.syncml.dm.notification
+application/vnd.syncml.ds.notification
+application/vnd.tao.intent-module-archive   tao
+application/vnd.tmobile-livetv          tmo
+application/vnd.trid.tpt            tpt
+application/vnd.triscape.mxs            mxs
+application/vnd.trueapp             tra
+application/vnd.truedoc
+application/vnd.ufdl                ufd ufdl
+application/vnd.uiq.theme           utz
+application/vnd.umajin              umj
+application/vnd.unity               unityweb
+application/vnd.uoml+xml            uoml
+application/vnd.uplanet.alert
+application/vnd.uplanet.alert-wbxml
+application/vnd.uplanet.bearer-choice
+application/vnd.uplanet.bearer-choice-wbxml
+application/vnd.uplanet.cacheop
+application/vnd.uplanet.cacheop-wbxml
+application/vnd.uplanet.channel
+application/vnd.uplanet.channel-wbxml
+application/vnd.uplanet.list
+application/vnd.uplanet.list-wbxml
+application/vnd.uplanet.listcmd
+application/vnd.uplanet.listcmd-wbxml
+application/vnd.uplanet.signal
+application/vnd.vcx             vcx
+application/vnd.vd-study
+application/vnd.vectorworks
+application/vnd.vidsoft.vidconference
+application/vnd.visio               vsd vst vss vsw
+application/vnd.visionary           vis
+application/vnd.vividence.scriptfile
+application/vnd.vsf             vsf
+application/vnd.wap.sic
+application/vnd.wap.slc
+application/vnd.wap.wbxml           wbxml
+application/vnd.wap.wmlc            wmlc
+application/vnd.wap.wmlscriptc          wmlsc
+application/vnd.webturbo            wtb
+application/vnd.wfa.wsc
+application/vnd.wmc
+application/vnd.wmf.bootstrap
+application/vnd.wordperfect         wpd
+application/vnd.wqd             wqd
+application/vnd.wrq-hp3000-labelled
+application/vnd.wt.stf              stf
+application/vnd.wv.csp+wbxml
+application/vnd.wv.csp+xml
+application/vnd.wv.ssp+xml
+application/vnd.xara                xar
+application/vnd.xfdl                xfdl
+application/vnd.xfdl.webform
+application/vnd.xmi+xml
+application/vnd.xmpie.cpkg
+application/vnd.xmpie.dpkg
+application/vnd.xmpie.plan
+application/vnd.xmpie.ppkg
+application/vnd.xmpie.xlim
+application/vnd.yamaha.hv-dic           hvd
+application/vnd.yamaha.hv-script        hvs
+application/vnd.yamaha.hv-voice         hvp
+application/vnd.yamaha.openscoreformat          osf
+application/vnd.yamaha.openscoreformat.osfpvg+xml   osfpvg
+application/vnd.yamaha.smaf-audio       saf
+application/vnd.yamaha.smaf-phrase      spf
+application/vnd.yellowriver-custom-menu     cmp
+application/vnd.zul             zir zirz
+application/vnd.zzazz.deck+xml          zaz
+application/voicexml+xml            vxml
+application/watcherinfo+xml
+application/whoispp-query
+application/whoispp-response
+application/winhlp              hlp
+application/wita
+application/wordperfect5.1
+application/wsdl+xml                wsdl
+application/wspolicy+xml            wspolicy
+application/x-abiword               abw
+application/x-ace-compressed            ace
+application/x-authorware-bin            aab x32 u32 vox
+application/x-authorware-map            aam
+application/x-authorware-seg            aas
+application/x-bcpio             bcpio
+application/x-bittorrent            torrent
+application/x-bzip              bz
+application/x-bzip2             bz2 boz
+application/x-cdlink                vcd
+application/x-chat              chat
+application/x-chess-pgn             pgn
+application/x-compress          Z
+application/x-cpio              cpio
+application/x-csh               csh
+application/x-debian-package            deb udeb
+application/x-director          dir dcr dxr cst cct cxt w3d fgd swa
+application/x-doom              wad
+application/x-dtbncx+xml            ncx
+application/x-dtbook+xml            dtb
+application/x-dtbresource+xml           res
+application/x-dvi               dvi
+application/x-font-bdf              bdf
+application/x-font-dos
+application/x-font-framemaker
+application/x-font-ghostscript          gsf
+application/x-font-libgrx
+application/x-font-linux-psf            psf
+application/x-font-otf              otf
+application/x-font-pcf              pcf
+application/x-font-snf              snf
+application/x-font-speedo
+application/x-font-sunos-news
+application/x-font-ttf              ttf ttc
+application/x-font-type1            pfa pfb pfm afm
+application/x-font-vfont
+application/x-futuresplash          spl
+application/x-gnumeric              gnumeric
+application/x-gtar              gtar
+application/x-gzip
+application/x-hdf               hdf
+application/x-java-jnlp-file            jnlp
+application/x-latex             latex
+application/x-mobipocket-ebook          prc mobi
+application/x-ms-wmd                wmd
+application/x-ms-wmz                wmz
+application/x-msaccess              mdb
+application/x-msbinder              obd
+application/x-mscardfile            crd
+application/x-msclip                clp
+application/x-msdownload            exe dll com bat msi
+application/x-msmediaview           mvb m13 m14
+application/x-msmetafile            wmf
+application/x-msmoney               mny
+application/x-mspublisher           pub
+application/x-msschedule            scd
+application/x-msterminal            trm
+application/x-mswrite               wri
+application/x-netcdf                nc cdf
+application/x-pkcs12                p12 pfx
+application/x-pkcs7-certificates        p7b spc
+application/x-pkcs7-certreqresp         p7r
+application/x-rar-compressed            rar
+application/x-sh                sh
+application/x-shar              shar
+application/x-shockwave-flash           swf
+application/x-stuffit               sit
+application/x-stuffitx              sitx
+application/x-sv4cpio               sv4cpio
+application/x-sv4crc                sv4crc
+application/x-tar               tar
+application/x-tcl               tcl
+application/x-tex               tex
+application/x-tex-tfm               tfm
+application/x-texinfo               texinfo texi
+application/x-ustar             ustar
+application/x-wais-source           src
+application/x-x509-ca-cert          der crt
+application/x-xfig              fig
+application/x-xpinstall             xpi
+application/x400-bp
+application/xcap-att+xml
+application/xcap-caps+xml
+application/xcap-el+xml
+application/xcap-error+xml
+application/xcap-ns+xml
+application/xcon-conference-info-diff+xml
+application/xcon-conference-info+xml
+application/xenc+xml                xenc
+application/xhtml+xml               xhtml xht
+application/xhtml-voice+xml
+application/xml                 xml xsl
+application/xml-dtd             dtd
+application/xml-external-parsed-entity
+application/xmpp+xml
+application/xop+xml             xop
+application/xslt+xml                xslt
+application/xspf+xml                xspf
+application/xv+xml              mxml xhvml xvml xvm
+application/zip                 zip
+audio/32kadpcm
+audio/3gpp
+audio/3gpp2
+audio/ac3
+audio/adpcm                 adp
+audio/amr
+audio/amr-wb
+audio/amr-wb+
+audio/asc
+audio/basic                 au snd
+audio/bv16
+audio/bv32
+audio/clearmode
+audio/cn
+audio/dat12
+audio/dls
+audio/dsr-es201108
+audio/dsr-es202050
+audio/dsr-es202211
+audio/dsr-es202212
+audio/dvi4
+audio/eac3
+audio/evrc
+audio/evrc-qcp
+audio/evrc0
+audio/evrc1
+audio/evrcb
+audio/evrcb0
+audio/evrcb1
+audio/evrcwb
+audio/evrcwb0
+audio/evrcwb1
+audio/example
+audio/g719
+audio/g722
+audio/g7221
+audio/g723
+audio/g726-16
+audio/g726-24
+audio/g726-32
+audio/g726-40
+audio/g728
+audio/g729
+audio/g7291
+audio/g729d
+audio/g729e
+audio/gsm
+audio/gsm-efr
+audio/ilbc
+audio/l16
+audio/l20
+audio/l24
+audio/l8
+audio/lpc
+audio/midi                  mid midi kar rmi
+audio/mobile-xmf
+audio/mp4                   mp4a
+audio/mp4a-latm
+audio/mpa
+audio/mpa-robust
+audio/mpeg                  mpga mp2 mp2a mp3 m2a m3a
+audio/mpeg4-generic
+audio/ogg                   oga ogg spx
+audio/parityfec
+audio/pcma
+audio/pcma-wb
+audio/pcmu-wb
+audio/pcmu
+audio/prs.sid
+audio/qcelp
+audio/red
+audio/rtp-enc-aescm128
+audio/rtp-midi
+audio/rtx
+audio/smv
+audio/smv0
+audio/smv-qcp
+audio/sp-midi
+audio/t140c
+audio/t38
+audio/telephone-event
+audio/tone
+audio/ulpfec
+audio/vdvi
+audio/vmr-wb
+audio/vnd.3gpp.iufp
+audio/vnd.4sb
+audio/vnd.audiokoz
+audio/vnd.celp
+audio/vnd.cisco.nse
+audio/vnd.cmles.radio-events
+audio/vnd.cns.anp1
+audio/vnd.cns.inf1
+audio/vnd.digital-winds             eol
+audio/vnd.dlna.adts
+audio/vnd.dolby.heaac.1
+audio/vnd.dolby.heaac.2
+audio/vnd.dolby.mlp
+audio/vnd.dolby.mps
+audio/vnd.dolby.pl2
+audio/vnd.dolby.pl2x
+audio/vnd.dolby.pl2z
+audio/vnd.dts                   dts
+audio/vnd.dts.hd                dtshd
+audio/vnd.everad.plj
+audio/vnd.hns.audio
+audio/vnd.lucent.voice              lvp
+audio/vnd.ms-playready.media.pya        pya
+audio/vnd.nokia.mobile-xmf
+audio/vnd.nortel.vbk
+audio/vnd.nuera.ecelp4800           ecelp4800
+audio/vnd.nuera.ecelp7470           ecelp7470
+audio/vnd.nuera.ecelp9600           ecelp9600
+audio/vnd.octel.sbc
+audio/vnd.qcelp
+audio/vnd.rhetorex.32kadpcm
+audio/vnd.sealedmedia.softseal.mpeg
+audio/vnd.vmx.cvsd
+audio/vorbis
+audio/vorbis-config
+audio/wav                   wav
+audio/x-aac                 aac
+audio/x-aiff                    aif aiff aifc
+audio/x-mpegurl                 m3u
+audio/x-ms-wax                  wax
+audio/x-ms-wma                  wma
+audio/x-pn-realaudio                ram ra
+audio/x-pn-realaudio-plugin         rmp
+audio/x-wav                 wav
+chemical/x-cdx                  cdx
+chemical/x-cif                  cif
+chemical/x-cmdf                 cmdf
+chemical/x-cml                  cml
+chemical/x-csml                 csml
+chemical/x-pdb                  pdb
+chemical/x-xyz                  xyz
+image/bmp                   bmp
+image/cgm                   cgm
+image/example
+image/fits
+image/g3fax                 g3
+image/gif                   gif
+image/ief                   ief
+image/jp2
+image/jpeg                  jpeg jpg jpe
+image/jpm
+image/jpx
+image/naplps
+image/png                   png
+image/prs.btif                  btif
+image/prs.pti
+image/svg+xml                   svg svgz
+image/t38
+image/tiff                  tiff tif
+image/tiff-fx
+image/vnd.adobe.photoshop           psd
+image/vnd.cns.inf2
+image/vnd.djvu                  djvu djv
+image/vnd.dwg                   dwg
+image/vnd.dxf                   dxf
+image/vnd.fastbidsheet              fbs
+image/vnd.fpx                   fpx
+image/vnd.fst                   fst
+image/vnd.fujixerox.edmics-mmr          mmr
+image/vnd.fujixerox.edmics-rlc          rlc
+image/vnd.globalgraphics.pgb
+image/vnd.microsoft.icon
+image/vnd.mix
+image/vnd.ms-modi               mdi
+image/vnd.net-fpx               npx
+image/vnd.radiance
+image/vnd.sealed.png
+image/vnd.sealedmedia.softseal.gif
+image/vnd.sealedmedia.softseal.jpg
+image/vnd.svf
+image/vnd.wap.wbmp              wbmp
+image/vnd.xiff                  xif
+image/x-cmu-raster              ras
+image/x-cmx                 cmx
+image/x-freehand                fh fhc fh4 fh5 fh7
+image/x-icon                    ico
+image/x-pcx                 pcx
+image/x-pict                    pic pct
+image/x-portable-anymap             pnm
+image/x-portable-bitmap             pbm
+image/x-portable-graymap            pgm
+image/x-portable-pixmap             ppm
+image/x-rgb                 rgb
+image/x-xbitmap                 xbm
+image/x-xpixmap                 xpm
+image/x-xwindowdump             xwd
+message/cpim
+message/delivery-status
+message/disposition-notification
+message/example
+message/external-body
+message/global
+message/global-delivery-status
+message/global-disposition-notification
+message/global-headers
+message/http
+message/imdn+xml
+message/news
+message/partial
+message/rfc822                  eml mime
+message/s-http
+message/sip
+message/sipfrag
+message/tracking-status
+message/vnd.si.simp
+model/example
+model/iges                  igs iges
+model/mesh                  msh mesh silo
+model/vnd.dwf                   dwf
+model/vnd.flatland.3dml
+model/vnd.gdl                   gdl
+model/vnd.gs-gdl
+model/vnd.gs.gdl
+model/vnd.gtw                   gtw
+model/vnd.moml+xml
+model/vnd.mts                   mts
+model/vnd.parasolid.transmit.binary
+model/vnd.parasolid.transmit.text
+model/vnd.vtu                   vtu
+model/vrml                  wrl vrml
+multipart/alternative
+multipart/appledouble
+multipart/byteranges
+multipart/digest
+multipart/encrypted
+multipart/example
+multipart/form-data
+multipart/header-set
+multipart/mixed
+multipart/parallel
+multipart/related
+multipart/report
+multipart/signed
+multipart/voice-message
+text/calendar                   ics ifb
+text/css                    css
+text/csv                    csv
+text/directory
+text/dns
+text/ecmascript
+text/enriched
+text/example
+text/html                   html htm
+text/javascript
+text/parityfec
+text/plain                  txt text conf def list log in
+text/prs.fallenstein.rst
+text/prs.lines.tag              dsc
+text/red
+text/rfc822-headers
+text/richtext                   rtx
+text/rtf
+text/rtp-enc-aescm128
+text/rtx
+text/sgml                   sgml sgm
+text/t140
+text/tab-separated-values           tsv
+text/troff                  t tr roff man me ms
+text/ulpfec
+text/uri-list                   uri uris urls
+text/vnd.abc
+text/vnd.curl                   curl
+text/vnd.curl.dcurl             dcurl
+text/vnd.curl.scurl             scurl
+text/vnd.curl.mcurl             mcurl
+text/vnd.dmclientscript
+text/vnd.esmertec.theme-descriptor
+text/vnd.fly                    fly
+text/vnd.fmi.flexstor               flx
+text/vnd.graphviz               gv
+text/vnd.in3d.3dml              3dml
+text/vnd.in3d.spot              spot
+text/vnd.iptc.newsml
+text/vnd.iptc.nitf
+text/vnd.latex-z
+text/vnd.motorola.reflex
+text/vnd.ms-mediapackage
+text/vnd.net2phone.commcenter.command
+text/vnd.si.uricatalogue
+text/vnd.sun.j2me.app-descriptor        jad
+text/vnd.trolltech.linguist
+text/vnd.wap.si
+text/vnd.wap.sl
+text/vnd.wap.wml                wml
+text/vnd.wap.wmlscript              wmls
+text/x-asm                  s asm
+text/x-c                    c cc cxx cpp h hh dic
+text/x-fortran                  f for f77 f90
+text/x-pascal                   p pas
+text/x-java-source              java
+text/x-setext                   etx
+text/x-uuencode                 uu
+text/x-vcalendar                vcs
+text/x-vcard                    vcf
+text/xml
+text/xml-external-parsed-entity
+video/3gpp                  3gp
+video/3gpp-tt
+video/3gpp2                 3g2
+video/bmpeg
+video/bt656
+video/celb
+video/dv
+video/example
+video/h261                  h261
+video/h263                  h263
+video/h263-1998
+video/h263-2000
+video/h264                  h264
+video/jpeg                  jpgv
+video/jpeg2000
+video/jpm                   jpm jpgm
+video/mj2                   mj2 mjp2
+video/mp1s
+video/mp2p
+video/mp2t
+video/mp4                   mp4 mp4v mpg4
+video/mp4v-es
+video/mpeg                  mpeg mpg mpe m1v m2v
+video/mpeg4-generic
+video/mpv
+video/nv
+video/ogg                   ogv
+video/parityfec
+video/pointer
+video/quicktime                 qt mov
+video/raw
+video/rtp-enc-aescm128
+video/rtx
+video/smpte292m
+video/ulpfec
+video/vc1
+video/vnd.cctv
+video/vnd.dlna.mpeg-tts
+video/vnd.fvt                   fvt
+video/vnd.hns.video
+video/vnd.iptvforum.1dparityfec-1010
+video/vnd.iptvforum.1dparityfec-2005
+video/vnd.iptvforum.2dparityfec-1010
+video/vnd.iptvforum.2dparityfec-2005
+video/vnd.iptvforum.ttsavc
+video/vnd.iptvforum.ttsmpeg2
+video/vnd.motorola.video
+video/vnd.motorola.videop
+video/vnd.mpegurl               mxu m4u
+video/vnd.ms-playready.media.pyv        pyv
+video/vnd.nokia.interleaved-multimedia
+video/vnd.nokia.videovoip
+video/vnd.objectvideo
+video/vnd.sealed.mpeg1
+video/vnd.sealed.mpeg4
+video/vnd.sealed.swf
+video/vnd.sealedmedia.softseal.mov
+video/vnd.vivo                  viv
+video/x-f4v                 f4v
+video/x-fli                 fli
+video/x-flv                 flv
+video/x-m4v                 m4v
+video/x-ms-asf                  asf asx
+video/x-ms-wm                   wm
+video/x-ms-wmv                  wmv
+video/x-ms-wmx                  wmx
+video/x-ms-wvx                  wvx
+video/x-msvideo                 avi
+video/x-sgi-movie               movie
+x-conference/x-cooltalk             ice
\ No newline at end of file

Added: trunk/dna-common/src/test/java/org/jboss/dna/common/util/MimeTypeUtilTest.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/util/MimeTypeUtilTest.java	                        (rev 0)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/util/MimeTypeUtilTest.java	2009-08-04 14:58:56 UTC (rev 1142)
@@ -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.common.util;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.nullValue;
+import static org.junit.Assert.assertThat;
+import java.io.File;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MimeTypeUtilTest {
+
+    private MimeTypeUtil detector;
+
+    @Before
+    public void beforeEach() throws Exception {
+        detector = new MimeTypeUtil();
+    }
+
+    @Test
+    public void shouldFindMimeTypeForExtenionsInStandardPropertiesFile() {
+        assertThat(detector.mimeTypeOf("something.txt"), is("text/plain"));
+    }
+
+    @Test
+    public void shouldFindMimeTypeForOneCharacterExtension() {
+        assertThat(detector.mimeTypeOf("something.gzip.Z"), is("application/x-compress"));
+    }
+
+    @Test
+    public void shouldFindMimeTypeForTwoCharacterExtension() {
+        assertThat(detector.mimeTypeOf("something.sh"), is("application/x-sh"));
+    }
+
+    @Test
+    public void shouldFindMimeTypeForThreeCharacterExtension() {
+        assertThat(detector.mimeTypeOf("something.png"), is("image/png"));
+    }
+
+    @Test
+    public void shouldNotFindMimeTypeForNameWithoutExtension() {
+        assertThat(detector.mimeTypeOf("something"), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotFindMimeTypeForNameUnknownExtension() {
+        assertThat(detector.mimeTypeOf("something.thisExtensionIsNotKnown"), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotFindMimeTypeForZeroLengthName() {
+        assertThat(detector.mimeTypeOf(""), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotFindMimeTypeForNameContainingWhitespace() {
+        assertThat(detector.mimeTypeOf("/t   /n  "), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotFindMimeTypeForNullName() {
+        assertThat(detector.mimeTypeOf((String)null), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotFindMimeTypeForNullFile() {
+        assertThat(detector.mimeTypeOf((File)null), is(nullValue()));
+    }
+
+    @Test
+    public void shouldFindMimeTypeForUppercaseExtenionsInStandardPropertiesFile() {
+        assertThat(detector.mimeTypeOf("something.TXT"), is("text/plain"));
+    }
+
+    @Test
+    public void shouldFindMimeTypeForNameWithTrailingWhitespace() {
+        assertThat(detector.mimeTypeOf("something.txt \t"), is("text/plain"));
+    }
+
+}


Property changes on: trunk/dna-common/src/test/java/org/jboss/dna/common/util/MimeTypeUtilTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java	2009-07-31 16:52:11 UTC (rev 1141)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java	2009-08-04 14:58:56 UTC (rev 1142)
@@ -61,7 +61,6 @@
     public static I18n pathExpressionHasInvalidSelect;
     public static I18n pathExpressionHasInvalidMatch;
     public static I18n messageDigestNotFound;
-    public static I18n unableToAccessResourceFileFromClassLoader;
     public static I18n pathNotFoundExceptionLowestExistingLocationFound;
 
     public static I18n executingRequest;

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/mimetype/ExtensionBasedMimeTypeDetector.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/mimetype/ExtensionBasedMimeTypeDetector.java	2009-07-31 16:52:11 UTC (rev 1141)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/mimetype/ExtensionBasedMimeTypeDetector.java	2009-08-04 14:58:56 UTC (rev 1142)
@@ -23,49 +23,23 @@
  */
 package org.jboss.dna.graph.mimetype;
 
-import java.io.IOException;
 import java.io.InputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import net.jcip.annotations.Immutable;
-import org.jboss.dna.common.i18n.I18n;
-import org.jboss.dna.common.util.CheckArg;
-import org.jboss.dna.common.util.IoUtil;
-import org.jboss.dna.common.util.Logger;
-import org.jboss.dna.common.util.StringUtil;
-import org.jboss.dna.graph.GraphI18n;
+import org.jboss.dna.common.util.MimeTypeUtil;
 
 /**
  * A {@link MimeTypeDetector} that attempts to match the extension of the supplied name against a set of known file extensions.
- * 
- * @author Randall Hauch
  */
 @Immutable
-public class ExtensionBasedMimeTypeDetector implements MimeTypeDetector {
+public class ExtensionBasedMimeTypeDetector extends MimeTypeUtil implements MimeTypeDetector {
 
     /**
-     * The default location of the properties file containing the extension patterns to MIME types. Value is "{@value} ".
-     */
-    public static final String MIME_TYPE_EXTENSIONS_RESOURCE_PATH = "/org/jboss/dna/graph/mime.types";
-    // public static final String MIME_TYPE_EXTENSIONS_RESOURCE_PATH = "/org/jboss/dna/graph/MimeTypes.properties";
-
-    /**
-     * The mapping of extension (which includes the leading '.') to MIME type.
-     */
-    private final Map<String, String> mimeTypesByExtension;
-
-    /**
      * Create a default instance of the extension-based MIME type detector. The set of extension patterns to MIME-types is loaded
      * from the "org/jboss/dna/graph/mime.types" classpath resource.
      */
     public ExtensionBasedMimeTypeDetector() {
-        this(null, true);
+        super();
     }
 
     /**
@@ -77,7 +51,7 @@
      *        be null if the default mappings are to be used
      */
     public ExtensionBasedMimeTypeDetector( Map<String, String> extensionsToMimeTypes ) {
-        this(extensionsToMimeTypes, true);
+        super(extensionsToMimeTypes);
     }
 
     /**
@@ -91,131 +65,16 @@
      */
     public ExtensionBasedMimeTypeDetector( Map<String, String> extensionsToMimeTypes,
                                            boolean initWithDefaults ) {
-        Map<String, String> mappings = getDefaultMappings();
-        if (extensionsToMimeTypes != null) {
-            for (Map.Entry<String, String> entry : extensionsToMimeTypes.entrySet()) {
-                String extensionString = entry.getKey();
-                if (extensionString == null) continue;
-                // Lowercase, trime, and remove all leading '.' characters ...
-                extensionString = extensionString.toLowerCase().trim().replaceAll("^.+", "");
-                if (extensionString.length() == 0) continue;
-                String mimeType = entry.getValue();
-                if (mimeType == null) continue;
-                mimeType = entry.getValue().trim();
-                if (mimeType.length() == 0) continue;
-                assert extensionString.length() != 0;
-                assert mimeType.length() != 0;
-                mappings.put(extensionString, mimeType);
-            }
-        }
-        // Now put the mappings into the different maps ...
-        Map<String, String> mappingsByAnyCharExtension = new HashMap<String, String>();
-        for (Map.Entry<String, String> entry : mappings.entrySet()) {
-            String extensionString = entry.getKey();
-            String mimeType = entry.getValue();
-            assert extensionString != null;
-            assert extensionString.length() != 0;
-            assert mimeType != null;
-            assert mimeType.length() != 0;
-            mappingsByAnyCharExtension.put("." + extensionString, mimeType);
-        }
-        mimeTypesByExtension = Collections.unmodifiableMap(mappingsByAnyCharExtension);
+        super(extensionsToMimeTypes, initWithDefaults);
     }
 
     /**
-     * Load the default extensions from {@link #MIME_TYPE_EXTENSIONS_RESOURCE_PATH}, which can either be a property file or a
-     * tab-delimited *nix-style MIME types file (common in web servers and libraries). If an extension applies to more than one
-     * MIME type, the first one in the file wins.
-     * 
-     * @return the default mappings; never null
-     */
-    protected static Map<String, String> getDefaultMappings() {
-        Map<String, Set<String>> duplicates = new HashMap<String, Set<String>>();
-        return load(ExtensionBasedMimeTypeDetector.class.getResourceAsStream(MIME_TYPE_EXTENSIONS_RESOURCE_PATH), duplicates);
-    }
-
-    /**
-     * Load the default extensions from the supplied stream, which may provide the contents in the format of property file or a
-     * tab-delimited *nix-style MIME types file (common in web servers and libraries). If an extension applies to more than one
-     * MIME type, the first one in the file wins.
-     * 
-     * @param stream the stream containing the content; may not be null
-     * @param duplicateMimeTypesByExtension a map into which any extension should be placed if there are multiple MIME types that
-     *        apply; may be null if this information is not required
-     * @return the default mappings; never null
-     */
-    protected static Map<String, String> load( InputStream stream,
-                                               Map<String, Set<String>> duplicateMimeTypesByExtension ) {
-        CheckArg.isNotNull(stream, "stream");
-        // Create a Regex pattern that can be used for each line. This pattern looks for a mime type
-        // (which may contain no whitespace or '=') followed by an optional whitespace, an optional equals sign,
-        // optionally more whitespace, and finally by a string of one or more extensions.
-        Pattern linePattern = Pattern.compile("\\s*([^\\s=]+)\\s*=?\\s*(.*)");
-        List<String> lines = null;
-        try {
-            String content = IoUtil.read(stream);
-            lines = StringUtil.splitLines(content);
-        } catch (IOException e) {
-            I18n msg = GraphI18n.unableToAccessResourceFileFromClassLoader;
-            Logger.getLogger(ExtensionBasedMimeTypeDetector.class).warn(e, msg, MIME_TYPE_EXTENSIONS_RESOURCE_PATH);
-        }
-        Map<String, String> mimeTypesByExtension = new HashMap<String, String>();
-        if (lines != null) {
-            for (String line : lines) {
-                line = line.trim();
-                if (line.length() == 0 || line.startsWith("#")) continue;
-                // Apply the pattern to each line ...
-                Matcher matcher = linePattern.matcher(line);
-                if (matcher.matches()) {
-                    String mimeType = matcher.group(1).trim().toLowerCase();
-                    String extensions = matcher.group(2).trim().toLowerCase();
-                    if (extensions.length() != 0) {
-                        // A valid mime type with at least one extension was found, so for each extension ...
-                        for (String extensionString : extensions.split("\\s+")) {
-                            extensionString = extensionString.trim();
-                            if (extensionString.length() != 0) {
-                                // Register the extension with the MIME type ...
-                                String existingMimeType = mimeTypesByExtension.put(extensionString, mimeType);
-                                if (existingMimeType != null) {
-                                    // A MIME type already had this extension, so use the first one ...
-                                    mimeTypesByExtension.put(extensionString, existingMimeType);
-                                    if (duplicateMimeTypesByExtension != null) {
-                                        // And record the duplicate ...
-                                        Set<String> dups = duplicateMimeTypesByExtension.get(extensionString);
-                                        if (dups == null) {
-                                            dups = new HashSet<String>();
-                                            duplicateMimeTypesByExtension.put(extensionString, dups);
-                                        }
-                                        dups.add(existingMimeType);
-                                        dups.add(mimeType);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return mimeTypesByExtension;
-    }
-
-    /**
      * {@inheritDoc}
      * 
      * @see org.jboss.dna.graph.mimetype.MimeTypeDetector#mimeTypeOf(java.lang.String, java.io.InputStream)
      */
     public String mimeTypeOf( String name,
                               InputStream content ) {
-        if (name == null || name.length() == 0) return null;
-        String trimmedName = name.trim();
-        if (trimmedName.length() == 0) return null;
-
-        // Find the extension ...
-        int indexOfDelimiter = trimmedName.lastIndexOf('.');
-        if (indexOfDelimiter < 1) return null;
-        String extension = trimmedName.substring(indexOfDelimiter).toLowerCase();
-
-        // Look for a match ...
-        return mimeTypesByExtension.get(extension);
+        return mimeTypeOf(name);
     }
 }

Modified: trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties
===================================================================
--- trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties	2009-07-31 16:52:11 UTC (rev 1141)
+++ trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties	2009-08-04 14:58:56 UTC (rev 1142)
@@ -48,7 +48,6 @@
 pathExpressionHasInvalidSelect = Invalid select expression "{0}" in the path expression "{1}"
 pathExpressionHasInvalidMatch = Invalid match expression "{0}" in the path expression "{1}"
 messageDigestNotFound = The "{0}" message digest algorithm could not be found
-unableToAccessResourceFileFromClassLoader = Unable to access "{0}" resource from the class loader
 pathNotFoundExceptionLowestExistingLocationFound = Unable to find "{0}"; lowest existing path is "{1}"
 
 executingRequest = Executing {0}

Deleted: trunk/dna-graph/src/main/resources/org/jboss/dna/graph/mime.types
===================================================================
--- trunk/dna-graph/src/main/resources/org/jboss/dna/graph/mime.types	2009-07-31 16:52:11 UTC (rev 1141)
+++ trunk/dna-graph/src/main/resources/org/jboss/dna/graph/mime.types	2009-08-04 14:58:56 UTC (rev 1142)
@@ -1,1226 +0,0 @@
-# This file defines the Internet media types and extensions.
-# For more information about Internet media types,
-# please read RFC 2045, 2046, 2047, 2048, and 2077.  The Internet media type
-# registry is at <http://www.iana.org/assignments/media-types/>.
-
-# MIME type                 Extensions
-application/activemessage
-application/andrew-inset            ez
-application/applefile
-application/applixware              aw
-application/atom+xml                atom
-application/atomcat+xml             atomcat
-application/atomicmail
-application/atomsvc+xml             atomsvc
-application/auth-policy+xml
-application/batch-smtp
-application/beep+xml
-application/cals-1840
-application/ccxml+xml               ccxml
-application/cea-2018+xml
-application/cellml+xml
-application/cnrp+xml
-application/commonground
-application/conference-info+xml
-application/cpl+xml
-application/csta+xml
-application/cstadata+xml
-application/cu-seeme                cu
-application/cybercash
-application/davmount+xml            davmount
-application/dca-rft
-application/dec-dx
-application/dialog-info+xml
-application/dicom
-application/dns
-application/dvcs
-application/ecmascript              ecma
-application/edi-consent
-application/edi-x12
-application/edifact
-application/emma+xml                emma
-application/epp+xml
-application/epub+zip                epub
-application/eshop
-application/example
-application/fastinfoset
-application/fastsoap
-application/fits
-application/font-tdpfr              pfr
-application/h224
-application/http
-application/hyperstudio             stk
-application/ibe-key-request+xml
-application/ibe-pkg-reply+xml
-application/ibe-pp-data
-application/iges
-application/im-iscomposing+xml
-application/index
-application/index.cmd
-application/index.obj
-application/index.response
-application/index.vnd
-application/iotp
-application/ipp
-application/isup
-application/java-archive            jar
-application/java-serialized-object      ser
-application/java-vm             class
-application/javascript              js
-application/json                json
-application/kpml-request+xml
-application/kpml-response+xml
-application/lost+xml                lostxml
-application/mac-binhex40            hqx
-application/mac-compactpro          cpt
-application/macwriteii
-application/marc                mrc
-application/mathematica             ma nb mb
-application/mathml+xml              mathml
-application/mbms-associated-procedure-description+xml
-application/mbms-deregister+xml
-application/mbms-envelope+xml
-application/mbms-msk+xml
-application/mbms-msk-response+xml
-application/mbms-protection-description+xml
-application/mbms-reception-report+xml
-application/mbms-register+xml
-application/mbms-register-response+xml
-application/mbms-user-service-description+xml
-application/mbox                mbox
-application/media_control+xml
-application/mediaservercontrol+xml      mscml
-application/mikey
-application/moss-keys
-application/moss-signature
-application/mosskey-data
-application/mosskey-request
-application/mp4                 mp4s
-application/mpeg4-generic
-application/mpeg4-iod
-application/mpeg4-iod-xmt
-application/msword              doc dot
-application/mxf                 mxf
-application/nasdata
-application/news-checkgroups
-application/news-groupinfo
-application/news-transmission
-application/nss
-application/ocsp-request
-application/ocsp-response
-application/octet-stream bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc
-application/oda                 oda
-application/oebps-package+xml           opf
-application/ogg                 ogx
-application/onenote             onetoc onetoc2 onetmp onepkg
-application/parityfec
-application/patch-ops-error+xml         xer
-application/pdf                 pdf
-application/pgp-encrypted           pgp
-application/pgp-keys
-application/pgp-signature           asc sig
-application/pics-rules              prf
-application/pidf+xml
-application/pidf-diff+xml
-application/pkcs10              p10
-application/pkcs7-mime              p7m p7c
-application/pkcs7-signature         p7s
-application/pkix-cert               cer
-application/pkix-crl                crl
-application/pkix-pkipath            pkipath
-application/pkixcmp             pki
-application/pls+xml             pls
-application/poc-settings+xml
-application/postscript              ai eps ps
-application/prs.alvestrand.titrax-sheet
-application/prs.cww             cww
-application/prs.nprend
-application/prs.plucker
-application/qsig
-application/rdf+xml             rdf
-application/reginfo+xml             rif
-application/relax-ng-compact-syntax     rnc
-application/remote-printing
-application/resource-lists+xml          rl
-application/resource-lists-diff+xml     rld
-application/riscos
-application/rlmi+xml
-application/rls-services+xml            rs
-application/rsd+xml             rsd
-application/rss+xml             rss
-application/rtf                 rtf
-application/rtx
-application/samlassertion+xml
-application/samlmetadata+xml
-application/sbml+xml                sbml
-application/scvp-cv-request         scq
-application/scvp-cv-response            scs
-application/scvp-vp-request         spq
-application/scvp-vp-response            spp
-application/sdp                 sdp
-application/set-payment
-application/set-payment-initiation      setpay
-application/set-registration
-application/set-registration-initiation     setreg
-application/sgml
-application/sgml-open-catalog
-application/shf+xml             shf
-application/sieve
-application/simple-filter+xml
-application/simple-message-summary
-application/simplesymbolcontainer
-application/slate
-application/smil
-application/smil+xml                smi smil
-application/soap+fastinfoset
-application/soap+xml
-application/sparql-query            rq
-application/sparql-results+xml          srx
-application/spirits-event+xml
-application/srgs                gram
-application/srgs+xml                grxml
-application/ssml+xml                ssml
-application/timestamp-query
-application/timestamp-reply
-application/tve-trigger
-application/ulpfec
-application/vemmi
-application/vividence.scriptfile
-application/vnd.3gpp.bsf+xml
-application/vnd.3gpp.pic-bw-large       plb
-application/vnd.3gpp.pic-bw-small       psb
-application/vnd.3gpp.pic-bw-var         pvb
-application/vnd.3gpp.sms
-application/vnd.3gpp2.bcmcsinfo+xml
-application/vnd.3gpp2.sms
-application/vnd.3gpp2.tcap          tcap
-application/vnd.3m.post-it-notes        pwn
-application/vnd.accpac.simply.aso       aso
-application/vnd.accpac.simply.imp       imp
-application/vnd.acucobol            acu
-application/vnd.acucorp             atc acutc
-application/vnd.adobe.air-application-installer-package+zip air
-application/vnd.adobe.xdp+xml           xdp
-application/vnd.adobe.xfdf          xfdf
-application/vnd.aether.imp
-application/vnd.airzip.filesecure.azf       azf
-application/vnd.airzip.filesecure.azs       azs
-application/vnd.amazon.ebook            azw
-application/vnd.americandynamics.acc        acc
-application/vnd.amiga.ami           ami
-application/vnd.android.package-archive     apk
-application/vnd.anser-web-certificate-issue-initiation  cii
-application/vnd.anser-web-funds-transfer-initiation fti
-application/vnd.antix.game-component        atx
-application/vnd.apple.installer+xml     mpkg
-application/vnd.arastra.swi         swi
-application/vnd.audiograph          aep
-application/vnd.autopackage
-application/vnd.avistar+xml
-application/vnd.blueice.multipass       mpm
-application/vnd.bluetooth.ep.oob
-application/vnd.bmi             bmi
-application/vnd.businessobjects         rep
-application/vnd.cab-jscript
-application/vnd.canon-cpdl
-application/vnd.canon-lips
-application/vnd.cendio.thinlinc.clientconf
-application/vnd.chemdraw+xml            cdxml
-application/vnd.chipnuts.karaoke-mmd        mmd
-application/vnd.cinderella          cdy
-application/vnd.cirpack.isdn-ext
-application/vnd.claymore            cla
-application/vnd.clonk.c4group           c4g c4d c4f c4p c4u
-application/vnd.commerce-battelle
-application/vnd.commonspace         csp cst
-application/vnd.contact.cmsg            cdbcmsg
-application/vnd.cosmocaller         cmc
-application/vnd.crick.clicker           clkx
-application/vnd.crick.clicker.keyboard      clkk
-application/vnd.crick.clicker.palette       clkp
-application/vnd.crick.clicker.template      clkt
-application/vnd.crick.clicker.wordbank      clkw
-application/vnd.criticaltools.wbs+xml       wbs
-application/vnd.ctc-posml           pml
-application/vnd.ctct.ws+xml
-application/vnd.cups-pdf
-application/vnd.cups-postscript
-application/vnd.cups-ppd            ppd
-application/vnd.cups-raster
-application/vnd.cups-raw
-application/vnd.curl.car            car
-application/vnd.curl.pcurl          pcurl
-application/vnd.cybank
-application/vnd.data-vision.rdz         rdz
-application/vnd.denovo.fcselayout-link      fe_launch
-application/vnd.dir-bi.plate-dl-nosuffix
-application/vnd.dna             dna
-application/vnd.dolby.mlp           mlp
-application/vnd.dolby.mobile.1
-application/vnd.dolby.mobile.2
-application/vnd.dpgraph             dpg
-application/vnd.dreamfactory            dfac
-application/vnd.dvb.esgcontainer
-application/vnd.dvb.ipdcdftnotifaccess
-application/vnd.dvb.ipdcesgaccess
-application/vnd.dvb.ipdcroaming
-application/vnd.dvb.iptv.alfec-base
-application/vnd.dvb.iptv.alfec-enhancement
-application/vnd.dvb.notif-aggregate-root+xml
-application/vnd.dvb.notif-container+xml
-application/vnd.dvb.notif-generic+xml
-application/vnd.dvb.notif-ia-msglist+xml
-application/vnd.dvb.notif-ia-registration-request+xml
-application/vnd.dvb.notif-ia-registration-response+xml
-application/vnd.dvb.notif-init+xml
-application/vnd.dxr
-application/vnd.dynageo             geo
-application/vnd.ecdis-update
-application/vnd.ecowin.chart            mag
-application/vnd.ecowin.filerequest
-application/vnd.ecowin.fileupdate
-application/vnd.ecowin.series
-application/vnd.ecowin.seriesrequest
-application/vnd.ecowin.seriesupdate
-application/vnd.emclient.accessrequest+xml
-application/vnd.enliven             nml
-application/vnd.epson.esf           esf
-application/vnd.epson.msf           msf
-application/vnd.epson.quickanime        qam
-application/vnd.epson.salt          slt
-application/vnd.epson.ssf           ssf
-application/vnd.ericsson.quickcall
-application/vnd.eszigno3+xml            es3 et3
-application/vnd.etsi.aoc+xml
-application/vnd.etsi.cug+xml
-application/vnd.etsi.iptvcommand+xml
-application/vnd.etsi.iptvdiscovery+xml
-application/vnd.etsi.iptvprofile+xml
-application/vnd.etsi.iptvsad-bc+xml
-application/vnd.etsi.iptvsad-cod+xml
-application/vnd.etsi.iptvsad-npvr+xml
-application/vnd.etsi.iptvueprofile+xml
-application/vnd.etsi.mcid+xml
-application/vnd.etsi.sci+xml
-application/vnd.etsi.simservs+xml
-application/vnd.eudora.data
-application/vnd.ezpix-album         ez2
-application/vnd.ezpix-package           ez3
-application/vnd.f-secure.mobile
-application/vnd.fdf             fdf
-application/vnd.fdsn.mseed          mseed
-application/vnd.fdsn.seed           seed dataless
-application/vnd.ffsns
-application/vnd.fints
-application/vnd.flographit          gph
-application/vnd.fluxtime.clip           ftc
-application/vnd.font-fontforge-sfd
-application/vnd.framemaker          fm frame maker book
-application/vnd.frogans.fnc         fnc
-application/vnd.frogans.ltf         ltf
-application/vnd.fsc.weblaunch           fsc
-application/vnd.fujitsu.oasys           oas
-application/vnd.fujitsu.oasys2          oa2
-application/vnd.fujitsu.oasys3          oa3
-application/vnd.fujitsu.oasysgp         fg5
-application/vnd.fujitsu.oasysprs        bh2
-application/vnd.fujixerox.art-ex
-application/vnd.fujixerox.art4
-application/vnd.fujixerox.hbpl
-application/vnd.fujixerox.ddd           ddd
-application/vnd.fujixerox.docuworks     xdw
-application/vnd.fujixerox.docuworks.binder  xbd
-application/vnd.fut-misnet
-application/vnd.fuzzysheet          fzs
-application/vnd.genomatix.tuxedo        txd
-application/vnd.geogebra.file           ggb
-application/vnd.geogebra.tool           ggt
-application/vnd.geometry-explorer       gex gre
-application/vnd.gmx             gmx
-application/vnd.google-earth.kml+xml        kml
-application/vnd.google-earth.kmz        kmz
-application/vnd.grafeq              gqf gqs
-application/vnd.gridmp
-application/vnd.groove-account          gac
-application/vnd.groove-help         ghf
-application/vnd.groove-identity-message     gim
-application/vnd.groove-injector         grv
-application/vnd.groove-tool-message     gtm
-application/vnd.groove-tool-template        tpl
-application/vnd.groove-vcard            vcg
-application/vnd.handheld-entertainment+xml  zmm
-application/vnd.hbci                hbci
-application/vnd.hcl-bireports
-application/vnd.hhe.lesson-player       les
-application/vnd.hp-hpgl             hpgl
-application/vnd.hp-hpid             hpid
-application/vnd.hp-hps              hps
-application/vnd.hp-jlyt             jlt
-application/vnd.hp-pcl              pcl
-application/vnd.hp-pclxl            pclxl
-application/vnd.httphone
-application/vnd.hydrostatix.sof-data        sfd-hdstx
-application/vnd.hzn-3d-crossword        x3d
-application/vnd.ibm.afplinedata
-application/vnd.ibm.electronic-media
-application/vnd.ibm.minipay         mpy
-application/vnd.ibm.modcap          afp listafp list3820
-application/vnd.ibm.rights-management       irm
-application/vnd.ibm.secure-container        sc
-application/vnd.iccprofile          icc icm
-application/vnd.igloader            igl
-application/vnd.immervision-ivp         ivp
-application/vnd.immervision-ivu         ivu
-application/vnd.informedcontrol.rms+xml
-application/vnd.informix-visionary
-application/vnd.intercon.formnet        xpw xpx
-application/vnd.intertrust.digibox
-application/vnd.intertrust.nncp
-application/vnd.intu.qbo            qbo
-application/vnd.intu.qfx            qfx
-application/vnd.iptc.g2.conceptitem+xml
-application/vnd.iptc.g2.knowledgeitem+xml
-application/vnd.iptc.g2.newsitem+xml
-application/vnd.iptc.g2.packageitem+xml
-application/vnd.ipunplugged.rcprofile       rcprofile
-application/vnd.irepository.package+xml     irp
-application/vnd.is-xpr              xpr
-application/vnd.jam             jam
-application/vnd.japannet-directory-service
-application/vnd.japannet-jpnstore-wakeup
-application/vnd.japannet-payment-wakeup
-application/vnd.japannet-registration
-application/vnd.japannet-registration-wakeup
-application/vnd.japannet-setstore-wakeup
-application/vnd.japannet-verification
-application/vnd.japannet-verification-wakeup
-application/vnd.jcp.javame.midlet-rms       rms
-application/vnd.jisp                jisp
-application/vnd.joost.joda-archive      joda
-application/vnd.kahootz             ktz ktr
-application/vnd.kde.karbon          karbon
-application/vnd.kde.kchart          chrt
-application/vnd.kde.kformula            kfo
-application/vnd.kde.kivio           flw
-application/vnd.kde.kontour         kon
-application/vnd.kde.kpresenter          kpr kpt
-application/vnd.kde.kspread         ksp
-application/vnd.kde.kword           kwd kwt
-application/vnd.kenameaapp          htke
-application/vnd.kidspiration            kia
-application/vnd.kinar               kne knp
-application/vnd.koan                skp skd skt skm
-application/vnd.kodak-descriptor        sse
-application/vnd.liberty-request+xml
-application/vnd.llamagraphics.life-balance.desktop  lbd
-application/vnd.llamagraphics.life-balance.exchange+xml lbe
-application/vnd.lotus-1-2-3         123
-application/vnd.lotus-approach          apr
-application/vnd.lotus-freelance         pre
-application/vnd.lotus-notes         nsf
-application/vnd.lotus-organizer         org
-application/vnd.lotus-screencam         scm
-application/vnd.lotus-wordpro           lwp
-application/vnd.macports.portpkg        portpkg
-application/vnd.marlin.drm.actiontoken+xml
-application/vnd.marlin.drm.conftoken+xml
-application/vnd.marlin.drm.license+xml
-application/vnd.marlin.drm.mdcf
-application/vnd.mcd             mcd
-application/vnd.medcalcdata         mc1
-application/vnd.mediastation.cdkey      cdkey
-application/vnd.meridian-slingshot
-application/vnd.mfer                mwf
-application/vnd.mfmp                mfm
-application/vnd.micrografx.flo          flo
-application/vnd.micrografx.igx          igx
-application/vnd.mif             mif
-application/vnd.minisoft-hp3000-save
-application/vnd.mitsubishi.misty-guard.trustweb
-application/vnd.mobius.daf          daf
-application/vnd.mobius.dis          dis
-application/vnd.mobius.mbk          mbk
-application/vnd.mobius.mqy          mqy
-application/vnd.mobius.msl          msl
-application/vnd.mobius.plc          plc
-application/vnd.mobius.txf          txf
-application/vnd.mophun.application      mpn
-application/vnd.mophun.certificate      mpc
-application/vnd.motorola.flexsuite
-application/vnd.motorola.flexsuite.adsi
-application/vnd.motorola.flexsuite.fis
-application/vnd.motorola.flexsuite.gotap
-application/vnd.motorola.flexsuite.kmr
-application/vnd.motorola.flexsuite.ttc
-application/vnd.motorola.flexsuite.wem
-application/vnd.motorola.iprm
-application/vnd.mozilla.xul+xml         xul
-application/vnd.ms-artgalry         cil
-application/vnd.ms-asf              asf
-application/vnd.ms-cab-compressed       cab
-application/vnd.ms-excel            xls xlm xla xlc xlt xlw
-application/vnd.ms-excel.addin.macroenabled.12      xlam
-application/vnd.ms-excel.sheet.binary.macroenabled.12   xlsb
-application/vnd.ms-excel.sheet.macroenabled.12      xlsm
-application/vnd.ms-excel.template.macroenabled.12   xltm
-application/vnd.ms-fontobject           eot
-application/vnd.ms-htmlhelp         chm
-application/vnd.ms-ims              ims
-application/vnd.ms-lrm              lrm
-application/vnd.ms-pki.seccat           cat
-application/vnd.ms-pki.stl          stl
-application/vnd.ms-playready.initiator+xml
-application/vnd.ms-powerpoint           ppt pps pot
-application/vnd.ms-powerpoint.addin.macroenabled.12     ppam
-application/vnd.ms-powerpoint.presentation.macroenabled.12  pptm
-application/vnd.ms-powerpoint.slide.macroenabled.12     sldm
-application/vnd.ms-powerpoint.slideshow.macroenabled.12     ppsm
-application/vnd.ms-powerpoint.template.macroenabled.12      potm
-application/vnd.ms-project          mpp mpt
-application/vnd.ms-tnef
-application/vnd.ms-wmdrm.lic-chlg-req
-application/vnd.ms-wmdrm.lic-resp
-application/vnd.ms-wmdrm.meter-chlg-req
-application/vnd.ms-wmdrm.meter-resp
-application/vnd.ms-word.document.macroenabled.12    docm
-application/vnd.ms-word.template.macroenabled.12    dotm
-application/vnd.ms-works            wps wks wcm wdb
-application/vnd.ms-wpl              wpl
-application/vnd.ms-xpsdocument          xps
-application/vnd.mseq                mseq
-application/vnd.msign
-application/vnd.multiad.creator
-application/vnd.multiad.creator.cif
-application/vnd.music-niff
-application/vnd.musician            mus
-application/vnd.muvee.style         msty
-application/vnd.ncd.control
-application/vnd.ncd.reference
-application/vnd.nervana
-application/vnd.netfpx
-application/vnd.neurolanguage.nlu       nlu
-application/vnd.noblenet-directory      nnd
-application/vnd.noblenet-sealer         nns
-application/vnd.noblenet-web            nnw
-application/vnd.nokia.catalogs
-application/vnd.nokia.conml+wbxml
-application/vnd.nokia.conml+xml
-application/vnd.nokia.isds-radio-presets
-application/vnd.nokia.iptv.config+xml
-application/vnd.nokia.landmark+wbxml
-application/vnd.nokia.landmark+xml
-application/vnd.nokia.landmarkcollection+xml
-application/vnd.nokia.n-gage.ac+xml
-application/vnd.nokia.n-gage.data       ngdat
-application/vnd.nokia.n-gage.symbian.install    n-gage
-application/vnd.nokia.ncd
-application/vnd.nokia.pcd+wbxml
-application/vnd.nokia.pcd+xml
-application/vnd.nokia.radio-preset      rpst
-application/vnd.nokia.radio-presets     rpss
-application/vnd.novadigm.edm            edm
-application/vnd.novadigm.edx            edx
-application/vnd.novadigm.ext            ext
-application/vnd.oasis.opendocument.chart        odc
-application/vnd.oasis.opendocument.chart-template   otc
-application/vnd.oasis.opendocument.database     odb
-application/vnd.oasis.opendocument.formula      odf
-application/vnd.oasis.opendocument.formula-template odft
-application/vnd.oasis.opendocument.graphics     odg
-application/vnd.oasis.opendocument.graphics-template    otg
-application/vnd.oasis.opendocument.image        odi
-application/vnd.oasis.opendocument.image-template   oti
-application/vnd.oasis.opendocument.presentation     odp
-application/vnd.oasis.opendocument.presentation-template otp
-application/vnd.oasis.opendocument.spreadsheet      ods
-application/vnd.oasis.opendocument.spreadsheet-template ots
-application/vnd.oasis.opendocument.text         odt
-application/vnd.oasis.opendocument.text-master      otm
-application/vnd.oasis.opendocument.text-template    ott
-application/vnd.oasis.opendocument.text-web     oth
-application/vnd.obn
-application/vnd.olpc-sugar          xo
-application/vnd.oma-scws-config
-application/vnd.oma-scws-http-request
-application/vnd.oma-scws-http-response
-application/vnd.oma.bcast.associated-procedure-parameter+xml
-application/vnd.oma.bcast.drm-trigger+xml
-application/vnd.oma.bcast.imd+xml
-application/vnd.oma.bcast.ltkm
-application/vnd.oma.bcast.notification+xml
-application/vnd.oma.bcast.provisioningtrigger
-application/vnd.oma.bcast.sgboot
-application/vnd.oma.bcast.sgdd+xml
-application/vnd.oma.bcast.sgdu
-application/vnd.oma.bcast.simple-symbol-container
-application/vnd.oma.bcast.smartcard-trigger+xml
-application/vnd.oma.bcast.sprov+xml
-application/vnd.oma.bcast.stkm
-application/vnd.oma.dcd
-application/vnd.oma.dcdc
-application/vnd.oma.dd2+xml         dd2
-application/vnd.oma.drm.risd+xml
-application/vnd.oma.group-usage-list+xml
-application/vnd.oma.poc.detailed-progress-report+xml
-application/vnd.oma.poc.final-report+xml
-application/vnd.oma.poc.groups+xml
-application/vnd.oma.poc.invocation-descriptor+xml
-application/vnd.oma.poc.optimized-progress-report+xml
-application/vnd.oma.xcap-directory+xml
-application/vnd.omads-email+xml
-application/vnd.omads-file+xml
-application/vnd.omads-folder+xml
-application/vnd.omaloc-supl-init
-application/vnd.openofficeorg.extension     oxt
-application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
-application/vnd.openxmlformats-officedocument.presentationml.slide  sldx
-application/vnd.openxmlformats-officedocument.presentationml.slideshow  ppsx
-application/vnd.openxmlformats-officedocument.presentationml.template   potx
-application/vnd.openxmlformats-officedocument.spreadsheetml.sheet   xlsx
-application/vnd.openxmlformats-officedocument.spreadsheetml.template    xltx
-application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
-application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
-application/vnd.osa.netdeploy
-application/vnd.osgi.bundle
-application/vnd.osgi.dp             dp
-application/vnd.otps.ct-kip+xml
-application/vnd.palm                pdb pqa oprc
-application/vnd.paos.xml
-application/vnd.pg.format           str
-application/vnd.pg.osasli           ei6
-application/vnd.piaccess.application-licence
-application/vnd.picsel              efif
-application/vnd.poc.group-advertisement+xml
-application/vnd.pocketlearn         plf
-application/vnd.powerbuilder6           pbd
-application/vnd.powerbuilder6-s
-application/vnd.powerbuilder7
-application/vnd.powerbuilder7-s
-application/vnd.powerbuilder75
-application/vnd.powerbuilder75-s
-application/vnd.preminet
-application/vnd.previewsystems.box      box
-application/vnd.proteus.magazine        mgz
-application/vnd.publishare-delta-tree       qps
-application/vnd.pvi.ptid1           ptid
-application/vnd.pwg-multiplexed
-application/vnd.pwg-xhtml-print+xml
-application/vnd.qualcomm.brew-app-res
-application/vnd.quark.quarkxpress       qxd qxt qwd qwt qxl qxb
-application/vnd.rapid
-application/vnd.recordare.musicxml      mxl
-application/vnd.recordare.musicxml+xml      musicxml
-application/vnd.renlearn.rlprint
-application/vnd.rim.cod             cod
-application/vnd.rn-realmedia            rm
-application/vnd.route66.link66+xml      link66
-application/vnd.ruckus.download
-application/vnd.s3sms
-application/vnd.sbm.cid
-application/vnd.sbm.mid2
-application/vnd.scribus
-application/vnd.sealed.3df
-application/vnd.sealed.csf
-application/vnd.sealed.doc
-application/vnd.sealed.eml
-application/vnd.sealed.mht
-application/vnd.sealed.net
-application/vnd.sealed.ppt
-application/vnd.sealed.tiff
-application/vnd.sealed.xls
-application/vnd.sealedmedia.softseal.html
-application/vnd.sealedmedia.softseal.pdf
-application/vnd.seemail             see
-application/vnd.sema                sema
-application/vnd.semd                semd
-application/vnd.semf                semf
-application/vnd.shana.informed.formdata     ifm
-application/vnd.shana.informed.formtemplate itp
-application/vnd.shana.informed.interchange  iif
-application/vnd.shana.informed.package      ipk
-application/vnd.simtech-mindmapper      twd twds
-application/vnd.smaf                mmf
-application/vnd.smart.teacher           teacher
-application/vnd.software602.filler.form+xml
-application/vnd.software602.filler.form-xml-zip
-application/vnd.solent.sdkm+xml         sdkm sdkd
-application/vnd.spotfire.dxp            dxp
-application/vnd.spotfire.sfs            sfs
-application/vnd.sss-cod
-application/vnd.sss-dtf
-application/vnd.sss-ntf
-application/vnd.stardivision.calc       sdc
-application/vnd.stardivision.draw       sda
-application/vnd.stardivision.impress        sdd
-application/vnd.stardivision.math       smf
-application/vnd.stardivision.writer     sdw
-application/vnd.stardivision.writer     vor
-application/vnd.stardivision.writer-global  sgl
-application/vnd.street-stream
-application/vnd.sun.xml.calc            sxc
-application/vnd.sun.xml.calc.template       stc
-application/vnd.sun.xml.draw            sxd
-application/vnd.sun.xml.draw.template       std
-application/vnd.sun.xml.impress         sxi
-application/vnd.sun.xml.impress.template    sti
-application/vnd.sun.xml.math            sxm
-application/vnd.sun.xml.writer          sxw
-application/vnd.sun.xml.writer.global       sxg
-application/vnd.sun.xml.writer.template     stw
-application/vnd.sun.wadl+xml
-application/vnd.sus-calendar            sus susp
-application/vnd.svd             svd
-application/vnd.swiftview-ics
-application/vnd.symbian.install         sis sisx
-application/vnd.syncml+xml          xsm
-application/vnd.syncml.dm+wbxml         bdm
-application/vnd.syncml.dm+xml           xdm
-application/vnd.syncml.dm.notification
-application/vnd.syncml.ds.notification
-application/vnd.tao.intent-module-archive   tao
-application/vnd.tmobile-livetv          tmo
-application/vnd.trid.tpt            tpt
-application/vnd.triscape.mxs            mxs
-application/vnd.trueapp             tra
-application/vnd.truedoc
-application/vnd.ufdl                ufd ufdl
-application/vnd.uiq.theme           utz
-application/vnd.umajin              umj
-application/vnd.unity               unityweb
-application/vnd.uoml+xml            uoml
-application/vnd.uplanet.alert
-application/vnd.uplanet.alert-wbxml
-application/vnd.uplanet.bearer-choice
-application/vnd.uplanet.bearer-choice-wbxml
-application/vnd.uplanet.cacheop
-application/vnd.uplanet.cacheop-wbxml
-application/vnd.uplanet.channel
-application/vnd.uplanet.channel-wbxml
-application/vnd.uplanet.list
-application/vnd.uplanet.list-wbxml
-application/vnd.uplanet.listcmd
-application/vnd.uplanet.listcmd-wbxml
-application/vnd.uplanet.signal
-application/vnd.vcx             vcx
-application/vnd.vd-study
-application/vnd.vectorworks
-application/vnd.vidsoft.vidconference
-application/vnd.visio               vsd vst vss vsw
-application/vnd.visionary           vis
-application/vnd.vividence.scriptfile
-application/vnd.vsf             vsf
-application/vnd.wap.sic
-application/vnd.wap.slc
-application/vnd.wap.wbxml           wbxml
-application/vnd.wap.wmlc            wmlc
-application/vnd.wap.wmlscriptc          wmlsc
-application/vnd.webturbo            wtb
-application/vnd.wfa.wsc
-application/vnd.wmc
-application/vnd.wmf.bootstrap
-application/vnd.wordperfect         wpd
-application/vnd.wqd             wqd
-application/vnd.wrq-hp3000-labelled
-application/vnd.wt.stf              stf
-application/vnd.wv.csp+wbxml
-application/vnd.wv.csp+xml
-application/vnd.wv.ssp+xml
-application/vnd.xara                xar
-application/vnd.xfdl                xfdl
-application/vnd.xfdl.webform
-application/vnd.xmi+xml
-application/vnd.xmpie.cpkg
-application/vnd.xmpie.dpkg
-application/vnd.xmpie.plan
-application/vnd.xmpie.ppkg
-application/vnd.xmpie.xlim
-application/vnd.yamaha.hv-dic           hvd
-application/vnd.yamaha.hv-script        hvs
-application/vnd.yamaha.hv-voice         hvp
-application/vnd.yamaha.openscoreformat          osf
-application/vnd.yamaha.openscoreformat.osfpvg+xml   osfpvg
-application/vnd.yamaha.smaf-audio       saf
-application/vnd.yamaha.smaf-phrase      spf
-application/vnd.yellowriver-custom-menu     cmp
-application/vnd.zul             zir zirz
-application/vnd.zzazz.deck+xml          zaz
-application/voicexml+xml            vxml
-application/watcherinfo+xml
-application/whoispp-query
-application/whoispp-response
-application/winhlp              hlp
-application/wita
-application/wordperfect5.1
-application/wsdl+xml                wsdl
-application/wspolicy+xml            wspolicy
-application/x-abiword               abw
-application/x-ace-compressed            ace
-application/x-authorware-bin            aab x32 u32 vox
-application/x-authorware-map            aam
-application/x-authorware-seg            aas
-application/x-bcpio             bcpio
-application/x-bittorrent            torrent
-application/x-bzip              bz
-application/x-bzip2             bz2 boz
-application/x-cdlink                vcd
-application/x-chat              chat
-application/x-chess-pgn             pgn
-application/x-compress          Z
-application/x-cpio              cpio
-application/x-csh               csh
-application/x-debian-package            deb udeb
-application/x-director          dir dcr dxr cst cct cxt w3d fgd swa
-application/x-doom              wad
-application/x-dtbncx+xml            ncx
-application/x-dtbook+xml            dtb
-application/x-dtbresource+xml           res
-application/x-dvi               dvi
-application/x-font-bdf              bdf
-application/x-font-dos
-application/x-font-framemaker
-application/x-font-ghostscript          gsf
-application/x-font-libgrx
-application/x-font-linux-psf            psf
-application/x-font-otf              otf
-application/x-font-pcf              pcf
-application/x-font-snf              snf
-application/x-font-speedo
-application/x-font-sunos-news
-application/x-font-ttf              ttf ttc
-application/x-font-type1            pfa pfb pfm afm
-application/x-font-vfont
-application/x-futuresplash          spl
-application/x-gnumeric              gnumeric
-application/x-gtar              gtar
-application/x-gzip
-application/x-hdf               hdf
-application/x-java-jnlp-file            jnlp
-application/x-latex             latex
-application/x-mobipocket-ebook          prc mobi
-application/x-ms-wmd                wmd
-application/x-ms-wmz                wmz
-application/x-msaccess              mdb
-application/x-msbinder              obd
-application/x-mscardfile            crd
-application/x-msclip                clp
-application/x-msdownload            exe dll com bat msi
-application/x-msmediaview           mvb m13 m14
-application/x-msmetafile            wmf
-application/x-msmoney               mny
-application/x-mspublisher           pub
-application/x-msschedule            scd
-application/x-msterminal            trm
-application/x-mswrite               wri
-application/x-netcdf                nc cdf
-application/x-pkcs12                p12 pfx
-application/x-pkcs7-certificates        p7b spc
-application/x-pkcs7-certreqresp         p7r
-application/x-rar-compressed            rar
-application/x-sh                sh
-application/x-shar              shar
-application/x-shockwave-flash           swf
-application/x-stuffit               sit
-application/x-stuffitx              sitx
-application/x-sv4cpio               sv4cpio
-application/x-sv4crc                sv4crc
-application/x-tar               tar
-application/x-tcl               tcl
-application/x-tex               tex
-application/x-tex-tfm               tfm
-application/x-texinfo               texinfo texi
-application/x-ustar             ustar
-application/x-wais-source           src
-application/x-x509-ca-cert          der crt
-application/x-xfig              fig
-application/x-xpinstall             xpi
-application/x400-bp
-application/xcap-att+xml
-application/xcap-caps+xml
-application/xcap-el+xml
-application/xcap-error+xml
-application/xcap-ns+xml
-application/xcon-conference-info-diff+xml
-application/xcon-conference-info+xml
-application/xenc+xml                xenc
-application/xhtml+xml               xhtml xht
-application/xhtml-voice+xml
-application/xml                 xml xsl
-application/xml-dtd             dtd
-application/xml-external-parsed-entity
-application/xmpp+xml
-application/xop+xml             xop
-application/xslt+xml                xslt
-application/xspf+xml                xspf
-application/xv+xml              mxml xhvml xvml xvm
-application/zip                 zip
-audio/32kadpcm
-audio/3gpp
-audio/3gpp2
-audio/ac3
-audio/adpcm                 adp
-audio/amr
-audio/amr-wb
-audio/amr-wb+
-audio/asc
-audio/basic                 au snd
-audio/bv16
-audio/bv32
-audio/clearmode
-audio/cn
-audio/dat12
-audio/dls
-audio/dsr-es201108
-audio/dsr-es202050
-audio/dsr-es202211
-audio/dsr-es202212
-audio/dvi4
-audio/eac3
-audio/evrc
-audio/evrc-qcp
-audio/evrc0
-audio/evrc1
-audio/evrcb
-audio/evrcb0
-audio/evrcb1
-audio/evrcwb
-audio/evrcwb0
-audio/evrcwb1
-audio/example
-audio/g719
-audio/g722
-audio/g7221
-audio/g723
-audio/g726-16
-audio/g726-24
-audio/g726-32
-audio/g726-40
-audio/g728
-audio/g729
-audio/g7291
-audio/g729d
-audio/g729e
-audio/gsm
-audio/gsm-efr
-audio/ilbc
-audio/l16
-audio/l20
-audio/l24
-audio/l8
-audio/lpc
-audio/midi                  mid midi kar rmi
-audio/mobile-xmf
-audio/mp4                   mp4a
-audio/mp4a-latm
-audio/mpa
-audio/mpa-robust
-audio/mpeg                  mpga mp2 mp2a mp3 m2a m3a
-audio/mpeg4-generic
-audio/ogg                   oga ogg spx
-audio/parityfec
-audio/pcma
-audio/pcma-wb
-audio/pcmu-wb
-audio/pcmu
-audio/prs.sid
-audio/qcelp
-audio/red
-audio/rtp-enc-aescm128
-audio/rtp-midi
-audio/rtx
-audio/smv
-audio/smv0
-audio/smv-qcp
-audio/sp-midi
-audio/t140c
-audio/t38
-audio/telephone-event
-audio/tone
-audio/ulpfec
-audio/vdvi
-audio/vmr-wb
-audio/vnd.3gpp.iufp
-audio/vnd.4sb
-audio/vnd.audiokoz
-audio/vnd.celp
-audio/vnd.cisco.nse
-audio/vnd.cmles.radio-events
-audio/vnd.cns.anp1
-audio/vnd.cns.inf1
-audio/vnd.digital-winds             eol
-audio/vnd.dlna.adts
-audio/vnd.dolby.heaac.1
-audio/vnd.dolby.heaac.2
-audio/vnd.dolby.mlp
-audio/vnd.dolby.mps
-audio/vnd.dolby.pl2
-audio/vnd.dolby.pl2x
-audio/vnd.dolby.pl2z
-audio/vnd.dts                   dts
-audio/vnd.dts.hd                dtshd
-audio/vnd.everad.plj
-audio/vnd.hns.audio
-audio/vnd.lucent.voice              lvp
-audio/vnd.ms-playready.media.pya        pya
-audio/vnd.nokia.mobile-xmf
-audio/vnd.nortel.vbk
-audio/vnd.nuera.ecelp4800           ecelp4800
-audio/vnd.nuera.ecelp7470           ecelp7470
-audio/vnd.nuera.ecelp9600           ecelp9600
-audio/vnd.octel.sbc
-audio/vnd.qcelp
-audio/vnd.rhetorex.32kadpcm
-audio/vnd.sealedmedia.softseal.mpeg
-audio/vnd.vmx.cvsd
-audio/vorbis
-audio/vorbis-config
-audio/wav                   wav
-audio/x-aac                 aac
-audio/x-aiff                    aif aiff aifc
-audio/x-mpegurl                 m3u
-audio/x-ms-wax                  wax
-audio/x-ms-wma                  wma
-audio/x-pn-realaudio                ram ra
-audio/x-pn-realaudio-plugin         rmp
-audio/x-wav                 wav
-chemical/x-cdx                  cdx
-chemical/x-cif                  cif
-chemical/x-cmdf                 cmdf
-chemical/x-cml                  cml
-chemical/x-csml                 csml
-chemical/x-pdb                  pdb
-chemical/x-xyz                  xyz
-image/bmp                   bmp
-image/cgm                   cgm
-image/example
-image/fits
-image/g3fax                 g3
-image/gif                   gif
-image/ief                   ief
-image/jp2
-image/jpeg                  jpeg jpg jpe
-image/jpm
-image/jpx
-image/naplps
-image/png                   png
-image/prs.btif                  btif
-image/prs.pti
-image/svg+xml                   svg svgz
-image/t38
-image/tiff                  tiff tif
-image/tiff-fx
-image/vnd.adobe.photoshop           psd
-image/vnd.cns.inf2
-image/vnd.djvu                  djvu djv
-image/vnd.dwg                   dwg
-image/vnd.dxf                   dxf
-image/vnd.fastbidsheet              fbs
-image/vnd.fpx                   fpx
-image/vnd.fst                   fst
-image/vnd.fujixerox.edmics-mmr          mmr
-image/vnd.fujixerox.edmics-rlc          rlc
-image/vnd.globalgraphics.pgb
-image/vnd.microsoft.icon
-image/vnd.mix
-image/vnd.ms-modi               mdi
-image/vnd.net-fpx               npx
-image/vnd.radiance
-image/vnd.sealed.png
-image/vnd.sealedmedia.softseal.gif
-image/vnd.sealedmedia.softseal.jpg
-image/vnd.svf
-image/vnd.wap.wbmp              wbmp
-image/vnd.xiff                  xif
-image/x-cmu-raster              ras
-image/x-cmx                 cmx
-image/x-freehand                fh fhc fh4 fh5 fh7
-image/x-icon                    ico
-image/x-pcx                 pcx
-image/x-pict                    pic pct
-image/x-portable-anymap             pnm
-image/x-portable-bitmap             pbm
-image/x-portable-graymap            pgm
-image/x-portable-pixmap             ppm
-image/x-rgb                 rgb
-image/x-xbitmap                 xbm
-image/x-xpixmap                 xpm
-image/x-xwindowdump             xwd
-message/cpim
-message/delivery-status
-message/disposition-notification
-message/example
-message/external-body
-message/global
-message/global-delivery-status
-message/global-disposition-notification
-message/global-headers
-message/http
-message/imdn+xml
-message/news
-message/partial
-message/rfc822                  eml mime
-message/s-http
-message/sip
-message/sipfrag
-message/tracking-status
-message/vnd.si.simp
-model/example
-model/iges                  igs iges
-model/mesh                  msh mesh silo
-model/vnd.dwf                   dwf
-model/vnd.flatland.3dml
-model/vnd.gdl                   gdl
-model/vnd.gs-gdl
-model/vnd.gs.gdl
-model/vnd.gtw                   gtw
-model/vnd.moml+xml
-model/vnd.mts                   mts
-model/vnd.parasolid.transmit.binary
-model/vnd.parasolid.transmit.text
-model/vnd.vtu                   vtu
-model/vrml                  wrl vrml
-multipart/alternative
-multipart/appledouble
-multipart/byteranges
-multipart/digest
-multipart/encrypted
-multipart/example
-multipart/form-data
-multipart/header-set
-multipart/mixed
-multipart/parallel
-multipart/related
-multipart/report
-multipart/signed
-multipart/voice-message
-text/calendar                   ics ifb
-text/css                    css
-text/csv                    csv
-text/directory
-text/dns
-text/ecmascript
-text/enriched
-text/example
-text/html                   html htm
-text/javascript
-text/parityfec
-text/plain                  txt text conf def list log in
-text/prs.fallenstein.rst
-text/prs.lines.tag              dsc
-text/red
-text/rfc822-headers
-text/richtext                   rtx
-text/rtf
-text/rtp-enc-aescm128
-text/rtx
-text/sgml                   sgml sgm
-text/t140
-text/tab-separated-values           tsv
-text/troff                  t tr roff man me ms
-text/ulpfec
-text/uri-list                   uri uris urls
-text/vnd.abc
-text/vnd.curl                   curl
-text/vnd.curl.dcurl             dcurl
-text/vnd.curl.scurl             scurl
-text/vnd.curl.mcurl             mcurl
-text/vnd.dmclientscript
-text/vnd.esmertec.theme-descriptor
-text/vnd.fly                    fly
-text/vnd.fmi.flexstor               flx
-text/vnd.graphviz               gv
-text/vnd.in3d.3dml              3dml
-text/vnd.in3d.spot              spot
-text/vnd.iptc.newsml
-text/vnd.iptc.nitf
-text/vnd.latex-z
-text/vnd.motorola.reflex
-text/vnd.ms-mediapackage
-text/vnd.net2phone.commcenter.command
-text/vnd.si.uricatalogue
-text/vnd.sun.j2me.app-descriptor        jad
-text/vnd.trolltech.linguist
-text/vnd.wap.si
-text/vnd.wap.sl
-text/vnd.wap.wml                wml
-text/vnd.wap.wmlscript              wmls
-text/x-asm                  s asm
-text/x-c                    c cc cxx cpp h hh dic
-text/x-fortran                  f for f77 f90
-text/x-pascal                   p pas
-text/x-java-source              java
-text/x-setext                   etx
-text/x-uuencode                 uu
-text/x-vcalendar                vcs
-text/x-vcard                    vcf
-text/xml
-text/xml-external-parsed-entity
-video/3gpp                  3gp
-video/3gpp-tt
-video/3gpp2                 3g2
-video/bmpeg
-video/bt656
-video/celb
-video/dv
-video/example
-video/h261                  h261
-video/h263                  h263
-video/h263-1998
-video/h263-2000
-video/h264                  h264
-video/jpeg                  jpgv
-video/jpeg2000
-video/jpm                   jpm jpgm
-video/mj2                   mj2 mjp2
-video/mp1s
-video/mp2p
-video/mp2t
-video/mp4                   mp4 mp4v mpg4
-video/mp4v-es
-video/mpeg                  mpeg mpg mpe m1v m2v
-video/mpeg4-generic
-video/mpv
-video/nv
-video/ogg                   ogv
-video/parityfec
-video/pointer
-video/quicktime                 qt mov
-video/raw
-video/rtp-enc-aescm128
-video/rtx
-video/smpte292m
-video/ulpfec
-video/vc1
-video/vnd.cctv
-video/vnd.dlna.mpeg-tts
-video/vnd.fvt                   fvt
-video/vnd.hns.video
-video/vnd.iptvforum.1dparityfec-1010
-video/vnd.iptvforum.1dparityfec-2005
-video/vnd.iptvforum.2dparityfec-1010
-video/vnd.iptvforum.2dparityfec-2005
-video/vnd.iptvforum.ttsavc
-video/vnd.iptvforum.ttsmpeg2
-video/vnd.motorola.video
-video/vnd.motorola.videop
-video/vnd.mpegurl               mxu m4u
-video/vnd.ms-playready.media.pyv        pyv
-video/vnd.nokia.interleaved-multimedia
-video/vnd.nokia.videovoip
-video/vnd.objectvideo
-video/vnd.sealed.mpeg1
-video/vnd.sealed.mpeg4
-video/vnd.sealed.swf
-video/vnd.sealedmedia.softseal.mov
-video/vnd.vivo                  viv
-video/x-f4v                 f4v
-video/x-fli                 fli
-video/x-flv                 flv
-video/x-m4v                 m4v
-video/x-ms-asf                  asf asx
-video/x-ms-wm                   wm
-video/x-ms-wmv                  wmv
-video/x-ms-wmx                  wmx
-video/x-ms-wvx                  wvx
-video/x-msvideo                 avi
-video/x-sgi-movie               movie
-x-conference/x-cooltalk             ice
\ No newline at end of file


From dna-commits at lists.jboss.org  Wed Aug  5 09:13:29 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 5 Aug 2009 09:13:29 -0400
Subject: [dna-commits] DNA SVN: r1143 - in trunk:
	docs/examples/gettingstarted and 1 other directories.
Message-ID: <200908051313.n75DDTU7021187@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-05 09:13:29 -0400 (Wed, 05 Aug 2009)
New Revision: 1143

Modified:
   trunk/docs/examples/gettingstarted/pom.xml
   trunk/docs/examples/gettingstarted/repositories/pom.xml
   trunk/pom.xml
Log:
DNA-500 Repositories example throws NoSuchMethodError due to conflicting log4j versions

This issue has been an occasional source of frustration for some time.  But I just noticed that we're quite a few releases behind on the SLF4J library (the latest is 1.5.6, but we're using 1.4.3).  According to http://www.slf4j.org/news.html this TRACE issue appears when using Log4J versions older than 1.2.12 (as demonstrated above), and this was reported and fixed as Bug 68 (http://bugzilla.slf4j.org/show_bug.cgi?id=68) in SLF4J 1.5.1 by having the Log4J adapter class remap TRACE messages as DEBUG messages.

Simply upgrading the SLF4J API and adapter versions to 1.5.1 (or higher) should therefore fix this problem (hopefully once and for all).  Changing the SLF4J API and Log4J adapter to 1.5.6 (the latest) appears to have worked with no regressions, and I was able to successfully run the repositories example using run.sh from target/dna-example-repositories-basic.dir/.

Modified: trunk/docs/examples/gettingstarted/pom.xml
===================================================================
--- trunk/docs/examples/gettingstarted/pom.xml	2009-08-04 14:58:56 UTC (rev 1142)
+++ trunk/docs/examples/gettingstarted/pom.xml	2009-08-05 13:13:29 UTC (rev 1143)
@@ -63,19 +63,19 @@
       </dependency>
       <!-- Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for testing) -->
       <dependency>
-		<groupId>org.slf4j</groupId>
-		<artifactId>slf4j-api</artifactId>
-		<version>1.4.3</version>
+		    <groupId>org.slf4j</groupId>
+		    <artifactId>slf4j-api</artifactId>
+		    <version>1.5.6</version>
       </dependency>
       <dependency>
-		<groupId>org.slf4j</groupId>
-		<artifactId>slf4j-log4j12</artifactId>
-		<version>1.4.3</version>
+		    <groupId>org.slf4j</groupId>
+		    <artifactId>slf4j-log4j12</artifactId>
+		    <version>1.5.6</version>
       </dependency>
 	   <dependency>
-		<groupId>log4j</groupId>
-		<artifactId>log4j</artifactId>
-		<version>1.2.14</version>
+		    <groupId>log4j</groupId>
+		    <artifactId>log4j</artifactId>
+		    <version>1.2.14</version>
       </dependency>
       <!-- Java Content Repository API -->
       <dependency>

Modified: trunk/docs/examples/gettingstarted/repositories/pom.xml
===================================================================
--- trunk/docs/examples/gettingstarted/repositories/pom.xml	2009-08-04 14:58:56 UTC (rev 1142)
+++ trunk/docs/examples/gettingstarted/repositories/pom.xml	2009-08-05 13:13:29 UTC (rev 1143)
@@ -35,7 +35,7 @@
       <scope>runtime</scope>
     </dependency>
     <!-- 
-    Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for testing) 
+    Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for running) 
     -->
     <dependency>
       <groupId>org.slf4j</groupId>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2009-08-04 14:58:56 UTC (rev 1142)
+++ trunk/pom.xml	2009-08-05 13:13:29 UTC (rev 1143)
@@ -541,13 +541,13 @@
 			<dependency>
 				<groupId>org.slf4j</groupId>
 				<artifactId>slf4j-api</artifactId>
-				<version>1.4.3</version>
+				<version>1.5.6</version>
 				<scope>compile</scope>
 			</dependency>
 			<dependency>
 				<groupId>org.slf4j</groupId>
 				<artifactId>slf4j-log4j12</artifactId>
-				<version>1.4.3</version>
+				<version>1.5.6</version>
 				<scope>test</scope>
 			</dependency>
 			<dependency>


From dna-commits at lists.jboss.org  Wed Aug  5 10:45:38 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 5 Aug 2009 10:45:38 -0400
Subject: [dna-commits] DNA SVN: r1144 - in trunk:
	dna-integration-tests/src/test/resources/tck/filesystem and 4
	other directories.
Message-ID: <200908051445.n75EjcwI004654@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-05 10:45:38 -0400 (Wed, 05 Aug 2009)
New Revision: 1144

Added:
   trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
Removed:
   trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorNotWritableTest.java
Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaIntLexicon.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java
   trunk/dna-integration-tests/src/test/resources/tck/filesystem/configRepository.xml
   trunk/dna-integration-tests/src/test/resources/tck/filesystem/repositoryOverlay.properties
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DnaIntLexicon.java
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemConnection.java
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemI18n.java
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java
   trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties
Log:
DNA-269 Add update support to the File System connector

Committed patch that implements a writable file system connector. The write capabilities have some limits. Node ordering and same-name siblings are not supported. Namespaces for paths (other than the default, empty namespace) are not permitted. Primary types other than nt:folder, nt:file, dna:resource, and jcr:resource are not permitted. Files with primary type jcr:resource are effectively converted to files of type dna:resource since references are not permitted and nt:resource has mix:referenceable as a supertype.

The concept of a maximum path length (FileSystemSource#maxPathLength) was added to limit the maximum length of the file path of any node that was created. This came about after I wrote a deeply nested graph to my local filesystem and then found out that Windows won't let me delete extremely long paths. I defaulted this value to 255 characters, but some research is needed to determine the correct length for Windows and other operating systems.

Because of all of the limitations (no arbitrary properties, no namespaces, no node ordering, no SNS), the canonical writable connector tests don't really pass, so I added a bespoke test suite for the writable capabilities of the connector. I tried to make it as inclusive as I could, but other test cases are always welcome.

Also added patch from DNA-499 (Thanks, Torkjel!)


Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaIntLexicon.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaIntLexicon.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaIntLexicon.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -23,7 +23,10 @@
  */
 package org.jboss.dna.graph;
 
+import org.jboss.dna.graph.property.Name;
+import org.jboss.dna.graph.property.basic.BasicName;
 
+
 /**
  * A lexicon of internal and implementation-specific information
  */
@@ -33,4 +36,7 @@
         public static final String URI = "http://www.jboss.org/dna/internal/1.0";
         public static final String PREFIX = "dnaint";
     }
+    
+    public static final Name NODE_DEFINITON = new BasicName(Namespace.URI, "nodeDefinition");
+    
 }

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -4225,6 +4225,15 @@
          * @return the interface for additional requests or actions
          */
         Next as( Name newName );
+        
+        /**
+         * Finish the request by specifying the name of the new child node. This method indicates that the child should be added
+         * as a new node with the given name at the end of the parents children
+         * 
+         * @param newName the new name
+         * @return the interface for additional requests or actions
+         */
+        Next as( String newName );        
     }
 
     /**
@@ -6473,8 +6482,13 @@
                             return source.submit(workspaceName, from, intoWorkspaceName, into, name, null, removeExisting);
                         }
                     };
+
                 }
 
+                public Into<WithUuids<T>> as( final String name ) {
+                    return as(context.getValueFactories().getNameFactory().create(name));
+                }
+
                 public Into<WithUuids<T>> as( final Segment segment ) {
                     return new CloneTargetAction<T>(afterConjunction(), source) {
                         @Override

Modified: trunk/dna-integration-tests/src/test/resources/tck/filesystem/configRepository.xml
===================================================================
--- trunk/dna-integration-tests/src/test/resources/tck/filesystem/configRepository.xml	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/dna-integration-tests/src/test/resources/tck/filesystem/configRepository.xml	2009-08-05 14:45:38 UTC (rev 1144)
@@ -41,6 +41,8 @@
         	dna:defaultWorkspaceName="defaultWorkspace"
         	dna:predefinedWorkspaceNames="otherWorkspace"
         	dna:creatingWorkspacesAllowed="false"
+        	dna:updatesAllowed="true"
+        	dna:exclusionPattern="\.svn"
         	/>    
         <!-- 
         <dna:source jcr:name="Store" dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource" />

Modified: trunk/dna-integration-tests/src/test/resources/tck/filesystem/repositoryOverlay.properties
===================================================================
--- trunk/dna-integration-tests/src/test/resources/tck/filesystem/repositoryOverlay.properties	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/dna-integration-tests/src/test/resources/tck/filesystem/repositoryOverlay.properties	2009-08-05 14:45:38 UTC (rev 1144)
@@ -3,6 +3,8 @@
 javax.jcr.tck.dnaSkipImport=true
 
 
-javax.jcr.tck.nodetype=nt\:file
-javax.jcr.tck.nodetype2=nt\:file
+javax.jcr.tck.nodetype=nt\:folder
+javax.jcr.tck.nodetype2=nt\:folder
+javax.jcr.tck.propertyname1=jcr:created
 
+

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DnaIntLexicon.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DnaIntLexicon.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DnaIntLexicon.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -30,6 +30,5 @@
  * A lexicon of internal and implementation-specific information
  */
 public class DnaIntLexicon extends org.jboss.dna.graph.DnaIntLexicon {
-    public static final Name NODE_DEFINITON = new BasicName(Namespace.URI, "nodeDefinition");
     public static final Name MULTI_VALUED_PROPERTIES = new BasicName(Namespace.URI, "multiValuedProperties");
 }

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemConnection.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemConnection.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemConnection.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -51,6 +51,7 @@
     private final boolean creatingWorkspacesAllowed;
     private final FilenameFilter filenameFilter;
     private final UUID rootNodeUuid;
+    private final int maxPathLength;
     private final String workspaceRootPath;
     private final boolean updatesAllowed;
 
@@ -61,6 +62,7 @@
                           CachePolicy cachePolicy,
                           UUID rootNodeUuid,
                           String workspaceRootPath,
+                          int maxPathLength,
                           FilenameFilter filenameFilter,
                           boolean updatesAllowed ) {
         assert sourceName != null;
@@ -74,6 +76,7 @@
         this.cachePolicy = cachePolicy;
         this.rootNodeUuid = rootNodeUuid;
         this.workspaceRootPath = workspaceRootPath;
+        this.maxPathLength = maxPathLength;
         this.filenameFilter = filenameFilter;
         this.updatesAllowed = updatesAllowed;
     }
@@ -125,7 +128,7 @@
                          Request request ) throws RepositorySourceException {
         RequestProcessor proc = new FileSystemRequestProcessor(sourceName, defaultWorkspaceName, availableWorkspaces,
                                                                creatingWorkspacesAllowed, rootNodeUuid, workspaceRootPath,
-                                                               context, filenameFilter, updatesAllowed);
+                                                               maxPathLength, context, filenameFilter, updatesAllowed);
         try {
             proc.process(request);
         } finally {

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemI18n.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemI18n.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemI18n.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -46,9 +46,27 @@
     public static I18n propertyIsRequired;
     public static I18n locationInRequestMustHavePath;
     public static I18n sameNameSiblingsAreNotAllowed;
+    public static I18n nodeOrderingNotSupported;
     public static I18n onlyTheDefaultNamespaceIsAllowed;
     public static I18n sourceIsReadOnly;
+    public static I18n pathIsReadOnly;
     public static I18n unableToCreateWorkspaces;
+    
+    // Writable messages
+    public static I18n parentIsReadOnly;
+    public static I18n fileAlreadyExists;
+    public static I18n couldNotCreateFile;
+    public static I18n unsupportedPrimaryType;
+    public static I18n invalidNameForResource;
+    public static I18n invalidPathForResource;
+    public static I18n invalidPropertyNames;
+    public static I18n couldNotWriteData;
+    public static I18n couldNotUpdateData;
+    public static I18n missingRequiredProperty;
+    public static I18n deleteFailed;
+    public static I18n copyFailed;
+    public static I18n getCanonicalPathFailed;
+    public static I18n maxPathLengthExceeded;
 
     static {
         try {

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -26,30 +26,44 @@
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import org.jboss.dna.common.i18n.I18n;
+import org.jboss.dna.common.util.FileUtil;
+import org.jboss.dna.graph.DnaIntLexicon;
 import org.jboss.dna.graph.DnaLexicon;
 import org.jboss.dna.graph.ExecutionContext;
 import org.jboss.dna.graph.JcrLexicon;
 import org.jboss.dna.graph.JcrNtLexicon;
 import org.jboss.dna.graph.Location;
+import org.jboss.dna.graph.NodeConflictBehavior;
 import org.jboss.dna.graph.connector.RepositorySourceException;
 import org.jboss.dna.graph.mimetype.MimeTypeDetector;
+import org.jboss.dna.graph.property.Binary;
 import org.jboss.dna.graph.property.BinaryFactory;
 import org.jboss.dna.graph.property.DateTimeFactory;
 import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.NameFactory;
+import org.jboss.dna.graph.property.NamespaceRegistry;
 import org.jboss.dna.graph.property.Path;
 import org.jboss.dna.graph.property.PathFactory;
 import org.jboss.dna.graph.property.PathNotFoundException;
+import org.jboss.dna.graph.property.Property;
 import org.jboss.dna.graph.property.PropertyFactory;
+import org.jboss.dna.graph.property.UuidFactory;
+import org.jboss.dna.graph.property.Path.Segment;
 import org.jboss.dna.graph.request.CloneBranchRequest;
 import org.jboss.dna.graph.request.CloneWorkspaceRequest;
 import org.jboss.dna.graph.request.CopyBranchRequest;
@@ -79,11 +93,37 @@
 
     private static final String DEFAULT_MIME_TYPE = "application/octet";
 
+    /**
+     * Only certain properties are tolerated when writing content (dna:resource or jcr:resource) nodes. These properties are
+     * implicitly stored (primary type, data) or silently ignored (encoded, mimetype, last modified). The silently ignored
+     * properties must be accepted to stay compatible with the JCR specification.
+     */
+    private static final Set<Name> ALLOWABLE_PROPERTIES_FOR_CONTENT = Collections.unmodifiableSet(new HashSet<Name>(
+                                                                                                                    Arrays.asList(new Name[] {
+                                                                                                                        JcrLexicon.PRIMARY_TYPE,
+                                                                                                                        JcrLexicon.DATA,
+                                                                                                                        JcrLexicon.ENCODED,
+                                                                                                                        JcrLexicon.MIMETYPE,
+                                                                                                                        JcrLexicon.LAST_MODIFIED,
+                                                                                                                        JcrLexicon.UUID,
+                                                                                                                        DnaIntLexicon.NODE_DEFINITON})));
+    /**
+     * Only certain properties are tolerated when writing files (nt:file) or folders (nt:folder) nodes. These properties are
+     * implicitly stored in the file or folder (primary type, created).
+     */
+    private static final Set<Name> ALLOWABLE_PROPERTIES_FOR_FILE_OR_FOLDER = Collections.unmodifiableSet(new HashSet<Name>(
+                                                                                                                           Arrays.asList(new Name[] {
+                                                                                                                               JcrLexicon.PRIMARY_TYPE,
+                                                                                                                               JcrLexicon.CREATED,
+                                                                                                                               JcrLexicon.UUID,
+                                                                                                                               DnaIntLexicon.NODE_DEFINITON})));
+
     private final String defaultNamespaceUri;
     private final Map<String, File> availableWorkspaces;
     private final boolean creatingWorkspacesAllowed;
     private final String defaultWorkspaceName;
     private final File workspaceRootPath;
+    private final int maxPathLength;
     private final FilenameFilter filenameFilter;
     private final boolean updatesAllowed;
     private final MimeTypeDetector mimeTypeDetector;
@@ -99,6 +139,7 @@
      *        generated each time that the repository is started.
      * @param workspaceRootPath the path to the workspace root directory; may be null. If specified, all workspace names will be
      *        treated as relative paths from this directory.
+     * @param maxPathLength the maximum absolute path length supported by this processor
      * @param filenameFilter the filename filter to use to restrict the allowable nodes, or null if all files/directories are to
      *        be exposed by this connector
      * @param updatesAllowed true if this connector supports updating the file system, or false if the connector is readonly
@@ -109,6 +150,7 @@
                                           boolean creatingWorkspacesAllowed,
                                           UUID rootNodeUuid,
                                           String workspaceRootPath,
+                                          int maxPathLength,
                                           ExecutionContext context,
                                           FilenameFilter filenameFilter,
                                           boolean updatesAllowed ) {
@@ -120,6 +162,7 @@
         this.creatingWorkspacesAllowed = creatingWorkspacesAllowed;
         this.defaultNamespaceUri = getExecutionContext().getNamespaceRegistry().getDefaultNamespaceUri();
         this.rootNodeUuid = rootNodeUuid;
+        this.maxPathLength = maxPathLength;
         this.filenameFilter = filenameFilter;
         this.defaultWorkspaceName = defaultWorkspaceName;
         this.updatesAllowed = updatesAllowed;
@@ -178,8 +221,9 @@
             // Create a Location for each file and directory contained by the parent directory ...
             PathFactory pathFactory = pathFactory();
             NameFactory nameFactory = nameFactory();
-            for (String localName : parent.list(filenameFilter)) {
-                Name childName = nameFactory.create(defaultNamespaceUri, localName);
+            for (File child : parent.listFiles(filenameFilter)) {
+                if (!child.canRead()) continue;
+                Name childName = nameFactory.create(defaultNamespaceUri, child.getName());
                 Path childPath = pathFactory.create(parentPath, childName);
                 request.addChild(Location.create(childPath));
             }
@@ -299,7 +343,213 @@
      */
     @Override
     public void process( CreateNodeRequest request ) {
-        updatesAllowed(request);
+        if (!updatesAllowed(request)) return;
+
+        Path parentPath = getPathFor(request.under(), request);
+        if (parentPath == null) return;
+
+        File workspace = getWorkspaceDirectory(request.inWorkspace());
+        assert workspace != null;
+
+        File parent = getExistingFileFor(workspace, parentPath, request.under(), request);
+        assert parent != null;
+
+        NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();
+        String newName = request.named().getString(registry);
+        File newFile = new File(parent, newName);
+
+        Map<Name, Property> properties = new HashMap<Name, Property>(request.properties().size());
+        for (Property property : request.properties()) {
+            properties.put(property.getName(), property);
+        }
+
+        Property primaryTypeProp = properties.get(JcrLexicon.PRIMARY_TYPE);
+        Name primaryType = primaryTypeProp == null ? null : nameFactory().create(primaryTypeProp.getFirstValue());
+
+        if (JcrNtLexicon.FILE.equals(primaryType)) {
+            ensureValidProperties(request.properties(), ALLOWABLE_PROPERTIES_FOR_FILE_OR_FOLDER);
+
+            // The FILE node is represented by the existence of the file
+            if (!parent.canWrite()) {
+                I18n msg = FileSystemI18n.parentIsReadOnly;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                         request.inWorkspace(),
+                                                                                         getSourceName())));
+                return;
+            }
+
+            try {
+                ensureValidPathLength(newFile);
+                boolean skipWrite = false;
+
+                if (newFile.exists()) {
+                    if (request.conflictBehavior().equals(NodeConflictBehavior.APPEND)) {
+                        I18n msg = FileSystemI18n.sameNameSiblingsAreNotAllowed;
+                        throw new InvalidRequestException(msg.text(this.getSourceName(), newName));
+                    } else if (request.conflictBehavior().equals(NodeConflictBehavior.DO_NOT_REPLACE)) {
+                        skipWrite = true;
+                    }
+                }
+
+                // Don't try to write if the node conflict behavior is DO_NOT_REPLACE
+                if (!skipWrite) {
+                    if (!newFile.createNewFile()) {
+                        I18n msg = FileSystemI18n.fileAlreadyExists;
+                        request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                                 request.inWorkspace(),
+                                                                                                 getSourceName())));
+                        return;
+                    }
+                }
+            } catch (IOException ioe) {
+                I18n msg = FileSystemI18n.couldNotCreateFile;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                         request.inWorkspace(),
+                                                                                         getSourceName(),
+                                                                                         ioe.getMessage()), ioe));
+                return;
+            }
+        } else if (JcrNtLexicon.RESOURCE.equals(primaryType) || DnaLexicon.RESOURCE.equals(primaryType)) {
+            ensureValidProperties(request.properties(), ALLOWABLE_PROPERTIES_FOR_CONTENT);
+            if (!JcrLexicon.CONTENT.equals(request.named())) {
+                I18n msg = FileSystemI18n.invalidNameForResource;
+                String nodeName = request.named().getString(registry);
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                         request.inWorkspace(),
+                                                                                         getSourceName(),
+                                                                                         nodeName)));
+                return;
+            }
+
+            if (!parent.isFile()) {
+                I18n msg = FileSystemI18n.invalidPathForResource;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                         request.inWorkspace(),
+                                                                                         getSourceName())));
+                return;
+            }
+
+            if (!parent.canWrite()) {
+                I18n msg = FileSystemI18n.parentIsReadOnly;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                         request.inWorkspace(),
+                                                                                         getSourceName())));
+                return;
+            }
+
+            boolean skipWrite = false;
+
+            if (parent.exists()) {
+                if (request.conflictBehavior().equals(NodeConflictBehavior.APPEND)) {
+                    I18n msg = FileSystemI18n.sameNameSiblingsAreNotAllowed;
+                    throw new InvalidRequestException(msg.text(this.getSourceName(), newName));
+                } else if (request.conflictBehavior().equals(NodeConflictBehavior.DO_NOT_REPLACE)) {
+                    // The content node logically maps to the file contents. If there are file contents, don't replace them.
+                    FileInputStream checkForContents = null;
+                    try {
+                        checkForContents = new FileInputStream(parent);
+                        if (-1 != checkForContents.read()) skipWrite = true;
+
+                    } catch (IOException ignore) {
+
+                    } finally {
+                        try {
+                            checkForContents.close();
+                        } catch (Exception ignore) {
+                        }
+                    }
+                    skipWrite = true;
+                }
+            }
+
+            if (!skipWrite) {
+                // Copy over data into a temp file, then move it to the correct location
+                FileOutputStream fos = null;
+                try {
+                    File temp = File.createTempFile("dna", null);
+                    fos = new FileOutputStream(temp);
+
+                    Property dataProp = properties.get(JcrLexicon.DATA);
+                    if (dataProp == null) {
+                        I18n msg = FileSystemI18n.missingRequiredProperty;
+                        String dataPropName = JcrLexicon.DATA.getString(registry);
+                        request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                                 request.inWorkspace(),
+                                                                                                 getSourceName(),
+                                                                                                 dataPropName)));
+                        return;
+                    }
+
+                    BinaryFactory binaryFactory = getExecutionContext().getValueFactories().getBinaryFactory();
+                    Binary binary = binaryFactory.create(properties.get(JcrLexicon.DATA).getFirstValue());
+                    InputStream is = binary.getStream();
+
+                    final int BUFF_SIZE = 2 << 15;
+                    byte[] buff = new byte[BUFF_SIZE];
+                    int len;
+                    while (-1 != (len = is.read(buff, 0, BUFF_SIZE))) {
+                        fos.write(buff, 0, len);
+                    }
+                    fos.flush();
+                    fos.close();
+                    is.close();
+
+                    if (!FileUtil.delete(parent)) {
+                        I18n msg = FileSystemI18n.deleteFailed;
+                        request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                                 request.inWorkspace(),
+                                                                                                 getSourceName())));
+                        return;
+                    }
+
+                    if (!temp.renameTo(parent)) {
+                        I18n msg = FileSystemI18n.couldNotUpdateData;
+                        request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                                 request.inWorkspace(),
+                                                                                                 getSourceName())));
+                        return;
+
+                    }
+                } catch (IOException ioe) {
+                    I18n msg = FileSystemI18n.couldNotWriteData;
+                    request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                             request.inWorkspace(),
+                                                                                             getSourceName(),
+                                                                                             ioe.getMessage()), ioe));
+                    return;
+
+                } finally {
+                    try {
+                        if (fos != null) fos.close();
+                    } catch (Exception ex) {
+                    }
+                }
+            }
+
+        } else if (JcrNtLexicon.FOLDER.equals(primaryType) || primaryType == null) {
+            ensureValidProperties(request.properties(), ALLOWABLE_PROPERTIES_FOR_FILE_OR_FOLDER);
+            ensureValidPathLength(newFile);
+
+            if (!newFile.mkdir()) {
+                I18n msg = FileSystemI18n.couldNotCreateFile;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
+                                                                                         request.inWorkspace(),
+                                                                                         getSourceName(),
+                                                                                         primaryType.getString(registry))));
+                return;
+            }
+        } else {
+            // Set error and return
+            I18n msg = FileSystemI18n.unsupportedPrimaryType;
+            request.setError(new RepositorySourceException(getSourceName(), msg.text(primaryType.getString(registry),
+                                                                                     parent.getPath(),
+                                                                                     request.inWorkspace(),
+                                                                                     getSourceName())));
+            return;
+        }
+
+        Path newPath = pathFactory().create(parentPath, request.named());
+        request.setActualLocationOfNode(Location.create(newPath));
     }
 
     /**
@@ -309,7 +559,24 @@
      */
     @Override
     public void process( UpdatePropertiesRequest request ) {
-        updatesAllowed(request);
+        if (!updatesAllowed(request)) return;
+
+        File workspace = getWorkspaceDirectory(request.inWorkspace());
+        File target = getExistingFileFor(workspace, request.on().getPath(), request.on(), request);
+
+        if (!target.exists()) {
+            // getExistingFile fills in the PathNotFoundException for non-existent files
+            assert request.hasError();
+            return;
+        }
+
+        if (target.isFile()) {
+            ensureValidProperties(request.properties().values(), ALLOWABLE_PROPERTIES_FOR_FILE_OR_FOLDER);
+        } else {
+            ensureValidProperties(request.properties().values(), ALLOWABLE_PROPERTIES_FOR_CONTENT);
+        }
+
+        request.setActualLocationOfNode(request.on());
     }
 
     /**
@@ -319,7 +586,96 @@
      */
     @Override
     public void process( CopyBranchRequest request ) {
-        updatesAllowed(request);
+        if (!updatesAllowed(request)) return;
+
+        File fromWorkspace = getWorkspaceDirectory(request.fromWorkspace());
+        File intoWorkspace = getWorkspaceDirectory(request.intoWorkspace());
+        Path fromPath = getPathFor(request.from(), request);
+        if (fromPath == null) return;
+        File from = getExistingFileFor(fromWorkspace, fromPath, request.from(), request);
+
+        Path intoPath = getPathFor(request.into(), request);
+        if (intoPath == null) return;
+        File into = getExistingFileFor(intoWorkspace, intoPath, request.into(), request);
+
+        NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();
+        Name desiredName = request.desiredName();
+        String fileName = desiredName != null ? desiredName.getString(registry) : fromPath.getLastSegment().getString(registry);
+        File target = new File(into, fileName);
+        File tempInto = null;
+
+        Location actualFrom = null;
+        Location actualTo = null;
+        try {
+            actualFrom = locationFor(fromWorkspace, from);
+            actualTo = locationFor(intoWorkspace, target);
+        } catch (IOException ioe) {
+            throw new RepositorySourceException(this.getSourceName(), FileSystemI18n.getCanonicalPathFailed.text(), ioe);
+        }
+
+        try {
+            int pathLenDelta = into.getCanonicalPath().length() - from.getCanonicalFile().getParent().length();
+            if (pathLenDelta > 0) {
+                ensureValidPathLength(from, pathLenDelta);
+            }
+        } catch (IOException ioe) {
+            throw new RepositorySourceException(this.getSourceName(), FileSystemI18n.getCanonicalPathFailed.text(), ioe);
+        }
+
+        if (target.exists() && from.isFile()) {
+            try {
+                tempInto = File.createTempFile("dna", null, into);
+            } catch (IOException ioe) {
+                throw new RepositorySourceException(this.getSourceName(),
+                                                    FileSystemI18n.couldNotCreateFile.text("temporary file",
+                                                                                           request.intoWorkspace(),
+                                                                                           getSourceName(),
+                                                                                           ioe.getMessage()), ioe);
+            }
+
+            try {
+                FileUtil.copy(from, tempInto);
+            } catch (IOException ioe) {
+                FileUtil.delete(tempInto);
+                throw new RepositorySourceException(this.getSourceName(), FileSystemI18n.copyFailed.text(from.getPath(),
+                                                                                                         request.fromWorkspace(),
+                                                                                                         tempInto.getPath(),
+                                                                                                         request.intoWorkspace(),
+                                                                                                         getSourceName()), ioe);
+            }
+
+            // If everything worked, delete whatever was there and rename
+            if (target.exists()) {
+                if (!FileUtil.delete(target)) {
+                    I18n msg = FileSystemI18n.deleteFailed;
+                    request.setError(new RepositorySourceException(getSourceName(), msg.text(target.getPath(),
+                                                                                             request.intoWorkspace(),
+                                                                                             getSourceName())));
+                    FileUtil.delete(tempInto);
+                    return;
+                }
+            }
+
+            if (!tempInto.renameTo(target)) {
+                I18n msg = FileSystemI18n.couldNotUpdateData;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(target.getPath(),
+                                                                                         request.intoWorkspace(),
+                                                                                         getSourceName())));
+                FileUtil.delete(tempInto);
+                return;
+            }
+        } else {
+            if (!from.renameTo(target)) {
+                I18n msg = FileSystemI18n.couldNotUpdateData;
+                request.setError(new RepositorySourceException(getSourceName(), msg.text(target.getPath(),
+                                                                                         request.intoWorkspace(),
+                                                                                         getSourceName())));
+                return;
+            }
+
+        }
+        request.setActualLocations(actualFrom, actualTo);
+
     }
 
     /**
@@ -329,7 +685,19 @@
      */
     @Override
     public void process( CloneBranchRequest request ) {
-        updatesAllowed(request);
+        if (!updatesAllowed(request)) return;
+
+        CopyBranchRequest copy = new CopyBranchRequest(request.from(), request.fromWorkspace(), request.into(),
+                                                       request.intoWorkspace(), request.desiredName());
+
+        process(copy);
+
+        if (copy.hasError()) {
+            request.setError(copy.getError());
+            return;
+        }
+
+        request.setActualLocations(copy.getActualLocationBefore(), copy.getActualLocationAfter());
     }
 
     /**
@@ -339,7 +707,30 @@
      */
     @Override
     public void process( DeleteBranchRequest request ) {
-        updatesAllowed(request);
+        if (!updatesAllowed(request)) return;
+
+        File workspace = getWorkspaceDirectory(request.inWorkspace());
+        Path targetPath = getPathFor(request.at(), request);
+        if (targetPath == null) return;
+
+        File target = getExistingFileFor(workspace, targetPath, request.at(), request);
+        Location actual = null;
+
+        try {
+            actual = locationFor(workspace, target);
+        } catch (IOException ioe) {
+            throw new RepositorySourceException(this.getSourceName(), FileSystemI18n.getCanonicalPathFailed.text(), ioe);
+        }
+
+        if (!FileUtil.delete(target)) {
+            request.setError(new RepositorySourceException(this.getSourceName(),
+                                                           FileSystemI18n.deleteFailed.text(target.getPath(),
+                                                                                            request.inWorkspace(),
+                                                                                            getSourceName())));
+            return;
+        }
+
+        request.setActualLocationOfNode(actual);
     }
 
     /**
@@ -349,7 +740,56 @@
      */
     @Override
     public void process( MoveBranchRequest request ) {
-        updatesAllowed(request);
+        if (!updatesAllowed(request)) return;
+
+        /* This connector does not support node ordering */
+        if (request.before() != null) {
+            throw new InvalidRequestException(FileSystemI18n.nodeOrderingNotSupported.text(this.getSourceName()));
+        }
+
+        File workspace = getWorkspaceDirectory(request.inWorkspace());
+        Path fromPath = getPathFor(request.from(), request);
+        if (fromPath == null) return;
+        File from = getExistingFileFor(workspace, fromPath, request.from(), request);
+
+        Path intoPath = getPathFor(request.into(), request);
+        if (intoPath == null) return;
+        File into = getExistingFileFor(workspace, intoPath, request.into(), request);
+
+        NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();
+        Name desiredName = request.desiredName();
+        String fileName = desiredName != null ? desiredName.getString(registry) : fromPath.getLastSegment().getString(registry);
+        File target = new File(into, fileName);
+
+        Location actualFrom = null;
+        Location actualTo = null;
+        try {
+            actualFrom = locationFor(workspace, from);
+            actualTo = locationFor(workspace, target);
+        } catch (IOException ioe) {
+            request.setError(new RepositorySourceException(this.getSourceName(), FileSystemI18n.getCanonicalPathFailed.text()));
+            return;
+        }
+
+        try {
+            int pathLenDelta = into.getCanonicalPath().length() - from.getCanonicalFile().getParent().length();
+            if (pathLenDelta > 0) {
+                ensureValidPathLength(from, pathLenDelta);
+            }
+        } catch (IOException ioe) {
+            request.setError(new RepositorySourceException(this.getSourceName(), FileSystemI18n.getCanonicalPathFailed.text()));
+            return;
+        }
+
+        if (!from.renameTo(target)) {
+            I18n msg = FileSystemI18n.couldNotUpdateData;
+            request.setError(new RepositorySourceException(getSourceName(),
+                                                           msg.text(target.getPath(), workspace, getSourceName())));
+            return;
+        }
+
+        request.setActualLocations(actualFrom, actualTo);
+
     }
 
     /**
@@ -359,12 +799,46 @@
      */
     @Override
     public void process( RenameNodeRequest request ) {
-        if (updatesAllowed(request)) super.process(request);
+        if (!updatesAllowed(request)) return;
+
+        super.process(request);
     }
 
     /**
      * {@inheritDoc}
      * 
+     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CloneWorkspaceRequest)
+     */
+    @Override
+    public void process( CloneWorkspaceRequest request ) {
+        if (!updatesAllowed(request)) return;
+
+        CreateWorkspaceRequest create = new CreateWorkspaceRequest(request.desiredNameOfTargetWorkspace(),
+                                                                   request.targetConflictBehavior());
+        process(create);
+
+        if (create.hasError()) {
+            request.setError(create.getError());
+            return;
+        }
+
+        File fromWorkspace = getWorkspaceDirectory(request.nameOfWorkspaceToBeCloned());
+        assert fromWorkspace != null;
+        File toWorkspace = getWorkspaceDirectory(create.getActualWorkspaceName());
+        assert toWorkspace != null;
+
+        try {
+            FileUtil.copy(fromWorkspace, toWorkspace);
+            request.setActualWorkspaceName(create.getActualWorkspaceName());
+            request.setActualRootLocation(Location.create(pathFactory().createRootPath(), this.rootNodeUuid));
+        } catch (IOException ioe) {
+            throw new RepositorySourceException(this.getSourceName(), ioe.getMessage());
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
      * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.VerifyWorkspaceRequest)
      */
     @Override
@@ -442,16 +916,6 @@
     /**
      * {@inheritDoc}
      * 
-     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CloneWorkspaceRequest)
-     */
-    @Override
-    public void process( CloneWorkspaceRequest request ) {
-        updatesAllowed(request);
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
      * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CreateWorkspaceRequest)
      */
     @Override
@@ -464,7 +928,7 @@
         }
         // This doesn't create the directory representing the workspace (it must already exist), but it will add
         // the workspace name to the available names ...
-        File directory = new File(workspaceName);
+        File directory = getWorkspaceDirectory(workspaceName);
         if (directory.exists() && directory.isDirectory() && directory.canRead()) {
             request.setActualWorkspaceName(getCanonicalWorkspaceName(directory));
             request.setActualRootLocation(Location.create(pathFactory().createRootPath()));
@@ -503,6 +967,19 @@
         return !request.hasError();
     }
 
+    private UUID uuidFor( Location location ) {
+        if (location.getUuid() != null) return location.getUuid();
+        if (!location.hasIdProperties()) return null;
+
+        for (Property idProperty : location.getIdProperties()) {
+            if (JcrLexicon.UUID.equals(idProperty.getName())) {
+                return uuidFactory().create(idProperty.getFirstValue());
+            }
+        }
+
+        return null;
+    }
+
     protected NameFactory nameFactory() {
         return getExecutionContext().getValueFactories().getNameFactory();
     }
@@ -511,19 +988,105 @@
         return getExecutionContext().getValueFactories().getPathFactory();
     }
 
+    protected UuidFactory uuidFactory() {
+        return getExecutionContext().getValueFactories().getUuidFactory();
+    }
+
+    /**
+     * Checks that the collection of {@code properties} only contains properties with allowable names.
+     * 
+     * @param properties
+     * @param validPropertyNames
+     * @throws RepositorySourceException if {@code properties} contains a
+     * @see #ALLOWABLE_PROPERTIES_FOR_CONTENT
+     * @see #ALLOWABLE_PROPERTIES_FOR_FILE_OR_FOLDER
+     */
+    protected void ensureValidProperties( Collection<Property> properties,
+                                          Set<Name> validPropertyNames ) {
+        List<String> invalidNames = new LinkedList<String>();
+        NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();
+
+        for (Property property : properties) {
+            if (!validPropertyNames.contains(property.getName())) {
+                invalidNames.add(property.getName().getString(registry));
+            }
+        }
+
+        if (!invalidNames.isEmpty()) {
+            throw new RepositorySourceException(this.getSourceName(),
+                                                FileSystemI18n.invalidPropertyNames.text(invalidNames.toString()));
+        }
+    }
+
+    protected void ensureValidPathLength( File root ) {
+        ensureValidPathLength(root, 0);
+    }
+
+    /**
+     * Recursively checks if any of the files in the tree rooted at {@code root} would exceed the {@link #maxPathLength maximum
+     * path length for the processor} if their paths were {@code delta} characters longer. If any files would exceed this length,
+     * a {@link RepositorySourceException} is thrown.
+     * 
+     * @param root the root of the tree to check; may be a file or directory but may not be null
+     * @param delta the change in the length of the path to check. Used to preemptively check whether moving a file or directory
+     *        to a new path would violate path length rules
+     * @throws RepositorySourceException if any files in the tree rooted at {@code root} would exceed this {@link #maxPathLength
+     *         the maximum path length for this processor}
+     */
+    protected void ensureValidPathLength( File root,
+                                          int delta ) {
+        try {
+            int len = root.getCanonicalPath().length();
+            if (len > maxPathLength - delta) {
+                String msg = FileSystemI18n.maxPathLengthExceeded.text(this.maxPathLength,
+                                                                       this.getSourceName(),
+                                                                       root.getCanonicalPath());
+                throw new RepositorySourceException(this.getSourceName(), msg);
+            }
+
+            if (root.isDirectory()) {
+                for (File child : root.listFiles(filenameFilter)) {
+                    ensureValidPathLength(child, delta);
+                }
+
+            }
+        } catch (IOException ioe) {
+            throw new RepositorySourceException(this.getSourceName(), FileSystemI18n.getCanonicalPathFailed.text(), ioe);
+        }
+    }
+
+    protected Location locationFor( File workspaceRoot,
+                                    File path ) throws IOException {
+        assert workspaceRoot != null;
+        assert path != null;
+        assert path.getCanonicalPath().startsWith(workspaceRoot.getCanonicalPath());
+
+        String relativePath = path.getCanonicalPath().substring(workspaceRoot.getCanonicalPath().length());
+        PathFactory pathFactory = pathFactory();
+        List<Segment> segments = new LinkedList<Segment>();
+
+        String sepString = File.separator.equals("\\") ? "\\\\" : File.separator;
+        assert relativePath.charAt(0) == File.separatorChar;
+        for (String segment : relativePath.substring(1).split(sepString)) {
+            segments.add(pathFactory.createSegment(segment, 1));
+        }
+
+        return Location.create(pathFactory().createAbsolutePath(segments));
+    }
+
     protected Path getPathFor( Location location,
                                Request request ) {
-        Path path = location.getPath();
 
-        if (location.getUuid() != null && rootNodeUuid.equals(location.getUuid())) {
+        if (location.hasPath()) return location.getPath();
+
+        UUID uuid = uuidFor(location);
+        if (rootNodeUuid.equals(uuid)) {
             return pathFactory().createRootPath();
         }
 
-        if (path == null) {
-            I18n msg = FileSystemI18n.locationInRequestMustHavePath;
-            throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
-        }
-        return path;
+        I18n msg = FileSystemI18n.locationInRequestMustHavePath;
+        request.setError(new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request)));
+        return null;
     }
 
     protected File getWorkspaceDirectory( String workspaceName ) {

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -33,6 +33,7 @@
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Pattern;
 import javax.naming.Context;
 import javax.naming.RefAddr;
 import javax.naming.Reference;
@@ -78,6 +79,9 @@
     protected static final String WORKSPACE_ROOT = "workspaceRootPath";
     protected static final String PREDEFINED_WORKSPACE_NAMES = "predefinedWorkspaceNames";
     protected static final String ALLOW_CREATING_WORKSPACES = "allowCreatingWorkspaces";
+    protected static final String MAX_PATH_LENGTH = "maxPathLength";
+    protected static final String EXCLUSION_PATTERN = "exclusionPattern";
+    protected static final String ALLOW_UPDATES = "allowUpdates";
 
     /**
      * This source supports events.
@@ -103,6 +107,8 @@
 
     public static final int DEFAULT_RETRY_LIMIT = 0;
     public static final int DEFAULT_CACHE_TIME_TO_LIVE_IN_SECONDS = 60 * 5; // 5 minutes
+    public static final int DEFAULT_MAX_PATH_LENGTH = 255; // 255 for windows users
+    public static final String DEFAULT_EXCLUSION_PATTERN = null;
 
     private volatile String name;
     private volatile int retryLimit = DEFAULT_RETRY_LIMIT;
@@ -111,6 +117,8 @@
     private volatile String workspaceRootPath;
     private volatile String[] predefinedWorkspaces = new String[] {};
     private volatile UUID rootNodeUuid = UUID.randomUUID();
+    private volatile int maxPathLength = DEFAULT_MAX_PATH_LENGTH;
+    private volatile String exclusionPattern = DEFAULT_EXCLUSION_PATTERN;
     private volatile RepositorySourceCapabilities capabilities = new RepositorySourceCapabilities(
                                                                                                   SUPPORTS_SAME_NAME_SIBLINGS,
                                                                                                   DEFAULT_SUPPORTS_UPDATES,
@@ -200,6 +208,25 @@
     }
 
     /**
+     * Get the regular expression that, if matched by a file or folder, indicates that the file or folder should be ignored
+     * 
+     * @return the regular expression that, if matched by a file or folder, indicates that the file or folder should be ignored
+     */
+    public String getExclusionPattern() {
+        return exclusionPattern;
+    }
+
+    /**
+     * Sets the regular expression that, if matched by a file or folder, indicates that the file or folder should be ignored
+     * 
+     * @param exclusionPattern the regular expression that, if matched by a file or folder, indicates that the file or folder
+     *        should be ignored. If this pattern is {@code null}, no files will be excluded.
+     */
+    public synchronized void setExclusionPattern( String exclusionPattern ) {
+        this.exclusionPattern = exclusionPattern;
+    }
+
+    /**
      * Get the UUID that is used for the root node of each workspace
      * 
      * @return the UUID that is used for the root node of each workspace
@@ -219,6 +246,31 @@
     }
 
     /**
+     * Get the UUID that is used for the root node of each workspace
+     * 
+     * @return the UUID that is used for the root node of each workspace
+     */
+    public int getMaxPathLength() {
+        return maxPathLength;
+    }
+
+    /**
+     * Set the maximum absolute path length supported by this source.
+     * <p>
+     * The length of any path is calculated relative to the file system root, NOT the repository root. That is, if a workspace
+     * {@code foo} is mapped to the {@code /tmp/foo/bar} directory on the file system, then the path {@code /node1/node2} in the
+     * {@code foo} workspace has an effective length of 23 for the purposes of the {@code maxPathLength} calculation ({@code
+     * /tmp/foo/bar} has length 11, {@code /node1/node2} has length 12, 11 + 12 = 23).
+     * </p>
+     * 
+     * @param maxPathLength the maximum absolute path length supported by this source; must be non-negative
+     */
+    public synchronized void setMaxPathLength( int maxPathLength ) {
+        CheckArg.isNonNegative(maxPathLength, "maxPathLength");
+        this.maxPathLength = maxPathLength;
+    }
+
+    /**
      * Get the name of the default workspace.
      * 
      * @return the name of the workspace that should be used by default; never null
@@ -292,6 +344,29 @@
     }
 
     /**
+     * Get whether this source allows updates.
+     * 
+     * @return true if this source allows updates by clients, or false if no updates are allowed
+     * @see #setUpdatesAllowed(boolean)
+     */
+    public boolean areUpdatesAllowed() {
+        return capabilities.supportsUpdates();
+    }
+
+    /**
+     * Set whether this source allows updates to data within workspaces
+     * 
+     * @param allowUpdates true if this source allows updates to data within workspaces clients, or false if updates are not
+     *        allowed.
+     * @see #areUpdatesAllowed()
+     */
+    public synchronized void setUpdatesAllowed( boolean allowUpdates ) {
+        capabilities = new RepositorySourceCapabilities(capabilities.supportsSameNameSiblings(), allowUpdates,
+                                                        capabilities.supportsEvents(), capabilities.supportsCreatingWorkspaces(),
+                                                        capabilities.supportsReferences());
+    }
+
+    /**
      * {@inheritDoc}
      * 
      * @see org.jboss.dna.graph.connector.RepositorySource#getRetryLimit()
@@ -356,6 +431,8 @@
         ref.add(new StringRefAddr(RETRY_LIMIT, Integer.toString(getRetryLimit())));
         ref.add(new StringRefAddr(DEFAULT_WORKSPACE, getDefaultWorkspaceName()));
         ref.add(new StringRefAddr(ALLOW_CREATING_WORKSPACES, Boolean.toString(isCreatingWorkspacesAllowed())));
+        ref.add(new StringRefAddr(EXCLUSION_PATTERN, exclusionPattern));
+        ref.add(new StringRefAddr(MAX_PATH_LENGTH, String.valueOf(maxPathLength)));
         String[] workspaceNames = getPredefinedWorkspaceNames();
         if (workspaceNames != null && workspaceNames.length != 0) {
             ref.add(new StringRefAddr(PREDEFINED_WORKSPACE_NAMES, StringUtil.combineLines(workspaceNames)));
@@ -387,6 +464,8 @@
             String retryLimit = values.get(RETRY_LIMIT);
             String defaultWorkspace = values.get(DEFAULT_WORKSPACE);
             String createWorkspaces = values.get(ALLOW_CREATING_WORKSPACES);
+            String exclusionPattern = values.get(DEFAULT_EXCLUSION_PATTERN);
+            String maxPathLength = values.get(DEFAULT_MAX_PATH_LENGTH);
 
             String combinedWorkspaceNames = values.get(PREDEFINED_WORKSPACE_NAMES);
             String[] workspaceNames = null;
@@ -403,6 +482,8 @@
             if (defaultWorkspace != null) source.setDefaultWorkspaceName(defaultWorkspace);
             if (createWorkspaces != null) source.setCreatingWorkspacesAllowed(Boolean.parseBoolean(createWorkspaces));
             if (workspaceNames != null && workspaceNames.length != 0) source.setPredefinedWorkspaceNames(workspaceNames);
+            if (exclusionPattern != null) source.setExclusionPattern(exclusionPattern);
+            if (maxPathLength != null) source.setMaxPathLength(Integer.valueOf(maxPathLength));
             return source;
         }
         return null;
@@ -445,29 +526,48 @@
                 } else if (!file.canRead()) {
                     Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceCannotBeRead, predefined, name);
                 }
-                
-                
+
                 this.availableWorkspaces.put(predefined, file);
             }
         }
 
-        if (defaultWorkspaceName != null) { 
+        if (defaultWorkspaceName != null) {
             // Look for the file at this path ...
             File file = new File(pathFor(defaultWorkspaceName));
             if (!file.exists()) {
-                Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceDoesNotExist, defaultWorkspaceName, name);
+                Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceDoesNotExist,
+                                                  defaultWorkspaceName,
+                                                  name);
             } else if (!file.isDirectory()) {
-                Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceIsNotDirectory, defaultWorkspaceName, name);
+                Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceIsNotDirectory,
+                                                  defaultWorkspaceName,
+                                                  name);
             } else if (!file.canRead()) {
-                Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceCannotBeRead, defaultWorkspaceName, name);
+                Logger.getLogger(getClass()).warn(FileSystemI18n.pathForPredefinedWorkspaceCannotBeRead,
+                                                  defaultWorkspaceName,
+                                                  name);
             }
-            
-            
+
             this.availableWorkspaces.put(defaultWorkspaceName, file);
         }
+
+        FilenameFilter filenameFilter = null;
+        if (exclusionPattern != null) {
+            final String filterPattern = exclusionPattern;
+            filenameFilter = new FilenameFilter() {
+                Pattern filter = Pattern.compile(filterPattern);
+
+                @Override
+                public boolean accept( File dir,
+                                       String name ) {
+                    return !filter.matcher(name).matches();
+                }
+            };
+        }
         
         return new FileSystemConnection(name, defaultWorkspaceName, availableWorkspaces, isCreatingWorkspacesAllowed(),
-                                        cachePolicy, rootNodeUuid, workspaceRootPath, (FilenameFilter) null, getSupportsUpdates());
+                                        cachePolicy, rootNodeUuid, workspaceRootPath, maxPathLength, filenameFilter,
+                                        getSupportsUpdates());
     }
 
     @Immutable

Modified: trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties	2009-08-05 14:45:38 UTC (rev 1144)
@@ -35,6 +35,24 @@
 propertyIsRequired = The {0} property is required but has no value
 locationInRequestMustHavePath = {0} requires a path in the request: {1}
 sameNameSiblingsAreNotAllowed = {0} does not allow same name siblings on nodes: {1}
+nodeOrderingNotSupported = {0} does not support node ordering
 onlyTheDefaultNamespaceIsAllowed = {0} requires node names use the default namespace: {1}
-sourceIsReadOnly = {0} is a read-only source; no updates are allowed
+sourceIsReadOnly = The source "{0}" does not allow updates
+pathIsReadOnly = The path "{0}" in workspace "{1}" in {2} cannot be written to.  See java.io.File\#canWrite().
+
+# Writable tests
+parentIsReadOnly = The parent node at path "{0}" in workspace "{1}" in {2} cannot be written to.  See java.io.File\#canWrite().
 unableToCreateWorkspaces = {0} does not allow creating new workspaces (request was to create "{1}")
+fileAlreadyExists = The path "{0}" in workspace "{1}" in {2} already exists.
+couldNotCreateFile = Error creating the path "{0}" in workspace "{1}" in {2}: {3}
+unsupportedPrimaryType = Primary type "{3}" for path "{0}" in workspace "{1}" in {2} is not valid for the file system connector.  Valid primary types are nt\:file, nt\:folder, nt\:resource, and dna\:resouce. 
+invalidNameForResource = Invalid node name "{3}" for node at path "{0}" in workspace "{1}" in {2}. The name of nodes with primary type nt:resource or dna:resource must be "jcr:content".
+invalidPathForResource = Invalid parent type for node at path "{0}" in workspace "{1}" in {2}. The parent node for nodes with primary type nt:resource or dna:resource must be of type nt:file.
+invalidPropertyNames = Attempt to set or update invalid property names: {0}
+couldNotWriteData = Error writing data to path "{0}" in workspace "{1}" in {2}\: {3} 
+couldNotUpdateData = Error moving temporary data file to path "{0}" in workspace "{1}" in {2} 
+missingRequiredProperty = Missing required property "{3}" at path "{0}" in workspace "{1}" in {2} 
+deleteFailed = Could not delete file at path "{0}" in workspace "{1}" in {2}
+copyFailed = Could not copy file at path "{0}" in workspace "{1}" to path "{2}" in workspace "{3}" in {4}
+getCanonicalPathFailed = Could not determine canonical path
+maxPathLengthExceeded = The maximum absolute path length ({0}) for source "{1}" was exceeded by the node at: {2}

Deleted: trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorNotWritableTest.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorNotWritableTest.java	2009-08-05 13:13:29 UTC (rev 1143)
+++ trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorNotWritableTest.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -1,64 +0,0 @@
-/*
- * 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.connector.filesystem;
-
-import java.io.File;
-import org.jboss.dna.graph.Graph;
-import org.jboss.dna.graph.connector.RepositorySource;
-import org.jboss.dna.graph.connector.test.NotWritableConnectorTest;
-
-/**
- * @author Randall Hauch
- */
-public class FileSystemConnectorNotWritableTest extends NotWritableConnectorTest {
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.graph.connector.test.AbstractConnectorTest#setUpSource()
-     */
-    @Override
-    protected RepositorySource setUpSource() {
-        // Set the connection properties to be use the content of "./src/test/resources/repositories" as a repository ...
-        String path = new File(".").getAbsolutePath() + "/src/test/resources/repositories/";
-        String[] predefinedWorkspaceNames = new String[] {path + "airplanes", path + "cars"};
-        FileSystemSource source = new FileSystemSource();
-        source.setName("Test Repository");
-        source.setPredefinedWorkspaceNames(predefinedWorkspaceNames);
-        source.setDefaultWorkspaceName(predefinedWorkspaceNames[0]);
-        source.setCreatingWorkspacesAllowed(false);
-
-        return source;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.graph.connector.test.AbstractConnectorTest#initializeContent(org.jboss.dna.graph.Graph)
-     */
-    @Override
-    protected void initializeContent( Graph graph ) {
-        // No need to initialize any content ...
-    }
-}

Copied: trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java (from rev 1126, trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorNotWritableTest.java)
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	                        (rev 0)
+++ trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-05 14:45:38 UTC (rev 1144)
@@ -0,0 +1,474 @@
+/*
+ * 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.connector.filesystem;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import org.jboss.dna.common.util.FileUtil;
+import org.jboss.dna.graph.DnaLexicon;
+import org.jboss.dna.graph.Graph;
+import org.jboss.dna.graph.JcrLexicon;
+import org.jboss.dna.graph.JcrMixLexicon;
+import org.jboss.dna.graph.JcrNtLexicon;
+import org.jboss.dna.graph.connector.RepositorySource;
+import org.jboss.dna.graph.connector.RepositorySourceException;
+import org.jboss.dna.graph.connector.test.AbstractConnectorTest;
+import org.jboss.dna.graph.request.InvalidRequestException;
+import org.junit.Test;
+
+public class FileSystemConnectorWritableTest extends AbstractConnectorTest {
+
+    public static final String ARBITRARY_PROPERTIES_NOT_SUPPORTED = "This connector does not support setting arbitrary properties";
+
+    private static final String REPO_PATH = "./src/test/resources/repositories/";
+    private final String TEST_CONTENT = "Test content";
+
+    protected File testWorkspaceRoot;
+    protected File otherWorkspaceRoot;
+    protected File newWorkspaceRoot;
+
+    @Override
+    protected RepositorySource setUpSource() {
+        // Set the connection properties to be use the content of "./src/test/resources/repositories" as a repository ...
+        String[] predefinedWorkspaceNames = new String[] {"test", "otherWorkspace", "airplanes", "cars"};
+        FileSystemSource source = new FileSystemSource();
+        source.setName("Test Repository");
+        source.setWorkspaceRootPath(REPO_PATH);
+        source.setPredefinedWorkspaceNames(predefinedWorkspaceNames);
+        source.setDefaultWorkspaceName(predefinedWorkspaceNames[0]);
+        source.setCreatingWorkspacesAllowed(true);
+        source.setUpdatesAllowed(true);
+
+        testWorkspaceRoot = new File(REPO_PATH, "test");
+        testWorkspaceRoot.mkdir();
+        
+        otherWorkspaceRoot = new File(REPO_PATH, "otherWorkspace");
+        otherWorkspaceRoot.mkdir();
+
+        newWorkspaceRoot = new File(REPO_PATH, "newWorkspace");
+        newWorkspaceRoot.mkdir();
+
+        return source;
+    }
+
+    @Override
+    protected void initializeContent( Graph graph ) {
+        // No setup required
+    }
+
+    @Override
+    public void afterEach() throws Exception {
+        FileUtil.delete(testWorkspaceRoot);
+        FileUtil.delete(otherWorkspaceRoot);
+        FileUtil.delete(newWorkspaceRoot);
+        super.afterEach();
+    }
+
+    @Test
+    public void shouldBeAbleToCreateFileWithContent() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldRespectConflictBehaviorOnCreate() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     "Should not overwrite".getBytes()).ifAbsent().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToCreateFileWithNoContent() {
+        graph.create("/testEmptyFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testEmptyFile");
+        assertThat(newFile.exists(), is(true));
+        assertThat(newFile.isFile(), is(true));
+    }
+
+    @Test
+    public void shouldBeAbleToCreateFolder() {
+        graph.create("/testFolder").orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFolder");
+        assertThat(newFile.exists(), is(true));
+        assertThat(newFile.isDirectory(), is(true));
+    }
+
+    @Test
+    public void shouldBeAbleToAddChildrenToFolder() {
+        graph.create("/testFolder").orReplace().and();
+
+        File newFolder = new File(testWorkspaceRoot, "testFolder");
+        assertThat(newFolder.exists(), is(true));
+        assertThat(newFolder.isDirectory(), is(true));
+
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testfile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+    }
+
+    @Test( expected = RepositorySourceException.class )
+    public void shouldNotBeAbleToCreateInvalidTypeForRepository() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.UNSTRUCTURED).orReplace().and();
+    }
+
+    @Test( expected = RepositorySourceException.class )
+    public void shouldNotBeAbleToSetArbitraryProperties() {
+        graph.create("/testFile").with(JcrLexicon.MIXIN_TYPES, JcrMixLexicon.LOCKABLE).orReplace().and();
+    }
+
+    @Test
+    public void shouldBeAbleToCopyFile() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.copy("/testFile").to("/copiedFile");
+        File copiedFile = new File(testWorkspaceRoot, "copiedFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToCopyFolder() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.copy("/testFolder").to("/copiedFolder");
+        File copiedFolder = new File(testWorkspaceRoot, "copiedFolder");
+        assertTrue(copiedFolder.exists());
+        assertTrue(copiedFolder.isDirectory());
+
+        File copiedFile = new File(testWorkspaceRoot, "copiedFolder/testFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToMoveFile() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.create("/newFolder").orReplace().and();
+
+        graph.move("/testFile").into("/newFolder");
+        assertThat(newFile.exists(), is(false));
+
+        File copiedFile = new File(testWorkspaceRoot, "newFolder/testFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToMoveFolder() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.create("/newFolder").orReplace().and();
+
+        graph.move("/testFolder").into("/newFolder");
+        assertThat(newFile.exists(), is(false));
+
+        File copiedFolder = new File(testWorkspaceRoot, "newFolder/testFolder");
+        assertTrue(copiedFolder.exists());
+        assertTrue(copiedFolder.isDirectory());
+
+        File copiedFile = new File(testWorkspaceRoot, "newFolder/testFolder/testFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToDeleteFolderWithContents() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFolder = new File(testWorkspaceRoot, "testFolder");
+        assertTrue(newFolder.exists());
+        assertTrue(newFolder.isDirectory());
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.delete("/testFolder");
+
+        assertThat(newFolder.exists(), is(false));
+    }
+
+    @Test
+    public void shouldBeAbleToDeleteFile() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFolder = new File(testWorkspaceRoot, "testFolder");
+        assertTrue(newFolder.exists());
+        assertTrue(newFolder.isDirectory());
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.delete("/testFolder/testFile");
+
+        assertTrue(newFolder.exists());
+        assertThat(newFile.exists(), is(false));
+    }
+
+    /**
+     * Since the FS connector does not support UUIDs (under the root node), all clones are just copies (clone for
+     * non-referenceable nodes is a copy to the corresponding path).
+     */
+    @Test
+    public void shouldBeAbleToCloneFolder() {
+        graph.useWorkspace("otherWorkspace");
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(otherWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.useWorkspace("test");
+        graph.clone("/testFolder").fromWorkspace("otherWorkspace").as("clonedFolder").into("/").failingIfAnyUuidsMatch();
+        File copiedFolder = new File(testWorkspaceRoot, "clonedFolder");
+        assertTrue(copiedFolder.exists());
+        assertTrue(copiedFolder.isDirectory());
+
+        File copiedFile = new File(testWorkspaceRoot, "clonedFolder/testFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    /**
+     * Since the FS connector does not support UUIDs (under the root node), all clones are just copies (clone for
+     * non-referenceable nodes is a copy to the corresponding path).
+     */
+    @Test
+    public void shouldBeAbleToCloneFile() {
+        graph.useWorkspace("otherWorkspace");
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(otherWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.useWorkspace("test");
+        graph.clone("/testFile").fromWorkspace("otherWorkspace").as("clonedFile").into("/").failingIfAnyUuidsMatch();
+        File copiedFile = new File(testWorkspaceRoot, "clonedFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test( expected = InvalidRequestException.class )
+    public void shouldNotBeAbleToReorderFolder() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder2").orReplace().and();
+
+        File newFolder = new File(testWorkspaceRoot, "testFolder");
+        assertTrue(newFolder.exists());
+        assertTrue(newFolder.isDirectory());
+
+        File newFolder2 = new File(testWorkspaceRoot, "testFolder2");
+        assertTrue(newFolder2.exists());
+        assertTrue(newFolder2.isDirectory());
+
+        graph.move("/testFolder2").before("/testFolder");
+    }
+
+    @Test( expected = InvalidRequestException.class )
+    public void shouldNotBeAbleToReorderFile() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile2").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile2/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                 TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFolder = new File(testWorkspaceRoot, "testFolder");
+        assertTrue(newFolder.exists());
+        assertTrue(newFolder.isDirectory());
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+        File newFile2 = new File(testWorkspaceRoot, "testFolder/testFile2");
+        assertContents(newFile2, TEST_CONTENT);
+        
+        graph.move("/testFolder/testFile2").before("/testFolder/testFile");
+    }
+
+    @Test
+    public void shouldBeAbleToRenameFolder() {
+        graph.create("/testFolder").orReplace().and();
+        graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.move("/testFolder").as("newFolder").into("/");
+        assertThat(newFile.exists(), is(false));
+
+        File copiedFolder = new File(testWorkspaceRoot, "newFolder");
+        assertTrue(copiedFolder.exists());
+        assertTrue(copiedFolder.isDirectory());
+
+        File copiedFile = new File(testWorkspaceRoot, "newFolder/testFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToRenameFile() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.move("/testFile").as("copiedFile").into("/");
+        assertThat(newFile.exists(), is(false));
+
+        File copiedFile = new File(testWorkspaceRoot, "copiedFile");
+        assertContents(copiedFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToCreateWorkspace() {
+        graph.createWorkspace().named("newWorkspace");
+
+        graph.useWorkspace("newWorkspace");
+
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(newWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+    }
+
+    @Test
+    public void shouldBeAbleToCloneWorkspace() {
+        graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
+        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+
+        File newFile = new File(testWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+
+        graph.createWorkspace().clonedFrom("test").named("newWorkspace");
+
+        newFile = new File(newWorkspaceRoot, "testFile");
+        assertContents(newFile, TEST_CONTENT);
+        
+    }
+
+    @Test
+    public void shouldBeAbleToCreateDeepPath() {
+        String pathName = "";
+
+        for (int i = 0; i < 30; i++) {
+            pathName += "/test";
+            graph.create(pathName).orReplace().and();
+        }
+    }
+
+    @Test( expected = RepositorySourceException.class )
+    public void shouldNotBeAbleToCreateTooDeepPath() {
+        String pathName = "";
+
+        for (int i = 0; i < 100; i++) {
+            pathName += "/testFolder";
+            graph.create(pathName).orReplace().and();
+        }
+    }
+
+    protected void assertContents( File file,
+                                   String contents ) {
+        assertTrue(file.exists());
+        assertTrue(file.isFile());
+
+        StringBuilder buff = new StringBuilder();
+        final int BUFF_SIZE = 8192;
+        byte[] bytes = new byte[BUFF_SIZE];
+        int len;
+        FileInputStream fis = null;
+
+        try {
+            fis = new FileInputStream(file);
+
+            while (-1 != (len = fis.read(bytes, 0, BUFF_SIZE))) {
+                buff.append(new String(bytes, 0, len));
+            }
+
+            assertThat(buff.toString(), is(contents));
+        } catch (IOException ioe) {
+            ioe.printStackTrace();
+            fail(ioe.getMessage());
+            return;
+        } finally {
+            try {
+                fis.close();
+            } catch (Exception ignore) {
+            }
+        }
+    }
+}


From dna-commits at lists.jboss.org  Wed Aug  5 11:01:53 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 5 Aug 2009 11:01:53 -0400
Subject: [dna-commits] DNA SVN: r1145 - trunk/extensions/dna-web-jcr-rest.
Message-ID: <200908051501.n75F1rdR007959@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-05 11:01:53 -0400 (Wed, 05 Aug 2009)
New Revision: 1145

Modified:
   trunk/extensions/dna-web-jcr-rest/pom.xml
Log:
DNA-501 dna-web-jcr-rest should depend on servlet-api using the provided scope instead of compile

Switched scope of servlet-api dependency in pom.xml

Modified: trunk/extensions/dna-web-jcr-rest/pom.xml
===================================================================
--- trunk/extensions/dna-web-jcr-rest/pom.xml	2009-08-05 14:45:38 UTC (rev 1144)
+++ trunk/extensions/dna-web-jcr-rest/pom.xml	2009-08-05 15:01:53 UTC (rev 1145)
@@ -64,7 +64,7 @@
 			<groupId>javax.servlet</groupId>
 			<artifactId>servlet-api</artifactId>
 			<version>2.5</version>
-			<scope>compile</scope>
+			<scope>provided</scope>
 		</dependency>
 
 		<!--  TESTING DEPENDENCIES -->


From dna-commits at lists.jboss.org  Wed Aug  5 11:37:14 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 5 Aug 2009 11:37:14 -0400
Subject: [dna-commits] DNA SVN: r1146 - in trunk:
	docs/examples/gettingstarted and 1 other directory.
Message-ID: <200908051537.n75FbEJm016322@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-05 11:37:14 -0400 (Wed, 05 Aug 2009)
New Revision: 1146

Modified:
   trunk/docs/examples/gettingstarted/pom.xml
   trunk/pom.xml
Log:
DNA-500 Repositories example throws NoSuchMethodError due to conflicting log4j versions

I just uploaded 1.5.8 to the JBoss Maven 2 repository (including source), and have changed our POM files to reference this version.  A complete build was successful, and the repository example was run successfully.

Modified: trunk/docs/examples/gettingstarted/pom.xml
===================================================================
--- trunk/docs/examples/gettingstarted/pom.xml	2009-08-05 15:01:53 UTC (rev 1145)
+++ trunk/docs/examples/gettingstarted/pom.xml	2009-08-05 15:37:14 UTC (rev 1146)
@@ -65,12 +65,12 @@
       <dependency>
 		    <groupId>org.slf4j</groupId>
 		    <artifactId>slf4j-api</artifactId>
-		    <version>1.5.6</version>
+		    <version>1.5.8</version>
       </dependency>
       <dependency>
 		    <groupId>org.slf4j</groupId>
 		    <artifactId>slf4j-log4j12</artifactId>
-		    <version>1.5.6</version>
+		    <version>1.5.8</version>
       </dependency>
 	   <dependency>
 		    <groupId>log4j</groupId>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2009-08-05 15:01:53 UTC (rev 1145)
+++ trunk/pom.xml	2009-08-05 15:37:14 UTC (rev 1146)
@@ -541,13 +541,13 @@
 			<dependency>
 				<groupId>org.slf4j</groupId>
 				<artifactId>slf4j-api</artifactId>
-				<version>1.5.6</version>
+				<version>1.5.8</version>
 				<scope>compile</scope>
 			</dependency>
 			<dependency>
 				<groupId>org.slf4j</groupId>
 				<artifactId>slf4j-log4j12</artifactId>
-				<version>1.5.6</version>
+				<version>1.5.8</version>
 				<scope>test</scope>
 			</dependency>
 			<dependency>


From dna-commits at lists.jboss.org  Wed Aug  5 12:00:30 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 5 Aug 2009 12:00:30 -0400
Subject: [dna-commits] DNA SVN: r1147 -
	trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model.
Message-ID: <200908051600.n75G0UbH021271@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-05 12:00:30 -0400 (Wed, 05 Aug 2009)
New Revision: 1147

Modified:
   trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryEntry.java
   trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryResources.java
   trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceEntry.java
   trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceResources.java
Log:
DNA-502 Allow REST service model classes to be used on client side

Applied Torkjel's patch to make the model classes useful on the client side.

Modified: trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryEntry.java
===================================================================
--- trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryEntry.java	2009-08-05 15:37:14 UTC (rev 1146)
+++ trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryEntry.java	2009-08-05 16:00:30 UTC (rev 1147)
@@ -48,8 +48,16 @@
         return name;
     }
 
+    public void setName(String name) {
+        this.name = name;
+    }
+
     @XmlElement
     public RepositoryResources getResources() {
         return resources;
     }
+
+    public void setResources(RepositoryResources resources) {
+        this.resources = resources;
+    }
 }

Modified: trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryResources.java
===================================================================
--- trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryResources.java	2009-08-05 15:37:14 UTC (rev 1146)
+++ trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/RepositoryResources.java	2009-08-05 16:00:30 UTC (rev 1147)
@@ -40,5 +40,9 @@
     public String getWorkspaces() {
         return baseUri;
     }
+
+    public void setWorkspaces(String workspaces) {
+        this.baseUri = workspaces;
+    }
 }
 

Modified: trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceEntry.java
===================================================================
--- trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceEntry.java	2009-08-05 15:37:14 UTC (rev 1146)
+++ trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceEntry.java	2009-08-05 16:00:30 UTC (rev 1147)
@@ -49,9 +49,17 @@
         return name;
     }
 
+    public void setName(String name) {
+        this.name = name;
+    }
+
     @XmlElement
     public WorkspaceResources getResources() {
         return resources;
     }
+
+    public void setResources(WorkspaceResources resources) {
+        this.resources = resources;
+    }
 }
 

Modified: trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceResources.java
===================================================================
--- trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceResources.java	2009-08-05 15:37:14 UTC (rev 1146)
+++ trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/model/WorkspaceResources.java	2009-08-05 16:00:30 UTC (rev 1147)
@@ -41,5 +41,9 @@
     public String getWorkspaces() {
         return baseUri + "/items";
     }
+
+    public void setWorkspaces(String workspaces) {
+        this.baseUri = workspaces;
+    }
 }
 


From dna-commits at lists.jboss.org  Wed Aug  5 15:38:12 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 5 Aug 2009 15:38:12 -0400
Subject: [dna-commits] DNA SVN: r1148 - in
	branches/eclipse/dna-web-jcr-rest-client/src:
	main/java/org/jboss/dna/web/jcr/rest/client/domain and 6
	other directories.
Message-ID: <200908051938.n75JcChR001526@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-05 15:38:11 -0400 (Wed, 05 Aug 2009)
New Revision: 1148

Added:
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/package-info.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/package-info.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/package-info.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/package-info.java
Modified:
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IJcrConstants.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IJsonConstants.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/StatusTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/RepositoryTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/ServerTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/WorkspaceTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java
Log:
Remove @author tags, added class javadocs, and created package-info.java classes.

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IJcrConstants.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IJcrConstants.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IJcrConstants.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -24,7 +24,9 @@
 package org.jboss.dna.web.jcr.rest.client;
 
 /**
- * @author Dan Florian
+ * The <code>IJcrContants</code> class provides constants for the commonly used JCR types and property identifiers.
+ * 
+ * @since 0.6
  */
 public interface IJcrConstants {
 
@@ -55,14 +57,14 @@
      * @since 0.6
      */
     String FOLDER_NODE_TYPE = "nt:folder"; //$NON-NLS-1$
-    
+
     /**
      * The JCR data property name (<code>jcr:lastModified</code>).
      * 
      * @since 0.6
      */
     String LAST_MODIFIED = "jcr:lastModified"; //$NON-NLS-1$
-    
+
     /**
      * The JCR data property name (<code>jcr:lastModified</code>).
      * 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -26,9 +26,8 @@
 import java.util.ResourceBundle;
 
 /**
- * I18N messages found in the Messages.properties file.
+ * The <code>IMessages</code> interface are the resource bundle keys used in the <code>Messages.properties</code> file.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public interface IMessages {
@@ -94,7 +93,7 @@
     String PublishFailedMsg = "PublishFailedMsg"; //$NON-NLS-1$
 
     String UnpublishFailedMsg = "UnpublishFailedMsg"; //$NON-NLS-1$
-    
+
     String UnpublishNeverPublishedMsg = "UnpublishNeverPublishedMsg"; //$NON-NLS-1$
 
 }

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -31,11 +31,15 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
- * @author dan
+ * The <code>IRestClient</code> interface is the API for all REST clients used by the Eclipse DNA plugin.
+ * 
+ * @since 0.6
  */
 public interface IRestClient {
 
     /**
+     * Obtains the DNA repositories defined within the specified server.
+     * 
      * @param server the server whose repositories are being requested (never <code>null</code>)
      * @return the repositories within the specified server (never <code>null</code>)
      * @throws Exception if there is a problem obtaining the repositories
@@ -44,6 +48,8 @@
     Collection<Repository> getRepositories( Server server ) throws Exception;
 
     /**
+     * Obtains the workspaces defined within the specified DNA respository.
+     * 
      * @param repository the repository whose workspaces are being requested (never <code>null</code>)
      * @return the workspaces within the specified repository (never <code>null</code>)
      * @throws Exception if there is a problem obtaining the workspaces
@@ -52,6 +58,8 @@
     Collection<Workspace> getWorkspaces( Repository repository ) throws Exception;
 
     /**
+     * Publishes, or uploads, a local file to the workspace at the specified path.
+     * 
      * @param workspace the workspace where the resource will be published (never <code>null</code>)
      * @param path the path to the folder where the file will be published (never <code>null</code>)
      * @param file the resource being published (never <code>null</code>)
@@ -63,7 +71,8 @@
                     File file );
 
     /**
-     * If a file being unpublished is not found in the workspace an {@link Severity#INFO info status} results.
+     * Unpublishes, or deletes, the resource at the specified path in the workspace. If a file being unpublished is not found in
+     * the workspace an {@link Severity#INFO info status} is returned.
      * 
      * @param workspace the workspace where the resource will be unpublished (never <code>null</code>)
      * @param path the path to the folder where the file is published (never <code>null</code>)

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -24,7 +24,8 @@
 package org.jboss.dna.web.jcr.rest.client;
 
 /**
- * @author Dan Florian
+ * The <code>IServerRegistryListener</code> interface defines the API for a server registry listener.
+ * 
  * @since 0.6
  */
 public interface IServerRegistryListener {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -27,7 +27,8 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * @author Dan Florian
+ * The <code>Logger</code> class provides a basic interface into an Eclipse SLF4J implementation.
+ * 
  * @since 0.6
  */
 public final class Logger {
@@ -74,18 +75,22 @@
     }
 
     /**
-     * @param clazz the class whose logger will be used
-     * @param status the status being logged
+     * @param clazz the class whose logger will be used (never <code>null</code>)
+     * @param status the status being logged (never <code>null</code>)
      * @since 0.6
      */
     public static void log( Class<?> clazz,
                             Status status ) {
+        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
+        Utils.nullArgumentCheck("status", status); //$NON-NLS-1$
+
         org.slf4j.Logger delegate = null;
-        
+
         try {
             delegate = LoggerFactory.getLogger(clazz);
         } catch (Throwable e) {
             // adapter not found
+            System.err.println(status.getMessage());
             return;
         }
 
@@ -113,20 +118,25 @@
     }
 
     /**
-     * @param clazz the class whose logger will be used
-     * @param status the status being logged (status message is a {@link MessageFormat} pattern)
-     * @param arguments the arguments to be inserted into the pattern
+     * @param clazz the class whose logger will be used (never <code>null</code>)
+     * @param status the status being logged whose message is a {@link MessageFormat} pattern (never <code>null</code>)
+     * @param arguments the arguments to be inserted into the pattern (never <code>null</code>)
      * @since 0.6
      */
     public static void log( Class<?> clazz,
                             Status status,
                             Object... arguments ) {
+        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
+        Utils.nullArgumentCheck("status", status); //$NON-NLS-1$
+        Utils.nullArgumentCheck("arguments", arguments); //$NON-NLS-1$
+
         org.slf4j.Logger delegate = null;
-        
+
         try {
             delegate = LoggerFactory.getLogger(clazz);
         } catch (Throwable e) {
             // adapter not found
+            System.err.println(status.getMessage());
             return;
         }
 
@@ -162,18 +172,22 @@
     /**
      * @param clazz the class whose logger will be used
      * @param e the error being logged or <code>null</code>
-     * @param msg the message being logged
+     * @param msg the message being logged (never <code>null</code>)
      * @since 0.6
      */
     public static void trace( Class<?> clazz,
                               Throwable e,
                               String msg ) {
+        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
+        Utils.nullArgumentCheck("msg", msg); //$NON-NLS-1$
+
         org.slf4j.Logger delegate = null;
-        
+
         try {
             delegate = LoggerFactory.getLogger(clazz);
         } catch (Throwable error) {
             // adapter not found
+            System.err.println(msg);
             return;
         }
 
@@ -187,22 +201,27 @@
     }
 
     /**
-     * @param clazz the class whose logger will be used
+     * @param clazz the class whose logger will be used (never <code>null</code>)
      * @param e the error being logged or <code>null</code>
-     * @param pattern the {@link MessageFormat} pattern
-     * @param arguments the arguments to be inserted into the pattern
+     * @param pattern the {@link MessageFormat} pattern (never <code>null</code>)
+     * @param arguments the arguments to be inserted into the pattern (never <code>null</code>)
      * @since 0.6
      */
     public static void trace( Class<?> clazz,
                               Throwable e,
                               String pattern,
                               Object... arguments ) {
+        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
+        Utils.nullArgumentCheck("pattern", pattern); //$NON-NLS-1$
+        Utils.nullArgumentCheck("arguments", arguments); //$NON-NLS-1$
+
         org.slf4j.Logger delegate = null;
-        
+
         try {
             delegate = LoggerFactory.getLogger(clazz);
         } catch (Throwable error) {
             // adapter not found
+            System.err.println(MessageFormat.format(pattern, arguments));
             return;
         }
 

Added: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -0,0 +1,129 @@
+/*
+ * 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.web.jcr.rest.client;
+
+import java.net.Authenticator;
+import java.net.PasswordAuthentication;
+
+/**
+ * @since 0.6
+ */
+public class ServerAuthenticator extends Authenticator {
+
+    // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    private final ServerManager serverManager;
+
+    // ===========================================================================================================================
+    // Constructors
+    // ===========================================================================================================================
+
+    public ServerAuthenticator( ServerManager serverManager ) {
+        this.serverManager = serverManager;
+    }
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see java.net.Authenticator#getPasswordAuthentication()
+     * @since 0.6
+     */
+    @Override
+    protected PasswordAuthentication getPasswordAuthentication() {
+        // URL url = getRequestingURL();
+        return super.getPasswordAuthentication();
+    }
+
+    /*    
+        public final class DelegatingAuthenticator extends Authenticator {
+
+            private static DelegatingAuthenticator m_INSTANCE;
+
+            private Map m_authenticators;
+
+            static public DelegatingAuthenticator getInstance() {
+                synchronized (DelegatingAuthenticator.class) {
+                    if (m_INSTANCE == null) {
+                        m_INSTANCE = new DelegatingAuthenticator();
+                        Authenticator.setDefault(m_INSTANCE);
+                    }
+                    return m_INSTANCE;
+                }
+            }
+
+            private DelegatingAuthenticator() {
+                m_authenticators = new HashMap();
+            }
+
+            public void addTransitAuthenticator( TransitAuthenticator authenticator,
+                                                 RequestIdentifier id ) {
+                synchronized (m_authenticators) {
+                    m_authenticators.put(id, authenticator);
+                }
+            }
+
+            public void removeTransitAuthenticator( TransitAuthenticator authenticator ) {
+                synchronized (m_authenticators) {
+                    Iterator list = m_authenticators.values().iterator();
+                    while (list.hasNext()) {
+                        Authenticator item = (Authenticator)list.next();
+                        if (item.equals(authenticator)) {
+                            list.remove();
+                        }
+                    }
+                }
+            }
+
+            protected PasswordAuthentication getPasswordAuthentication() {
+                try {
+                    String host = getRequestingHost();
+                    String protocol = getRequestingProtocol();
+                    String prompt = getRequestingPrompt();
+                    String scheme = getRequestingScheme();
+                    int port = getRequestingPort();
+                    InetAddress addr = getRequestingSite();
+                    if (addr == null) {
+                        addr = InetAddress.getByName(host);
+                    }
+                    RequestIdentifier id = new RequestIdentifier(addr, port, protocol, scheme, prompt);
+                    synchronized (m_authenticators) {
+                        TransitAuthenticator auth = (TransitAuthenticator)m_authenticators.get(id);
+                        if (auth == null) {
+                            return null;
+                        }
+                        return auth.resolvePasswordAuthentication(this);
+                    }
+                } catch (UnknownHostException e) {
+                    return null;
+                }
+            }
+        }
+    */
+}


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -55,9 +55,8 @@
 import org.w3c.dom.NodeList;
 
 /**
- * The Server Manager class managers the creation, deletion, and editing of servers.
+ * The <code>ServerManager</code> class managers the creation, deletion, and editing of servers hosting DNA repositories.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 @ThreadSafe
@@ -167,6 +166,9 @@
         this.stateLocationPath = stateLocationPath;
         this.delegate = restExecutor;
         this.listeners = new CopyOnWriteArrayList<IServerRegistryListener>();
+
+        // TODO set authenticator here
+        // Authenticator.setDefault(new ServerAuthenticator());
     }
 
     /**

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -26,7 +26,9 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
 /**
- * @author Dan Florian
+ * The <code>ServerRegistryEvent</code> class is the event that is broadcast from the {@link ServerManager server manager} when a
+ * server is added, removed, or changed.
+ * 
  * @since 0.6
  */
 public final class ServerRegistryEvent {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -26,11 +26,12 @@
 import net.jcip.annotations.Immutable;
 
 /**
- * @author Dan Florian
+ * The <code>Status</code> class is an outcome that provides an outcome or result of an operation.
+ * 
  * @since 0.6
  */
 @Immutable
-public class Status {
+public final class Status {
 
     // ===========================================================================================================================
     // Constants

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -28,7 +28,8 @@
 import java.text.MessageFormat;
 
 /**
- * @author Dan Florian
+ * The <code>Utils</code> class contains common utilities used by this project.
+ * 
  * @since 0.6
  */
 public final class Utils {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -24,9 +24,8 @@
 package org.jboss.dna.web.jcr.rest.client.domain;
 
 /**
- * The IDnaObject class defines a business object.
+ * The <code>IDnaObject</code> class defines a DNA business object.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public interface IDnaObject {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -32,7 +32,6 @@
 /**
  * The Repository class is the business object for a DNA repository.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 @Immutable
@@ -133,7 +132,7 @@
      * @since 0.6
      */
     public String getShortDescription() {
-        return Utils.getMessage(RepositoryShortDescription, this.name, this.server.getShortDescription());
+        return Utils.getMessage(RepositoryShortDescription, this.name, this.server.getName());
     }
 
     /**

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -31,9 +31,8 @@
 import org.jboss.dna.web.jcr.rest.client.domain.validation.ServerValidator;
 
 /**
- * The Server class is the business object for a server that is hosting one or more DNA repositories.
+ * The <code>Server</code> class is the business object for a server that is hosting one or more DNA repositories.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 @Immutable

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -30,9 +30,8 @@
 import org.jboss.dna.web.jcr.rest.client.domain.validation.WorkspaceValidator;
 
 /**
- * The Workspace class is the business object for a DNA repository workspace.
+ * The <code>Workspace</code> class is the business object for a DNA repository workspace.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 @Immutable
@@ -139,7 +138,7 @@
      * @since 0.6
      */
     public String getShortDescription() {
-        return Utils.getMessage(WorkspaceShortDescription, this.name, this.repository.getShortDescription());
+        return Utils.getMessage(WorkspaceShortDescription, this.name, this.repository.getName());
     }
 
     /**

Added: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/package-info.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/package-info.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/package-info.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -0,0 +1,29 @@
+/*
+ * 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 domain package defines the DNA and JCR business objects. These include objects for 
+ * {@link Server servers}, {@link Repository repositories}, and {@link Workspace workspaces}.
+ */
+
+package org.jboss.dna.web.jcr.rest.client.domain;
\ No newline at end of file


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -28,10 +28,12 @@
 import static org.jboss.dna.web.jcr.rest.client.IMessages.RepositoryNullServerMsg;
 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;
 
 /**
- * @author Dan Florian
+ * The <code>RepositoryValidator</code> class provides validation for creating a {@link Repository DNA repository}.
+ * 
  * @since 0.6
  */
 public final class RepositoryValidator {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -36,7 +36,8 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
 /**
- * @author Dan Florian
+ * The <code>ServerValidator</code> class provides validation for creating a {@link Server DNA server}.
+ * 
  * @since 0.6
  */
 public final class ServerValidator {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -29,9 +29,11 @@
 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.Workspace;
 
 /**
- * @author Dan Florian
+ * The <code>WorkspaceValidator</code> class provides validation for creating a {@link Workspace DNA workspace}.
+ * 
  * @since 0.6
  */
 public final class WorkspaceValidator {

Added: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/package-info.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/package-info.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/package-info.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -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 domain validation package controls the validation of new and changed DNA business objects. 
+ */
+
+package org.jboss.dna.web.jcr.rest.client.domain.validation;
\ No newline at end of file


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -41,7 +41,9 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
- * @author Dan Florian
+ * The <code>FileNode</code> class is responsible for knowing how to create a URL for a file, create a JSON representation of a
+ * file, and to create the appropriate JCR nodes for a file.
+ * 
  * @since 0.6
  */
 @Immutable

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -31,7 +31,9 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
- * @author Dan Florian
+ * The <code>FolderNode</code> class is responsible for knowing how to create a URL for a folder, create a JSON representation of
+ * a folder, and create the appropriate JCR nodes for a folder.
+ * 
  * @since 0.6
  */
 @Immutable
@@ -61,7 +63,7 @@
     public FolderNode( Workspace workspace,
                        String fullPath ) throws Exception {
         super(fullPath);
-        
+
         Utils.nullArgumentCheck("workspace", workspace); //$NON-NLS-1$
         Utils.nullArgumentCheck("fullPath", fullPath); //$NON-NLS-1$
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IJsonConstants.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IJsonConstants.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IJsonConstants.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -24,7 +24,9 @@
 package org.jboss.dna.web.jcr.rest.client.json;
 
 /**
- * @author Dan Florian
+ * The <code>IJsonConstants</code> interface provides JSON-specific constants used when JSON as a transport mechanism between the
+ * REST client and the REST server.
+ * 
  * @since 0.6
  */
 public interface IJsonConstants {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -28,7 +28,9 @@
 import org.jboss.dna.web.jcr.rest.client.Utils;
 
 /**
- * @author Dan Florian
+ * The <code>JsonNode</code> class defines the API for interacing with JSON objects. Every <code>JsonNode</code> knows how to
+ * create their URL and create their JCR content.
+ * 
  * @since 0.6
  */
 public abstract class JsonNode extends JSONObject {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -49,7 +49,9 @@
 import org.jboss.dna.web.jcr.rest.client.json.IJsonConstants.RequestMethod;
 
 /**
- * @author Dan Florian
+ * The <code>JsonRestClient</code> class is an implementation of <code>IRestClient</code> that works with the DNA REST server that
+ * uses JSON as its interface protocol.
+ * 
  * @since 0.6
  */
 public final class JsonRestClient implements IRestClient {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -32,7 +32,8 @@
 import org.jboss.dna.web.jcr.rest.client.Utils;
 
 /**
- * @author Dan Florian
+ * The <code>JsonUtils</code> class provides utilities needed to work with the DNA REST server JSON API.
+ * 
  * @since 0.6
  */
 public final class JsonUtils {
@@ -40,7 +41,7 @@
     // ===========================================================================================================================
     // Class Methods
     // ===========================================================================================================================
-    
+
     /**
      * The default character set being used.
      * 
@@ -55,7 +56,7 @@
     /**
      * @param text the text whose escape sequences will be replaced with the actual characters (never <code>null</code>)
      * @return the decoded text
-     * @throws UnsupportedEncodingException 
+     * @throws UnsupportedEncodingException
      * @since 0.6
      */
     public static String decodeEscaping( String text ) throws UnsupportedEncodingException {
@@ -66,7 +67,7 @@
     /**
      * @param text the text whose escape sequences will be replaced with the actual characters (never <code>null</code>)
      * @return the decoded text
-     * @throws UnsupportedEncodingException 
+     * @throws UnsupportedEncodingException
      * @since 0.6
      */
     public static String encodeEscaping( String text ) throws UnsupportedEncodingException {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -33,7 +33,9 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
- * @author Dan Florian
+ * The <code>RepositoryNode</code> class is responsible for knowing how to create a URL for a repository and to parse a JSON
+ * response into {@link Workspace workspace} objects.
+ * 
  * @since 0.6
  */
 public final class RepositoryNode extends JsonNode {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -34,7 +34,9 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
 /**
- * @author Dan Florian
+ * The <code>ServerNode</code> class is responsible for knowing how to create a URL for a server, create a URL to obtain a
+ * server's repositories, and parse a JSON response into {@link Repository repository} objects.
+ * 
  * @since 0.6
  */
 public final class ServerNode extends JsonNode {
@@ -84,7 +86,10 @@
             url.delete((url.length() - 1), (url.length() - 1));
         }
 
+        // append server context and insert user
         url.append(IJsonConstants.SERVER_CONTEXT);
+        //        url.insert(url.indexOf(":") + 1, this.server.getUser() + '@'); //$NON-NLS-1$
+
         return new URL(url.toString());
     }
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -27,7 +27,10 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
- * @author dan
+ * The <code>WorkspaceNode</code> class is responsible for knowing how to create a URL for a {@link Workspace workspace}. The URL
+ * can be used to publish and unpublish resources.
+ * 
+ * @since 0.6
  */
 public class WorkspaceNode extends JsonNode {
 

Added: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/package-info.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/package-info.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/package-info.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -0,0 +1,29 @@
+/*
+ * 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 JSON package defines an implementation of an
+ * {@link org.jboss.dna.web.jcr.rest.client.IRestClient DNA REST client}. Classes in this package are responsible for creating 
+ * JSON requests and parsing JSON responses from the server into domain objects.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
\ No newline at end of file


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/package-info.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/package-info.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/package-info.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -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.
+ */
+/**
+ * The JBoss DNA REST Client is a lightweight, non-UI Maven project that interacts with the DNA REST server. A server 
+ * registry managed by the {@link ServerManager server manager} is used to publish and unpublish files to/from DNA
+ * {@link org.jboss.dna.web.jcr.rest.client.domain.Repository repository}
+ * {@link org.jboss.dna.web.jcr.rest.client.domain.Workspace workspaces}. When a DNA 
+ * {@link org.jboss.dna.web.jcr.rest.client.domain.Server server} is added, deleted, or updated in the registry the server manager
+ * notifies all registered listeners.
+ */
+
+package org.jboss.dna.web.jcr.rest.client;
\ No newline at end of file


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties	2009-08-05 19:38:11 UTC (rev 1148)
@@ -29,13 +29,13 @@
 
 RepositoryEmptyNameMsg = A repository name cannot be empty
 RepositoryNullServerMsg = A repository server cannot be null
-RepositoryShortDescription = DNA Repository: Name: {0}, {1}
+RepositoryShortDescription = DNA Repository - Name: {0}, Server: {1}
 
 ServerEmptyUserMsg = The user cannot be empty
 ServerEmptyUrlMsg = A server URL cannot be empty
 ServerExistsMsg = {0} already exists so it cannot be added
 ServerInvalidUrlMsg = The  value "{0}" is not a valid server URL
-ServerShortDescription = DNA Server: URL={0} User={1}
+ServerShortDescription = DNA Server - URL: {0} User: {1}
 
 ServerManagerRegistryAddUnexpectedError = Unexpected error adding server to registry
 ServerManagerRegistryListenerError = This error was reported by an IServerRegistryListener
@@ -47,7 +47,7 @@
 
 WorkspaceEmptyNameMsg = A workspace name cannot be empty
 WorkspaceNullRepositoryMsg = A workspace repository cannot be null
-WorkspaceShortDescription = DNA Repository Workspace: Name: {0}, {1}
+WorkspaceShortDescription = DNA Workspace - Name: {0}, Repository: {1}
 
 # JsonRestClient messages
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -30,7 +30,8 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
- * @author Dan Florian
+ * The <code>MockRestExecutor</code> class is a test <code>IRestClient</code> implementation that does nothing.
+ * 
  * @since 0.6
  */
 public final class MockRestExecutor implements IRestClient {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -31,7 +31,8 @@
 import org.junit.Test;
 
 /**
- * @author Dan Florian
+ * The <code>ServerManagerTest</code> class is a test class for the {@link ServerManager server manager} object.
+ * 
  * @since 0.6
  */
 public final class ServerManagerTest {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/StatusTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/StatusTest.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/StatusTest.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -31,7 +31,8 @@
 import org.junit.Test;
 
 /**
- * @author Dan Florian
+ * The <code>StatusTest</code> class is a test class for the {@link Status status} object.
+ * 
  * @since 0.6
  */
 public final class StatusTest {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/RepositoryTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/RepositoryTest.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/RepositoryTest.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -32,7 +32,8 @@
 import org.junit.Test;
 
 /**
- * @author Dan Florian
+ * The <code>RepositoryTest</code> class is a test class for the {@link Repository repository} object.
+ * 
  * @since 0.6
  */
 public final class RepositoryTest {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/ServerTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/ServerTest.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/ServerTest.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -32,7 +32,8 @@
 import org.junit.Test;
 
 /**
- * @author Dan Florian
+ * The <code>ServerTest</code> class is a test class for the {@link Server server} object.
+ * 
  * @since 0.6
  */
 public final class ServerTest {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/WorkspaceTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/WorkspaceTest.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/domain/WorkspaceTest.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -32,7 +32,8 @@
 import org.junit.Test;
 
 /**
- * @author Dan Florian
+ * The <code>WorkspaceTest</code> class is a test class for the {@link Workspace workspace} object.
+ * 
  * @since 0.6
  */
 public final class WorkspaceTest {

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java	2009-08-05 16:00:30 UTC (rev 1147)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java	2009-08-05 19:38:11 UTC (rev 1148)
@@ -40,7 +40,8 @@
 import org.junit.Test;
 
 /**
- * @author Dan Florian
+ * The <code>JsonRestClientTest</code> class is a test class for the {@link JsonRestClient JSON REST client} object.
+ * 
  * @since 0.6
  */
 public final class JsonRestClientTest {
@@ -120,7 +121,7 @@
 
         // confirm it exists in repository
         assertThat(((JsonRestClient)this.restClient).pathExists(WORKSPACE1, WORKSPACE_PATH, file), is(true));
-        
+
         // TODO: get jcr:data and compare
     }
 


From dna-commits at lists.jboss.org  Wed Aug  5 17:42:44 2009
From: dna-commits at lists.jboss.org (© VIAGRA ® Official Site)
Date: Wed, 5 Aug 2009 17:42:44 -0400
Subject: [dna-commits] Dear dna-commits@lists.jboss.org 72% 0FF on Pfizer !
Message-ID: <200908052142.n75Lgirw030995@lists01.dmz-a.mwc.hst.phx2.redhat.com>

An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/dna-commits/attachments/20090805/527a340a/attachment.html 

From dna-commits at lists.jboss.org  Thu Aug  6 04:03:17 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 04:03:17 -0400
Subject: [dna-commits] DNA SVN: r1149 -
	trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem.
Message-ID: <200908060803.n7683HJr013689@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 04:03:17 -0400 (Thu, 06 Aug 2009)
New Revision: 1149

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java
Log:
Fixed erroneous @Override tag that broke nightly integration build

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java	2009-08-05 19:38:11 UTC (rev 1148)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemSource.java	2009-08-06 08:03:17 UTC (rev 1149)
@@ -557,7 +557,6 @@
             filenameFilter = new FilenameFilter() {
                 Pattern filter = Pattern.compile(filterPattern);
 
-                @Override
                 public boolean accept( File dir,
                                        String name ) {
                     return !filter.matcher(name).matches();


From dna-commits at lists.jboss.org  Thu Aug  6 08:34:38 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 08:34:38 -0400
Subject: [dna-commits] DNA SVN: r1150 -
	branches/eclipse/dna-web-jcr-rest-client.
Message-ID: <200908061234.n76CYc83000848@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-06 08:34:38 -0400 (Thu, 06 Aug 2009)
New Revision: 1150

Removed:
   branches/eclipse/dna-web-jcr-rest-client/target/
Log:
Mistakenly checked-in target. Deleting it now.


From dna-commits at lists.jboss.org  Thu Aug  6 11:01:08 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 11:01:08 -0400
Subject: [dna-commits] DNA SVN: r1151 -
	trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem.
Message-ID: <200908061501.n76F18aV003013@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 11:01:07 -0400 (Thu, 06 Aug 2009)
New Revision: 1151

Modified:
   trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
Log:
Corrected test that passes locally but fails on Hudson due to environmental issues

Modified: trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-06 12:34:38 UTC (rev 1150)
+++ trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-06 15:01:07 UTC (rev 1151)
@@ -425,7 +425,7 @@
     public void shouldBeAbleToCreateDeepPath() {
         String pathName = "";
 
-        for (int i = 0; i < 30; i++) {
+        for (int i = 0; i < 20; i++) {
             pathName += "/test";
             graph.create(pathName).orReplace().and();
         }


From dna-commits at lists.jboss.org  Thu Aug  6 11:02:53 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 11:02:53 -0400
Subject: [dna-commits] DNA SVN: r1152 -
	trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem.
Message-ID: <200908061502.n76F2r8m003251@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 11:02:52 -0400 (Thu, 06 Aug 2009)
New Revision: 1152

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
Log:
Added output to an assertion to try to determine why a request is failing on Hudson and passing locally.

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 15:01:07 UTC (rev 1151)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 15:02:52 UTC (rev 1152)
@@ -352,7 +352,7 @@
         assert workspace != null;
 
         File parent = getExistingFileFor(workspace, parentPath, request.under(), request);
-        assert parent != null;
+        assert parent != null : workspace.getPath() + " <=> " + parentPath.getString();
 
         NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();
         String newName = request.named().getString(registry);


From dna-commits at lists.jboss.org  Thu Aug  6 11:29:02 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 11:29:02 -0400
Subject: [dna-commits] DNA SVN: r1153 - in
	trunk/extensions/dna-connector-filesystem/src/main:
	resources/org/jboss/dna/connector/filesystem and 1 other directory.
Message-ID: <200908061529.n76FT26g007174@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 11:29:02 -0400 (Thu, 06 Aug 2009)
New Revision: 1153

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
   trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties
Log:
Expanded error message to get more info about Hudson failure

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 15:02:52 UTC (rev 1152)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 15:29:02 UTC (rev 1153)
@@ -1040,7 +1040,8 @@
             if (len > maxPathLength - delta) {
                 String msg = FileSystemI18n.maxPathLengthExceeded.text(this.maxPathLength,
                                                                        this.getSourceName(),
-                                                                       root.getCanonicalPath());
+                                                                       root.getCanonicalPath(),
+                                                                       delta);
                 throw new RepositorySourceException(this.getSourceName(), msg);
             }
 

Modified: trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties	2009-08-06 15:02:52 UTC (rev 1152)
+++ trunk/extensions/dna-connector-filesystem/src/main/resources/org/jboss/dna/connector/filesystem/FileSystemI18n.properties	2009-08-06 15:29:02 UTC (rev 1153)
@@ -55,4 +55,4 @@
 deleteFailed = Could not delete file at path "{0}" in workspace "{1}" in {2}
 copyFailed = Could not copy file at path "{0}" in workspace "{1}" to path "{2}" in workspace "{3}" in {4}
 getCanonicalPathFailed = Could not determine canonical path
-maxPathLengthExceeded = The maximum absolute path length ({0}) for source "{1}" was exceeded by the node at: {2}
+maxPathLengthExceeded = The maximum absolute path length ({0}) for source "{1}" was exceeded by the node at: {2} ({3})


From dna-commits at lists.jboss.org  Thu Aug  6 11:31:03 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 11:31:03 -0400
Subject: [dna-commits] DNA SVN: r1154 -
	trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem.
Message-ID: <200908061531.n76FV3us007634@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 11:31:03 -0400 (Thu, 06 Aug 2009)
New Revision: 1154

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
Log:
Expanded error message to get more info about Hudson failure

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 15:29:02 UTC (rev 1153)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 15:31:03 UTC (rev 1154)
@@ -352,6 +352,9 @@
         assert workspace != null;
 
         File parent = getExistingFileFor(workspace, parentPath, request.under(), request);
+        if (parent == null) {
+            System.out.println(workspace.getPath() + " <=> " + parentPath.getString());
+        }
         assert parent != null : workspace.getPath() + " <=> " + parentPath.getString();
 
         NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();


From dna-commits at lists.jboss.org  Thu Aug  6 13:42:22 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 13:42:22 -0400
Subject: [dna-commits] DNA SVN: r1155 -
	trunk/dna-graph/src/main/java/org/jboss/dna/graph.
Message-ID: <200908061742.n76HgMwx031199@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-06 13:42:22 -0400 (Thu, 06 Aug 2009)
New Revision: 1155

Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java
Log:
Removed simulated synthetic access error by changing private variable to protected

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java	2009-08-06 15:31:03 UTC (rev 1154)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java	2009-08-06 17:42:22 UTC (rev 1155)
@@ -163,7 +163,7 @@
 
     private final String sourceName;
     private final RepositoryConnectionFactory connectionFactory;
-    private final ExecutionContext context;
+    protected final ExecutionContext context;
     protected final RequestBuilder requests;
     protected final Conjunction<Graph> nextGraph;
     private Workspace currentWorkspace;
@@ -4225,7 +4225,7 @@
          * @return the interface for additional requests or actions
          */
         Next as( Name newName );
-        
+
         /**
          * Finish the request by specifying the name of the new child node. This method indicates that the child should be added
          * as a new node with the given name at the end of the parents children
@@ -4233,7 +4233,7 @@
          * @param newName the new name
          * @return the interface for additional requests or actions
          */
-        Next as( String newName );        
+        Next as( String newName );
     }
 
     /**


From dna-commits at lists.jboss.org  Thu Aug  6 16:41:42 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 16:41:42 -0400
Subject: [dna-commits] DNA SVN: r1156 -
	trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem.
Message-ID: <200908062041.n76KfgoW005037@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 16:41:42 -0400 (Thu, 06 Aug 2009)
New Revision: 1156

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
Log:
DNA-503 File system connector unit tests are failing

Manually merged DNA-503.patch to attempt to address Hudson failures.  

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 17:42:22 UTC (rev 1155)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 20:41:42 UTC (rev 1156)
@@ -457,6 +457,7 @@
 
                     } finally {
                         try {
+                            if (checkForContents != null) checkForContents.close();
                             checkForContents.close();
                         } catch (Exception ignore) {
                         }
@@ -535,10 +536,12 @@
 
             if (!newFile.mkdir()) {
                 I18n msg = FileSystemI18n.couldNotCreateFile;
-                request.setError(new RepositorySourceException(getSourceName(), msg.text(parent.getPath(),
-                                                                                         request.inWorkspace(),
-                                                                                         getSourceName(),
-                                                                                         primaryType.getString(registry))));
+                request.setError(new RepositorySourceException(
+                                                               getSourceName(),
+                                                               msg.text(parent.getPath(),
+                                                                        request.inWorkspace(),
+                                                                        getSourceName(),
+                                                                        primaryType == null ? "null" : primaryType.getString(registry))));
                 return;
             }
         } else {


From dna-commits at lists.jboss.org  Thu Aug  6 18:08:01 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 18:08:01 -0400
Subject: [dna-commits] DNA SVN: r1157 - in
	trunk/extensions/dna-connector-filesystem/src:
	test/java/org/jboss/dna/connector/filesystem and 1 other directory.
Message-ID: <200908062208.n76M81S6017950@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 18:08:01 -0400 (Thu, 06 Aug 2009)
New Revision: 1157

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
   trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
Log:
Cleaned up exception handling, added debug message

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 20:41:42 UTC (rev 1156)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-06 22:08:01 UTC (rev 1157)
@@ -353,9 +353,9 @@
 
         File parent = getExistingFileFor(workspace, parentPath, request.under(), request);
         if (parent == null) {
-            System.out.println(workspace.getPath() + " <=> " + parentPath.getString());
+            // Error was already set on request in getExistingFileFor
+            return;
         }
-        assert parent != null : workspace.getPath() + " <=> " + parentPath.getString();
 
         NamespaceRegistry registry = getExecutionContext().getNamespaceRegistry();
         String newName = request.named().getString(registry);

Modified: trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-06 20:41:42 UTC (rev 1156)
+++ trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-06 22:08:01 UTC (rev 1157)
@@ -46,15 +46,24 @@
 
     public static final String ARBITRARY_PROPERTIES_NOT_SUPPORTED = "This connector does not support setting arbitrary properties";
 
-    private static final String REPO_PATH = "./src/test/resources/repositories/";
+    private static final String REPO_PATH = "./target/repositories/";
+    private static final String REPO_SOURCE_PATH = "./src/test/resources/repositories/";
     private final String TEST_CONTENT = "Test content";
 
     protected File testWorkspaceRoot;
     protected File otherWorkspaceRoot;
     protected File newWorkspaceRoot;
+    protected File scratchDirectory;
 
     @Override
-    protected RepositorySource setUpSource() {
+    protected RepositorySource setUpSource() throws Exception {
+        // Copy the directories into the target ...
+        File sourceRepo = new File(REPO_SOURCE_PATH);
+        scratchDirectory = new File(REPO_PATH);
+        scratchDirectory.mkdirs();
+        FileUtil.delete(scratchDirectory);
+        FileUtil.copy(sourceRepo, scratchDirectory);
+
         // Set the connection properties to be use the content of "./src/test/resources/repositories" as a repository ...
         String[] predefinedWorkspaceNames = new String[] {"test", "otherWorkspace", "airplanes", "cars"};
         FileSystemSource source = new FileSystemSource();
@@ -67,7 +76,7 @@
 
         testWorkspaceRoot = new File(REPO_PATH, "test");
         testWorkspaceRoot.mkdir();
-        
+
         otherWorkspaceRoot = new File(REPO_PATH, "otherWorkspace");
         otherWorkspaceRoot.mkdir();
 
@@ -84,9 +93,8 @@
 
     @Override
     public void afterEach() throws Exception {
-        FileUtil.delete(testWorkspaceRoot);
-        FileUtil.delete(otherWorkspaceRoot);
-        FileUtil.delete(newWorkspaceRoot);
+        FileUtil.delete(scratchDirectory);
+
         super.afterEach();
     }
 
@@ -132,13 +140,14 @@
     }
 
     @Test
-    public void shouldBeAbleToAddChildrenToFolder() {
+    public void shouldBeAbleToAddChildrenToFolder() throws Exception {
         graph.create("/testFolder").orReplace().and();
 
         File newFolder = new File(testWorkspaceRoot, "testFolder");
         assertThat(newFolder.exists(), is(true));
         assertThat(newFolder.isDirectory(), is(true));
-
+        System.out.println("Created new folder at: " + newFolder.getCanonicalPath());
+        
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
         graph.create("/testFolder/testfile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
                                                                                                                 TEST_CONTENT.getBytes()).orReplace().and();
@@ -350,7 +359,7 @@
         assertContents(newFile, TEST_CONTENT);
         File newFile2 = new File(testWorkspaceRoot, "testFolder/testFile2");
         assertContents(newFile2, TEST_CONTENT);
-        
+
         graph.move("/testFolder/testFile2").before("/testFolder/testFile");
     }
 
@@ -418,7 +427,7 @@
 
         newFile = new File(newWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
-        
+
     }
 
     @Test


From dna-commits at lists.jboss.org  Thu Aug  6 19:11:43 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 6 Aug 2009 19:11:43 -0400
Subject: [dna-commits] DNA SVN: r1158 -
	trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem.
Message-ID: <200908062311.n76NBhhN030628@svn01.web.mwc.hst.phx2.redhat.com>

Author: bcarothers
Date: 2009-08-06 19:11:43 -0400 (Thu, 06 Aug 2009)
New Revision: 1158

Modified:
   trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
Log:
Fixed casing in test so that the test might possibly pass on a case-sensitive FS.

Modified: trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-06 22:08:01 UTC (rev 1157)
+++ trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-06 23:11:43 UTC (rev 1158)
@@ -149,7 +149,7 @@
         System.out.println("Created new folder at: " + newFolder.getCanonicalPath());
         
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testfile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
+        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
                                                                                                                 TEST_CONTENT.getBytes()).orReplace().and();
 
         File newFile = new File(testWorkspaceRoot, "testFolder/testFile");


From dna-commits at lists.jboss.org  Mon Aug 10 14:34:03 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Mon, 10 Aug 2009 14:34:03 -0400
Subject: [dna-commits] DNA SVN: r1159 - in trunk/extensions:
	dna-web-jcr-rest-war and 1 other directory.
Message-ID: <200908101834.n7AIY3Z9024131@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-10 14:34:03 -0400 (Mon, 10 Aug 2009)
New Revision: 1159

Modified:
   trunk/extensions/dna-web-jcr-rest-war/pom.xml
   trunk/extensions/dna-web-jcr-rest/pom.xml
Log:
DNA-500 Corrected the POM file for the REST projects, which specified the version of SLF4J explicitly (rather than inheriting them from the parent POM

Modified: trunk/extensions/dna-web-jcr-rest/pom.xml
===================================================================
--- trunk/extensions/dna-web-jcr-rest/pom.xml	2009-08-06 23:11:43 UTC (rev 1158)
+++ trunk/extensions/dna-web-jcr-rest/pom.xml	2009-08-10 18:34:03 UTC (rev 1159)
@@ -49,7 +49,7 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-log4j12</artifactId>
-			<version>1.4.3</version>
+			<version>1.5.8</version>
 			<scope>runtime</scope>
 		</dependency>
 		<!-- 

Modified: trunk/extensions/dna-web-jcr-rest-war/pom.xml
===================================================================
--- trunk/extensions/dna-web-jcr-rest-war/pom.xml	2009-08-06 23:11:43 UTC (rev 1158)
+++ trunk/extensions/dna-web-jcr-rest-war/pom.xml	2009-08-10 18:34:03 UTC (rev 1159)
@@ -21,7 +21,7 @@
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-log4j12</artifactId>
-			<version>1.4.3</version>
+			<version>1.5.8</version>
 			<scope>runtime</scope>
 		</dependency>
 


From dna-commits at lists.jboss.org  Mon Aug 10 17:31:32 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Mon, 10 Aug 2009 17:31:32 -0400
Subject: [dna-commits] DNA SVN: r1160 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt: META-INF and
	10 other directories.
Message-ID: <200908102131.n7ALVWfq022769@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-10 17:31:32 -0400 (Mon, 10 Aug 2009)
New Revision: 1160

Added:
   branches/eclipse/org.jboss.dna.publish.ui.swt/dna-common-0.6-SNAPSHOT-sources.jar
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/dna_icon_16x.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/publish.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/unpublish.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/wizards/dna_wizard_banner.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/log4j.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/package-info.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/package-info.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLogger.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLoggerFactory.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/StaticLoggerBinder.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/package-info.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/package-info.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/package-info.java
Removed:
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/dna_window.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/wizards/dna_wizard_banner.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/I18n.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/i18n.properties
Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF
   branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
   branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/objects/server.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/objects/workspace.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java
Log:
Added dna-common as a dependency so I could start using it's I18n, logging, CheckArg, and file extension mime type detector frameworks. Added or modified some images. Many javadoc changes and removed all @author tags. Added logging to the Eclipse Console view. However, the slf4j logging is not working.

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF	2009-08-10 21:31:32 UTC (rev 1160)
@@ -8,7 +8,9 @@
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.eclipse.core.resources
+ org.eclipse.core.resources,
+ org.eclipse.ui.console,
+ org.eclipse.jface.text
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Bundle-ClassPath: dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar,

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties	2009-08-10 21:31:32 UTC (rev 1160)
@@ -12,7 +12,8 @@
                plugin.xml,\
                LEGAL.txt,\
                AUTHORS.txt,\
-               dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
+               dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar,\
+               src/log4j.properties
 src.includes = src/,\
                LEGAL.txt
 source.dnaPublishUi.jar = src/

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-common-0.6-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-common-0.6-SNAPSHOT-sources.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/objects/server.gif
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/objects/workspace.gif
===================================================================
(Binary files differ)

Copied: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/dna_icon_16x.png (from rev 1076, branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/dna_window.png)
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/dna_icon_16x.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/dna_window.png
===================================================================
(Binary files differ)

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/publish.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/publish.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/unpublish.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/unpublish.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/wizards/dna_wizard_banner.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/wizards/dna_wizard_banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/wizards/dna_wizard_banner.png
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-10 21:31:32 UTC (rev 1160)
@@ -13,7 +13,7 @@
                label="%contextMenu.label"
                path="additions">
             <separator
-                  name="group1">
+                  name="dna">
             </separator>
          </menu>
          
@@ -22,6 +22,7 @@
                id="org.jboss.dna.web.jcr.rest.client.swt.unpublishAction"
                label="%unpublishAction.label"
                class="org.jboss.dna.web.jcr.rest.client.swt.actions.UnpublishAction"
+               icon="icons/views/unpublish.png"
                menubarPath="org.jboss.dna.web.jcr.rest.client.swt.contextMenu/group1"
                enablesFor="*">
                <enablement>
@@ -41,6 +42,7 @@
                id="org.jboss.dna.web.jcr.rest.client.swt.publishAction"
                label="%publishAction.label"
                class="org.jboss.dna.web.jcr.rest.client.swt.actions.PublishAction"
+               icon="icons/views/publish.png"
                menubarPath="org.jboss.dna.web.jcr.rest.client.swt.contextMenu/group1"
                enablesFor="*">
                <enablement>

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/log4j.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/log4j.properties	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/log4j.properties	2009-08-10 21:31:32 UTC (rev 1160)
@@ -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: branches/eclipse/org.jboss.dna.publish.ui.swt/src/log4j.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -25,6 +25,7 @@
 
 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;
@@ -32,7 +33,7 @@
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.jboss.dna.web.jcr.rest.client.Logger;
+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;
@@ -43,12 +44,12 @@
 import org.osgi.framework.BundleContext;
 
 /**
- * The activator class controls the plug-in life cycle.
+ * The <code>Activator</code> controls the plug-in life cycle, provides utility functions, and keeps track of the
+ * {@link ServerManager}.
  * 
- * @author Dan Florian
  * @since 0.6
  */
-public class Activator extends AbstractUIPlugin implements IUiConstants {
+public final class Activator extends AbstractUIPlugin implements IUiConstants {
 
     // ===========================================================================================================================
     // Class Fields
@@ -95,12 +96,19 @@
     // 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
+     * @since 0.6
+     */
     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, I18n.bind(I18n.MissingImage, key), e));
+            log(new Status(Severity.ERROR, RestClientI18n.missingImage.text(key), e));
             return null;
         }
     }
@@ -118,23 +126,25 @@
     }
 
     /**
-     * @param imageId the shared image identifier
-     * @return the image or <code>null</code>
+     * @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
      * @since 0.6
      */
     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
-     * @return the image descriptor or <code>null</code>
+     * @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
      * @since 0.6
      */
     public ImageDescriptor getSharedImageDescriptor( String imageId ) {
+        CheckArg.isNotNull(imageId, "imageId"); //$NON-NLS-1$
         ImageDescriptor result = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imageId);
 
         if (result != null) {
@@ -225,10 +235,11 @@
     }
 
     /**
-     * @param status the status being logged
+     * @param status the status being logged (never <code>null</code>)
      * @since 0.6
      */
     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());
@@ -243,6 +254,8 @@
      */
     @Override
     public void start( BundleContext context ) throws Exception {
+        BasicConfigurator.configure();
+        
         super.start(context);
         plugin = this;
 
@@ -251,7 +264,7 @@
 
         // problem restoring server registry
         if (!status.isOk()) {
-            Logger.log(getClass(), status);
+            log(status);
         }
     }
 

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/I18n.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/I18n.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/I18n.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -1,138 +0,0 @@
-/*
- * 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.web.jcr.rest.client.swt;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * The I18n class handles localization messages.
- * 
- * @author Dan Florian
- * @since 0.6
- */
-public final class I18n extends NLS {
-    
-    public static String BasePublishingActionPublishingWizardErrorMsg;
-    public static String BasePublishingActionUnpublishingWizardErrorMsg;
-
-    public static String CollapseActionToolTip;
-
-    public static String DeleteServerActionText;
-    public static String DeleteServerActionToolTip;
-
-    public static String DeleteServerDialogErrorsOccurredMsg;
-    public static String DeleteServerDialogMultipleServersMsg;
-    public static String DeleteServerDialogOneServerMsg;
-    public static String DeleteServerDialogTitle;
-
-    public static String EditServerActionText;
-    public static String EditServerActionToolTip;
-    
-    public static String ErrorDialogTitle;
-
-    public static String MissingImage;
-    
-    public static String NewServerActionText;
-    public static String NewServerActionToolTip;
-
-    public static String PublishingResultsPublishNotAttemptedMsg;
-    public static String PublishingResultsTooManyResultsMsg;
-    public static String PublishingResultsUnknownSeverityMsg;
-    public static String PublishingResultsUnpublishNotAttemptedMsg;
-
-    public static String PublishOperationPublishTaskName;
-    public static String PublishOperationUnpublishTaskName;
-    
-    public static String PublishPagePublishTitle;
-    public static String PublishPageLocationGroupTitle;
-    public static String PublishPageMissingRepositoryStatusMsg;
-    public static String PublishPageMissingServerStatusMsg;
-    public static String PublishPageMissingWorkspaceStatusMsg;
-    public static String PublishPageNewServerButton;
-    public static String PublishPageNoAvailableRepositoriesStatusMsg;
-    public static String PublishPageNoAvailableServersStatusMsg;
-    public static String PublishPageNoAvailableWorkspacesStatusMsg;
-    public static String PublishPageNoResourcesToPublishStatusMsg;
-    public static String PublishPageNoResourcesToUnpublishStatusMsg;
-    public static String PublishPagePublishOkStatusMsg;
-    public static String PublishPagePublishResourcesLabel;
-    public static String PublishPageRecurseCheckBox;
-    public static String PublishPageRecurseCheckBoxToolTip;
-    public static String PublishPageRecurseProcessingErrorMsg;
-    public static String PublishPageRepositoryLabel;
-    public static String PublishPageRepositoryToolTip;
-    public static String PublishPageServerLabel;
-    public static String PublishPageServerToolTip;
-    public static String PublishPageUnpublishOkStatusMsg;
-    public static String PublishPageUnpublishResourcesLabel;
-    public static String PublishPageUnpublishTitle;
-    public static String PublishPageWorkspaceLabel;
-    public static String PublishPageWorkspacePublishToolTip;
-    public static String PublishPageWorkspaceUnpublishToolTip;
-    
-    public static String PublishResultsDialogErrorPublishingMsg;
-    public static String PublishResultsDialogErrorUnpublishingMsg;
-    public static String PublishResultsDialogFileHeader;
-    public static String PublishResultsDialogMessageHeader;
-    public static String PublishResultsDialogPublishMsg;
-    public static String PublishResultsDialogTitle;
-    public static String PublishResultsDialogUnpublishMsg;
-
-    public static String PublishWizardPublishErrorMsg;
-    public static String PublishWizardPublishTitle;
-    public static String PublishWizardUnpublishTitle;
-    public static String PublishWizardUnpublishErrorMsg;
-
-    public static String RefreshActionToolTip;
-
-    public static String ServerManagerGetRepositoriesExceptionMsg;
-    public static String ServerManagerGetWorkspacesExceptionMsg;
-
-    public static String ServerPageAuthenticationGroupTitle;
-    public static String ServerPageInvalidServerProperties;
-    public static String ServerPageOkStatusMsg;
-    public static String ServerPagePasswordLabel;
-    public static String ServerPagePasswordToolTip;
-    public static String ServerPageSavePasswordButton;
-    public static String ServerPageSavePasswordLabel;
-    public static String ServerPageSavePasswordToolTip;
-    public static String ServerPageTitle;
-    public static String ServerPageUrlLabel;
-    public static String ServerPageUrlToolTip;
-    public static String ServerPageUserLabel;
-    public static String ServerPageUserToolTip;
-    
-    public static String ServerViewToolTip;
-
-    public static String ServerWizardEditServerErrorMsg;
-    public static String ServerWizardEditServerTitle;
-    public static String ServerWizardNewServerErrorMsg;
-    public static String ServerWizardNewServerTitle;
-
-    static {
-        // load message bundle
-        NLS.initializeMessages(I18n.class.getPackage().getName() + ".i18n", I18n.class); //$NON-NLS-1$
-    }
-
-}

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -24,7 +24,6 @@
 package org.jboss.dna.web.jcr.rest.client.swt;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public interface IUiConstants {
@@ -62,20 +61,24 @@
 
     String DELETE_SERVER_IMAGE_PATH = VIEWS_ICON_FOLDER + "delete_server.gif"; //$NON-NLS-1$
 
-    String DNA_WINDOW_IMAGE_PATH = VIEWS_ICON_FOLDER + "dna_window.png"; //$NON-NLS-1$
+    String DNA_IMAGE_16x = VIEWS_ICON_FOLDER + "dna_icon_16x.png"; //$NON-NLS-1$
 
     String EDIT_SERVER_IMAGE_PATH = VIEWS_ICON_FOLDER + "edit_server.gif"; //$NON-NLS-1$
 
     String NEW_SERVER_IMAGE_PATH = VIEWS_ICON_FOLDER + "new_server.gif"; //$NON-NLS-1$
 
+    String PUBLISH_IMAGE_PATH = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
+
     String REFRESH_IMAGE_PATH = VIEWS_ICON_FOLDER + "refresh.gif"; //$NON-NLS-1$
 
+    String UNPUBLISH_IMAGE_PATH = VIEWS_ICON_FOLDER + "unpublish.png"; //$NON-NLS-1$
+
     //
     // /icons/wizards/
     //
 
     String WIZARD_ICONS_FOLDER = ICON_PATH + "wizards/"; //$NON-NLS-1$
 
-    String DNA_WIZARD_BANNER_IMAGE_PATH = WIZARD_ICONS_FOLDER + "dna_wizard_banner.png"; //$NON-NLS-1$
+    String DNA_WIZARD_BANNER_IMAGE_PATH = WIZARD_ICONS_FOLDER + "dna_wizard_banner.gif"; //$NON-NLS-1$
 
 }

Copied: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java (from rev 1141, branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/I18n.java)
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -0,0 +1,152 @@
+/*
+ * 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.web.jcr.rest.client.swt;
+
+import org.jboss.dna.common.i18n.I18n;
+
+/**
+ * The <code>RestClientI18n</code> class provides localized messages.
+ * 
+ * @since 0.6
+ */
+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 editServerActionText;
+    public static I18n editServerActionToolTip;
+
+    public static I18n errorDialogTitle;
+
+    public static I18n missingImage;
+
+    public static I18n newServerActionText;
+    public static I18n newServerActionToolTip;
+
+    public static I18n publishingResultsPublishNotAttemptedMsg;
+    public static I18n publishingResultsTooManyResultsMsg;
+    public static I18n publishingResultsUnknownSeverityMsg;
+    public static I18n publishingResultsUnpublishNotAttemptedMsg;
+
+    public static I18n publishOperationConsoleName;
+    public static I18n publishOperationPublish;
+    public static I18n publishOperationPublishFile;
+    public static I18n publishOperationPublishFileFailed;
+    public static I18n publishOperationPublishTaskName;
+    public static I18n publishOperationUnpublish;
+    public static I18n publishOperationUnpublishFile;
+    public static I18n publishOperationUnpublishFileFailed;
+    public static I18n publishOperationUnpublishTaskName;
+
+    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 publishResultsDialogErrorIncompletePublishingMsg;
+    public static I18n publishResultsDialogErrorIncompleteUnpublishingMsg;
+    public static I18n publishResultsDialogErrorPublishingMsg;
+    public static I18n publishResultsDialogErrorUnpublishingMsg;
+    public static I18n publishResultsDialogFileHeader;
+    public static I18n publishResultsDialogIncompletePublishMsg;
+    public static I18n publishResultsDialogIncompleteUnpublishMsg;
+    public static I18n publishResultsDialogMessageHeader;
+    public static I18n publishResultsDialogPublishMsg;
+    public static I18n publishResultsDialogStatisticsMsg;
+    public static I18n publishResultsDialogTitle;
+    public static I18n publishResultsDialogUnpublishMsg;
+
+    public static I18n publishWizardPublishErrorMsg;
+    public static I18n publishWizardPublishTitle;
+    public static I18n publishWizardUnpublishTitle;
+    public static I18n publishWizardUnpublishErrorMsg;
+
+    public static I18n refreshActionToolTip;
+
+    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 serverPageTitle;
+    public static I18n serverPageUrlLabel;
+    public static I18n serverPageUrlToolTip;
+    public static I18n serverPageUserLabel;
+    public static I18n serverPageUserToolTip;
+
+    public static I18n serverViewToolTip;
+
+    public static I18n serverWizardEditServerErrorMsg;
+    public static I18n serverWizardEditServerTitle;
+    public static I18n serverWizardNewServerErrorMsg;
+    public static I18n serverWizardNewServerTitle;
+
+    static {
+        try {
+            I18n.initialize(RestClientI18n.class);
+        } catch (Exception e) {
+            System.err.println(e);
+        }
+    }
+    
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties (from rev 1141, branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/i18n.properties)
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-10 21:31:32 UTC (rev 1160)
@@ -0,0 +1,131 @@
+#
+# 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 = Delete Server
+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 "{0}" server?
+deleteServerDialogTitle = Confirm Delete Server
+
+editServerActionText = Server Properties
+editServerActionToolTip = Edit server properties
+
+errorDialogTitle = Error
+
+missingImage = The following image cannot be found "{0}"
+
+newServerActionText = New Server
+newServerActionToolTip = Create a new server
+
+publishingResultsPublishNotAttemptedMsg = Publishing not attempted
+publishingResultsTooManyResultsMsg = Adding a status to the results failed since there is not enough files involved in the publishing operation.
+publishingResultsUnknownSeverityMsg = "{0}" is an unknown status severity
+publishingResultsUnpublishNotAttemptedMsg = Unpublishing not attempted
+
+publishOperationConsoleName = DNA
+publishOperationPublish = DNA publish to server "{0}", repository "{1}", workspace "{2}"
+publishOperationPublishFile = \t+ Published file "{0}" to location "{1}"
+publishOperationPublishFileFailed = \t* ERROR publishing file "{0}" to location "{1}"
+publishOperationPublishTaskName = Publishing resources
+publishOperationUnpublish = DNA unpublish from server "{0}", repository "{1}", workspace "{2}"
+publishOperationUnpublishFile = \t- Unpublished file "{0}" from location "{1}"
+publishOperationUnpublishFileFailed = \t* ERROR unpublished file "{0}" from location "{1}"
+publishOperationUnpublishTaskName = Unpublishing resources
+
+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 selected resources will be published. Then 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 selected resources will be unpublished. Then 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
+
+publishResultsDialogErrorIncompletePublishingMsg = There was a problem publishing some or all of the files. The publishing operation did not complete. See results below and the log for more details. Error message: "{0}."
+publishResultsDialogErrorIncompleteUnpublishingMsg = There was a problem publishing some or all of the files. The unpublishing operation did not complete. See results below and the log for more details. Error message: "{0}."
+publishResultsDialogErrorPublishingMsg = There was a problem publishing some or all of the files. See results below and the log for more details. Error message: "{0}."
+publishResultsDialogErrorUnpublishingMsg = There was a problem publishing some or all of the files. See results below and the log for more details. Error message: "{0}."
+publishResultsDialogFileHeader = File
+publishResultsDialogIncompletePublishMsg = {0} file(s) were successfully published (uploaded) to the DNA repository workspace but the publishing operation did not complete.
+publishResultsDialogIncompleteUnpublishMsg = {0} file(s) were successfully unpublished (removed) from the DNA repository workspace but the unpublishing operation did not complete.
+publishResultsDialogMessageHeader = Message
+publishResultsDialogPublishMsg = {0} file(s) were successfully published (uploaded) to the DNA repository workspace.
+publishResultsDialogStatisticsMsg = There were {1} error(s), {2} info(s), and {3} warning(s).
+publishResultsDialogTitle = Results
+publishResultsDialogUnpublishMsg = {0} file(s) were successfully unpublished (removed) from the DNA repository workspace.
+
+publishWizardPublishErrorMsg = Error Publishing
+publishWizardPublishTitle = Publish
+publishWizardUnpublishErrorMsg = Error Unpublishing
+publishWizardUnpublishTitle = Unpublish
+
+refreshActionToolTip = Refresh
+
+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
+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


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -33,7 +33,6 @@
 import org.jboss.dna.web.jcr.rest.client.Status.Severity;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public final class Utils {

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WINDOW_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
 import java.util.Collections;
 import java.util.List;
 import org.eclipse.core.resources.IResource;
@@ -39,12 +39,11 @@
 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.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishWizard;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public abstract class BasePublishingAction implements IObjectActionDelegate {
@@ -117,7 +116,7 @@
                 @Override
                 protected void configureShell( Shell newShell ) {
                     super.configureShell(newShell);
-                    newShell.setImage(Activator.getDefault().getImage(DNA_WINDOW_IMAGE_PATH));
+                    newShell.setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
                 }
             };
 
@@ -126,13 +125,13 @@
             String msg = null;
 
             if (this.type == Type.PUBLISH) {
-                msg = I18n.BasePublishingActionPublishingWizardErrorMsg;
+                msg = RestClientI18n.basePublishingActionPublishingWizardErrorMsg.text();
             } else {
-                msg = I18n.BasePublishingActionUnpublishingWizardErrorMsg;
+                msg = RestClientI18n.basePublishingActionUnpublishingWizardErrorMsg.text();
             }
 
             Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
-            MessageDialog.openError(this.shell, I18n.ErrorDialogTitle, msg);
+            MessageDialog.openError(this.shell, RestClientI18n.errorDialogTitle.text(), msg);
         }
     }
 

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -36,13 +36,12 @@
 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.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.dialogs.DeleteServerDialog;
 
 /**
  * The DeleteServerAction deletes one or more servers from the server registry.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public final class DeleteServerAction extends BaseSelectionListenerAction {
@@ -83,8 +82,8 @@
      */
     public DeleteServerAction( Shell shell,
                                ServerManager serverManager ) {
-        super(I18n.DeleteServerActionText);
-        setToolTipText(I18n.DeleteServerActionToolTip);
+        super(RestClientI18n.deleteServerActionText.text());
+        setToolTipText(RestClientI18n.deleteServerActionToolTip.text());
         setImageDescriptor(Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE_PATH));
         setEnabled(false);
 
@@ -123,7 +122,9 @@
             }
 
             if (errorsOccurred) {
-                MessageDialog.openError(this.shell, I18n.ErrorDialogTitle, I18n.DeleteServerDialogErrorsOccurredMsg);
+                MessageDialog.openError(this.shell,
+                                        RestClientI18n.errorDialogTitle.text(),
+                                        RestClientI18n.deleteServerDialogErrorsOccurredMsg.text());
             }
         }
     }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WINDOW_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.EDIT_SERVER_IMAGE_PATH;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.WizardDialog;
@@ -32,11 +32,12 @@
 import org.jboss.dna.web.jcr.rest.client.ServerManager;
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.ServerWizard;
 
 /**
- * @author Dan Florian
+ * The <code>EditServerAction</code> runs a UI that allows {@link Server server} properties to be changed.
+ * 
  * @since 0.6
  */
 public final class EditServerAction extends BaseSelectionListenerAction {
@@ -77,8 +78,8 @@
      */
     public EditServerAction( Shell shell,
                              ServerManager serverManager ) {
-        super(I18n.EditServerActionText);
-        setToolTipText(I18n.EditServerActionToolTip);
+        super(RestClientI18n.editServerActionText.text());
+        setToolTipText(RestClientI18n.editServerActionToolTip.text());
         setImageDescriptor(Activator.getDefault().getImageDescriptor(EDIT_SERVER_IMAGE_PATH));
         setEnabled(false);
 
@@ -103,10 +104,10 @@
             @Override
             protected void configureShell( Shell newShell ) {
                 super.configureShell(newShell);
-                newShell.setImage(Activator.getDefault().getImage(DNA_WINDOW_IMAGE_PATH));
+                newShell.setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
             }
         };
-        
+
         dialog.open();
     }
 

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -23,18 +23,20 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WINDOW_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.NEW_SERVER_IMAGE_PATH;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.actions.BaseSelectionListenerAction;
 import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.ServerWizard;
 
 /**
- * @author Dan Florian
+ * The <code>NewServerAction</code> runs a UI that allows the user to create a new {@link Server server}.
+ * 
  * @since 0.6
  */
 public final class NewServerAction extends BaseSelectionListenerAction {
@@ -68,8 +70,8 @@
      */
     public NewServerAction( Shell shell,
                             ServerManager serverManager ) {
-        super(I18n.NewServerActionText);
-        setToolTipText(I18n.NewServerActionToolTip);
+        super(RestClientI18n.newServerActionText.text());
+        setToolTipText(RestClientI18n.newServerActionToolTip.text());
         setImageDescriptor(Activator.getDefault().getImageDescriptor(NEW_SERVER_IMAGE_PATH));
 
         this.shell = shell;
@@ -93,7 +95,7 @@
             @Override
             protected void configureShell( Shell newShell ) {
                 super.configureShell(newShell);
-                newShell.setImage(Activator.getDefault().getImage(DNA_WINDOW_IMAGE_PATH));
+                newShell.setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
             }
         };
 

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -26,9 +26,9 @@
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
 
 /**
- * The PublishAction controls the publishing of one or more {@link org.eclipse.core.resources.IResource}s to a DNA repository.
+ * The <code>PublishAction</code> controls the publishing of one or more {@link org.eclipse.core.resources.IResource}s to a DNA
+ * repository.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public final class PublishAction extends BasePublishingAction {

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -26,10 +26,9 @@
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
 
 /**
- * The UnpublishAction controls the unpublishing of on or more {@link org.eclipse.core.resources.IResource}s from a DNA
- * repository.
+ * The <code>UnpublishAction</code> controls the unpublishing of one or more {@link org.eclipse.core.resources.IResource}s from a
+ * DNA repository.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public final class UnpublishAction extends BasePublishingAction {

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/package-info.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/package-info.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/package-info.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -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.web.jcr.rest.client.swt.actions;
\ No newline at end of file


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -23,11 +23,10 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.dialogs;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WINDOW_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
 import java.util.Collection;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
@@ -38,15 +37,14 @@
 import org.jboss.dna.web.jcr.rest.client.domain.IDnaObject;
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
  * The <code>DeleteServerDialog</code> class provides a UI for deleting a {@link Server server}.
  * 
- * @author Dan Florian
  * @since 0.6
  */
-public class DeleteServerDialog extends MessageDialog {
+public final class DeleteServerDialog extends MessageDialog {
 
     // ===========================================================================================================================
     // Fields
@@ -70,10 +68,10 @@
      */
     public DeleteServerDialog( Shell parentShell,
                                Collection<Server> serversBeingDeleted ) {
-        super(parentShell, I18n.DeleteServerDialogTitle, Activator.getDefault().getImage(DNA_WINDOW_IMAGE_PATH), null,
+        super(parentShell, RestClientI18n.deleteServerDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x), null,
               MessageDialog.QUESTION, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0);
         this.serversBeingDeleted = serversBeingDeleted;
-        
+
         // make sure dialog is resizable
         setShellStyle(getShellStyle() | SWT.RESIZE);
     }
@@ -97,9 +95,9 @@
 
         if (this.serversBeingDeleted.size() == 1) {
             IDnaObject server = this.serversBeingDeleted.iterator().next();
-            msg = NLS.bind(I18n.DeleteServerDialogOneServerMsg, server.getName());
+            msg = RestClientI18n.deleteServerDialogOneServerMsg.text(server.getName());
         } else {
-            msg = NLS.bind(I18n.DeleteServerDialogMultipleServersMsg, this.serversBeingDeleted.size());
+            msg = RestClientI18n.deleteServerDialogMultipleServersMsg.text(this.serversBeingDeleted.size());
         }
 
         this.message = msg;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -24,7 +24,7 @@
 package org.jboss.dna.web.jcr.rest.client.swt.dialogs;
 
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.CHECKMARK_IMAGE_PATH;
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WINDOW_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
 import java.util.List;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -35,29 +35,29 @@
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
 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.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.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.Utils;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishingResults;
 
 /**
- * The <code>DeleteServerDialog</code> class provides a UI for deleting a {@link Server server}.
+ * The <code>PublishingResultsDialog</code> displays the results of a publishing operation.
  * 
- * @author Dan Florian
  * @since 0.6
  */
-public class PublishingResultsDialog extends MessageDialog {
+public final class PublishingResultsDialog extends MessageDialog {
 
     // ===========================================================================================================================
     // Constants
@@ -113,7 +113,7 @@
      */
     public PublishingResultsDialog( Shell parentShell,
                                     PublishingResults results ) {
-        super(parentShell, I18n.PublishResultsDialogTitle, Activator.getDefault().getImage(DNA_WINDOW_IMAGE_PATH), null,
+        super(parentShell, RestClientI18n.publishResultsDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x), null,
               MessageDialog.INFORMATION, new String[] {IDialogConstants.OK_LABEL}, 0);
         this.results = results;
 
@@ -130,7 +130,7 @@
     public PublishingResultsDialog( Shell parentShell,
                                     PublishingResults results,
                                     Throwable error ) {
-        super(parentShell, I18n.PublishResultsDialogTitle, Activator.getDefault().getImage(DNA_WINDOW_IMAGE_PATH), null,
+        super(parentShell, RestClientI18n.publishResultsDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x), null,
               MessageDialog.ERROR, new String[] {IDialogConstants.OK_LABEL}, 0);
         this.results = results;
         this.error = error;
@@ -154,15 +154,37 @@
         super.configureShell(shell);
 
         // now set message
-        Object[] counts = new Object[] {this.results.getOksCount(), this.results.getErrorCount(), this.results.getInfoCount(),
-            this.results.getWarningsCount()};
+        int successCount = this.results.getFiles().size() - this.results.getErrorCount();
+        boolean completed = this.results.isComplete();
 
         if (this.results.getType() == PublishOperation.Type.PUBLISH) {
-            this.message = ((this.error == null) ? I18n.bind(I18n.PublishResultsDialogPublishMsg, counts) : I18n.bind(I18n.PublishResultsDialogErrorPublishingMsg,
-                                                                                                                      this.error.getLocalizedMessage()));
+            if (completed) {
+                if ((this.error == null)) {
+                    this.message = RestClientI18n.publishResultsDialogPublishMsg.text(successCount);
+                } else {
+                    this.message = RestClientI18n.publishResultsDialogErrorPublishingMsg.text(this.error.getLocalizedMessage());
+                }
+            } else {
+                if ((this.error == null)) {
+                    this.message = RestClientI18n.publishResultsDialogIncompletePublishMsg.text(successCount);
+                } else {
+                    this.message = RestClientI18n.publishResultsDialogErrorIncompletePublishingMsg.text(this.error.getLocalizedMessage());
+                }
+            }
         } else {
-            this.message = ((this.error == null) ? I18n.bind(I18n.PublishResultsDialogUnpublishMsg, counts) : I18n.bind(I18n.PublishResultsDialogErrorUnpublishingMsg,
-                                                                                                                        this.error.getLocalizedMessage()));
+            if (completed) {
+                if ((this.error == null)) {
+                    this.message = RestClientI18n.publishResultsDialogUnpublishMsg.text(successCount);
+                } else {
+                    this.message = RestClientI18n.publishResultsDialogErrorUnpublishingMsg.text(this.error.getLocalizedMessage());
+                }
+            } else {
+                if ((this.error == null)) {
+                    this.message = RestClientI18n.publishResultsDialogIncompleteUnpublishMsg.text(successCount);
+                } else {
+                    this.message = RestClientI18n.publishResultsDialogErrorIncompleteUnpublishingMsg.text(this.error.getLocalizedMessage());
+                }
+            }
         }
     }
 
@@ -203,13 +225,13 @@
         table.setLinesVisible(true);
 
         TableColumn col = new TableColumn(table, SWT.LEFT);
-        col.setText(I18n.PublishResultsDialogFileHeader);
+        col.setText(RestClientI18n.publishResultsDialogFileHeader.text());
 
         col = new TableColumn(table, SWT.CENTER);
         col.setResizable(false);
 
         col = new TableColumn(table, SWT.LEFT);
-        col.setText(I18n.PublishResultsDialogMessageHeader);
+        col.setText(RestClientI18n.publishResultsDialogMessageHeader.text());
 
         // populate the table
         viewer.setInput(this);
@@ -220,6 +242,21 @@
             column.setWidth(column.getWidth() + 2);
         }
 
+        // add statistics label
+        StyledText st = new StyledText(parent, SWT.READ_ONLY | SWT.MULTI | SWT.NO_FOCUS | SWT.WRAP);
+        st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+        st.setCaret(null);
+        gd = new GridData(GridData.FILL_BOTH);
+        gd.grabExcessVerticalSpace = false;
+        gd.horizontalIndent = ((GridLayout)pnl.getLayout()).horizontalSpacing * 5;
+        st.setLayoutData(gd);
+
+        // set message
+        Object[] counts = new Object[] {this.results.getOksCount(), this.results.getErrorCount(), this.results.getInfoCount(),
+            this.results.getWarningsCount()};
+        String msg = RestClientI18n.publishResultsDialogStatisticsMsg.text(counts);
+        st.setText(msg);
+
         return pnl;
     }
 
@@ -248,7 +285,6 @@
      * The <code>ResultsProvider</code> class is the label provider and content provider for the table that is shown in the
      * dialog.
      * 
-     * @author Dan Florian
      * @since 0.6
      */
     class ResultsProvider extends LabelProvider implements IStructuredContentProvider, ITableLabelProvider {

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/package-info.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/package-info.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/package-info.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -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.web.jcr.rest.client.swt.dialogs;
\ No newline at end of file


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/i18n.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/i18n.properties	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/i18n.properties	2009-08-10 21:31:32 UTC (rev 1160)
@@ -1,119 +0,0 @@
-#
-# 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 = Delete Server
-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 "{0}" server?
-DeleteServerDialogTitle = Confirm Delete Server
-
-EditServerActionText = Server Properties
-EditServerActionToolTip = Edit server properties
-
-ErrorDialogTitle = Error
-
-MissingImage = The following image cannot be found "{0}"
-
-NewServerActionText = New Server
-NewServerActionToolTip = Create a new server
-
-PublishingResultsPublishNotAttemptedMsg = Publishing not attempted
-PublishingResultsTooManyResultsMsg = Adding a status to the results failed since there is not enough files involved in the publishing operation.
-PublishingResultsUnknownSeverityMsg = "{0}" is an unknown status severity
-PublishingResultsUnpublishNotAttemptedMsg = Unpublishing not attempted
-
-PublishOperationPublishTaskName = Publishing resources
-PublishOperationUnpublishTaskName = Unpublishing resources
-
-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 selected resources will be published. Then click "Finish" to execute the publish operation.
-PublishPagePublishResourcesLabel = These resources will be published to the specified DNA repository:
-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 selected resources will be unpublished. Then click "Finish" to execute the unpublish operation.
-PublishPageUnpublishResourcesLabel = These resources will be unpublished from the specified DNA repository:
-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
-
-PublishResultsDialogErrorPublishingMsg = There was a problem publishing some or all of the files. See results below and the log for more details. Error message: "{0}."
-PublishResultsDialogErrorUnpublishingMsg = There was a problem publishing some or all of the files. See results below and the log for more details. Error message: "{0}."
-PublishResultsDialogFileHeader = File
-PublishResultsDialogMessageHeader = Message
-PublishResultsDialogPublishMsg = The operation completed with {0} file(s) being published. There were {1} error(s), {2} info(s), and {3} warning(s).
-PublishResultsDialogTitle = Results
-PublishResultsDialogUnpublishMsg = The operation completed with {0} file(s) being unpublished. There were {1} error(s), {2} info(s), and {3} warning(s).
-
-PublishWizardPublishErrorMsg = Error Publishing
-PublishWizardPublishTitle = Publish
-PublishWizardUnpublishErrorMsg = Error Unpublishing
-PublishWizardUnpublishTitle = Unpublish
-
-RefreshActionToolTip = Refresh
-
-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
-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

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLogger.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLogger.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLogger.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -0,0 +1,822 @@
+/*
+ * 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.web.jcr.rest.client.swt.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.web.jcr.rest.client.swt.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.
+ * 
+ * @since 0.6
+ */
+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)
+     * @since 0.6
+     */
+    @Override
+    public void debug( String message ) {
+        if (isDebugEnabled()) info(message);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public void error( Marker marker,
+                       String pattern,
+                       Object arg1,
+                       Object arg2 ) {
+        error(pattern, arg1, arg2);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#getName()
+     * @since 0.6
+     */
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#info(java.lang.String)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public void info( Marker marker,
+                      String pattern,
+                      Object arg1,
+                      Object arg2 ) {
+        info(pattern, arg1, arg2);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isDebugEnabled()
+     * @since 0.6
+     */
+    @Override
+    public boolean isDebugEnabled() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isDebugEnabled(org.slf4j.Marker)
+     * @since 0.6
+     */
+    @Override
+    public boolean isDebugEnabled( Marker marker ) {
+        return isDebugEnabled();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isErrorEnabled()
+     * @since 0.6
+     */
+    @Override
+    public boolean isErrorEnabled() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isErrorEnabled(org.slf4j.Marker)
+     * @since 0.6
+     */
+    @Override
+    public boolean isErrorEnabled( Marker marker ) {
+        return isErrorEnabled();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isInfoEnabled()
+     * @since 0.6
+     */
+    @Override
+    public boolean isInfoEnabled() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isInfoEnabled(org.slf4j.Marker)
+     * @since 0.6
+     */
+    @Override
+    public boolean isInfoEnabled( Marker marker ) {
+        return isInfoEnabled();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isTraceEnabled()
+     * @since 0.6
+     */
+    @Override
+    public boolean isTraceEnabled() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isTraceEnabled(org.slf4j.Marker)
+     * @since 0.6
+     */
+    @Override
+    public boolean isTraceEnabled( Marker marker ) {
+        return isTraceEnabled();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isWarnEnabled()
+     * @since 0.6
+     */
+    @Override
+    public boolean isWarnEnabled() {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#isWarnEnabled(org.slf4j.Marker)
+     * @since 0.6
+     */
+    @Override
+    public boolean isWarnEnabled( Marker marker ) {
+        return isWarnEnabled();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#trace(java.lang.String)
+     * @since 0.6
+     */
+    @Override
+    public void trace( String message ) {
+        if (isTraceEnabled()) info(message);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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[])
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public void warn( Marker marker,
+                      String pattern,
+                      Object arg1,
+                      Object arg2 ) {
+        warn(pattern, arg1, arg2);
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLogger.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLoggerFactory.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLoggerFactory.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLoggerFactory.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -0,0 +1,98 @@
+/*
+ * 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.web.jcr.rest.client.swt.log;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.slf4j.ILoggerFactory;
+import org.slf4j.Logger;
+
+/**
+ * @since 0.6
+ */
+public final class EclipseLoggerFactory implements ILoggerFactory {
+
+    // ===========================================================================================================================
+    // Class Fields
+    // ===========================================================================================================================
+
+    /**
+     * The shared instance of the factory.
+     * 
+     * @since 0.6
+     */
+    static final EclipseLoggerFactory INSTANCE = new EclipseLoggerFactory();
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * Map of loggers keyed by logger name.
+     * 
+     * @since 0.6
+     */
+    private Map<String, Logger> loggerMap;
+
+    // ===========================================================================================================================
+    // Constructors
+    // ===========================================================================================================================
+
+    /**
+     * Constructs the factory.
+     * 
+     * @since 0.6
+     */
+    public EclipseLoggerFactory() {
+        this.loggerMap = new HashMap<String, Logger>();
+    }
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.ILoggerFactory#getLogger(java.lang.String)
+     * @since 0.6
+     */
+    @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: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/EclipseLoggerFactory.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/StaticLoggerBinder.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/StaticLoggerBinder.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/StaticLoggerBinder.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -0,0 +1,101 @@
+/*
+ * 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.web.jcr.rest.client.swt.log;
+
+import org.slf4j.ILoggerFactory;
+import org.slf4j.spi.LoggerFactoryBinder;
+
+/**
+ * @since 0.6
+ */
+public final class StaticLoggerBinder implements LoggerFactoryBinder {
+
+    // ===========================================================================================================================
+    // Class Fields
+    // ===========================================================================================================================
+
+    /**
+     * The class name of the logger factory.
+     * 
+     * @since 0.6
+     */
+    private static final String LOGGER_FACTORY_CLASS_NAME = EclipseLoggerFactory.class.getName();
+
+    /**
+     * The unique instance of this class.
+     * 
+     * @since 0.6
+     */
+    private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
+
+    // ===========================================================================================================================
+    // Class Methods
+    // ===========================================================================================================================
+
+    /**
+     * @return the static instance of the logger
+     * @since 0.6
+     */
+    public static final StaticLoggerBinder getSingleton() {
+        return SINGLETON;
+    }
+
+    // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    /**
+     * The logger factory used.
+     * 
+     * @since 0.6
+     */
+    private final ILoggerFactory loggerFactory = new EclipseLoggerFactory();
+    
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactory()
+     * @since 0.6
+     */
+    @Override
+    public ILoggerFactory getLoggerFactory() {
+        return this.loggerFactory;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactoryClassStr()
+     * @since 0.6
+     */
+    @Override
+    public String getLoggerFactoryClassStr() {
+        return LOGGER_FACTORY_CLASS_NAME;
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/log/StaticLoggerBinder.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/package-info.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/package-info.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/package-info.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -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.web.jcr.rest.client.swt;
\ No newline at end of file


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -37,12 +37,11 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
- * The ServerContentProvider is a content and label provider for DNA repositories.
+ * The <code>ServerContentProvider</code> is a content and label provider for DNA repositories.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public final class ServerContentProvider extends ColumnLabelProvider implements ITreeContentProvider {
@@ -118,11 +117,11 @@
                 return this.serverManager.getRepositories((Server)parentElement).toArray();
             }
         } catch (Exception e) {
-            String msg = I18n.bind(I18n.ServerManagerGetRepositoriesExceptionMsg, ((Server)parentElement).getShortDescription());
+            String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(((Server)parentElement).getShortDescription());
             Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
 
             if (this.viewer.getControl().isVisible()) {
-                MessageDialog.openError(this.viewer.getControl().getShell(), I18n.ErrorDialogTitle, msg);
+                MessageDialog.openError(this.viewer.getControl().getShell(), RestClientI18n.errorDialogTitle.text(), msg);
             }
         }
 
@@ -131,11 +130,11 @@
                 return this.serverManager.getWorkspaces((Repository)parentElement).toArray();
             }
         } catch (Exception e) {
-            String msg = I18n.ServerManagerGetWorkspacesExceptionMsg;
+            String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text();
             Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
 
             if (this.viewer.getControl().isVisible()) {
-                MessageDialog.openError(this.viewer.getControl().getShell(), I18n.ErrorDialogTitle, msg);
+                MessageDialog.openError(this.viewer.getControl().getShell(), RestClientI18n.errorDialogTitle.text(), msg);
             }
         }
 

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -47,15 +47,14 @@
 import org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent;
 import org.jboss.dna.web.jcr.rest.client.domain.IDnaObject;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.DeleteServerAction;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.EditServerAction;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.NewServerAction;
 
 /**
- * The ServerView shows all defined servers and their DNA repositories.
+ * The <code>ServerView</code> shows all defined servers and their DNA repositories.
  * 
- * @author Dan Florian
  * @since 0.6
  */
 public final class ServerView extends ViewPart implements IServerRegistryListener {
@@ -127,7 +126,7 @@
             }
         };
 
-        this.collapseAllAction.setToolTipText(I18n.CollapseActionToolTip);
+        this.collapseAllAction.setToolTipText(RestClientI18n.collapseActionToolTip.text());
         this.collapseAllAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(COLLAPSE_ALL_IMAGE_PATH));
 
         // the refresh action is always enabled
@@ -138,7 +137,7 @@
             }
         };
 
-        this.refreshAction.setToolTipText(I18n.RefreshActionToolTip);
+        this.refreshAction.setToolTipText(RestClientI18n.refreshActionToolTip.text());
         this.refreshAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE_PATH));
 
         // the shell used for dialogs that the actions display
@@ -226,7 +225,7 @@
         constructToolBar();
         constructContextMenu();
 
-        setTitleToolTip(I18n.ServerViewToolTip);
+        setTitleToolTip(RestClientI18n.serverViewToolTip.text());
 
         // register to receive changes to the server registry
         getServerManager().addRegistryListener(this);

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/package-info.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/package-info.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/package-info.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -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.web.jcr.rest.client.swt.views;
\ No newline at end of file


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -28,17 +28,24 @@
 import java.util.List;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.IProgressMonitor;
+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.web.jcr.rest.client.ServerManager;
 import org.jboss.dna.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
- * @author Dan Florian
+ * The <code>PublishOperation</code> publishes or unpublishes one or more files using the {@link ServerManager}.
+ * 
  * @since 0.6
  */
-public class PublishOperation {
+public final class PublishOperation {
 
     // ===========================================================================================================================
     // Constants
@@ -65,6 +72,13 @@
         UNPUBLISH
     }
 
+    /**
+     * The name of the message console that is written to.
+     * 
+     * @since 0.6
+     */
+    private static final String CONSOLE_NAME = RestClientI18n.publishOperationConsoleName.text();
+
     // ===========================================================================================================================
     // Fields
     // ===========================================================================================================================
@@ -110,9 +124,9 @@
     public PublishOperation( Type type,
                              List<IFile> files,
                              Workspace workspace ) {
-        Utils.nullArgumentCheck("type", type); //$NON-NLS-1$
-        Utils.nullArgumentCheck("files", files); //$NON-NLS-1$
-        Utils.nullArgumentCheck("workspace", workspace); //$NON-NLS-1$
+        CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
+        CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
 
         this.type = type;
         this.files = files;
@@ -159,12 +173,22 @@
         this.results = new PublishingResults(this.type, this.files);
 
         try {
-            String name = (isPublishing() ? I18n.PublishOperationPublishTaskName : I18n.PublishOperationUnpublishTaskName);
+            String name = (isPublishing() ? RestClientI18n.publishOperationPublishTaskName.text() : RestClientI18n.publishOperationUnpublishTaskName.text());
             monitor.beginTask(name, this.files.size());
             monitor.setTaskName(name);
 
+            // write initial message to console
+            if (isPublishing()) {
+                writeToConsole(RestClientI18n.publishOperationPublish.text(this.workspace.getServer().getUrl(),
+                                                                           this.workspace.getRepository().getName(),
+                                                                           this.workspace.getName()));
+            } else {
+                writeToConsole(RestClientI18n.publishOperationUnpublish.text(this.workspace.getServer().getUrl(),
+                                                                             this.workspace.getRepository().getName(),
+                                                                             this.workspace.getName()));
+            }
+
             for (IFile eclipseFile : this.files) {
-
                 if (monitor.isCanceled()) {
                     throw new InterruptedException();
                 }
@@ -172,7 +196,6 @@
                 File file = eclipseFile.getLocation().toFile();
                 Status status = null;
 
-                // TODO call publisher here (timeout?)
                 if (isPublishing()) {
                     status = Activator.getDefault().getServerManager().publish(this.workspace,
                                                                                eclipseFile.getFullPath().toString(),
@@ -183,9 +206,15 @@
                                                                                  file);
                 }
 
-                results.addStatus(status);
                 monitor.worked(1);
+                this.results.addStatus(status);
+
+                // write to console
+                writeToConsole(file, eclipseFile.getParent().getFullPath().toString(), status);
             }
+
+            // add a gap before next console message
+            writeToConsole("\n"); //$NON-NLS-1$
         } catch (InterruptedException e) {
             throw e;
         } catch (Exception e) {
@@ -196,4 +225,58 @@
         }
     }
 
+    /**
+     * @param file the file involved in the publishing operation
+     * @param workspacePath the path in the workspace where the file is located
+     * @param status the status of the publishing operation
+     * @since 0.6
+     */
+    private void writeToConsole( File file,
+                                 String workspacePath,
+                                 Status status ) {
+        String msg = null;
+
+        if (status.isError()) {
+            msg = (isPublishing() ? RestClientI18n.publishOperationPublishFileFailed.text(file.getAbsolutePath(), workspacePath) 
+                                  : RestClientI18n.publishOperationUnpublishFileFailed.text(file.getAbsolutePath(), workspacePath));
+        } else {
+            msg = (isPublishing() ? RestClientI18n.publishOperationPublishFile.text(file.getAbsolutePath(), workspacePath) 
+                                  : RestClientI18n.publishOperationUnpublishFile.text(file.getAbsolutePath(), workspacePath));
+        }
+
+        // TODO create hyperlink in console for the file
+        writeToConsole(msg);
+    }
+
+    /**
+     * @param message the message being written to the DNA console
+     * @since 0.6
+     */
+    private void writeToConsole( String message ) {
+        MessageConsole console = null;
+        IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
+        IConsole[] consoles = consoleMgr.getConsoles();
+
+        // see if DNA console already exists
+        for (int i = 0; i < consoles.length; ++i) {
+            if (CONSOLE_NAME.equals(consoles[i].getName())) {
+                console = (MessageConsole)consoles[i];
+                break;
+            }
+        }
+
+        // create DNA console if necessary
+        if (console == null) {
+            console = new MessageConsole(CONSOLE_NAME, null);
+            consoleMgr.addConsoles(new IConsole[] {console});
+        }
+
+        // show and focus console view
+        console.activate();
+
+        // write message
+        MessageConsoleStream out = console.newMessageStream();
+        out.println(message);
+    }
+
 }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -61,12 +61,13 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.NewServerAction;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
 
 /**
- * @author Dan Florian
+ * The <code>PublishPage</code> is a UI for publishing or unpublishing one or more files to a DNA repository.
+ * 
  * @since 0.6
  */
 public final class PublishPage extends WizardPage implements IServerRegistryListener, ModifyListener {
@@ -375,7 +376,8 @@
     public PublishPage( Type type,
                         List<IResource> resources ) throws CoreException {
         super(PublishPage.class.getSimpleName());
-        setTitle((type == Type.PUBLISH) ? I18n.PublishPagePublishTitle : I18n.PublishPageUnpublishTitle);
+        setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text() 
+                                        : RestClientI18n.publishPageUnpublishTitle.text());
         setPageComplete(false);
 
         this.type = type;
@@ -388,7 +390,7 @@
 
     private void constructLocationPanel( Composite parent ) {
         Group pnl = new Group(parent, SWT.NONE);
-        pnl.setText(I18n.PublishPageLocationGroupTitle);
+        pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
         pnl.setLayout(new GridLayout(2, false));
         pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 
@@ -408,16 +410,16 @@
 
             Label lblServer = new Label(pnlServer, SWT.LEFT);
             lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-            lblServer.setText(I18n.PublishPageServerLabel);
+            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(I18n.PublishPageServerToolTip);
+            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(I18n.PublishPageNewServerButton);
+            btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
             btnNewServer.setToolTipText(action.getToolTipText());
             btnNewServer.addSelectionListener(new SelectionAdapter() {
                 @Override
@@ -442,25 +444,25 @@
         { // row 2: repository row
             Label lblRepository = new Label(pnl, SWT.LEFT);
             lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-            lblRepository.setText(I18n.PublishPageRepositoryLabel);
+            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(I18n.PublishPageRepositoryToolTip);
+            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(I18n.PublishPageWorkspaceLabel);
+            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(I18n.PublishPageWorkspacePublishToolTip);
+                this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
             } else {
-                this.cbxWorkspace.setToolTipText(I18n.PublishPageWorkspaceUnpublishToolTip);
+                this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
             }
         }
     }
@@ -480,9 +482,9 @@
             lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
 
             if (type == Type.PUBLISH) {
-                lbl.setText(I18n.PublishPagePublishResourcesLabel);
+                lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
             } else {
-                lbl.setText(I18n.PublishPageUnpublishResourcesLabel);
+                lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
             }
         }
 
@@ -510,8 +512,8 @@
         { // row 3
             final Button chkRecurse = new Button(pnl, SWT.CHECK);
             chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-            chkRecurse.setText(I18n.PublishPageRecurseCheckBox);
-            chkRecurse.setToolTipText(I18n.PublishPageRecurseCheckBoxToolTip);
+            chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
+            chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
             chkRecurse.setSelection(this.recurse);
             chkRecurse.addSelectionListener(new SelectionAdapter() {
                 @Override
@@ -575,7 +577,8 @@
      * @since 0.6
      */
     void updateInitialMessage() {
-        String msg = ((this.type == Type.PUBLISH) ? I18n.PublishPagePublishOkStatusMsg : I18n.PublishPageUnpublishOkStatusMsg);
+        String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() 
+                                                  : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
 
         if (msg.equals(getMessage())) {
             updateState();
@@ -613,10 +616,12 @@
             this.files = processResources(this.resources, isRecursing());
             loadFiles();
         } catch (CoreException e) {
-            Activator.getDefault().log(new Status(Severity.ERROR, I18n.PublishPageRecurseProcessingErrorMsg, e));
+            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
 
             if (getControl().isVisible()) {
-                MessageDialog.openError(getShell(), I18n.ErrorDialogTitle, I18n.PublishPageRecurseProcessingErrorMsg);
+                MessageDialog.openError(getShell(),
+                                        RestClientI18n.errorDialogTitle.text(),
+                                        RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
             }
         }
     }
@@ -745,11 +750,11 @@
                 this.repositories = new ArrayList<Repository>(getServerManager().getRepositories(this.server));
             } catch (Exception e) {
                 this.repositories = Collections.emptyList();
-                String msg = I18n.bind(I18n.ServerManagerGetRepositoriesExceptionMsg, this.server.getShortDescription());
+                String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server.getShortDescription());
                 Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
 
                 if (getControl().isVisible()) {
-                    MessageDialog.openError(getShell(), I18n.ErrorDialogTitle, msg);
+                    MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(), msg);
                 }
             }
         }
@@ -857,11 +862,11 @@
                 this.workspaces = new ArrayList<Workspace>(getServerManager().getWorkspaces(this.repository));
             } catch (Exception e) {
                 this.workspaces = Collections.emptyList();
-                String msg = I18n.ServerManagerGetWorkspacesExceptionMsg;
+                String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text();
                 Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
 
                 if (getControl().isVisible()) {
-                    MessageDialog.openError(getShell(), I18n.ErrorDialogTitle, msg);
+                    MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(), msg);
                 }
             }
         }
@@ -922,9 +927,8 @@
     public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
         // should only be a new server event
         if (event.isNew()) {
-            Server newServer = event.getServer();
-            this.servers.add(newServer);
-            this.cbxServer.add(newServer.getName());
+            refreshServers();
+            updateState();
         }
 
         return null;
@@ -949,7 +953,8 @@
 
             // set initial message
             if (this.status.isOk()) {
-                String msg = ((this.type == Type.PUBLISH) ? I18n.PublishPagePublishOkStatusMsg : I18n.PublishPageUnpublishOkStatusMsg);
+                String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() 
+                                                          : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
                 setMessage(msg);
             } else {
                 setErrorMessage(this.status.getMessage());
@@ -973,7 +978,7 @@
         try {
             this.files = processResources(this.resources, this.recurse);
         } catch (CoreException e) {
-            Activator.getDefault().log(new Status(Severity.ERROR, I18n.PublishPageRecurseProcessingErrorMsg, e));
+            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
         }
     }
 
@@ -1007,7 +1012,7 @@
 
         // update page message
         if (this.status.isError()) {
-            setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+            setErrorMessage(this.status.getMessage());
         } else {
             if (this.status.isWarning()) {
                 setMessage(this.status.getMessage(), IMessageProvider.WARNING);
@@ -1029,19 +1034,24 @@
         Severity severity = Severity.ERROR;
 
         if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
-            msg = ((type == Type.PUBLISH) ? I18n.PublishPageNoResourcesToPublishStatusMsg : I18n.PublishPageNoResourcesToUnpublishStatusMsg);
+            msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
+                                          : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
         } else if (this.server == null) {
             int count = this.cbxServer.getItemCount();
-            msg = ((count == 0) ? I18n.PublishPageNoAvailableServersStatusMsg : I18n.PublishPageMissingServerStatusMsg);
+            msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg.text() 
+                                : RestClientI18n.publishPageMissingServerStatusMsg.text());
         } else if (this.repository == null) {
             int count = this.cbxRepository.getItemCount();
-            msg = ((count == 0) ? I18n.PublishPageNoAvailableRepositoriesStatusMsg : I18n.PublishPageMissingRepositoryStatusMsg);
+            msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text() 
+                                : RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
         } else if (this.workspace == null) {
             int count = this.cbxWorkspace.getItemCount();
-            msg = ((count == 0) ? I18n.PublishPageNoAvailableWorkspacesStatusMsg : I18n.PublishPageMissingWorkspaceStatusMsg);
+            msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text() 
+                                : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
         } else {
             severity = Severity.OK;
-            msg = ((type == Type.PUBLISH) ? I18n.PublishPagePublishOkStatusMsg : I18n.PublishPageUnpublishOkStatusMsg);
+            msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() 
+                                          : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
         }
 
         this.status = new Status(severity, msg, null);

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -34,18 +34,17 @@
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.wizard.Wizard;
+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.Utils;
 import org.jboss.dna.web.jcr.rest.client.Status.Severity;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.dialogs.PublishingResultsDialog;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public final class PublishWizard extends Wizard {
@@ -89,15 +88,16 @@
     public PublishWizard( Type type,
                           List<IResource> resources,
                           ServerManager serverManager ) throws CoreException {
-        Utils.nullArgumentCheck("type", type); //$NON-NLS-1$
-        Utils.nullArgumentCheck("resources", resources); //$NON-NLS-1$
-        Utils.nullArgumentCheck("serverManager", serverManager); //$NON-NLS-1$
+        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) ? I18n.PublishWizardPublishTitle : I18n.PublishWizardUnpublishTitle);
+        setWindowTitle((type == Type.PUBLISH) ? RestClientI18n.publishWizardPublishTitle.text() 
+                                              : RestClientI18n.publishWizardUnpublishTitle.text());
         setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE_PATH));
     }
 
@@ -181,7 +181,8 @@
                     error = ((InvocationTargetException)e).getTargetException();
                 }
 
-                String message = (operation.isPublishing() ? I18n.PublishWizardPublishErrorMsg : I18n.PublishWizardUnpublishErrorMsg);
+                String message = (operation.isPublishing() ? RestClientI18n.publishWizardPublishErrorMsg.text() 
+                                                           : RestClientI18n.publishWizardUnpublishErrorMsg.text());
                 Activator.getDefault().log(new Status(Severity.ERROR, message, error));
             }
         } finally {

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -26,14 +26,13 @@
 import java.util.ArrayList;
 import java.util.List;
 import org.eclipse.core.resources.IFile;
+import org.jboss.dna.common.util.CheckArg;
 import org.jboss.dna.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.Status.Severity;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public final class PublishingResults {
@@ -48,7 +47,8 @@
      * @since 0.6
      */
     private static final Status PUBLISH_NOT_ATTEMPTED_STATUS = new Status(Severity.INFO,
-                                                                          I18n.PublishingResultsPublishNotAttemptedMsg, null);
+                                                                          RestClientI18n.publishingResultsPublishNotAttemptedMsg.text(),
+                                                                          null);
 
     /**
      * Status indicating the file was not attempted to be published.
@@ -56,7 +56,8 @@
      * @since 0.6
      */
     private static final Status UNPUBLISH_NOT_ATTEMPTED_STATUS = new Status(Severity.INFO,
-                                                                            I18n.PublishingResultsUnpublishNotAttemptedMsg, null);
+                                                                            RestClientI18n.publishingResultsUnpublishNotAttemptedMsg.text(),
+                                                                            null);
 
     // ===========================================================================================================================
     // Fields
@@ -123,14 +124,14 @@
     // ===========================================================================================================================
 
     /**
-     * @param type the type of publishing operation
+     * @param type the type of publishing operation (never <code>null</code>)
      * @param files the files involved in the publishing operation (never <code>null</code>)
      * @since 0.6
      */
     public PublishingResults( Type type,
                               List<IFile> files ) {
-        Utils.nullArgumentCheck("type", type); //$NON-NLS-1$
-        Utils.nullArgumentCheck("files", files); //$NON-NLS-1$
+        CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
+        CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
 
         this.type = type;
         this.files = files;
@@ -142,13 +143,15 @@
     // ===========================================================================================================================
 
     /**
-     * @param status the status being added
+     * @param status the status being added (never <code>null</code>)
      * @throws RuntimeException if the number of status objects is greater than the number of files
      * @since 0.6
      */
     public void addStatus( Status status ) {
+        CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
+
         if (this.files.size() < (this.statuses.size() + 1)) {
-            throw new RuntimeException(I18n.PublishingResultsTooManyResultsMsg);
+            throw new RuntimeException(RestClientI18n.publishingResultsTooManyResultsMsg.text());
         }
 
         this.statuses.add(status);
@@ -157,7 +160,7 @@
         else if (status.isInfo()) ++this.numInfos;
         else if (status.isOk()) ++this.numOks;
         else if (status.isWarning()) ++this.numWarnings;
-        else throw new RuntimeException(I18n.bind(I18n.PublishingResultsUnknownSeverityMsg, status.getSeverity()));
+        else throw new RuntimeException(RestClientI18n.publishingResultsUnknownSeverityMsg.text(status.getSeverity()));
 
         this.complete = (this.files.size() == this.statuses.size());
     }
@@ -186,7 +189,7 @@
     }
 
     /**
-     * @return the files involved in the publishing operation
+     * @return the files involved in the publishing operation (never <code>null</code>)
      * @since 0.6
      */
     public List<IFile> getFiles() {
@@ -215,7 +218,7 @@
      * @since 0.6
      */
     public Status getStatus( IFile file ) {
-        Utils.nullArgumentCheck("file", file); //$NON-NLS-1$
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
         int index = this.files.indexOf(file);
 
         if (index == -1) {
@@ -226,7 +229,8 @@
     }
 
     /**
-     * @return the status of each file involved in the publishing operation
+     * @return the status of each file involved in the publishing operation (never <code>null</code> but can be incomplete)
+     * @see #isComplete()
      * @since 0.6
      */
     public List<Status> getStatuses() {
@@ -234,7 +238,7 @@
     }
 
     /**
-     * @return the publishing operation type
+     * @return the publishing operation type (never <code>null</code>)
      * @since 0.6
      */
     public Type getType() {

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -43,10 +43,9 @@
 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;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public final class ServerPage extends WizardPage {
@@ -108,7 +107,7 @@
      */
     public ServerPage() {
         super(ServerPage.class.getSimpleName());
-        setTitle(I18n.ServerPageTitle);
+        setTitle(RestClientI18n.serverPageTitle.text());
         setPageComplete(false);
     }
 
@@ -120,7 +119,7 @@
      */
     public ServerPage( Server server ) {
         super(ServerPage.class.getSimpleName());
-        setTitle(I18n.ServerPageTitle);
+        setTitle(RestClientI18n.serverPageTitle.text());
 
         this.server = server;
         this.url = server.getUrl();
@@ -135,18 +134,18 @@
 
     private void constructAuthenticationPanel( Composite parent ) {
         Group pnl = new Group(parent, SWT.NONE);
-        pnl.setText(I18n.ServerPageAuthenticationGroupTitle);
+        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(I18n.ServerPageUserLabel);
+            lblUser.setText(RestClientI18n.serverPageUserLabel.text());
 
             Text txtUser = new Text(pnl, SWT.BORDER);
             txtUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-            txtUser.setToolTipText(I18n.ServerPageUserToolTip);
+            txtUser.setToolTipText(RestClientI18n.serverPageUserToolTip.text());
 
             // set initial value
             if (this.user != null) {
@@ -164,11 +163,11 @@
         { // password row
             Label lblPassword = new Label(pnl, SWT.LEFT);
             lblPassword.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-            lblPassword.setText(I18n.ServerPagePasswordLabel);
+            lblPassword.setText(RestClientI18n.serverPagePasswordLabel.text());
 
             Text txtPassword = new Text(pnl, SWT.BORDER);
             txtPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-            txtPassword.setToolTipText(I18n.ServerPagePasswordToolTip);
+            txtPassword.setToolTipText(RestClientI18n.serverPagePasswordToolTip.text());
             txtPassword.setEchoChar('*');
 
             // set initial value before hooking up listener
@@ -189,8 +188,8 @@
             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(I18n.ServerPageSavePasswordButton);
-            btn.setToolTipText(I18n.ServerPageSavePasswordToolTip);
+            btn.setText(RestClientI18n.serverPageSavePasswordButton.text());
+            btn.setToolTipText(RestClientI18n.serverPageSavePasswordToolTip.text());
 
             // set initial value before hooking up listeners
             if (this.savePassword) {
@@ -221,7 +220,7 @@
             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(I18n.ServerPageSavePasswordLabel);
+            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);
@@ -240,11 +239,11 @@
 
         Label lblUrl = new Label(pnl, SWT.LEFT);
         lblUrl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-        lblUrl.setText(I18n.ServerPageUrlLabel);
+        lblUrl.setText(RestClientI18n.serverPageUrlLabel.text());
 
         Text txtUrl = new Text(pnl, SWT.BORDER);
         txtUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-        txtUrl.setToolTipText(I18n.ServerPageUrlToolTip);
+        txtUrl.setToolTipText(RestClientI18n.serverPageUrlToolTip.text());
 
         // set initial value
         if (this.url != null) {
@@ -286,7 +285,7 @@
         }
 
         // should never be called if error status
-        throw new RuntimeException(I18n.ServerPageInvalidServerProperties);
+        throw new RuntimeException(RestClientI18n.serverPageInvalidServerProperties.text());
     }
 
     /**
@@ -344,7 +343,7 @@
      * @since 0.6
      */
     void updateInitialMessage() {
-        if (I18n.ServerPageOkStatusMsg.equals(getMessage())) {
+        if (RestClientI18n.serverPageOkStatusMsg.text().equals(getMessage())) {
             updateState();
         }
     }
@@ -364,7 +363,7 @@
             validate();
 
             // set initial message
-            setMessage(I18n.ServerPageOkStatusMsg);
+            setMessage(RestClientI18n.serverPageOkStatusMsg.text());
         }
     }
 
@@ -389,7 +388,7 @@
             } else if (this.status.isInfo()) {
                 setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
             } else {
-                setMessage(I18n.ServerPageOkStatusMsg);
+                setMessage(RestClientI18n.serverPageOkStatusMsg.text());
             }
         }
     }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java	2009-08-10 18:34:03 UTC (rev 1159)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -30,10 +30,9 @@
 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.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.I18n;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
- * @author Dan Florian
  * @since 0.6
  */
 public final class ServerWizard extends Wizard {
@@ -78,7 +77,7 @@
         this.serverManager = serverManager;
 
         setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE_PATH));
-        setWindowTitle(I18n.ServerWizardNewServerTitle);
+        setWindowTitle(RestClientI18n.serverWizardNewServerTitle.text());
     }
 
     /**
@@ -93,7 +92,7 @@
         this.page = new ServerPage(server);
         this.serverManager = serverManager;
         this.existingServer = server;
-        setWindowTitle(I18n.ServerWizardEditServerTitle);
+        setWindowTitle(RestClientI18n.serverWizardEditServerTitle.text());
     }
 
     // ===========================================================================================================================
@@ -134,13 +133,17 @@
             status = this.serverManager.addServer(server);
 
             if (status.isError()) {
-                MessageDialog.openError(getShell(), I18n.ErrorDialogTitle, I18n.ServerWizardEditServerErrorMsg);
+                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(), I18n.ErrorDialogTitle, I18n.ServerWizardNewServerErrorMsg);
+                MessageDialog.openError(getShell(),
+                                        RestClientI18n.errorDialogTitle.text(),
+                                        RestClientI18n.serverWizardNewServerErrorMsg.text());
             }
         }
 

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/package-info.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/package-info.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/package-info.java	2009-08-10 21:31:32 UTC (rev 1160)
@@ -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.web.jcr.rest.client.swt.wizards;
\ No newline at end of file


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/package-info.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain


From dna-commits at lists.jboss.org  Fri Aug 14 12:29:04 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 14 Aug 2009 12:29:04 -0400
Subject: [dna-commits] DNA SVN: r1161 - in
	branches/eclipse/dna-web-jcr-rest-client:
	src/main/java/org/jboss/dna/web/jcr/rest/client and 6 other
	directories.
Message-ID: <200908141629.n7EGT4Bn004268@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-14 12:29:03 -0400 (Fri, 14 Aug 2009)
New Revision: 1161

Added:
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/RestClientI18n.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/RestClientI18n.properties
   branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/mime.types
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestClient.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestClientI18nTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestIntegrationTest.java
Removed:
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java
Modified:
   branches/eclipse/dna-web-jcr-rest-client/
   branches/eclipse/dna-web-jcr-rest-client/pom.xml
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java
   branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java
Log:
Now using dna-common's logger, I18n, CheckArg, and extension-based mime detector frameworks. Added a ServerAuthenticator that works with ServerManager's server registry for authentication. Added a "ping" method to ServerManager so that the client UI can test a connection before actually creating it. Added "Authorization" request property to the HTTPConnection. Did some work with javadocs.


Property changes on: branches/eclipse/dna-web-jcr-rest-client
___________________________________________________________________
Name: svn:ignore
   + target


Modified: branches/eclipse/dna-web-jcr-rest-client/pom.xml
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/pom.xml	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/pom.xml	2009-08-14 16:29:03 UTC (rev 1161)
@@ -18,11 +18,19 @@
 		those defined in the dependencyManagement section of the parent pom.
 	-->
 	<dependencies>
-		<!-- 
-        Testing (note the scope)
-    -->
 		<dependency>
 			<groupId>org.jboss.dna</groupId>
+			<artifactId>dna-common</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.dna</groupId>
+			<artifactId>dna-common</artifactId>
+			<version>${pom.version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.dna</groupId>
 			<artifactId>dna-web-jcr-rest-war</artifactId>
 			<type>war</type>
 			<version>${pom.version}</version>

Deleted: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -1,99 +0,0 @@
-/*
- * 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.web.jcr.rest.client;
-
-import java.util.ResourceBundle;
-
-/**
- * The <code>IMessages</code> interface are the resource bundle keys used in the <code>Messages.properties</code> file.
- * 
- * @since 0.6
- */
-public interface IMessages {
-
-    ResourceBundle MESSAGES = ResourceBundle.getBundle(IMessages.class.getPackage().getName() + ".Messages"); //$NON-NLS-1$
-
-    String ErrorDeletingServerRegistryFile = "ErrorDeletingServerRegistryFile"; //$NON-NLS-1$
-
-    String ErrorRestoringServerRegistry = "ErrorRestoringServerRegistry"; //$NON-NLS-1$
-
-    String ErrorSavingServerRegistry = "ErrorSavingServerRegistry"; //$NON-NLS-1$
-
-    String NullArgumentMsg = "NullArgumentMsg"; //$NON-NLS-1$
-
-    String RepositoryEmptyNameMsg = "RepositoryEmptyNameMsg"; //$NON-NLS-1$
-
-    String RepositoryNullServerMsg = "RepositoryNullServerMsg"; //$NON-NLS-1$
-
-    String RepositoryShortDescription = "RepositoryShortDescription"; //$NON-NLS-1$
-
-    String ServerEmptyUrlMsg = "ServerEmptyUrlMsg"; //$NON-NLS-1$
-
-    String ServerInvalidUrlMsg = "ServerInvalidUrlMsg"; //$NON-NLS-1$
-
-    String ServerEmptyUserMsg = "ServerEmptyUserMsg"; //$NON-NLS-1$
-
-    String ServerExistsMsg = "ServerExistsMsg"; //$NON-NLS-1$
-
-    String ServerManagerRegistryAddUnexpectedError = "ServerManagerRegistryAddUnexpectedError"; //$NON-NLS-1$
-
-    String ServerManagerRegistryListenerError = "ServerManagerRegistryListenerError"; //$NON-NLS-1$
-
-    String ServerManagerRegistryListenerErrorsOccurred = "ServerManagerRegistryListenerErrorsOccurred"; //$NON-NLS-1$
-
-    String ServerManagerRegistryRemoveUnexpectedError = "ServerManagerRegistryRemoveUnexpectedError"; //$NON-NLS-1$
-
-    String ServerManagerRegistryUpdateAddError = "ServerManagerRegistryUpdateAddError"; //$NON-NLS-1$
-
-    String ServerManagerRegistryUpdateRemoveError = "ServerManagerRegistryUpdateRemoveError"; //$NON-NLS-1$
-
-    String ServerManagerUnregisteredServer = "ServerManagerUnregisteredServer"; //$NON-NLS-1$
-
-    String ServerShortDescription = "ServerShortDescription"; //$NON-NLS-1$
-
-    String WorkspaceEmptyNameMsg = "WorkspaceEmptyNameMsg"; //$NON-NLS-1$
-
-    String WorkspaceNullRepositoryMsg = "WorkspaceNullRepositoryMsg"; //$NON-NLS-1$
-
-    String WorkspaceShortDescription = "WorkspaceShortDescription"; //$NON-NLS-1$
-
-    // JsonRestClient messages
-
-    String ConnectionErrorMsg = "ConnectionErrorMsg"; //$NON-NLS-1$
-
-    String CreateFileFailedMsg = "CreateFileFailedMsg"; //$NON-NLS-1$
-
-    String CreateFolderFailedMsg = "CreateFolderFailedMsg"; //$NON-NLS-1$
-
-    String GetRepositoriesFailedMsg = "GetRepositoriesFailedMsg"; //$NON-NLS-1$
-
-    String GetWorkspacesFailedMsg = "GetWorkspacesFailedMsg"; //$NON-NLS-1$
-
-    String PublishFailedMsg = "PublishFailedMsg"; //$NON-NLS-1$
-
-    String UnpublishFailedMsg = "UnpublishFailedMsg"; //$NON-NLS-1$
-
-    String UnpublishNeverPublishedMsg = "UnpublishNeverPublishedMsg"; //$NON-NLS-1$
-
-}

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IRestClient.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -61,7 +61,7 @@
      * Publishes, or uploads, a local file to the workspace at the specified path.
      * 
      * @param workspace the workspace where the resource will be published (never <code>null</code>)
-     * @param path the path to the folder where the file will be published (never <code>null</code>)
+     * @param path the unencoded path to the folder where the file will be published (never <code>null</code>)
      * @param file the resource being published (never <code>null</code>)
      * @return a status of the publishing operation outcome (never <code>null</code>)
      * @since 0.6
@@ -75,7 +75,7 @@
      * the workspace an {@link Severity#INFO info status} is returned.
      * 
      * @param workspace the workspace where the resource will be unpublished (never <code>null</code>)
-     * @param path the path to the folder where the file is published (never <code>null</code>)
+     * @param path the unencoded path to the folder where the file is published (never <code>null</code>)
      * @param file the file being unpublished (never <code>null</code>)
      * @return a status of the unpublishing operation outcome (never <code>null</code>)
      * @since 0.6

Deleted: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -1,249 +0,0 @@
-/*
- * 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.web.jcr.rest.client;
-
-import java.text.MessageFormat;
-import org.slf4j.LoggerFactory;
-
-/**
- * The <code>Logger</code> class provides a basic interface into an Eclipse SLF4J implementation.
- * 
- * @since 0.6
- */
-public final class Logger {
-
-    // ===========================================================================================================================
-    // Class Methods
-    // ===========================================================================================================================
-
-    /**
-     * @param clazz the class whose logger will be used
-     * @param message the localized message
-     * @return the message prepended with the class name and a delimiter
-     * @since 0.6
-     */
-    private static String getMessage( Class<?> clazz,
-                                      String message ) {
-        return (clazz.getSimpleName() + ": " + message); //$NON-NLS-1$
-    }
-
-    /**
-     * @param clazz the class whose logger will be used
-     * @param pattern the {@link MessageFormat} pattern
-     * @param arguments the arguments being inserted into the pattern
-     * @return the message
-     * @since 0.6
-     */
-    private static String getMessage( Class<?> clazz,
-                                      String pattern,
-                                      Object... arguments ) {
-        return getMessage(clazz, MessageFormat.format(pattern, arguments));
-    }
-
-    /**
-     * @param clazz the class whose logger will be used
-     * @param status the status whose message is a {@link MessageFormat} pattern
-     * @param arguments the arguments being inserted into the pattern
-     * @return the message
-     * @since 0.6
-     */
-    private static String getMessage( Class<?> clazz,
-                                      Status status,
-                                      Object... arguments ) {
-        return getMessage(clazz, status.getMessage(), arguments);
-    }
-
-    /**
-     * @param clazz the class whose logger will be used (never <code>null</code>)
-     * @param status the status being logged (never <code>null</code>)
-     * @since 0.6
-     */
-    public static void log( Class<?> clazz,
-                            Status status ) {
-        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
-        Utils.nullArgumentCheck("status", status); //$NON-NLS-1$
-
-        org.slf4j.Logger delegate = null;
-
-        try {
-            delegate = LoggerFactory.getLogger(clazz);
-        } catch (Throwable e) {
-            // adapter not found
-            System.err.println(status.getMessage());
-            return;
-        }
-
-        if (status.isError() && delegate.isErrorEnabled()) {
-            if (status.getException() == null) {
-                delegate.error(getMessage(clazz, status.getMessage()));
-            } else {
-                delegate.error(getMessage(clazz, status.getMessage()), status.getException());
-            }
-        } else if (status.isWarning() && delegate.isWarnEnabled()) {
-            if (status.getException() == null) {
-                delegate.warn(getMessage(clazz, status.getMessage()));
-            } else {
-                delegate.warn(getMessage(clazz, status.getMessage()), status.getException());
-            }
-        } else if (status.isInfo() && delegate.isInfoEnabled()) {
-            if (status.getException() == null) {
-                delegate.info(getMessage(clazz, status.getMessage()));
-            } else {
-                delegate.info(getMessage(clazz, status.getMessage()), status.getException());
-            }
-        } else {
-            trace(clazz, null, status.getMessage());
-        }
-    }
-
-    /**
-     * @param clazz the class whose logger will be used (never <code>null</code>)
-     * @param status the status being logged whose message is a {@link MessageFormat} pattern (never <code>null</code>)
-     * @param arguments the arguments to be inserted into the pattern (never <code>null</code>)
-     * @since 0.6
-     */
-    public static void log( Class<?> clazz,
-                            Status status,
-                            Object... arguments ) {
-        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
-        Utils.nullArgumentCheck("status", status); //$NON-NLS-1$
-        Utils.nullArgumentCheck("arguments", arguments); //$NON-NLS-1$
-
-        org.slf4j.Logger delegate = null;
-
-        try {
-            delegate = LoggerFactory.getLogger(clazz);
-        } catch (Throwable e) {
-            // adapter not found
-            System.err.println(status.getMessage());
-            return;
-        }
-
-        if (status.isError() && delegate.isErrorEnabled()) {
-            String msg = getMessage(clazz, status, arguments);
-
-            if (status.getException() == null) {
-                delegate.error(msg);
-            } else {
-                delegate.error(msg, status.getException());
-            }
-        } else if (status.isWarning() && delegate.isWarnEnabled()) {
-            String msg = getMessage(clazz, status, arguments);
-
-            if (status.getException() == null) {
-                delegate.warn(msg);
-            } else {
-                delegate.warn(msg, status.getException());
-            }
-        } else if (status.isInfo() && delegate.isInfoEnabled()) {
-            String msg = getMessage(clazz, status, arguments);
-
-            if (status.getException() == null) {
-                delegate.info(msg);
-            } else {
-                delegate.info(msg, status.getException());
-            }
-        } else {
-            trace(clazz, status.getException(), status.getMessage(), arguments);
-        }
-    }
-
-    /**
-     * @param clazz the class whose logger will be used
-     * @param e the error being logged or <code>null</code>
-     * @param msg the message being logged (never <code>null</code>)
-     * @since 0.6
-     */
-    public static void trace( Class<?> clazz,
-                              Throwable e,
-                              String msg ) {
-        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
-        Utils.nullArgumentCheck("msg", msg); //$NON-NLS-1$
-
-        org.slf4j.Logger delegate = null;
-
-        try {
-            delegate = LoggerFactory.getLogger(clazz);
-        } catch (Throwable error) {
-            // adapter not found
-            System.err.println(msg);
-            return;
-        }
-
-        if (delegate.isTraceEnabled()) {
-            if (e == null) {
-                delegate.trace(getMessage(clazz, msg));
-            } else {
-                delegate.trace(getMessage(clazz, msg), e);
-            }
-        }
-    }
-
-    /**
-     * @param clazz the class whose logger will be used (never <code>null</code>)
-     * @param e the error being logged or <code>null</code>
-     * @param pattern the {@link MessageFormat} pattern (never <code>null</code>)
-     * @param arguments the arguments to be inserted into the pattern (never <code>null</code>)
-     * @since 0.6
-     */
-    public static void trace( Class<?> clazz,
-                              Throwable e,
-                              String pattern,
-                              Object... arguments ) {
-        Utils.nullArgumentCheck("clazz", clazz); //$NON-NLS-1$
-        Utils.nullArgumentCheck("pattern", pattern); //$NON-NLS-1$
-        Utils.nullArgumentCheck("arguments", arguments); //$NON-NLS-1$
-
-        org.slf4j.Logger delegate = null;
-
-        try {
-            delegate = LoggerFactory.getLogger(clazz);
-        } catch (Throwable error) {
-            // adapter not found
-            System.err.println(MessageFormat.format(pattern, arguments));
-            return;
-        }
-
-        if (delegate.isTraceEnabled()) {
-            if (e == null) {
-                delegate.trace(getMessage(clazz, pattern, arguments));
-            } else {
-                delegate.trace(getMessage(clazz, pattern, arguments), e);
-            }
-        }
-    }
-
-    // ===========================================================================================================================
-    // Constructors
-    // ===========================================================================================================================
-
-    /**
-     * Don't allow construction.
-     * 
-     * @since 0.6
-     */
-    private Logger() {
-        // nothing to do
-    }
-}

Copied: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/RestClientI18n.java (from rev 1148, branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IMessages.java)
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/RestClientI18n.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/RestClientI18n.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -0,0 +1,109 @@
+/*
+ * 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.web.jcr.rest.client;
+
+import org.jboss.dna.common.i18n.I18n;
+
+/**
+ * The <code>RestClientI18n</code> class provides localized messages.
+ * 
+ * @since 0.6
+ */
+public final class RestClientI18n {
+
+    public static I18n errorDeletingServerRegistryFile;
+
+    public static I18n errorRestoringServerRegistry;
+
+    public static I18n errorSavingServerRegistry;
+
+    public static I18n nullArgumentMsg;
+
+    public static I18n repositoryEmptyNameMsg;
+
+    public static I18n repositoryNullServerMsg;
+
+    public static I18n repositoryShortDescription;
+
+    public static I18n serverEmptyUrlMsg;
+
+    public static I18n serverEmptyUserMsg;
+
+    public static I18n serverExistsMsg;
+
+    public static I18n serverInvalidUrlMsg;
+
+    public static I18n serverManagerConnectionEstablishedMsg;
+
+    public static I18n serverManagerConnectionFailedMsg;
+
+    public static I18n serverManagerRegistryAddUnexpectedError;
+
+    public static I18n serverManagerRegistryListenerError;
+
+    public static I18n serverManagerRegistryListenerErrorsOccurred;
+
+    public static I18n serverManagerRegistryRemoveUnexpectedError;
+
+    public static I18n serverManagerRegistryUpdateAddError;
+
+    public static I18n serverManagerRegistryUpdateRemoveError;
+
+    public static I18n serverManagerUnregisteredServer;
+
+    public static I18n serverShortDescription;
+
+    public static I18n workspaceEmptyNameMsg;
+
+    public static I18n workspaceNullRepositoryMsg;
+
+    public static I18n workspaceShortDescription;
+
+    // JsonRestClient messages
+
+    public static I18n connectionErrorMsg;
+
+    public static I18n createFileFailedMsg;
+
+    public static I18n createFolderFailedMsg;
+
+    public static I18n getRepositoriesFailedMsg;
+
+    public static I18n getWorkspacesFailedMsg;
+
+    public static I18n publishFailedMsg;
+
+    public static I18n unpublishFailedMsg;
+
+    public static I18n unpublishNeverPublishedMsg;
+
+    static {
+        try {
+            I18n.initialize(RestClientI18n.class);
+        } catch (Exception e) {
+            System.err.println(e);
+        }
+    }
+
+}


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/RestClientI18n.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerAuthenticator.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -25,8 +25,11 @@
 
 import java.net.Authenticator;
 import java.net.PasswordAuthentication;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
 /**
+ * The <code>ServerAuthenticator</code> class provides user names and passwords to the HTTP connection.
+ * 
  * @since 0.6
  */
 public class ServerAuthenticator extends Authenticator {
@@ -35,12 +38,21 @@
     // Fields
     // ===========================================================================================================================
 
+    /**
+     * The object managing the server registry.
+     * 
+     * @since 0.6
+     */
     private final ServerManager serverManager;
 
     // ===========================================================================================================================
     // Constructors
     // ===========================================================================================================================
 
+    /**
+     * @param serverManager the server manager manages the server registry
+     * @since 0.6
+     */
     public ServerAuthenticator( ServerManager serverManager ) {
         this.serverManager = serverManager;
     }
@@ -57,73 +69,8 @@
      */
     @Override
     protected PasswordAuthentication getPasswordAuthentication() {
-        // URL url = getRequestingURL();
-        return super.getPasswordAuthentication();
+        Server server = this.serverManager.getCurrentServer();
+        return new PasswordAuthentication(server.getUser(), server.getPassword().toCharArray());
     }
 
-    /*    
-        public final class DelegatingAuthenticator extends Authenticator {
-
-            private static DelegatingAuthenticator m_INSTANCE;
-
-            private Map m_authenticators;
-
-            static public DelegatingAuthenticator getInstance() {
-                synchronized (DelegatingAuthenticator.class) {
-                    if (m_INSTANCE == null) {
-                        m_INSTANCE = new DelegatingAuthenticator();
-                        Authenticator.setDefault(m_INSTANCE);
-                    }
-                    return m_INSTANCE;
-                }
-            }
-
-            private DelegatingAuthenticator() {
-                m_authenticators = new HashMap();
-            }
-
-            public void addTransitAuthenticator( TransitAuthenticator authenticator,
-                                                 RequestIdentifier id ) {
-                synchronized (m_authenticators) {
-                    m_authenticators.put(id, authenticator);
-                }
-            }
-
-            public void removeTransitAuthenticator( TransitAuthenticator authenticator ) {
-                synchronized (m_authenticators) {
-                    Iterator list = m_authenticators.values().iterator();
-                    while (list.hasNext()) {
-                        Authenticator item = (Authenticator)list.next();
-                        if (item.equals(authenticator)) {
-                            list.remove();
-                        }
-                    }
-                }
-            }
-
-            protected PasswordAuthentication getPasswordAuthentication() {
-                try {
-                    String host = getRequestingHost();
-                    String protocol = getRequestingProtocol();
-                    String prompt = getRequestingPrompt();
-                    String scheme = getRequestingScheme();
-                    int port = getRequestingPort();
-                    InetAddress addr = getRequestingSite();
-                    if (addr == null) {
-                        addr = InetAddress.getByName(host);
-                    }
-                    RequestIdentifier id = new RequestIdentifier(addr, port, protocol, scheme, prompt);
-                    synchronized (m_authenticators) {
-                        TransitAuthenticator auth = (TransitAuthenticator)m_authenticators.get(id);
-                        if (auth == null) {
-                            return null;
-                        }
-                        return auth.resolvePasswordAuthentication(this);
-                    }
-                } catch (UnknownHostException e) {
-                    return null;
-                }
-            }
-        }
-    */
 }

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,9 +23,9 @@
  */
 package org.jboss.dna.web.jcr.rest.client;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.MESSAGES;
 import java.io.File;
 import java.io.FileOutputStream;
+import java.net.Authenticator;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -43,6 +43,8 @@
 import javax.xml.transform.stream.StreamResult;
 import net.jcip.annotations.GuardedBy;
 import net.jcip.annotations.ThreadSafe;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
 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;
@@ -109,6 +111,31 @@
     private static final String USER_TAG = "user"; //$NON-NLS-1$
 
     // ===========================================================================================================================
+    // Class Fields
+    // ===========================================================================================================================
+
+    /**
+     * The java.net.Authenticator needs server information to complete the publish, unpublish, getRepositories(), and
+     * getWorkspaces() operations. Setting a thread variable was a way to do that.
+     * 
+     * @see ServerAuthenticator
+     * @since 0.6
+     */
+    private static ThreadLocal<Server> currentServer = new ThreadLocal<Server>();
+
+    // ===========================================================================================================================
+    // Class Methods
+    // ===========================================================================================================================
+
+    /**
+     * @return the server set on the current thread or <code>null</code>
+     * @since 0.6
+     */
+    public static Server getCurrentServer() {
+        return ServerManager.currentServer.get();
+    }
+
+    // ===========================================================================================================================
     // Fields
     // ===========================================================================================================================
 
@@ -127,6 +154,13 @@
     private final IRestClient delegate;
 
     /**
+     * The logger.
+     * 
+     * @since 0.6
+     */
+    private final Logger logger = Logger.getLogger(ServerManager.class);
+
+    /**
      * The path where the server registry is persisted or <code>null</code> if not persisted.
      * 
      * @since 0.6
@@ -155,20 +189,20 @@
     /**
      * @param stateLocationPath the directory where the {@link Server} registry} is persisted (may be <code>null</code> if
      *        persistence is not desired)
-     * @param restExecutor the executor that will communicate with the DNA REST server (never <code>null</code>)
+     * @param restClient the client that will communicate with the DNA REST server (never <code>null</code>)
      * @since 0.6
      */
     public ServerManager( String stateLocationPath,
-                          IRestClient restExecutor ) {
-        Utils.nullArgumentCheck("restExecutor", restExecutor); //$NON-NLS-1$
+                          IRestClient restClient ) {
+        CheckArg.isNotNull(restClient, "restClient"); //$NON-NLS-1$
 
         this.servers = new ArrayList<Server>();
         this.stateLocationPath = stateLocationPath;
-        this.delegate = restExecutor;
+        this.delegate = restClient;
         this.listeners = new CopyOnWriteArrayList<IServerRegistryListener>();
 
-        // TODO set authenticator here
-        // Authenticator.setDefault(new ServerAuthenticator());
+        // set our authenticator that uses the server registry
+        Authenticator.setDefault(new ServerAuthenticator(this));
     }
 
     /**
@@ -194,7 +228,7 @@
      * @since 0.6
      */
     public boolean addRegistryListener( IServerRegistryListener listener ) {
-        Utils.nullArgumentCheck("listener", listener); //$NON-NLS-1$
+        CheckArg.isNotNull(listener, "listener"); //$NON-NLS-1$
         return this.listeners.addIfAbsent(listener);
     }
 
@@ -206,7 +240,7 @@
      * @since 0.6
      */
     public Status addServer( Server server ) {
-        Utils.nullArgumentCheck("server", server); //$NON-NLS-1$
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
         return internalAddServer(server, true);
     }
 
@@ -241,21 +275,24 @@
      * {@inheritDoc}
      * 
      * @see org.jboss.dna.web.jcr.rest.client.IRestClient#getRepositories(org.jboss.dna.web.jcr.rest.client.domain.Server)
+     * @throws RuntimeException if the server is not registered
+     * @see #isRegistered(Server)
      * @since 0.6
      */
     public Collection<Repository> getRepositories( Server server ) throws Exception {
-        Utils.nullArgumentCheck("server", server); //$NON-NLS-1$
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
 
         try {
             this.serverLock.readLock().lock();
 
             if (isRegistered(server)) {
+                ServerManager.currentServer.set(server);
                 Collection<Repository> repositories = this.delegate.getRepositories(server);
                 return Collections.unmodifiableCollection(new ArrayList<Repository>(repositories));
             }
 
             // server must be registered in order to obtain it's repositories
-            throw new RuntimeException(Utils.getMessage(IMessages.ServerManagerUnregisteredServer, server.getShortDescription()));
+            throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
         } finally {
             this.serverLock.readLock().unlock();
         }
@@ -265,22 +302,25 @@
      * {@inheritDoc}
      * 
      * @see org.jboss.dna.web.jcr.rest.client.IRestClient#getWorkspaces(org.jboss.dna.web.jcr.rest.client.domain.Repository)
+     * @throws RuntimeException if the server is not registered
+     * @see #isRegistered(Server)
      * @since 0.6
      */
     public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
-        Utils.nullArgumentCheck("repository", repository); //$NON-NLS-1$
+        CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
 
         try {
             this.serverLock.readLock().lock();
 
             if (isRegistered(repository.getServer())) {
+                ServerManager.currentServer.set(repository.getServer());
                 Collection<Workspace> workspaces = this.delegate.getWorkspaces(repository);
                 return Collections.unmodifiableCollection(new ArrayList<Workspace>(workspaces));
             }
 
             // a repository's server must be registered in order to obtain it's workspaces
-            throw new RuntimeException(Utils.getMessage(IMessages.ServerManagerUnregisteredServer,
-                                                        repository.getServer().getShortDescription()));
+            String msg = RestClientI18n.serverManagerUnregisteredServer.text(repository.getServer().getShortDescription());
+            throw new RuntimeException(msg);
         } finally {
             this.serverLock.readLock().unlock();
         }
@@ -318,7 +358,7 @@
         }
 
         // server already exists
-        return new Status(Severity.ERROR, Utils.getMessage(IMessages.ServerExistsMsg, server.getShortDescription()), null);
+        return new Status(Severity.ERROR, RestClientI18n.serverExistsMsg.text(server.getShortDescription()), null);
     }
 
     /**
@@ -355,8 +395,8 @@
         }
 
         // server could not be removed
-        return new Status(Severity.ERROR, Utils.getMessage(IMessages.ServerManagerRegistryRemoveUnexpectedError,
-                                                           server.getShortDescription()), null);
+        return new Status(Severity.ERROR,
+                          RestClientI18n.serverManagerRegistryRemoveUnexpectedError.text(server.getShortDescription()), null);
     }
 
     /**
@@ -366,7 +406,7 @@
      * @since 0.6
      */
     public boolean isRegistered( Server server ) {
-        Utils.nullArgumentCheck("server", server); //$NON-NLS-1$
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
 
         try {
             this.serverLock.readLock().lock();
@@ -430,24 +470,58 @@
         }
 
         for (Exception error : errors) {
-            Logger.log(getClass(), new Status(Severity.ERROR, MESSAGES.getString(IMessages.ServerManagerRegistryListenerError),
-                                              error));
+            this.logger.error(error, RestClientI18n.serverManagerRegistryListenerError);
         }
 
-        return new Status(Severity.WARNING, MESSAGES.getString(IMessages.ServerManagerRegistryListenerErrorsOccurred), null);
+        return new Status(Severity.WARNING, RestClientI18n.serverManagerRegistryListenerErrorsOccurred.text(), null);
     }
 
     /**
+     * Attempts to connect to the server. The server does <strong>NOT</strong> need to be registered.
+     * 
+     * @param server the server being pinged (never <code>null</code>)
+     * @return a status indicating if the server can be connected to
+     * @see #isRegistered(Server)
+     * @since 0.6
+     */
+    public Status ping( Server server ) {
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
+
+        try {
+            ServerManager.currentServer.set(server);
+            this.delegate.getRepositories(server);
+            return new Status(Severity.OK, RestClientI18n.serverManagerConnectionEstablishedMsg.text(), null);
+        } catch (Exception e) {
+            return new Status(Severity.ERROR, RestClientI18n.serverManagerConnectionFailedMsg.text(), null);
+        }
+    }
+
+    /**
      * {@inheritDoc}
+     * <p>
+     * Only tries to unpublish if the workspace's {@link Server server} is registered.
      * 
      * @see org.jboss.dna.web.jcr.rest.client.IRestClient#publish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
      *      java.lang.String, java.io.File)
+     * @see #isRegistered(Server)
      * @since 0.6
      */
     public Status publish( Workspace workspace,
                            String path,
                            File file ) {
-        return this.delegate.publish(workspace, path, file);
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+        CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+
+        Server server = workspace.getServer();
+
+        if (isRegistered(server)) {
+            ServerManager.currentServer.set(server);
+            return this.delegate.publish(workspace, path, file);
+        }
+
+        // server must be registered in order to publish
+        throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
     }
 
     /**
@@ -456,7 +530,7 @@
      * @since 0.6
      */
     public boolean removeRegistryListener( IServerRegistryListener listener ) {
-        Utils.nullArgumentCheck("listener", listener); //$NON-NLS-1$
+        CheckArg.isNotNull(listener, "listener"); //$NON-NLS-1$
         return this.listeners.remove(listener);
     }
 
@@ -466,7 +540,7 @@
      * @since 0.6
      */
     public Status removeServer( Server server ) {
-        Utils.nullArgumentCheck("server", server); //$NON-NLS-1$
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
         return internalRemoveServer(server, true);
     }
 
@@ -502,8 +576,7 @@
                         }
                     }
                 } catch (Exception e) {
-                    return new Status(Severity.ERROR,
-                                      Utils.getMessage(IMessages.ErrorRestoringServerRegistry, getStateFileName()), e);
+                    return new Status(Severity.ERROR, RestClientI18n.errorRestoringServerRegistry.text(getStateFileName()), e);
                 }
             }
         }
@@ -549,15 +622,14 @@
                 transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
                 transformer.transform(source, resultXML);
             } catch (Exception e) {
-                return new Status(Severity.ERROR, Utils.getMessage(IMessages.ErrorSavingServerRegistry, getStateFileName()), e);
+                return new Status(Severity.ERROR, RestClientI18n.errorSavingServerRegistry.text(getStateFileName()), e);
             }
         } else if ((this.stateLocationPath != null) && stateFileExists()) {
             // delete current registry file since all servers have been deleted
             try {
                 new File(getStateFileName()).delete();
             } catch (Exception e) {
-                return new Status(Severity.ERROR,
-                                  Utils.getMessage(IMessages.ErrorDeletingServerRegistryFile, getStateFileName()), e);
+                return new Status(Severity.ERROR, RestClientI18n.errorDeletingServerRegistryFile.text(getStateFileName()), e);
             }
         }
 
@@ -574,15 +646,30 @@
 
     /**
      * {@inheritDoc}
+     * <p>
+     * Only tries to unpublish if the workspace's {@link Server server} is registered.
      * 
      * @see org.jboss.dna.web.jcr.rest.client.IRestClient#unpublish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
      *      java.lang.String, java.io.File)
+     * @see #isRegistered(Server)
      * @since 0.6
      */
     public Status unpublish( Workspace workspace,
                              String path,
                              File file ) {
-        return this.delegate.unpublish(workspace, path, file);
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+        CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+
+        Server server = workspace.getServer();
+
+        if (isRegistered(server)) {
+            ServerManager.currentServer.set(server);
+            return this.delegate.unpublish(workspace, path, file);
+        }
+
+        // server must be registered in order to unpublish
+        throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
     }
 
     /**
@@ -595,8 +682,8 @@
      */
     public Status updateServer( Server previousServerVersion,
                                 Server newServerVersion ) {
-        Utils.nullArgumentCheck("previousServerVersion", previousServerVersion); //$NON-NLS-1$
-        Utils.nullArgumentCheck("newServerVersion", newServerVersion); //$NON-NLS-1$
+        CheckArg.isNotNull(previousServerVersion, "previousServerVersion"); //$NON-NLS-1$
+        CheckArg.isNotNull(newServerVersion, "newServerVersion"); //$NON-NLS-1$
 
         Status status = null;
 
@@ -615,16 +702,15 @@
                 }
 
                 // unexpected problem adding new version of server to registry
-                return new Status(Severity.ERROR, Utils.getMessage(IMessages.ServerManagerRegistryUpdateAddError,
-                                                                   status.getMessage()), status.getException());
+                return new Status(Severity.ERROR, RestClientI18n.serverManagerRegistryUpdateAddError.text(status.getMessage()),
+                                  status.getException());
             }
         } finally {
             this.serverLock.writeLock().unlock();
         }
 
         // unexpected problem removing server from registry
-        return new Status(Severity.ERROR,
-                          Utils.getMessage(IMessages.ServerManagerRegistryUpdateRemoveError, status.getMessage()),
+        return new Status(Severity.ERROR, RestClientI18n.serverManagerRegistryUpdateRemoveError.text(status.getMessage()),
                           status.getException());
     }
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,6 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client;
 
+import org.jboss.dna.common.util.CheckArg;
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
 /**
@@ -76,7 +77,7 @@
      * @since 0.6
      */
     public static ServerRegistryEvent createNewEvent( Server newServer ) {
-        Utils.nullArgumentCheck("newServer", newServer); //$NON-NLS-1$
+        CheckArg.isNotNull(newServer, "newServer"); //$NON-NLS-1$
         return new ServerRegistryEvent(Type.NEW, newServer);
     }
 
@@ -87,7 +88,7 @@
      * @since 0.6
      */
     public static ServerRegistryEvent createRemoveEvent( Server removedServer ) {
-        Utils.nullArgumentCheck("removedServer", removedServer); //$NON-NLS-1$
+        CheckArg.isNotNull(removedServer, "removedServer"); //$NON-NLS-1$
         return new ServerRegistryEvent(Type.REMOVE, removedServer);
     }
 
@@ -100,8 +101,8 @@
      */
     public static ServerRegistryEvent createUpdateEvent( Server previousServerVersion,
                                                          Server newServerVersion ) {
-        Utils.nullArgumentCheck("previousServerVersion", previousServerVersion); //$NON-NLS-1$
-        Utils.nullArgumentCheck("newServerVersion", newServerVersion); //$NON-NLS-1$
+        CheckArg.isNotNull(previousServerVersion, "previousServerVersion"); //$NON-NLS-1$
+        CheckArg.isNotNull(newServerVersion, "newServerVersion"); //$NON-NLS-1$
 
         ServerRegistryEvent event = new ServerRegistryEvent(Type.UPDATE, previousServerVersion);
         event.updatedServer = newServerVersion;

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -96,21 +96,21 @@
      * 
      * @since 0.6
      */
-    protected final Throwable exception;
+    private final Throwable exception;
 
     /**
      * The localized message of this status (can be <code>null</code>).
      * 
      * @since 0.6
      */
-    protected final String message;
+    private final String message;
 
     /**
      * The severity level of this status (never <code>null</code>).
      * 
      * @since 0.6
      */
-    protected final Severity severity;
+    private final Severity severity;
 
     // ===========================================================================================================================
     // Constructors

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,9 +23,10 @@
  */
 package org.jboss.dna.web.jcr.rest.client;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.MESSAGES;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.NullArgumentMsg;
-import java.text.MessageFormat;
+import java.io.File;
+import java.io.InputStream;
+import java.util.Map;
+import org.jboss.dna.common.util.MimeTypeUtil;
 
 /**
  * The <code>Utils</code> class contains common utilities used by this project.
@@ -35,6 +36,13 @@
 public final class Utils {
 
     // ===========================================================================================================================
+    // Class Fields
+    // ===========================================================================================================================
+
+    // utility to detect file mime type by using file extension
+    private static MimeTypeUtil mimeTypeUtils;
+
+    // ===========================================================================================================================
     // Class Methods
     // ===========================================================================================================================
 
@@ -56,30 +64,22 @@
     }
 
     /**
-     * @param key the key of the pattern from the {@link IMessages#MESSAGES} resource bundle (never <code>null</code>)
-     * @param arguments the values being inserted into the pattern
-     * @return the localized text
+     * @param file the file whose mime type is being requested
+     * @return the mime type or the default mime type (<code>"application/octet-stream"</code>) if one can't be determined from
+     *         the file extension (never <code>null</code>)
      * @since 0.6
      */
-    public static String getMessage( String key,
-                                     Object... arguments ) {
-        Utils.nullArgumentCheck("key", key); //$NON-NLS-1$
-        String pattern = MESSAGES.getString(key);
-        return MessageFormat.format(pattern, arguments);
-    }
+    public static String getMimeType( File file ) {
+        // TODO write test for getMimeType(File)
+        if (mimeTypeUtils == null) {
 
-    /**
-     * @param name the argument name
-     * @param value the argument value
-     * @throws IllegalArgumentException if the value is <code>null</code>
-     * @since 0.6
-     */
-    public static void nullArgumentCheck( String name,
-                                          Object value ) throws IllegalArgumentException {
-        if (value == null) {
-            String pattern = MESSAGES.getString(NullArgumentMsg);
-            throw new IllegalArgumentException(MessageFormat.format(pattern, name));
+            InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("org/jboss/dna/web/jcr/rest/client/mime.types"); //$NON-NLS-1$
+            Map<String, String> customMap = MimeTypeUtil.load(stream, null);
+            mimeTypeUtils = new MimeTypeUtil(customMap, true);
         }
+
+        String mimeType = mimeTypeUtils.mimeTypeOf(file);
+        return ((mimeType == null) ? "application/octet-stream" : mimeType); //$NON-NLS-1$
     }
 
     // ===========================================================================================================================

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,10 +23,10 @@
  */
 package org.jboss.dna.web.jcr.rest.client.domain;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.RepositoryShortDescription;
 import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.web.jcr.rest.client.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.domain.validation.RepositoryValidator;
 
 /**
@@ -72,8 +72,8 @@
      */
     public Repository( String name,
                        Server server ) {
-        Utils.nullArgumentCheck("name", name); //$NON-NLS-1$
-        Utils.nullArgumentCheck("server", server); //$NON-NLS-1$
+        CheckArg.isNotNull(name, "name"); //$NON-NLS-1$
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
 
         // validate inputs
         Status status = RepositoryValidator.isValid(name, server);
@@ -132,7 +132,7 @@
      * @since 0.6
      */
     public String getShortDescription() {
-        return Utils.getMessage(RepositoryShortDescription, this.name, this.server.getName());
+        return RestClientI18n.repositoryShortDescription.text(this.name, this.server.getName());
     }
 
     /**

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,8 +23,9 @@
  */
 package org.jboss.dna.web.jcr.rest.client.domain;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.ServerShortDescription;
 import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.web.jcr.rest.client.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.Status;
 import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.domain.validation.RepositoryValidator;
@@ -89,7 +90,7 @@
                    String user,
                    String password,
                    boolean persistPassword ) {
-        Utils.nullArgumentCheck("url", url); //$NON-NLS-1$
+        CheckArg.isNotNull(url, "url"); //$NON-NLS-1$
 
         // valid inputs
         Status status = ServerValidator.isValid(url, user, password, persistPassword);
@@ -152,7 +153,7 @@
      * @since 0.6
      */
     public String getShortDescription() {
-        return Utils.getMessage(ServerShortDescription, this.url, this.user);
+        return RestClientI18n.serverShortDescription.text(this.url, this.user);
     }
 
     /**
@@ -200,7 +201,7 @@
      * @return <code>true</code> if the servers have the same key
      */
     public boolean hasSameKey( Server otherServer ) {
-        Utils.nullArgumentCheck("otherServer", otherServer); //$NON-NLS-1$
+        CheckArg.isNotNull(otherServer, "otherServer"); //$NON-NLS-1$
         return (Utils.equivalent(this.url, otherServer.url) && Utils.equivalent(this.user, otherServer.user));
     }
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,10 +23,10 @@
  */
 package org.jboss.dna.web.jcr.rest.client.domain;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.WorkspaceShortDescription;
 import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.web.jcr.rest.client.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.domain.validation.WorkspaceValidator;
 
 /**
@@ -70,8 +70,8 @@
      */
     public Workspace( String name,
                       Repository repository ) {
-        Utils.nullArgumentCheck("name", name); //$NON-NLS-1$
-        Utils.nullArgumentCheck("repository", repository); //$NON-NLS-1$
+        CheckArg.isNotNull(name, "name"); //$NON-NLS-1$
+        CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
 
         // validate inputs
         Status status = WorkspaceValidator.isValid(name, repository);
@@ -138,7 +138,7 @@
      * @since 0.6
      */
     public String getShortDescription() {
-        return Utils.getMessage(WorkspaceShortDescription, this.name, this.repository.getName());
+        return RestClientI18n.workspaceShortDescription.text(this.name, this.repository.getName());
     }
 
     /**

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,9 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.domain.validation;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.MESSAGES;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.RepositoryEmptyNameMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.RepositoryNullServerMsg;
+import org.jboss.dna.web.jcr.rest.client.RestClientI18n;
 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;
@@ -49,7 +47,7 @@
      */
     public static Status isNameValid( String name ) {
         if ((name == null) || (name.length() == 0)) {
-            return new Status(Severity.ERROR, MESSAGES.getString(RepositoryEmptyNameMsg), null);
+            return new Status(Severity.ERROR, RestClientI18n.repositoryEmptyNameMsg.text(), null);
         }
 
         return Status.OK_STATUS;
@@ -62,7 +60,7 @@
      */
     public static Status isServerValid( Server server ) {
         if (server == null) {
-            return new Status(Severity.ERROR, MESSAGES.getString(RepositoryNullServerMsg), null);
+            return new Status(Severity.ERROR, RestClientI18n.repositoryNullServerMsg.text(), null);
         }
 
         return Status.OK_STATUS;

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,15 +23,10 @@
  */
 package org.jboss.dna.web.jcr.rest.client.domain.validation;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.MESSAGES;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.ServerEmptyUrlMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.ServerEmptyUserMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.ServerExistsMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.ServerInvalidUrlMsg;
 import java.net.URL;
+import org.jboss.dna.web.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.Utils;
 import org.jboss.dna.web.jcr.rest.client.Status.Severity;
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
@@ -62,13 +57,13 @@
      */
     public static Status isUrlValid( String url ) {
         if ((url == null) || (url.length() == 0)) {
-            return new Status(Severity.ERROR, MESSAGES.getString(ServerEmptyUrlMsg), null);
+            return new Status(Severity.ERROR, RestClientI18n.serverEmptyUrlMsg.text(), null);
         }
 
         try {
             new URL(url);
         } catch (Exception e) {
-            return new Status(Severity.ERROR, Utils.getMessage(ServerInvalidUrlMsg, url), null);
+            return new Status(Severity.ERROR, RestClientI18n.serverInvalidUrlMsg.text(url), null);
         }
 
         return Status.OK_STATUS;
@@ -81,7 +76,7 @@
      */
     public static Status isUserValid( String user ) {
         if ((user == null) || (user.length() == 0)) {
-            return new Status(Severity.ERROR, MESSAGES.getString(ServerEmptyUserMsg), null);
+            return new Status(Severity.ERROR, RestClientI18n.serverEmptyUserMsg.text(), null);
         }
 
         return Status.OK_STATUS;
@@ -139,7 +134,7 @@
             Server newServer = new Server(url, user, password, persistPassword);
 
             if (serverManager.isRegistered(newServer)) {
-                status = new Status(Severity.ERROR, Utils.getMessage(ServerExistsMsg, newServer.getShortDescription()), null);
+                status = new Status(Severity.ERROR, RestClientI18n.serverExistsMsg.text(newServer.getShortDescription()), null);
             }
         }
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,9 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.domain.validation;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.MESSAGES;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.WorkspaceEmptyNameMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.WorkspaceNullRepositoryMsg;
+import org.jboss.dna.web.jcr.rest.client.RestClientI18n;
 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;
@@ -49,7 +47,7 @@
      */
     public static Status isNameValid( String name ) {
         if ((name == null) || (name.length() == 0)) {
-            return new Status(Severity.ERROR, MESSAGES.getString(WorkspaceEmptyNameMsg), null);
+            return new Status(Severity.ERROR, RestClientI18n.workspaceEmptyNameMsg.text(), null);
         }
 
         return Status.OK_STATUS;
@@ -62,7 +60,7 @@
      */
     public static Status isRepositoryValid( Repository repository ) {
         if (repository == null) {
-            return new Status(Severity.ERROR, MESSAGES.getString(WorkspaceNullRepositoryMsg), null);
+            return new Status(Severity.ERROR, RestClientI18n.workspaceNullRepositoryMsg.text(), null);
         }
 
         return Status.OK_STATUS;

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FileNode.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -36,6 +36,8 @@
 import java.util.TimeZone;
 import net.jcip.annotations.Immutable;
 import org.codehaus.jettison.json.JSONObject;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
 import org.jboss.dna.web.jcr.rest.client.IJcrConstants;
 import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
@@ -90,8 +92,8 @@
                      File file ) throws Exception {
         super(file.getName());
 
-        Utils.nullArgumentCheck("workspace", workspace); //$NON-NLS-1$
-        Utils.nullArgumentCheck("path", path); //$NON-NLS-1$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+        CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
 
         this.file = file;
         this.path = path;
@@ -167,8 +169,8 @@
         FolderNode folderNode = new FolderNode(this.workspace, getPath());
         StringBuilder url = new StringBuilder(folderNode.getUrl().toString());
 
-        // add file to path
-        url.append('/').append(this.file.getName());
+        // add file to path and encode the name
+        url.append('/').append(JsonUtils.encode(this.file.getName()));
         return new URL(url.toString());
     }
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/FolderNode.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -26,8 +26,9 @@
 import java.net.URL;
 import net.jcip.annotations.Immutable;
 import org.codehaus.jettison.json.JSONObject;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
 import org.jboss.dna.web.jcr.rest.client.IJcrConstants;
-import org.jboss.dna.web.jcr.rest.client.Utils;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
@@ -64,8 +65,8 @@
                        String fullPath ) throws Exception {
         super(fullPath);
 
-        Utils.nullArgumentCheck("workspace", workspace); //$NON-NLS-1$
-        Utils.nullArgumentCheck("fullPath", fullPath); //$NON-NLS-1$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+        CheckArg.isNotNull(fullPath, "fullPath"); //$NON-NLS-1$
 
         this.workspace = workspace;
 
@@ -100,19 +101,20 @@
         WorkspaceNode workspaceNode = new WorkspaceNode(this.workspace);
         StringBuilder url = new StringBuilder(workspaceNode.getUrl().toString());
 
-        // add folder path
+        // make sure path starts with a '/'
         String path = getPath();
 
-        if (path.startsWith("/")) { //$NON-NLS-1$
-            url.append(path);
-        } else {
-            url.append('/').append(path);
+        if (!path.startsWith("/")) { //$NON-NLS-1$
+            path = '/' + path;
         }
-
-        // strip off ending '/'
+        
+        // make sure path does NOT end with a '/'
         if (path.endsWith("/")) { //$NON-NLS-1$
-            url.setLength(url.length() - 1);
+            path = path.substring(0, path.length() - 1);
         }
+        
+        // path needs to be encoded
+        url.append(JsonUtils.encode(path));
 
         return new URL(url.toString());
     }

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonNode.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -25,7 +25,7 @@
 
 import java.net.URL;
 import org.codehaus.jettison.json.JSONObject;
-import org.jboss.dna.web.jcr.rest.client.Utils;
+import org.jboss.dna.common.util.CheckArg;
 
 /**
  * The <code>JsonNode</code> class defines the API for interacing with JSON objects. Every <code>JsonNode</code> knows how to
@@ -55,7 +55,7 @@
      * @since 0.6
      */
     protected JsonNode( String id ) {
-        Utils.nullArgumentCheck("id", id); //$NON-NLS-1$
+        CheckArg.isNotNull(id, "id"); //$NON-NLS-1$
         this.id = id;
     }
 

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClient.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -23,25 +23,17 @@
  */
 package org.jboss.dna.web.jcr.rest.client.json;
 
-import static org.jboss.dna.web.jcr.rest.client.IMessages.ConnectionErrorMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.CreateFileFailedMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.CreateFolderFailedMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.GetRepositoriesFailedMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.GetWorkspacesFailedMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.PublishFailedMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.UnpublishFailedMsg;
-import static org.jboss.dna.web.jcr.rest.client.IMessages.UnpublishNeverPublishedMsg;
 import java.io.File;
-import java.net.Authenticator;
 import java.net.HttpURLConnection;
-import java.net.PasswordAuthentication;
 import java.net.URL;
 import java.util.Collection;
 import javax.ws.rs.core.MediaType;
+import org.jboss.dna.common.util.Base64;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
 import org.jboss.dna.web.jcr.rest.client.IRestClient;
-import org.jboss.dna.web.jcr.rest.client.Logger;
+import org.jboss.dna.web.jcr.rest.client.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.Utils;
 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;
@@ -57,6 +49,17 @@
 public final class JsonRestClient implements IRestClient {
 
     // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    /**
+     * The logger.
+     * 
+     * @since 0.6
+     */
+    private final Logger logger = Logger.getLogger(JsonRestClient.class);
+
+    // ===========================================================================================================================
     // Methods
     // ===========================================================================================================================
 
@@ -72,35 +75,27 @@
     private void createFileNode( Workspace workspace,
                                  String path,
                                  File file ) throws Exception {
-        Logger.trace(JsonRestClient.class,
-                     null,
-                     "createFileNode: workspace=" + workspace.getName() + ", path=" + path + ", file=" + file.getAbsolutePath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        this.logger.trace("createFileNode: workspace={0}, path={1}, file={2}", workspace.getName(), path, file.getAbsolutePath()); //$NON-NLS-1$
         FileNode fileNode = new FileNode(workspace, path, file);
         HttpURLConnection connection = openConnection(workspace.getServer(), fileNode.getUrl(), RequestMethod.POST);
 
         try {
-            Logger.trace(JsonRestClient.class, null, "createFileNode: create node=" + fileNode); //$NON-NLS-1$
+            this.logger.trace("createFileNode: create node={0}", fileNode); //$NON-NLS-1$
             connection.getOutputStream().write(fileNode.getContent());
 
             // make sure node was created
             if (connection.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
-                // log
-                Status status = new Status(Severity.ERROR, Utils.getMessage(ConnectionErrorMsg,
-                                                                            connection.getResponseCode(),
-                                                                            "createFileNode"), null); //$NON-NLS-1$
-                Logger.log(JsonRestClient.class, status);
-
-                // throw exception
-                String msg = Utils.getMessage(CreateFileFailedMsg,
-                                              file.getName(),
-                                              path,
-                                              workspace.getName(),
-                                              connection.getResponseCode());
+                // node was not created
+                this.logger.error(RestClientI18n.connectionErrorMsg, connection.getResponseCode(), "createFileNode"); //$NON-NLS-1$
+                String msg = RestClientI18n.createFileFailedMsg.text(file.getName(),
+                                                                     path,
+                                                                     workspace.getName(),
+                                                                     connection.getResponseCode());
                 throw new RuntimeException(msg);
             }
         } finally {
             if (connection != null) {
-                Logger.trace(JsonRestClient.class, null, "createFileNode: leaving"); //$NON-NLS-1$
+                this.logger.trace("createFileNode: leaving"); //$NON-NLS-1$
                 connection.disconnect();
             }
         }
@@ -116,29 +111,24 @@
      */
     private void createFolderNode( Workspace workspace,
                                    String path ) throws Exception {
-        Logger.trace(JsonRestClient.class, null, "createFolderNode: workspace=" + workspace.getName() + ", path=" + path); //$NON-NLS-1$//$NON-NLS-2$
+        this.logger.trace("createFolderNode: workspace={0}, path={1}", workspace.getName(), path); //$NON-NLS-1$
         FolderNode folderNode = new FolderNode(workspace, path);
         HttpURLConnection connection = openConnection(workspace.getServer(), folderNode.getUrl(), RequestMethod.POST);
 
         try {
-            Logger.trace(JsonRestClient.class, null, "createFolderNode: create node=" + folderNode); //$NON-NLS-1$
+            this.logger.trace("createFolderNode: create node={0}", folderNode); //$NON-NLS-1$
             connection.getOutputStream().write(folderNode.getContent());
 
             // make sure node was created
             if (connection.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
-                // log
-                Status status = new Status(Severity.ERROR, Utils.getMessage(ConnectionErrorMsg,
-                                                                            connection.getResponseCode(),
-                                                                            "createFolderNode"), null); //$NON-NLS-1$
-                Logger.log(JsonRestClient.class, status);
-
-                // throw exception
-                String msg = Utils.getMessage(CreateFolderFailedMsg, path, workspace.getName(), connection.getResponseCode());
+                // node was not created
+                this.logger.error(RestClientI18n.connectionErrorMsg, connection.getResponseCode(), "createFolderNode"); //$NON-NLS-1$
+                String msg = RestClientI18n.createFolderFailedMsg.text(path, workspace.getName(), connection.getResponseCode());
                 throw new RuntimeException(msg);
             }
         } finally {
             if (connection != null) {
-                Logger.trace(JsonRestClient.class, null, "createFolderNode: leaving"); //$NON-NLS-1$
+                this.logger.trace("createFolderNode: leaving"); //$NON-NLS-1$
                 connection.disconnect();
             }
         }
@@ -154,7 +144,7 @@
      */
     private void ensureFolderExists( Workspace workspace,
                                      String folderPath ) throws Exception {
-        Logger.trace(JsonRestClient.class, null, "ensureFolderExists: workspace=" + workspace.getName() + ", path=" + folderPath); //$NON-NLS-1$//$NON-NLS-2$
+        this.logger.trace("ensureFolderExists: workspace={0}, path={1}", workspace.getName(), folderPath); //$NON-NLS-1$
         FolderNode folderNode = new FolderNode(workspace, folderPath);
 
         if (!pathExists(workspace.getServer(), folderNode.getUrl())) {
@@ -193,8 +183,8 @@
      * @since 0.6
      */
     public Collection<Repository> getRepositories( Server server ) throws Exception {
-        Utils.nullArgumentCheck("server", server); //$NON-NLS-1$
-        Logger.trace(JsonRestClient.class, null, "getRepositories: server=" + server); //$NON-NLS-1$
+        CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
+        this.logger.trace("getRepositories: server={0}", server); //$NON-NLS-1$
 
         ServerNode serverNode = new ServerNode(server);
         HttpURLConnection connection = openConnection(server, serverNode.getFindRepositoriesUrl(), RequestMethod.GET);
@@ -204,18 +194,13 @@
                 return serverNode.getRepositories(JsonUtils.readInputStream(connection));
             }
 
-            // log
-            Status status = new Status(Severity.ERROR, Utils.getMessage(ConnectionErrorMsg,
-                                                                        connection.getResponseCode(),
-                                                                        "getRepositories"), null); //$NON-NLS-1$
-            Logger.log(JsonRestClient.class, status);
-
             // not a good response code
-            String msg = Utils.getMessage(GetRepositoriesFailedMsg, server.getName(), connection.getResponseCode());
+            this.logger.error(RestClientI18n.connectionErrorMsg, connection.getResponseCode(), "getRepositories"); //$NON-NLS-1$
+            String msg = RestClientI18n.getRepositoriesFailedMsg.text(server.getName(), connection.getResponseCode());
             throw new RuntimeException(msg);
         } finally {
             if (connection != null) {
-                Logger.trace(JsonRestClient.class, null, "getRepositories: leaving"); //$NON-NLS-1$
+                this.logger.trace("getRepositories: leaving"); //$NON-NLS-1$
                 connection.disconnect();
             }
         }
@@ -228,8 +213,8 @@
      * @since 0.6
      */
     public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
-        Utils.nullArgumentCheck("repository", repository); //$NON-NLS-1$
-        Logger.trace(JsonRestClient.class, null, "getWorkspaces: repository=" + repository); //$NON-NLS-1$
+        CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
+        this.logger.trace("getWorkspaces: repository={0}", repository); //$NON-NLS-1$
 
         RepositoryNode repositoryNode = new RepositoryNode(repository);
         HttpURLConnection connection = openConnection(repository.getServer(), repositoryNode.getUrl(), RequestMethod.GET);
@@ -239,21 +224,15 @@
                 return repositoryNode.getWorkspaces(JsonUtils.readInputStream(connection));
             }
 
-            // log
-            Status status = new Status(Severity.ERROR, Utils.getMessage(ConnectionErrorMsg,
-                                                                        connection.getResponseCode(),
-                                                                        "getWorkspaces"), null); //$NON-NLS-1$
-            Logger.log(JsonRestClient.class, status);
-
             // not a good response code
-            String msg = Utils.getMessage(GetWorkspacesFailedMsg,
-                                          repository.getName(),
-                                          repository.getServer().getName(),
-                                          connection.getResponseCode());
+            this.logger.error(RestClientI18n.connectionErrorMsg, connection.getResponseCode(), "getWorkspaces"); //$NON-NLS-1$
+            String msg = RestClientI18n.getWorkspacesFailedMsg.text(repository.getName(),
+                                                                    repository.getServer().getName(),
+                                                                    connection.getResponseCode());
             throw new RuntimeException(msg);
         } finally {
             if (connection != null) {
-                Logger.trace(JsonRestClient.class, null, "getWorkspaces: leaving"); //$NON-NLS-1$
+                this.logger.trace("getWorkspaces: leaving"); //$NON-NLS-1$
                 connection.disconnect();
             }
         }
@@ -270,12 +249,14 @@
     private HttpURLConnection openConnection( Server server,
                                               URL url,
                                               RequestMethod method ) throws Exception {
-        Logger.trace(JsonRestClient.class, null, "openConnection: url=" + url + ", method=" + method); //$NON-NLS-1$ //$NON-NLS-2$
-        setAuthentication(server.getUser(), server.getPassword());
+        this.logger.trace("openConnection: url={0}, method={1}", url, method); //$NON-NLS-1$
         HttpURLConnection connection = (HttpURLConnection)url.openConnection();
         connection.setDoOutput(true);
+        String encoding = Base64.encodeBytes((server.getUser() + ':' + server.getPassword()).getBytes());
+        connection.setRequestProperty("Authorization", "Basic " + encoding); //$NON-NLS-1$ //$NON-NLS-2$
         connection.setRequestMethod(method.toString());
         connection.setRequestProperty("Content-Type", MediaType.APPLICATION_JSON); //$NON-NLS-1$
+        connection.setUseCaches(false);
         return connection;
     }
 
@@ -288,14 +269,14 @@
      */
     protected boolean pathExists( Server server,
                                   URL url ) throws Exception {
-        Logger.trace(JsonRestClient.class, null, "pathExists: url=" + url); //$NON-NLS-1$
+        this.logger.trace("pathExists: url={0}", url); //$NON-NLS-1$
         HttpURLConnection connection = openConnection(server, url, RequestMethod.GET);
 
         try {
             return (connection.getResponseCode() == HttpURLConnection.HTTP_OK);
         } finally {
             if (connection != null) {
-                Logger.trace(JsonRestClient.class, null, "pathExists: leaving"); //$NON-NLS-1$
+                this.logger.trace("pathExists: leaving"); //$NON-NLS-1$
                 connection.disconnect();
             }
         }
@@ -309,10 +290,11 @@
      * @throws Exception if there is a problem checking the existence of the file
      * @since 0.6
      */
-    protected boolean pathExists( Workspace workspace,
-                                  String path,
-                                  File file ) throws Exception {
+    public boolean pathExists( Workspace workspace,
+                               String path,
+                               File file ) throws Exception {
         FileNode fileNode = new FileNode(workspace, path, file);
+        this.logger.trace("pathExists: url={0}", fileNode.getUrl()); //$NON-NLS-1$
         return pathExists(workspace.getServer(), fileNode.getUrl());
     }
 
@@ -326,12 +308,10 @@
     public Status publish( Workspace workspace,
                            String path,
                            File file ) {
-        Utils.nullArgumentCheck("workspace", workspace); //$NON-NLS-1$
-        Utils.nullArgumentCheck("path", path); //$NON-NLS-1$
-        Utils.nullArgumentCheck("file", file); //$NON-NLS-1$
-        Logger.trace(JsonRestClient.class,
-                     null,
-                     "publish: workspace=" + workspace.getName() + ", path=" + path + ", file=" + file.getAbsolutePath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+        CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+        this.logger.trace("publish: workspace={0}, path={1}, file={2}", workspace.getName(), path, file.getAbsolutePath()); //$NON-NLS-1$
 
         try {
             // first delete if file exists at that path
@@ -345,28 +325,13 @@
             // publish file
             createFileNode(workspace, path, file);
         } catch (Exception e) {
-            return new Status(Severity.ERROR, Utils.getMessage(PublishFailedMsg,
-                                                               file.getAbsolutePath(),
-                                                               path,
-                                                               workspace.getName()), e);
+            String msg = RestClientI18n.publishFailedMsg.text(file.getAbsolutePath(), path, workspace.getName());
+            return new Status(Severity.ERROR, msg, e);
         }
 
         return Status.OK_STATUS;
     }
 
-    private void setAuthentication( final String user,
-                                    final String password ) {
-        final String pswd = ((password == null) ? "" : password); //$NON-NLS-1$
-
-        // TODO setAuthentication() make authenticator work with multi-threads
-        Authenticator.setDefault(new Authenticator() {
-            @Override
-            protected PasswordAuthentication getPasswordAuthentication() {
-                return new PasswordAuthentication(user, pswd.toCharArray());
-            }
-        });
-    }
-
     /**
      * {@inheritDoc}
      * 
@@ -377,12 +342,10 @@
     public Status unpublish( Workspace workspace,
                              String path,
                              File file ) {
-        Utils.nullArgumentCheck("workspace", workspace); //$NON-NLS-1$
-        Utils.nullArgumentCheck("path", path); //$NON-NLS-1$
-        Utils.nullArgumentCheck("file", file); //$NON-NLS-1$
-        Logger.trace(JsonRestClient.class,
-                     null,
-                     "unpublish: workspace=" + workspace.getName() + ", path=" + path + ", file=" + file.getAbsolutePath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+        CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+        this.logger.trace("unpublish: workspace={0}, path={1}, file={2}", workspace.getName(), path, file.getAbsolutePath()); //$NON-NLS-1$
 
         HttpURLConnection connection = null;
 
@@ -394,30 +357,23 @@
             if (responseCode != HttpURLConnection.HTTP_NO_CONTENT) {
                 // check to see if the file was never published
                 if (!pathExists(workspace.getServer(), fileNode.getUrl())) {
-                    return new Status(Severity.INFO, Utils.getMessage(UnpublishNeverPublishedMsg,
-                                                                      file.getAbsolutePath(),
-                                                                      workspace.getName(),
-                                                                      path), null);
+                    String msg = RestClientI18n.unpublishNeverPublishedMsg.text(file.getAbsolutePath(), workspace.getName(), path);
+                    return new Status(Severity.INFO, msg, null);
                 }
 
                 // unexpected result
-                Status status = new Status(Severity.ERROR, Utils.getMessage(ConnectionErrorMsg, responseCode, "unpublish"), null); //$NON-NLS-1$
-                Logger.log(JsonRestClient.class, status);
-
-                // throw exception
-                String msg = Utils.getMessage(UnpublishFailedMsg, file.getName(), workspace.getName(), path, responseCode);
+                this.logger.error(RestClientI18n.connectionErrorMsg, responseCode, "unpublish"); //$NON-NLS-1$
+                String msg = RestClientI18n.unpublishFailedMsg.text(file.getName(), workspace.getName(), path, responseCode);
                 throw new RuntimeException(msg);
             }
 
             return Status.OK_STATUS;
         } catch (Exception e) {
-            return new Status(Severity.ERROR, Utils.getMessage(PublishFailedMsg,
-                                                               workspace.getName(),
-                                                               path,
-                                                               file.getAbsolutePath()), e);
+            String msg = RestClientI18n.publishFailedMsg.text(workspace.getName(), path, file.getAbsolutePath());
+            return new Status(Severity.ERROR, msg, e);
         } finally {
             if (connection != null) {
-                Logger.trace(JsonRestClient.class, null, "unpublish: leaving"); //$NON-NLS-1$
+                this.logger.trace("unpublish: leaving"); //$NON-NLS-1$
                 connection.disconnect();
             }
         }

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonUtils.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -29,7 +29,7 @@
 import java.net.HttpURLConnection;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
-import org.jboss.dna.web.jcr.rest.client.Utils;
+import org.jboss.dna.common.util.CheckArg;
 
 /**
  * The <code>JsonUtils</code> class provides utilities needed to work with the DNA REST server JSON API.
@@ -54,25 +54,35 @@
     // ===========================================================================================================================
 
     /**
-     * @param text the text whose escape sequences will be replaced with the actual characters (never <code>null</code>)
+     * @param text the text being URL decoded (never <code>null</code>)
      * @return the decoded text
-     * @throws UnsupportedEncodingException
+     * @throws UnsupportedEncodingException if the charset is not supported
      * @since 0.6
      */
-    public static String decodeEscaping( String text ) throws UnsupportedEncodingException {
-        Utils.nullArgumentCheck("text", text); //$NON-NLS-1$
+    public static String decode( String text ) throws UnsupportedEncodingException {
+        CheckArg.isNotNull(text, "text"); //$NON-NLS-1$
         return URLDecoder.decode(text, DEFAULT_CHARSET);
     }
 
     /**
-     * @param text the text whose escape sequences will be replaced with the actual characters (never <code>null</code>)
+     * Forward slashes ('/') are not encoded.
+     * 
+     * @param text the text being URL encoded (never <code>null</code>)
      * @return the decoded text
-     * @throws UnsupportedEncodingException
+     * @throws UnsupportedEncodingException if the charset is not supported
      * @since 0.6
      */
-    public static String encodeEscaping( String text ) throws UnsupportedEncodingException {
-        Utils.nullArgumentCheck("text", text); //$NON-NLS-1$
-        return URLEncoder.encode(text, DEFAULT_CHARSET);
+    public static String encode( String text ) throws UnsupportedEncodingException {
+        CheckArg.isNotNull(text, "text"); //$NON-NLS-1$
+
+        // don't encode '/' as it needs to stay that way in the URL
+        StringBuilder encoded = new StringBuilder();
+
+        for (char c : text.toCharArray()) {
+            encoded.append((c == '/') ? c : URLEncoder.encode(Character.toString(c), DEFAULT_CHARSET));
+        }
+
+        return encoded.toString();
     }
 
     /**
@@ -84,7 +94,7 @@
      * @since 0.6
      */
     public static String readInputStream( HttpURLConnection connection ) throws IOException {
-        Utils.nullArgumentCheck("connection", connection); //$NON-NLS-1$
+        CheckArg.isNotNull(connection, "connection"); //$NON-NLS-1$
 
         InputStream stream = connection.getInputStream();
         int bytesRead;

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/RepositoryNode.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -28,7 +28,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 import org.codehaus.jettison.json.JSONObject;
-import org.jboss.dna.web.jcr.rest.client.Utils;
+import org.jboss.dna.common.util.CheckArg;
 import org.jboss.dna.web.jcr.rest.client.domain.Repository;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
@@ -82,7 +82,7 @@
         StringBuilder url = new StringBuilder(serverNode.getUrl().toString());
 
         // add repository path
-        url.append('/').append(JsonUtils.encodeEscaping(repository.getName()));
+        url.append('/').append(JsonUtils.encode(repository.getName()));
         return new URL(url.toString());
     }
 
@@ -94,13 +94,13 @@
      */
     @SuppressWarnings( "unchecked" )
     public Collection<Workspace> getWorkspaces( String jsonResponse ) throws Exception {
-        Utils.nullArgumentCheck("jsonResponse", jsonResponse); //$NON-NLS-1$
+        CheckArg.isNotNull(jsonResponse, "jsonResponse"); //$NON-NLS-1$
         Collection<Workspace> workspaces = new ArrayList<Workspace>();
         JSONObject jsonObj = new JSONObject(jsonResponse);
 
         // keys are the repository names
         for (Iterator<String> itr = jsonObj.keys(); itr.hasNext();) {
-            String name = JsonUtils.decodeEscaping(itr.next());
+            String name = JsonUtils.decode(itr.next());
             Workspace workspace = new Workspace(name, this.repository);
             workspaces.add(workspace);
         }

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/ServerNode.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -28,8 +28,8 @@
 import java.util.Collection;
 import java.util.Iterator;
 import org.codehaus.jettison.json.JSONObject;
-import org.jboss.dna.web.jcr.rest.client.Logger;
-import org.jboss.dna.web.jcr.rest.client.Utils;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
 import org.jboss.dna.web.jcr.rest.client.domain.Repository;
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 
@@ -46,6 +46,13 @@
     // ===========================================================================================================================
 
     /**
+     * The logger.
+     * 
+     * @since 0.6
+     */
+    private final Logger logger = Logger.getLogger(ServerNode.class);
+
+    /**
      * The server containing DNA repositories.
      * 
      * @since 0.6
@@ -110,17 +117,17 @@
      */
     @SuppressWarnings( "unchecked" )
     public Collection<Repository> getRepositories( String jsonResponse ) throws Exception {
-        Utils.nullArgumentCheck("jsonResponse", jsonResponse); //$NON-NLS-1$
+        CheckArg.isNotNull(jsonResponse, "jsonResponse"); //$NON-NLS-1$
         Collection<Repository> repositories = new ArrayList<Repository>();
-        Logger.trace(ServerNode.class, null, "getRepositories:jsonResponse=" + jsonResponse); //$NON-NLS-1$
+        this.logger.trace("getRepositories:jsonResponse={0}", jsonResponse); //$NON-NLS-1$
         JSONObject jsonObj = new JSONObject(jsonResponse);
 
         // keys are the repository names
         for (Iterator<String> itr = jsonObj.keys(); itr.hasNext();) {
-            String name = JsonUtils.decodeEscaping(itr.next());
+            String name = JsonUtils.decode(itr.next());
             Repository repository = new Repository(name, this.server);
             repositories.add(repository);
-            Logger.trace(ServerNode.class, null, "getRepositories: adding repository=" + repository); //$NON-NLS-1$
+            this.logger.trace("getRepositories: adding repository={0}", repository); //$NON-NLS-1$
         }
 
         return repositories;

Modified: branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/WorkspaceNode.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -69,7 +69,7 @@
         StringBuilder url = new StringBuilder(repositoryNode.getUrl().toString());
 
         // add workspace path
-        url.append('/').append(JsonUtils.encodeEscaping(workspace.getName())).append(IJsonConstants.WORKSPACE_CONTEXT);
+        url.append('/').append(JsonUtils.encode(workspace.getName())).append(IJsonConstants.WORKSPACE_CONTEXT);
         return new URL(url.toString());
     }
 

Deleted: branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties	2009-08-14 16:29:03 UTC (rev 1161)
@@ -1,61 +0,0 @@
-#
-# 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.
-#
-ErrorDeletingServerRegistryFile = There was a problem deleting server registry file "{0}"
-ErrorRestoringServerRegistry = Error trying to restore the server registry from file "{0}"
-ErrorSavingServerRegistry = Error trying to save the server registry to "{0}"
-
-NullArgumentMsg = The argument "{0}" may not be null.
-
-RepositoryEmptyNameMsg = A repository name cannot be empty
-RepositoryNullServerMsg = A repository server cannot be null
-RepositoryShortDescription = DNA Repository - Name: {0}, Server: {1}
-
-ServerEmptyUserMsg = The user cannot be empty
-ServerEmptyUrlMsg = A server URL cannot be empty
-ServerExistsMsg = {0} already exists so it cannot be added
-ServerInvalidUrlMsg = The  value "{0}" is not a valid server URL
-ServerShortDescription = DNA Server - URL: {0} User: {1}
-
-ServerManagerRegistryAddUnexpectedError = Unexpected error adding server to registry
-ServerManagerRegistryListenerError = This error was reported by an IServerRegistryListener
-ServerManagerRegistryListenerErrorsOccurred = Errors occurred processing a server registry event. Check error log for more details.
-ServerManagerRegistryRemoveUnexpectedError = {0} cannot be removed as it has not been registered
-ServerManagerRegistryUpdateAddError = There was an unexpected error updating the server in the registry. The old version of the server was successfully removed. However, the new version was not updated. Detail: {0}
-ServerManagerRegistryUpdateRemoveError = There was an unexpected error updating the server in the registry. The server has not been updated in the server registry. Detail: {0}
-ServerManagerUnregisteredServer = Server "{0}" is not registered so it's repositories and workspaces cannot be obtained.
-
-WorkspaceEmptyNameMsg = A workspace name cannot be empty
-WorkspaceNullRepositoryMsg = A workspace repository cannot be null
-WorkspaceShortDescription = DNA Workspace - Name: {0}, Repository: {1}
-
-# JsonRestClient messages
-
-ConnectionErrorMsg = response code={0}: {1}
-CreateFileFailedMsg = Creating the "{0}" file node in folder "{1}" in workspace "{2}" failed with HTTP response code of "{3}"
-CreateFolderFailedMsg = Creating the "{0}" folder node in workspace "{1}" failed with HTTP response code of "{2}"
-GetRepositoriesFailedMsg = Obtaining the repositories from server "{0}" failed with HTTP response code of "{1}"
-GetWorkspacesFailedMsg = Obtaining the workspaces from repository "{0}" at server "{1}" failed with HTTP response code of "{2}"
-PublishFailedMsg = Publishing file "{0}" to path "{1}" in workspace "{2}" failed.
-UnpublishFailedMsg = The file "{0}" could not be unpublished in workspace "{1}" at path "{2}". The HTTP response code was "{3}".
-UnpublishNeverPublishedMsg = The file "{0}" could not be unpublished in workspace "{1}" at path "{2}" because it could not be found.

Copied: branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/RestClientI18n.properties (from rev 1148, branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties)
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/RestClientI18n.properties	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/RestClientI18n.properties	2009-08-14 16:29:03 UTC (rev 1161)
@@ -0,0 +1,63 @@
+#
+# 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.
+#
+errorDeletingServerRegistryFile = There was a problem deleting server registry file "{0}"
+errorRestoringServerRegistry = Error trying to restore the server registry from file "{0}"
+errorSavingServerRegistry = Error trying to save the server registry to "{0}"
+
+nullArgumentMsg = The argument "{0}" may not be null.
+
+repositoryEmptyNameMsg = A repository name cannot be empty
+repositoryNullServerMsg = A repository server cannot be null
+repositoryShortDescription = DNA Repository - Name: {0}, Server: {1}
+
+serverEmptyUserMsg = The user cannot be empty
+serverEmptyUrlMsg = A server URL cannot be empty
+serverExistsMsg = {0} already exists so it cannot be added
+serverInvalidUrlMsg = The  value "{0}" is not a valid server URL
+serverShortDescription = DNA Server - URL: {0} User: {1}
+
+serverManagerConnectionEstablishedMsg = Connection established.
+serverManagerConnectionFailedMsg = Connection failed.
+serverManagerRegistryAddUnexpectedError = Unexpected error adding server to registry
+serverManagerRegistryListenerError = This error was reported by an IServerRegistryListener
+serverManagerRegistryListenerErrorsOccurred = Errors occurred processing a server registry event. Check error log for more details.
+serverManagerRegistryRemoveUnexpectedError = {0} cannot be removed as it has not been registered
+serverManagerRegistryUpdateAddError = There was an unexpected error updating the server in the registry. The old version of the server was successfully removed. However, the new version was not updated. Detail: {0}
+serverManagerRegistryUpdateRemoveError = There was an unexpected error updating the server in the registry. The server has not been updated in the server registry. Detail: {0}
+serverManagerUnregisteredServer = Server "{0}" is not registered so it's repositories and workspaces cannot be obtained and it cannot be involved in a publishing operation.
+
+workspaceEmptyNameMsg = A workspace name cannot be empty
+workspaceNullRepositoryMsg = A workspace repository cannot be null
+workspaceShortDescription = DNA Workspace - Name: {0}, Repository: {1}
+
+# JsonRestClient messages
+
+connectionErrorMsg = response code={0}: {1}
+createFileFailedMsg = Creating the "{0}" file node in folder "{1}" in workspace "{2}" failed with HTTP response code of "{3}"
+createFolderFailedMsg = Creating the "{0}" folder node in workspace "{1}" failed with HTTP response code of "{2}"
+getRepositoriesFailedMsg = Obtaining the repositories from server "{0}" failed with HTTP response code of "{1}"
+getWorkspacesFailedMsg = Obtaining the workspaces from repository "{0}" at server "{1}" failed with HTTP response code of "{2}"
+publishFailedMsg = Publishing file "{0}" to path "{1}" in workspace "{2}" failed.
+unpublishFailedMsg = The file "{0}" could not be unpublished in workspace "{1}" at path "{2}". The HTTP response code was "{3}".
+unpublishNeverPublishedMsg = The file "{0}" could not be unpublished in workspace "{1}" at path "{2}" because it could not be found.


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/RestClientI18n.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/mime.types
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/mime.types	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/mime.types	2009-08-14 16:29:03 UTC (rev 1161)
@@ -0,0 +1,9 @@
+# This file defines the Internet media types and extensions.
+# For more information about Internet media types,
+# please read RFC 2045, 2046, 2047, 2048, and 2077.  The Internet media type
+# registry is at <http://www.iana.org/assignments/media-types/>.
+
+# MIME type                 Extensions
+
+text/plain                  classpath debug epf ini lock mappings mf prefs properties readme svn-base
+application/xml             launch project template xsd

Copied: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestClient.java (from rev 1159, branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java)
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestClient.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestClient.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -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.web.jcr.rest.client;
+
+import java.io.File;
+import java.util.Collection;
+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>MockRestExecutor</code> class is a test <code>IRestClient</code> implementation that does nothing.
+ * 
+ * @since 0.6
+ */
+public final class MockRestClient implements IRestClient {
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#getRepositories(org.jboss.dna.web.jcr.rest.client.domain.Server)
+     * @since 0.6
+     */
+    public Collection<Repository> getRepositories( Server server ) throws Exception {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#getWorkspaces(org.jboss.dna.web.jcr.rest.client.domain.Repository)
+     * @since 0.6
+     */
+    public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#publish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
+     *      java.lang.String, java.io.File)
+     * @since 0.6
+     */
+    public Status publish( Workspace workspace,
+                           String path,
+                           File file ) {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#unpublish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
+     *      java.lang.String, java.io.File)
+     * @since 0.6
+     */
+    public Status unpublish( Workspace workspace,
+                             String path,
+                             File file ) {
+        return null;
+    }
+
+}


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestClient.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/MockRestExecutor.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -1,89 +0,0 @@
-/*
- * 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.web.jcr.rest.client;
-
-import java.io.File;
-import java.util.Collection;
-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>MockRestExecutor</code> class is a test <code>IRestClient</code> implementation that does nothing.
- * 
- * @since 0.6
- */
-public final class MockRestExecutor implements IRestClient {
-
-    // ===========================================================================================================================
-    // Methods
-    // ===========================================================================================================================
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#getRepositories(org.jboss.dna.web.jcr.rest.client.domain.Server)
-     * @since 0.6
-     */
-    public Collection<Repository> getRepositories( Server server ) throws Exception {
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#getWorkspaces(org.jboss.dna.web.jcr.rest.client.domain.Repository)
-     * @since 0.6
-     */
-    public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#publish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
-     *      java.lang.String, java.io.File)
-     * @since 0.6
-     */
-    public Status publish( Workspace workspace,
-                           String path,
-                           File file ) {
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.web.jcr.rest.client.IRestClient#unpublish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
-     *      java.lang.String, java.io.File)
-     * @since 0.6
-     */
-    public Status unpublish( Workspace workspace,
-                             String path,
-                             File file ) {
-        return null;
-    }
-
-}

Added: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestClientI18nTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestClientI18nTest.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestClientI18nTest.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -0,0 +1,37 @@
+/*
+ * 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.web.jcr.rest.client;
+
+import org.jboss.dna.common.AbstractI18nTest;
+
+/**
+ * @since 0.6
+ */
+public final class RestClientI18nTest extends AbstractI18nTest {
+    
+    public RestClientI18nTest() {
+        super(RestClientI18n.class);
+    }
+
+}


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestClientI18nTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestIntegrationTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestIntegrationTest.java	                        (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestIntegrationTest.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -0,0 +1,114 @@
+/*
+ * 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.web.jcr.rest.client;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import java.io.File;
+import java.net.URL;
+import java.util.Collection;
+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.jboss.dna.web.jcr.rest.client.json.JsonRestClient;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ */
+public final class RestIntegrationTest {
+
+    // ===========================================================================================================================
+    // Constants
+    // ===========================================================================================================================
+
+    // user and password configured in pom
+    private static final String PSWD = "password"; //$NON-NLS-1$
+    private static final String USER = "dnauser"; //$NON-NLS-1$
+
+    private static final Server SERVER = new Server("http://localhost:8080", USER, PSWD, false); //$NON-NLS-1$
+    private static final String REPOSITORY_NAME = "dna:repository"; //$NON-NLS-1$
+    private static final Repository REPOSITORY = new Repository(REPOSITORY_NAME, SERVER);
+    private static final String WORKSPACE_NAME = "default"; //$NON-NLS-1$
+    private static final Workspace WORKSPACE = new Workspace(WORKSPACE_NAME, REPOSITORY);
+
+    private static final String WORKSPACE_PATH = "/myproject/myfolder/"; //$NON-NLS-1$
+    private static final String FILE_PATH = WORKSPACE_PATH + "document.txt"; //$NON-NLS-1$
+
+    // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    private JsonRestClient restClient;
+
+    private ServerManager serverManager;
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    @Before
+    public void beforeEach() {
+        this.restClient = new JsonRestClient();
+        this.serverManager = new ServerManager(null, this.restClient);
+        this.serverManager.addServer(SERVER);
+    }
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    @Test
+    public void shouldGetRepositories() throws Exception {
+        Collection<Repository> repositories = this.serverManager.getRepositories(SERVER);
+        assertThat(repositories.size(), is(1));
+    }
+
+    @Test
+    public void shouldGetWorkspaces() throws Exception {
+        Collection<Workspace> workspaces = this.serverManager.getWorkspaces(REPOSITORY);
+        assertThat(workspaces.size(), is(1));
+    }
+
+    @Test
+    public void shouldPublish() throws Exception {
+        URL textFile = getClass().getResource(FILE_PATH);
+        assertThat(textFile, is(notNullValue()));
+
+        // publish
+        File file = new File(textFile.toURI());
+        assertThat(this.serverManager.publish(WORKSPACE, WORKSPACE_PATH, file).isOk(), is(true));
+
+        // confirm it exists in repository
+        assertThat((this.restClient).pathExists(WORKSPACE, WORKSPACE_PATH, file), is(true));
+    }
+
+    @Test
+    public void shouldUnpublish() {
+        // TODO implement shouldUnpublish()
+    }
+
+}


Property changes on: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/RestIntegrationTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/ServerManagerTest.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -67,7 +67,7 @@
 
     @Before
     public void beforeEach() {
-        this.serverManager = new ServerManager(null, new MockRestExecutor());
+        this.serverManager = new ServerManager(null, new MockRestClient());
     }
 
     // ===========================================================================================================================

Modified: branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java	2009-08-10 21:31:32 UTC (rev 1160)
+++ branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestClientTest.java	2009-08-14 16:29:03 UTC (rev 1161)
@@ -33,6 +33,7 @@
 import java.net.URL;
 import java.util.Collection;
 import org.jboss.dna.web.jcr.rest.client.IRestClient;
+import org.jboss.dna.web.jcr.rest.client.Status;
 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;
@@ -124,6 +125,11 @@
 
         // TODO: get jcr:data and compare
     }
+    
+    @Test
+    public void shouldPublishFilesHavingNonLettersNonNumbersInName() {
+        // TODO implement shouldPublishFilesHavingNonLettersNonNumbersInName test
+    }
 
     @Test
     public void shouldPublishTextResource() throws Exception {
@@ -132,11 +138,17 @@
 
         // publish
         File file = new File(textFile.toURI());
-        assertThat(this.restClient.publish(WORKSPACE1, WORKSPACE_PATH, file).isOk(), is(true));
+        Status status = this.restClient.publish(WORKSPACE1, WORKSPACE_PATH, file);
+        assertThat(status.getMessage(), status.isOk(), is(true));
 
         // confirm it exists in repository
         assertThat(((JsonRestClient)this.restClient).pathExists(WORKSPACE1, WORKSPACE_PATH, file), is(true));
     }
+    
+    @Test
+    public void shouldPublishToDirectoriesHavingNonLettersNonNumbersInName() {
+        // TODO implement shouldPublishToDirectoriesHavingNonLettersNonNumbersInName test
+    }
 
     @Test
     public void shouldUnpublish() throws Exception {


From dna-commits at lists.jboss.org  Fri Aug 14 15:19:07 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 14 Aug 2009 15:19:07 -0400
Subject: [dna-commits] DNA SVN: r1162 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt:
	src/org/jboss/dna/web/jcr/rest/client/swt and 3 other directories.
Message-ID: <200908141919.n7EJJ7wQ002174@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-14 15:19:06 -0400 (Fri, 14 Aug 2009)
New Revision: 1162

Added:
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
Removed:
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java
Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
   branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java
Log:
Now using the Eclipse Job API for publishing and unpublishing. Deleted PublishingResultsDialog since writing to Eclipse Console View seems to be enough. Added a test connection button on the ServerPage.

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -54,22 +54,28 @@
 
     public static I18n newServerActionText;
     public static I18n newServerActionToolTip;
+    
+    public static I18n publishJobPublishCanceledMsg;
+    public static I18n publishJobConsoleName;
+    public static I18n publishJobPublish;
+    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 publishingResultsPublishNotAttemptedMsg;
-    public static I18n publishingResultsTooManyResultsMsg;
-    public static I18n publishingResultsUnknownSeverityMsg;
-    public static I18n publishingResultsUnpublishNotAttemptedMsg;
-
-    public static I18n publishOperationConsoleName;
-    public static I18n publishOperationPublish;
-    public static I18n publishOperationPublishFile;
-    public static I18n publishOperationPublishFileFailed;
-    public static I18n publishOperationPublishTaskName;
-    public static I18n publishOperationUnpublish;
-    public static I18n publishOperationUnpublishFile;
-    public static I18n publishOperationUnpublishFileFailed;
-    public static I18n publishOperationUnpublishTaskName;
-
     public static I18n publishPagePublishTitle;
     public static I18n publishPageLocationGroupTitle;
     public static I18n publishPageMissingRepositoryStatusMsg;
@@ -97,19 +103,6 @@
     public static I18n publishPageWorkspacePublishToolTip;
     public static I18n publishPageWorkspaceUnpublishToolTip;
 
-    public static I18n publishResultsDialogErrorIncompletePublishingMsg;
-    public static I18n publishResultsDialogErrorIncompleteUnpublishingMsg;
-    public static I18n publishResultsDialogErrorPublishingMsg;
-    public static I18n publishResultsDialogErrorUnpublishingMsg;
-    public static I18n publishResultsDialogFileHeader;
-    public static I18n publishResultsDialogIncompletePublishMsg;
-    public static I18n publishResultsDialogIncompleteUnpublishMsg;
-    public static I18n publishResultsDialogMessageHeader;
-    public static I18n publishResultsDialogPublishMsg;
-    public static I18n publishResultsDialogStatisticsMsg;
-    public static I18n publishResultsDialogTitle;
-    public static I18n publishResultsDialogUnpublishMsg;
-
     public static I18n publishWizardPublishErrorMsg;
     public static I18n publishWizardPublishTitle;
     public static I18n publishWizardUnpublishTitle;
@@ -128,6 +121,12 @@
     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;
@@ -141,6 +140,9 @@
     public static I18n serverWizardNewServerErrorMsg;
     public static I18n serverWizardNewServerTitle;
 
+    public static I18n testServerActionText;
+    public static I18n testServerActionToolTip;
+
     static {
         try {
             I18n.initialize(RestClientI18n.class);

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-14 19:19:06 UTC (rev 1162)
@@ -31,7 +31,7 @@
 
 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 "{0}" server?
+deleteServerDialogOneServerMsg = Are you sure you want to delete the server with URL of "{0}" and user "{1}?"
 deleteServerDialogTitle = Confirm Delete Server
 
 editServerActionText = Server Properties
@@ -44,21 +44,27 @@
 newServerActionText = New Server
 newServerActionToolTip = Create a new server
 
-publishingResultsPublishNotAttemptedMsg = Publishing not attempted
-publishingResultsTooManyResultsMsg = Adding a status to the results failed since there is not enough files involved in the publishing operation.
-publishingResultsUnknownSeverityMsg = "{0}" is an unknown status severity
-publishingResultsUnpublishNotAttemptedMsg = Unpublishing not attempted
+publishJobConsoleName = DNA
+publishJobPublish = Publishing {3} file(s) to server "{0}" (repository "{1}", workspace "{2}") ...
+publishJobPublishCanceledMsg = i  Publishing to server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.
+publishJobPublishFile = \t+  Published file "{0}" to location "{1}"
+publishJobPublishFileFailed = \t*  ERROR publishing file "{0}" to location "{1}"
+publishJobPublishFileInfo = \ti  {0}
+publishJobPublishFileWarning = \tw  {0}
+publishJobPublishFinishedMsg = Done publishing ({3} milliseconds) to server "{0}" (repository "{1}", workspace "{2}").
+publishJobPublishName = DNA Publish
+publishJobPublishTaskName = Publishing resources
+publishJobUnexpectedErrorMsg = Unexpected error occurred. See log for more details.
+publishJobUnpublish = Unpublishing {3} file(s) from server "{0}" (repository "{1}", workspace "{2}") ...
+publishJobUnpublishCanceledMsg = *  Unpublishing from server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.
+publishJobUnpublishFile = \t-  Unpublished file "{0}" from location "{1}"
+publishJobUnpublishFileFailed = \t*  ERROR unpublished file "{0}" from location "{1}"
+publishJobUnpublishFileInfo = \ti  {0}
+publishJobUnpublishFileWarning = \tw  {0}
+publishJobUnpublishFinishedMsg = Done unpublishing ({3} milliseconds) from server "{0}" (repository "{1}", workspace "{2}").
+publishJobUnpublishName = DNA Unpublish
+publishJobUnpublishTaskName = Unpublishing resources
 
-publishOperationConsoleName = DNA
-publishOperationPublish = DNA publish to server "{0}", repository "{1}", workspace "{2}"
-publishOperationPublishFile = \t+ Published file "{0}" to location "{1}"
-publishOperationPublishFileFailed = \t* ERROR publishing file "{0}" to location "{1}"
-publishOperationPublishTaskName = Publishing resources
-publishOperationUnpublish = DNA unpublish from server "{0}", repository "{1}", workspace "{2}"
-publishOperationUnpublishFile = \t- Unpublished file "{0}" from location "{1}"
-publishOperationUnpublishFileFailed = \t* ERROR unpublished file "{0}" from location "{1}"
-publishOperationUnpublishTaskName = Unpublishing resources
-
 publishPagePublishTitle = Publish the selected resources
 publishPageLocationGroupTitle = Location
 publishPageMissingRepositoryStatusMsg = A repository must be selected
@@ -70,7 +76,7 @@
 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 selected resources will be published. Then click "Finish" to execute the publish operation.
+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
@@ -79,26 +85,13 @@
 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 selected resources will be unpublished. Then click "Finish" to execute the unpublish operation.
+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
 
-publishResultsDialogErrorIncompletePublishingMsg = There was a problem publishing some or all of the files. The publishing operation did not complete. See results below and the log for more details. Error message: "{0}."
-publishResultsDialogErrorIncompleteUnpublishingMsg = There was a problem publishing some or all of the files. The unpublishing operation did not complete. See results below and the log for more details. Error message: "{0}."
-publishResultsDialogErrorPublishingMsg = There was a problem publishing some or all of the files. See results below and the log for more details. Error message: "{0}."
-publishResultsDialogErrorUnpublishingMsg = There was a problem publishing some or all of the files. See results below and the log for more details. Error message: "{0}."
-publishResultsDialogFileHeader = File
-publishResultsDialogIncompletePublishMsg = {0} file(s) were successfully published (uploaded) to the DNA repository workspace but the publishing operation did not complete.
-publishResultsDialogIncompleteUnpublishMsg = {0} file(s) were successfully unpublished (removed) from the DNA repository workspace but the unpublishing operation did not complete.
-publishResultsDialogMessageHeader = Message
-publishResultsDialogPublishMsg = {0} file(s) were successfully published (uploaded) to the DNA repository workspace.
-publishResultsDialogStatisticsMsg = There were {1} error(s), {2} info(s), and {3} warning(s).
-publishResultsDialogTitle = Results
-publishResultsDialogUnpublishMsg = {0} file(s) were successfully unpublished (removed) from the DNA repository workspace.
-
 publishWizardPublishErrorMsg = Error Publishing
 publishWizardPublishTitle = Publish
 publishWizardUnpublishErrorMsg = Error Unpublishing
@@ -117,6 +110,12 @@
 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
@@ -129,3 +128,6 @@
 serverWizardEditServerTitle = Edit Server
 serverWizardNewServerErrorMsg = There were errors creating a new server. See log for more details.
 serverWizardNewServerTitle = New Server
+
+testServerActionText = Connect
+testServerActionToolTip = Connect to the server identified by the abover URL, user, and password

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -44,14 +44,14 @@
     /**
      * 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 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)
      * @since 0.6
      */
-    public static void sizeShellRelativeToDisplayAndCentery( Shell shell,
-                                                             int widthPercentage,
-                                                             int heightPercentage ) {
+    public static void centerAndSizeShellRelativeToDisplay( Shell shell,
+                                                            int widthPercentage,
+                                                            int heightPercentage ) {
         if ((widthPercentage < 1) || (widthPercentage > 100)) {
             widthPercentage = 50;
         }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/BasePublishingAction.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -40,8 +40,9 @@
 import org.jboss.dna.web.jcr.rest.client.Status.Severity;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.Utils;
 import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishWizard;
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
+import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishJob.Type;
 
 /**
  * @since 0.6
@@ -114,9 +115,10 @@
             WizardDialog dialog = new WizardDialog(shell, new PublishWizard(this.type, resources,
                                                                             Activator.getDefault().getServerManager())) {
                 @Override
-                protected void configureShell( Shell newShell ) {
-                    super.configureShell(newShell);
-                    newShell.setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
+                protected void initializeBounds() {
+                    super.initializeBounds();
+                    getShell().setImage(Activator.getDefault().getImage(DNA_IMAGE_16x));
+                    Utils.centerAndSizeShellRelativeToDisplay(getShell(), 75, 75);
                 }
             };
 

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/PublishAction.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
+import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishJob.Type;
 
 /**
  * The <code>PublishAction</code> controls the publishing of one or more {@link org.eclipse.core.resources.IResource}s to a DNA

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/UnpublishAction.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
+import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishJob.Type;
 
 /**
  * The <code>UnpublishAction</code> controls the unpublishing of one or more {@link org.eclipse.core.resources.IResource}s from a

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -94,8 +94,8 @@
         String msg;
 
         if (this.serversBeingDeleted.size() == 1) {
-            IDnaObject server = this.serversBeingDeleted.iterator().next();
-            msg = RestClientI18n.deleteServerDialogOneServerMsg.text(server.getName());
+            Server server = this.serversBeingDeleted.iterator().next();
+            msg = RestClientI18n.deleteServerDialogOneServerMsg.text(server.getName(), server.getUser());
         } else {
             msg = RestClientI18n.deleteServerDialogMultipleServersMsg.text(this.serversBeingDeleted.size());
         }

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishingResultsDialog.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -1,365 +0,0 @@
-/*
- * 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.web.jcr.rest.client.swt.dialogs;
-
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.CHECKMARK_IMAGE_PATH;
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-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.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.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
-import org.jboss.dna.web.jcr.rest.client.swt.Utils;
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation;
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishingResults;
-
-/**
- * The <code>PublishingResultsDialog</code> displays the results of a publishing operation.
- * 
- * @since 0.6
- */
-public final class PublishingResultsDialog extends MessageDialog {
-
-    // ===========================================================================================================================
-    // Constants
-    // ===========================================================================================================================
-
-    /**
-     * The table column index of the column where the file name is displayed.
-     * 
-     * @since 0.6
-     */
-    private static final int FILE_COL = 0;
-
-    /**
-     * The table column index of the column where the status severity is displayed.
-     * 
-     * @since 0.6
-     */
-    private static final int SEVERITY_COL = 1;
-
-    /**
-     * The table column index of the column where the error message is displayed.
-     * 
-     * @since 0.6
-     */
-    private static final int MESSAGE_COL = 2;
-
-    // ===========================================================================================================================
-    // Fields
-    // ===========================================================================================================================
-
-    /**
-     * An error caught during the publish operation (may be <code>null</code>).
-     * 
-     * @since 0.6
-     */
-    private Throwable error;
-
-    /**
-     * The results of the publishing operation.
-     * 
-     * @since 0.6
-     */
-    private final PublishingResults results;
-
-    // ===========================================================================================================================
-    // Constructors
-    // ===========================================================================================================================
-
-    /**
-     * @param parentShell the dialog parent
-     * @param results the results being displayed (never <code>null</code>)
-     * @since 0.6
-     */
-    public PublishingResultsDialog( Shell parentShell,
-                                    PublishingResults results ) {
-        super(parentShell, RestClientI18n.publishResultsDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x), null,
-              MessageDialog.INFORMATION, new String[] {IDialogConstants.OK_LABEL}, 0);
-        this.results = results;
-
-        // make sure dialog is resizable
-        setShellStyle(getShellStyle() | SWT.RESIZE);
-    }
-
-    /**
-     * @param parentShell the dialog parent
-     * @param results the results being displayed (never <code>null</code>)
-     * @param error an unexpected error caught during the publish operation
-     * @since 0.6
-     */
-    public PublishingResultsDialog( Shell parentShell,
-                                    PublishingResults results,
-                                    Throwable error ) {
-        super(parentShell, RestClientI18n.publishResultsDialogTitle.text(), Activator.getDefault().getImage(DNA_IMAGE_16x), null,
-              MessageDialog.ERROR, new String[] {IDialogConstants.OK_LABEL}, 0);
-        this.results = results;
-        this.error = error;
-
-        // make sure dialog is resizable
-        setShellStyle(getShellStyle() | SWT.RESIZE);
-    }
-
-    // ===========================================================================================================================
-    // Methods
-    // ===========================================================================================================================
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.dialogs.MessageDialog#configureShell(org.eclipse.swt.widgets.Shell)
-     * @since 0.6
-     */
-    @Override
-    protected void configureShell( Shell shell ) {
-        super.configureShell(shell);
-
-        // now set message
-        int successCount = this.results.getFiles().size() - this.results.getErrorCount();
-        boolean completed = this.results.isComplete();
-
-        if (this.results.getType() == PublishOperation.Type.PUBLISH) {
-            if (completed) {
-                if ((this.error == null)) {
-                    this.message = RestClientI18n.publishResultsDialogPublishMsg.text(successCount);
-                } else {
-                    this.message = RestClientI18n.publishResultsDialogErrorPublishingMsg.text(this.error.getLocalizedMessage());
-                }
-            } else {
-                if ((this.error == null)) {
-                    this.message = RestClientI18n.publishResultsDialogIncompletePublishMsg.text(successCount);
-                } else {
-                    this.message = RestClientI18n.publishResultsDialogErrorIncompletePublishingMsg.text(this.error.getLocalizedMessage());
-                }
-            }
-        } else {
-            if (completed) {
-                if ((this.error == null)) {
-                    this.message = RestClientI18n.publishResultsDialogUnpublishMsg.text(successCount);
-                } else {
-                    this.message = RestClientI18n.publishResultsDialogErrorUnpublishingMsg.text(this.error.getLocalizedMessage());
-                }
-            } else {
-                if ((this.error == null)) {
-                    this.message = RestClientI18n.publishResultsDialogIncompleteUnpublishMsg.text(successCount);
-                } else {
-                    this.message = RestClientI18n.publishResultsDialogErrorIncompleteUnpublishingMsg.text(this.error.getLocalizedMessage());
-                }
-            }
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.window.Window#constrainShellSize()
-     * @since 0.6
-     */
-    @Override
-    protected void constrainShellSize() {
-        super.constrainShellSize();
-        Utils.sizeShellRelativeToDisplayAndCentery(getShell(), 50, 50);
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
-     * @since 0.6
-     */
-    @Override
-    protected Control createCustomArea( Composite parent ) {
-        Composite pnl = new Composite(parent, SWT.NONE);
-        pnl.setLayout(new GridLayout());
-        GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-        pnl.setLayoutData(gd);
-
-        TableViewer viewer = new TableViewer(pnl, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
-        ResultsProvider provider = new ResultsProvider();
-        viewer.setContentProvider(provider);
-        viewer.setLabelProvider(provider);
-
-        Table table = viewer.getTable();
-        table.setLayout(new GridLayout());
-        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-        table.setHeaderVisible(true);
-        table.setLinesVisible(true);
-
-        TableColumn col = new TableColumn(table, SWT.LEFT);
-        col.setText(RestClientI18n.publishResultsDialogFileHeader.text());
-
-        col = new TableColumn(table, SWT.CENTER);
-        col.setResizable(false);
-
-        col = new TableColumn(table, SWT.LEFT);
-        col.setText(RestClientI18n.publishResultsDialogMessageHeader.text());
-
-        // populate the table
-        viewer.setInput(this);
-
-        // size columns
-        for (TableColumn column : table.getColumns()) {
-            column.pack();
-            column.setWidth(column.getWidth() + 2);
-        }
-
-        // add statistics label
-        StyledText st = new StyledText(parent, SWT.READ_ONLY | SWT.MULTI | SWT.NO_FOCUS | SWT.WRAP);
-        st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
-        st.setCaret(null);
-        gd = new GridData(GridData.FILL_BOTH);
-        gd.grabExcessVerticalSpace = false;
-        gd.horizontalIndent = ((GridLayout)pnl.getLayout()).horizontalSpacing * 5;
-        st.setLayoutData(gd);
-
-        // set message
-        Object[] counts = new Object[] {this.results.getOksCount(), this.results.getErrorCount(), this.results.getInfoCount(),
-            this.results.getWarningsCount()};
-        String msg = RestClientI18n.publishResultsDialogStatisticsMsg.text(counts);
-        st.setText(msg);
-
-        return pnl;
-    }
-
-    /**
-     * @return the files that were involved in the publishing operation
-     * @since 0.6
-     */
-    List<IFile> getFiles() {
-        return this.results.getFiles();
-    }
-
-    /**
-     * @param file the file whose status is being requested
-     * @return the status or <code>null</code> if not found
-     * @since 0.6
-     */
-    Status getStatus( IFile file ) {
-        return this.results.getStatus(file);
-    }
-
-    // ===========================================================================================================================
-    // Inner Class
-    // ===========================================================================================================================
-
-    /**
-     * The <code>ResultsProvider</code> class is the label provider and content provider for the table that is shown in the
-     * dialog.
-     * 
-     * @since 0.6
-     */
-    class ResultsProvider extends LabelProvider implements IStructuredContentProvider, ITableLabelProvider {
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
-         * @since 0.6
-         */
-        @Override
-        public Image getColumnImage( Object element,
-                                     int columnIndex ) {
-            if (columnIndex == SEVERITY_COL) {
-                Status status = getStatus((IFile)element);
-
-                if (status.isOk()) {
-                    return Activator.getDefault().getImage(CHECKMARK_IMAGE_PATH);
-                }
-
-                return Utils.getImage(status);
-            }
-
-            return null;
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
-         * @since 0.6
-         */
-        @Override
-        public String getColumnText( Object element,
-                                     int columnIndex ) {
-            if (columnIndex == FILE_COL) {
-                return ((IFile)element).getFullPath().toString();
-            }
-
-            if (columnIndex == MESSAGE_COL) {
-                Status status = getStatus((IFile)element);
-
-                if (!status.isOk()) {
-                    return status.getMessage();
-                }
-            }
-
-            return null;
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-         * @since 0.6
-         */
-        @Override
-        public Object[] getElements( Object inputElement ) {
-            return getFiles().toArray();
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object,
-         *      java.lang.Object)
-         * @since 0.6
-         */
-        @Override
-        public void inputChanged( Viewer viewer,
-                                  Object oldInput,
-                                  Object newInput ) {
-            // nothing to do
-        }
-
-    }
-
-}

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -0,0 +1,342 @@
+/*
+ * 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.web.jcr.rest.client.swt.wizards;
+
+import java.io.File;
+import java.util.List;
+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.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.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.IUiConstants;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+
+/**
+ * The <code>PublishJob</code> publishes or unpublishes one or more files using the {@link ServerManager}.
+ * 
+ * @since 0.6
+ */
+public final class PublishJob extends Job {
+
+    // ===========================================================================================================================
+    // Constants
+    // ===========================================================================================================================
+
+    /**
+     * The job type.
+     * 
+     * @since 0.6
+     */
+    public enum Type {
+        /**
+         * Indicates a publish job.
+         * 
+         * @since 0.6
+         */
+        PUBLISH,
+
+        /**
+         * Indicates an unpublish job.
+         * 
+         * @since 0.6
+         */
+        UNPUBLISH
+    }
+
+    /**
+     * The name of the message console that is written to.
+     * 
+     * @since 0.6
+     */
+    private static final String CONSOLE_NAME = RestClientI18n.publishJobConsoleName.text();
+
+    // ===========================================================================================================================
+    // Class Methods
+    // ===========================================================================================================================
+
+    /**
+     * @param type the job type (never <code>null</code>)
+     * @return the job name
+     * @since 0.6
+     */
+    private static String getJobName( Type type ) {
+        CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
+
+        if (Type.PUBLISH == type) {
+            return RestClientI18n.publishJobPublishName.text();
+        }
+
+        // unpublish
+        return RestClientI18n.publishJobUnpublishName.text();
+    }
+
+    // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    /**
+     * The files being published or unpublished.
+     * 
+     * @since 0.6
+     */
+    private final List<IFile> files;
+
+    /**
+     * The job type.
+     * 
+     * @since 0.6
+     */
+    private final Type type;
+
+    /**
+     * The workspace to use when publishing or unpublishing.
+     * 
+     * @since 0.6
+     */
+    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>)
+     * @since 0.6
+     */
+    public PublishJob( Type type,
+                       List<IFile> files,
+                       Workspace workspace ) {
+        super(getJobName(type));
+
+        CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
+
+        this.type = type;
+        this.files = files;
+        this.workspace = workspace;
+
+        setUser(true); // allow user to run in background
+    }
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * @return <code>true</code> if a publishing job
+     * @since 0.6
+     */
+    private boolean isPublishing() {
+        return (this.type == Type.PUBLISH);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+     * @since 0.6
+     */
+    @Override
+    protected IStatus run( IProgressMonitor monitor ) {
+        assert (this.workspace != null);
+        long startTime = System.currentTimeMillis();
+
+        try {
+            String name = (isPublishing() ? RestClientI18n.publishJobPublishTaskName.text() : RestClientI18n.publishJobUnpublishTaskName.text());
+            monitor.beginTask(name, this.files.size());
+            monitor.setTaskName(name);
+
+            // write initial message to console
+            if (isPublishing()) {
+                writeToConsole(RestClientI18n.publishJobPublish.text(this.workspace.getServer().getUrl(),
+                                                                     this.workspace.getRepository().getName(),
+                                                                     this.workspace.getName(),
+                                                                     this.files.size()));
+            } else {
+                writeToConsole(RestClientI18n.publishJobUnpublish.text(this.workspace.getServer().getUrl(),
+                                                                       this.workspace.getRepository().getName(),
+                                                                       this.workspace.getName(),
+                                                                       this.files.size()));
+            }
+
+            // process the files
+            int numProcessed = 0;
+
+            for (IFile eclipseFile : this.files) {
+                if (monitor.isCanceled()) {
+                    String msg = null;
+
+                    if (isPublishing()) {
+                        msg = RestClientI18n.publishJobPublishCanceledMsg.text(this.workspace.getServer().getUrl(),
+                                                                               this.workspace.getRepository().getName(),
+                                                                               this.workspace.getName(),
+                                                                               numProcessed,
+                                                                               this.files.size());
+                    } else {
+                        msg = RestClientI18n.publishJobUnpublishCanceledMsg.text(this.workspace.getServer().getUrl(),
+                                                                                 this.workspace.getRepository().getName(),
+                                                                                 this.workspace.getName(),
+                                                                                 numProcessed,
+                                                                                 this.files.size());
+                    }
+
+                    writeToConsole(msg); // write cancel msg to console
+                    throw new InterruptedException(msg);
+                }
+
+                File file = eclipseFile.getLocation().toFile();
+                Status status = null;
+
+                if (isPublishing()) {
+                    status = Activator.getDefault().getServerManager().publish(this.workspace,
+                                                                               eclipseFile.getFullPath().toString(),
+                                                                               file);
+                } else {
+                    status = Activator.getDefault().getServerManager().unpublish(this.workspace,
+                                                                                 eclipseFile.getFullPath().toString(),
+                                                                                 file);
+                }
+
+                ++numProcessed;
+                monitor.worked(1);
+
+                // write success msg to console
+                writeToConsole(file, eclipseFile.getParent().getFullPath().toString(), 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.ERROR, IUiConstants.PLUGIN_ID, msg, e);
+        } finally {
+            monitor.done();
+            // add done msg
+            // TODO need to format this duration better
+            long duration = System.currentTimeMillis() - startTime;
+
+            if (isPublishing()) {
+                writeToConsole(RestClientI18n.publishJobPublishFinishedMsg.text(this.workspace.getServer().getUrl(),
+                                                                                this.workspace.getRepository().getName(),
+                                                                                this.workspace.getName(),
+                                                                                duration));
+            } else {
+                writeToConsole(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.workspace.getServer().getUrl(),
+                                                                                  this.workspace.getRepository().getName(),
+                                                                                  this.workspace.getName(),
+                                                                                  duration));
+            }
+        }
+    }
+
+    /**
+     * @param file the file involved in the publishing operation
+     * @param workspacePath the path in the workspace where the file is located
+     * @param status the status of the publishing operation
+     * @since 0.6
+     */
+    private void writeToConsole( File file,
+                                 String workspacePath,
+                                 Status status ) {
+        String msg = null;
+
+        if (status.isOk()) {
+            if (isPublishing()) {
+                msg = RestClientI18n.publishJobPublishFile.text(file.getAbsolutePath(), workspacePath);
+            } else {
+                msg = RestClientI18n.publishJobUnpublishFile.text(file.getAbsolutePath(), workspacePath);
+            }
+        } else if (status.isError()) {
+            if (isPublishing()) {
+                msg = RestClientI18n.publishJobPublishFileFailed.text(file.getAbsolutePath(), workspacePath);
+            } else {
+                msg = RestClientI18n.publishJobUnpublishFileFailed.text(file.getAbsolutePath(), workspacePath);
+            }
+        } else if (status.isWarning()) {
+            if (isPublishing()) {
+                msg = RestClientI18n.publishJobPublishFileWarning.text(status.getMessage());
+            } else {
+                msg = RestClientI18n.publishJobUnpublishFileWarning.text(status.getMessage());
+            }
+        } else if (status.isInfo()) {
+            if (isPublishing()) {
+                msg = RestClientI18n.publishJobPublishFileInfo.text(status.getMessage());
+            } else {
+                msg = RestClientI18n.publishJobUnpublishFileInfo.text(status.getMessage());
+            }
+        }
+
+        // TODO create hyperlink in console for the file
+        writeToConsole(msg);
+    }
+
+    /**
+     * @param message the message being written to the DNA console
+     * @since 0.6
+     */
+    private void writeToConsole( String message ) {
+        MessageConsole console = null;
+        IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
+        IConsole[] consoles = consoleMgr.getConsoles();
+
+        // see if DNA console already exists
+        for (int i = 0; i < consoles.length; ++i) {
+            if (CONSOLE_NAME.equals(consoles[i].getName())) {
+                console = (MessageConsole)consoles[i];
+                break;
+            }
+        }
+
+        // create DNA console if necessary
+        if (console == null) {
+            console = new MessageConsole(CONSOLE_NAME, null);
+            consoleMgr.addConsoles(new IConsole[] {console});
+        }
+
+        // show and focus console view
+        console.activate();
+
+        // write message
+        MessageConsoleStream out = console.newMessageStream();
+        out.println(message);
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishOperation.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -1,282 +0,0 @@
-/*
- * 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.web.jcr.rest.client.swt.wizards;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.web.jcr.rest.client.ServerManager;
-import org.jboss.dna.web.jcr.rest.client.Status;
-import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
-import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
-
-/**
- * The <code>PublishOperation</code> publishes or unpublishes one or more files using the {@link ServerManager}.
- * 
- * @since 0.6
- */
-public final class PublishOperation {
-
-    // ===========================================================================================================================
-    // Constants
-    // ===========================================================================================================================
-
-    /**
-     * The operation type.
-     * 
-     * @since 0.6
-     */
-    public enum Type {
-        /**
-         * Indicates a publish operation.
-         * 
-         * @since 0.6
-         */
-        PUBLISH,
-
-        /**
-         * Indicates an unpublish operation.
-         * 
-         * @since 0.6
-         */
-        UNPUBLISH
-    }
-
-    /**
-     * The name of the message console that is written to.
-     * 
-     * @since 0.6
-     */
-    private static final String CONSOLE_NAME = RestClientI18n.publishOperationConsoleName.text();
-
-    // ===========================================================================================================================
-    // Fields
-    // ===========================================================================================================================
-
-    /**
-     * The files being published or unpublished.
-     * 
-     * @since 0.6
-     */
-    private final List<IFile> files;
-
-    /**
-     * The operation type.
-     * 
-     * @since 0.6
-     */
-    private final Type type;
-
-    /**
-     * The results of the publishing operation.
-     * 
-     * @since 0.6
-     */
-    private PublishingResults results;
-
-    /**
-     * The workspace to use when publishing or unpublishing.
-     * 
-     * @since 0.6
-     */
-    private final Workspace workspace;
-
-    // ===========================================================================================================================
-    // Constructors
-    // ===========================================================================================================================
-
-    /**
-     * @param type the operation 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>)
-     * @since 0.6
-     */
-    public PublishOperation( Type type,
-                             List<IFile> files,
-                             Workspace workspace ) {
-        CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
-        CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
-        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
-
-        this.type = type;
-        this.files = files;
-        this.workspace = workspace;
-    }
-
-    // ===========================================================================================================================
-    // Methods
-    // ===========================================================================================================================
-
-    /**
-     * @return the results of the publishing operation or <code>null</code> if operation has not been executed
-     * @since 0.6
-     */
-    public PublishingResults getResults() {
-        return this.results;
-    }
-
-    /**
-     * @return <code>true</code> if a publishing operation
-     * @since 0.6
-     */
-    public boolean isPublishing() {
-        return (this.type == Type.PUBLISH);
-    }
-
-    /**
-     * @return <code>true</code> if an unpublishing operation
-     * @since 0.6
-     */
-    public boolean isUnpublishing() {
-        return this.type == Type.UNPUBLISH;
-    }
-
-    /**
-     * @param monitor the progress monitor
-     * @throws InvocationTargetException if an unexpected error occurs
-     * @throws InterruptedException if the user cancels the monitor
-     * @since 0.6
-     */
-    public void execute( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
-        assert (this.workspace != null);
-
-        this.results = new PublishingResults(this.type, this.files);
-
-        try {
-            String name = (isPublishing() ? RestClientI18n.publishOperationPublishTaskName.text() : RestClientI18n.publishOperationUnpublishTaskName.text());
-            monitor.beginTask(name, this.files.size());
-            monitor.setTaskName(name);
-
-            // write initial message to console
-            if (isPublishing()) {
-                writeToConsole(RestClientI18n.publishOperationPublish.text(this.workspace.getServer().getUrl(),
-                                                                           this.workspace.getRepository().getName(),
-                                                                           this.workspace.getName()));
-            } else {
-                writeToConsole(RestClientI18n.publishOperationUnpublish.text(this.workspace.getServer().getUrl(),
-                                                                             this.workspace.getRepository().getName(),
-                                                                             this.workspace.getName()));
-            }
-
-            for (IFile eclipseFile : this.files) {
-                if (monitor.isCanceled()) {
-                    throw new InterruptedException();
-                }
-
-                File file = eclipseFile.getLocation().toFile();
-                Status status = null;
-
-                if (isPublishing()) {
-                    status = Activator.getDefault().getServerManager().publish(this.workspace,
-                                                                               eclipseFile.getFullPath().toString(),
-                                                                               file);
-                } else {
-                    status = Activator.getDefault().getServerManager().unpublish(this.workspace,
-                                                                                 eclipseFile.getFullPath().toString(),
-                                                                                 file);
-                }
-
-                monitor.worked(1);
-                this.results.addStatus(status);
-
-                // write to console
-                writeToConsole(file, eclipseFile.getParent().getFullPath().toString(), status);
-            }
-
-            // add a gap before next console message
-            writeToConsole("\n"); //$NON-NLS-1$
-        } catch (InterruptedException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new InvocationTargetException(e);
-        } finally {
-            results.closeOut();
-            monitor.done();
-        }
-    }
-
-    /**
-     * @param file the file involved in the publishing operation
-     * @param workspacePath the path in the workspace where the file is located
-     * @param status the status of the publishing operation
-     * @since 0.6
-     */
-    private void writeToConsole( File file,
-                                 String workspacePath,
-                                 Status status ) {
-        String msg = null;
-
-        if (status.isError()) {
-            msg = (isPublishing() ? RestClientI18n.publishOperationPublishFileFailed.text(file.getAbsolutePath(), workspacePath) 
-                                  : RestClientI18n.publishOperationUnpublishFileFailed.text(file.getAbsolutePath(), workspacePath));
-        } else {
-            msg = (isPublishing() ? RestClientI18n.publishOperationPublishFile.text(file.getAbsolutePath(), workspacePath) 
-                                  : RestClientI18n.publishOperationUnpublishFile.text(file.getAbsolutePath(), workspacePath));
-        }
-
-        // TODO create hyperlink in console for the file
-        writeToConsole(msg);
-    }
-
-    /**
-     * @param message the message being written to the DNA console
-     * @since 0.6
-     */
-    private void writeToConsole( String message ) {
-        MessageConsole console = null;
-        IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
-        IConsole[] consoles = consoleMgr.getConsoles();
-
-        // see if DNA console already exists
-        for (int i = 0; i < consoles.length; ++i) {
-            if (CONSOLE_NAME.equals(consoles[i].getName())) {
-                console = (MessageConsole)consoles[i];
-                break;
-            }
-        }
-
-        // create DNA console if necessary
-        if (console == null) {
-            console = new MessageConsole(CONSOLE_NAME, null);
-            consoleMgr.addConsoles(new IConsole[] {console});
-        }
-
-        // show and focus console view
-        console.activate();
-
-        // write message
-        MessageConsoleStream out = console.newMessageStream();
-        out.println(message);
-    }
-
-}

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -63,7 +63,7 @@
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.NewServerAction;
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
+import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishJob.Type;
 
 /**
  * The <code>PublishPage</code> is a UI for publishing or unpublishing one or more files to a DNA repository.
@@ -280,13 +280,6 @@
     private List<IFile> files;
 
     /**
-     * The method in control of registering/unregistering combobox listners or <code>null</code>.
-     * 
-     * @since 0.6
-     */
-    private String listenerControlLock = null;
-
-    /**
      * The control containing all the files being published or unpublished.
      * 
      * @since 0.6
@@ -376,8 +369,7 @@
     public PublishPage( Type type,
                         List<IResource> resources ) throws CoreException {
         super(PublishPage.class.getSimpleName());
-        setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text() 
-                                        : RestClientI18n.publishPageUnpublishTitle.text());
+        setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text() : RestClientI18n.publishPageUnpublishTitle.text());
         setPageComplete(false);
 
         this.type = type;
@@ -530,7 +522,6 @@
                     chkRecurse.removeSelectionListener(this);
                 }
             });
-
         }
     }
 
@@ -548,6 +539,12 @@
         constructResourcesPanel(pnlMain);
         setControl(pnlMain);
 
+        // add combobox listeners
+        this.cbxRepository.addModifyListener(this);
+        this.cbxServer.addModifyListener(this);
+        this.cbxWorkspace.addModifyListener(this);
+        
+        // load the UI with data
         refreshServers();
     }
 
@@ -577,8 +574,7 @@
      * @since 0.6
      */
     void updateInitialMessage() {
-        String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() 
-                                                  : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+        String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
 
         if (msg.equals(getMessage())) {
             updateState();
@@ -633,8 +629,12 @@
      */
     void handleRepositoryModified() {
         int index = this.cbxRepository.getSelectionIndex();
-        this.repository = this.repositories.get(index);
 
+        // make sure there is a selection
+        if (index != -1) {
+            this.repository = this.repositories.get(index);
+        }
+
         // clear loaded workspaces
         refreshWorkspaces();
 
@@ -663,23 +663,14 @@
      * @since 0.6
      */
     void handleWorkspaceModified() {
-        this.workspace = this.workspaces.get(this.cbxWorkspace.getSelectionIndex());
-        updateState();
-    }
+        int index = this.cbxWorkspace.getSelectionIndex();
 
-    /**
-     * Installs the combobox listeners.
-     * 
-     * @param listenerControlLock the method in control of registering/unregistering combobox listeners
-     * @since 0.6
-     */
-    private void installLocationListeners( String listenerControlLock ) {
-        if ((this.listenerControlLock == null) || this.listenerControlLock.equals(listenerControlLock)) {
-            this.cbxRepository.addModifyListener(this);
-            this.cbxServer.addModifyListener(this);
-            this.cbxWorkspace.addModifyListener(this);
-            this.listenerControlLock = null;
+        // make sure there is a selection
+        if (index != -1) {
+            this.workspace = this.workspaces.get(index);
         }
+
+        updateState();
     }
 
     /**
@@ -740,7 +731,6 @@
      * @since 0.6
      */
     private void refreshRepositories() {
-        final String LOCK_ID = "refreshRepositories"; //$NON-NLS-1$
         this.repository = null;
 
         if (this.server == null) {
@@ -759,9 +749,6 @@
             }
         }
 
-        // uninstall listeners to prevent handling events
-        uninstallLocationListeners(LOCK_ID);
-
         // clear items
         this.cbxRepository.removeAll();
 
@@ -794,9 +781,6 @@
 
         // must reload workspaces
         refreshWorkspaces();
-
-        // reinstall listening
-        installLocationListeners(LOCK_ID);
     }
 
     /**
@@ -806,13 +790,9 @@
      * @since 0.6
      */
     void refreshServers() {
-        final String LOCK_ID = "refreshServers"; //$NON-NLS-1$
         this.server = null;
         this.servers = new ArrayList<Server>(getServerManager().getServers());
 
-        // uninstall listeners to prevent handling events
-        uninstallLocationListeners(LOCK_ID);
-
         if (this.servers.size() == 0) {
             // disable control if necessary
             if (this.cbxServer.getEnabled()) {
@@ -841,9 +821,6 @@
 
         // must reload repositories
         refreshRepositories();
-
-        // reinstall listening
-        installLocationListeners(LOCK_ID);
     }
 
     /**
@@ -852,7 +829,6 @@
      * @since 0.6
      */
     private void refreshWorkspaces() {
-        final String LOCK_ID = "refreshWorkspaces"; //$NON-NLS-1$
         this.workspace = null;
 
         if (this.repository == null) {
@@ -871,9 +847,6 @@
             }
         }
 
-        // uninstall listeners to prevent handling events
-        uninstallLocationListeners(LOCK_ID);
-
         // clear items
         this.cbxWorkspace.removeAll();
 
@@ -903,9 +876,6 @@
                 this.cbxWorkspace.setEnabled(true);
             }
         }
-
-        // reinstall listening
-        installLocationListeners(LOCK_ID);
     }
 
     /**
@@ -953,11 +923,10 @@
 
             // set initial message
             if (this.status.isOk()) {
-                String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() 
-                                                          : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
-                setMessage(msg);
+                String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+                setMessage(msg, IMessageProvider.NONE);
             } else {
-                setErrorMessage(this.status.getMessage());
+                setMessage(this.status.getMessage(), IMessageProvider.ERROR);
             }
         }
     }
@@ -983,22 +952,6 @@
     }
 
     /**
-     * Uninstalls the combobox listeners.
-     * 
-     * @param listenerControlLock the method in control of registering/unregistering combobox listeners
-     * @since 0.6
-     */
-    private void uninstallLocationListeners( String listenerControlLock ) {
-        if (this.listenerControlLock == null) {
-            this.listenerControlLock = listenerControlLock;
-            this.cbxRepository.removeModifyListener(this);
-            this.cbxServer.removeModifyListener(this);
-            this.cbxWorkspace.removeModifyListener(this);
-            this.listenerControlLock = listenerControlLock;
-        }
-    }
-
-    /**
      * Updates message, message icon, and OK button enablement based on validation results
      * 
      * @since 0.6
@@ -1012,14 +965,14 @@
 
         // update page message
         if (this.status.isError()) {
-            setErrorMessage(this.status.getMessage());
+            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());
+                setMessage(this.status.getMessage(), IMessageProvider.NONE);
             }
         }
     }
@@ -1034,24 +987,19 @@
         Severity severity = Severity.ERROR;
 
         if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
-            msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
-                                          : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
+            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());
+            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());
+            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());
+            msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text() : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
         } else {
             severity = Severity.OK;
-            msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() 
-                                          : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+            msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text() : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
         }
 
         this.status = new Status(severity, msg, null);

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -24,25 +24,18 @@
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WIZARD_BANNER_IMAGE_PATH;
-import java.lang.reflect.InvocationTargetException;
 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.core.runtime.IProgressMonitor;
 import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.wizard.Wizard;
 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.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
-import org.jboss.dna.web.jcr.rest.client.swt.dialogs.PublishingResultsDialog;
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
+import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishJob.Type;
 
 /**
  * @since 0.6
@@ -96,8 +89,7 @@
         this.page = new PublishPage(type, resources);
         this.serverManager = serverManager;
 
-        setWindowTitle((type == Type.PUBLISH) ? RestClientI18n.publishWizardPublishTitle.text() 
-                                              : RestClientI18n.publishWizardUnpublishTitle.text());
+        setWindowTitle((type == Type.PUBLISH) ? RestClientI18n.publishWizardPublishTitle.text() : RestClientI18n.publishWizardUnpublishTitle.text());
         setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE_PATH));
     }
 
@@ -156,50 +148,11 @@
      */
     @Override
     public boolean performFinish() {
-        Throwable error = null;
         Workspace workspace = this.page.getWorkspace();
         List<IFile> files = this.page.getFiles();
-        final PublishOperation operation = new PublishOperation(this.type, files, workspace);
+        PublishJob job = new PublishJob(this.type, files, workspace);
+        job.schedule();
 
-        // display progress dialog
-        IRunnableWithProgress op = new IRunnableWithProgress() {
-            @Override
-            public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
-                operation.execute(monitor);
-            }
-        };
-
-        ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
-
-        try {
-            dialog.run(true, true, op);
-        } catch (Throwable e) {
-            if (!(e instanceof InterruptedException)) {
-                error = e;
-
-                if (e instanceof InvocationTargetException) {
-                    error = ((InvocationTargetException)e).getTargetException();
-                }
-
-                String message = (operation.isPublishing() ? RestClientI18n.publishWizardPublishErrorMsg.text() 
-                                                           : RestClientI18n.publishWizardUnpublishErrorMsg.text());
-                Activator.getDefault().log(new Status(Severity.ERROR, message, error));
-            }
-        } finally {
-            dialog.getProgressMonitor().done();
-
-            // show results
-            PublishingResultsDialog resultsDialog = null;
-
-            if (error == null) {
-                resultsDialog = new PublishingResultsDialog(getShell(), operation.getResults());
-            } else {
-                resultsDialog = new PublishingResultsDialog(getShell(), operation.getResults(), error);
-            }
-
-            resultsDialog.open();
-        }
-
         return true;
     }
 

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishingResults.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -1,264 +0,0 @@
-/*
- * 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.web.jcr.rest.client.swt.wizards;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-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;
-import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
-import org.jboss.dna.web.jcr.rest.client.swt.wizards.PublishOperation.Type;
-
-/**
- * @since 0.6
- */
-public final class PublishingResults {
-
-    // ===========================================================================================================================
-    // Constants
-    // ===========================================================================================================================
-
-    /**
-     * Status indicating the file was not attempted to be published.
-     * 
-     * @since 0.6
-     */
-    private static final Status PUBLISH_NOT_ATTEMPTED_STATUS = new Status(Severity.INFO,
-                                                                          RestClientI18n.publishingResultsPublishNotAttemptedMsg.text(),
-                                                                          null);
-
-    /**
-     * Status indicating the file was not attempted to be published.
-     * 
-     * @since 0.6
-     */
-    private static final Status UNPUBLISH_NOT_ATTEMPTED_STATUS = new Status(Severity.INFO,
-                                                                            RestClientI18n.publishingResultsUnpublishNotAttemptedMsg.text(),
-                                                                            null);
-
-    // ===========================================================================================================================
-    // Fields
-    // ===========================================================================================================================
-
-    /**
-     * Indicates if a status for each file has been added.
-     * 
-     * @since 0.6
-     */
-    private boolean complete;
-
-    /**
-     * The files involved in the publishing operation.
-     * 
-     * @since 0.6
-     */
-    private final List<IFile> files;
-
-    /**
-     * The number of {@link Status status} objects that have an {@link Severity#ERROR error} severity.
-     * 
-     * @since 0.6
-     */
-    private int numErrors;
-
-    /**
-     * The number of {@link Status status} objects that have an {@link Severity#INFO info} severity.
-     * 
-     * @since 0.6
-     */
-    private int numInfos;
-
-    /**
-     * The number of {@link Status status} objects that have an {@link Severity#OK OK} severity.
-     * 
-     * @since 0.6
-     */
-    private int numOks;
-
-    /**
-     * The number of {@link Status status} objects that have a {@link Severity#WARNING warning} severity.
-     * 
-     * @since 0.6
-     */
-    private int numWarnings;
-
-    /**
-     * When complete there will be one status for each file.
-     * 
-     * @since 0.6
-     */
-    private final List<Status> statuses;
-
-    /**
-     * The type of publishing operation these results pertain to.
-     * 
-     * @since 0.6
-     */
-    private final Type type;
-
-    // ===========================================================================================================================
-    // Constructors
-    // ===========================================================================================================================
-
-    /**
-     * @param type the type of publishing operation (never <code>null</code>)
-     * @param files the files involved in the publishing operation (never <code>null</code>)
-     * @since 0.6
-     */
-    public PublishingResults( Type type,
-                              List<IFile> files ) {
-        CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
-        CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
-
-        this.type = type;
-        this.files = files;
-        this.statuses = new ArrayList<Status>(this.files.size());
-    }
-
-    // ===========================================================================================================================
-    // Methods
-    // ===========================================================================================================================
-
-    /**
-     * @param status the status being added (never <code>null</code>)
-     * @throws RuntimeException if the number of status objects is greater than the number of files
-     * @since 0.6
-     */
-    public void addStatus( Status status ) {
-        CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
-
-        if (this.files.size() < (this.statuses.size() + 1)) {
-            throw new RuntimeException(RestClientI18n.publishingResultsTooManyResultsMsg.text());
-        }
-
-        this.statuses.add(status);
-
-        if (status.isError()) ++this.numErrors;
-        else if (status.isInfo()) ++this.numInfos;
-        else if (status.isOk()) ++this.numOks;
-        else if (status.isWarning()) ++this.numWarnings;
-        else throw new RuntimeException(RestClientI18n.publishingResultsUnknownSeverityMsg.text(status.getSeverity()));
-
-        this.complete = (this.files.size() == this.statuses.size());
-    }
-
-    /**
-     * Finalizes the results by making sure there is one status object for each file. No need to call if all files have a status.
-     * 
-     * @since 0.6
-     */
-    public void closeOut() {
-        if (this.files.size() != this.statuses.size()) {
-            Status status = ((Type.PUBLISH == this.type) ? PUBLISH_NOT_ATTEMPTED_STATUS : UNPUBLISH_NOT_ATTEMPTED_STATUS);
-
-            for (int count = this.files.size() - this.statuses.size(), i = 0; i < count; ++i) {
-                addStatus(status);
-            }
-        }
-    }
-
-    /**
-     * @return the number of errors in the result
-     * @since 0.6
-     */
-    public int getErrorCount() {
-        return this.numErrors;
-    }
-
-    /**
-     * @return the files involved in the publishing operation (never <code>null</code>)
-     * @since 0.6
-     */
-    public List<IFile> getFiles() {
-        return this.files;
-    }
-
-    /**
-     * @return the number of infos in the result
-     * @since 0.6
-     */
-    public int getInfoCount() {
-        return this.numInfos;
-    }
-
-    /**
-     * @return the number of OKs in the result
-     * @since 0.6
-     */
-    public int getOksCount() {
-        return this.numOks;
-    }
-
-    /**
-     * @param file the file whose status is being requested (never <code>null</code>)
-     * @return the status or <code>null</code> if there is no status for the specified file
-     * @since 0.6
-     */
-    public Status getStatus( IFile file ) {
-        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
-        int index = this.files.indexOf(file);
-
-        if (index == -1) {
-            return null;
-        }
-
-        return this.statuses.get(index);
-    }
-
-    /**
-     * @return the status of each file involved in the publishing operation (never <code>null</code> but can be incomplete)
-     * @see #isComplete()
-     * @since 0.6
-     */
-    public List<Status> getStatuses() {
-        return this.statuses;
-    }
-
-    /**
-     * @return the publishing operation type (never <code>null</code>)
-     * @since 0.6
-     */
-    public Type getType() {
-        return this.type;
-    }
-
-    /**
-     * @return the number of warnings in the result
-     * @since 0.6
-     */
-    public int getWarningsCount() {
-        return this.numWarnings;
-    }
-
-    /**
-     * @return <code>true</code> if there is one status object for each file
-     * @since 0.6
-     */
-    public boolean isComplete() {
-        return this.complete;
-    }
-
-}

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java	2009-08-14 16:29:03 UTC (rev 1161)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java	2009-08-14 19:19:06 UTC (rev 1162)
@@ -23,14 +23,18 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
+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;
@@ -55,11 +59,11 @@
     // ===========================================================================================================================
 
     /**
-     * Indicates if the password should be persisted.
+     * The button used to test the connection to the server. Should only be enabled when server properties are valid.
      * 
      * @since 0.6
      */
-    private boolean savePassword;
+    private Button btnTestConnection;
 
     /**
      * The user password needed to login to the server.
@@ -69,6 +73,13 @@
     private String password;
 
     /**
+     * Indicates if the password should be persisted.
+     * 
+     * @since 0.6
+     */
+    private boolean savePassword;
+
+    /**
      * The server being editor or <code>null</code> if creating a new server.
      * 
      * @since 0.6
@@ -232,6 +243,34 @@
         }
     }
 
+    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() {
+            @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));
@@ -270,6 +309,7 @@
         pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
         constructUrlPanel(pnlMain);
         constructAuthenticationPanel(pnlMain);
+        constructTestConnectionPanel(pnlMain);
         setControl(pnlMain);
     }
 
@@ -292,7 +332,7 @@
      * @return the server manager obtained from the wizard
      * @since 0.6
      */
-    private ServerManager getServerManager() {
+    ServerManager getServerManager() {
         return ((ServerWizard)getWizard()).getServerManager();
     }
 
@@ -316,6 +356,34 @@
     }
 
     /**
+     * Tests the connection of the server specified by the properties entered on this page. Precondition is that server properties
+     * are valid.
+     * 
+     * @since 0.6
+     */
+    void handleTestConnection() {
+        final Server server = getServer();
+        final boolean[] success = new boolean[1];
+
+        BusyIndicator.showWhile(null, new Runnable() {
+            @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
@@ -376,8 +444,9 @@
         // get the current status
         validate();
 
-        // update OK/Finish button enablement
+        // update OK/Finish button and test button enablement
         setPageComplete(!this.status.isError());
+        this.btnTestConnection.setEnabled(isPageComplete());
 
         // update message
         if (this.status.isError()) {


From dna-commits at lists.jboss.org  Fri Aug 14 15:28:38 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 14 Aug 2009 15:28:38 -0400
Subject: [dna-commits] DNA SVN: r1163 - in
	branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite:
	features and 1 other directories.
Message-ID: <200908141928.n7EJScF4004002@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-14 15:28:37 -0400 (Fri, 14 Aug 2009)
New Revision: 1163

Modified:
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/features/org.jboss.dna.web.jcr.rest.client.swt.feature_1.0.0.v20090708.jar
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/plugins/org.jboss.dna.web.jcr.rest.client.swt_1.0.0.jar
Log:


Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml	2009-08-14 19:19:06 UTC (rev 1162)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml	2009-08-14 19:28:37 UTC (rev 1163)
@@ -3,14 +3,14 @@
 <repository name='JBoss DNA REST Eclipse SWT Client' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1.0.0'>
   <properties size='2'>
     <property name='p2.compressed' value='false'/>
-    <property name='p2.timestamp' value='1248905146973'/>
+    <property name='p2.timestamp' value='1250277630246'/>
   </properties>
   <mappings size='3'>
     <rule filter='(&amp; (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
     <rule filter='(&amp; (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
     <rule filter='(&amp; (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
   </mappings>
-  <artifacts size='6'>
+  <artifacts size='7'>
     <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
       <properties size='3'>
         <property name='artifact.size' value='85068'/>
@@ -33,6 +33,13 @@
     </artifact>
     <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
       <properties size='3'>
+        <property name='artifact.size' value='9959017'/>
+        <property name='download.size' value='9959017'/>
+        <property name='download.contentType' value='application/zip'/>
+      </properties>
+    </artifact>
+    <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
+      <properties size='3'>
         <property name='artifact.size' value='10911490'/>
         <property name='download.size' value='10911490'/>
         <property name='download.contentType' value='application/zip'/>

Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml	2009-08-14 19:19:06 UTC (rev 1162)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml	2009-08-14 19:28:37 UTC (rev 1163)
@@ -3,7 +3,7 @@
 <repository name='JBoss DNA REST Eclipse SWT Client' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
   <properties size='2'>
     <property name='p2.compressed' value='false'/>
-    <property name='p2.timestamp' value='1248905147025'/>
+    <property name='p2.timestamp' value='1250277630248'/>
   </properties>
   <units size='8'>
     <unit id='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.jar' version='1.0.0.v20090708'>

Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/features/org.jboss.dna.web.jcr.rest.client.swt.feature_1.0.0.v20090708.jar
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/plugins/org.jboss.dna.web.jcr.rest.client.swt_1.0.0.jar
===================================================================
(Binary files differ)


From dna-commits at lists.jboss.org  Fri Aug 14 15:51:48 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 14 Aug 2009 15:51:48 -0400
Subject: [dna-commits] DNA SVN: r1164 -
	branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt.
Message-ID: <200908141951.n7EJpmU8009358@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-14 15:51:48 -0400 (Fri, 14 Aug 2009)
New Revision: 1164

Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
Log:
Just added some formatting to some messages.

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-14 19:28:37 UTC (rev 1163)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-14 19:51:48 UTC (rev 1164)
@@ -46,22 +46,22 @@
 
 publishJobConsoleName = DNA
 publishJobPublish = Publishing {3} file(s) to server "{0}" (repository "{1}", workspace "{2}") ...
-publishJobPublishCanceledMsg = i  Publishing to server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.
+publishJobPublishCanceledMsg = i  Publishing to server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.\n
 publishJobPublishFile = \t+  Published file "{0}" to location "{1}"
 publishJobPublishFileFailed = \t*  ERROR publishing file "{0}" to location "{1}"
 publishJobPublishFileInfo = \ti  {0}
 publishJobPublishFileWarning = \tw  {0}
-publishJobPublishFinishedMsg = Done publishing ({3} milliseconds) to server "{0}" (repository "{1}", workspace "{2}").
+publishJobPublishFinishedMsg = Done publishing ({3} milliseconds) to server "{0}" (repository "{1}", workspace "{2}").\n
 publishJobPublishName = DNA Publish
 publishJobPublishTaskName = Publishing resources
 publishJobUnexpectedErrorMsg = Unexpected error occurred. See log for more details.
 publishJobUnpublish = Unpublishing {3} file(s) from server "{0}" (repository "{1}", workspace "{2}") ...
-publishJobUnpublishCanceledMsg = *  Unpublishing from server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.
+publishJobUnpublishCanceledMsg = *  Unpublishing from server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.\n
 publishJobUnpublishFile = \t-  Unpublished file "{0}" from location "{1}"
 publishJobUnpublishFileFailed = \t*  ERROR unpublished file "{0}" from location "{1}"
 publishJobUnpublishFileInfo = \ti  {0}
 publishJobUnpublishFileWarning = \tw  {0}
-publishJobUnpublishFinishedMsg = Done unpublishing ({3} milliseconds) from server "{0}" (repository "{1}", workspace "{2}").
+publishJobUnpublishFinishedMsg = Done unpublishing ({3} milliseconds) from server "{0}" (repository "{1}", workspace "{2}").\n
 publishJobUnpublishName = DNA Unpublish
 publishJobUnpublishTaskName = Unpublishing resources
 


From dna-commits at lists.jboss.org  Wed Aug 19 11:49:30 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 19 Aug 2009 11:49:30 -0400
Subject: [dna-commits] DNA SVN: r1165 -
	branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature.
Message-ID: <200908191549.n7JFnUkt007443@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-19 11:49:30 -0400 (Wed, 19 Aug 2009)
New Revision: 1165

Removed:
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/feature.png
Modified:
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/build.properties
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/feature.xml
Log:
Fixed problems with feature and feature image not showing up in About dialog. Tested update site archive in a new eclipse to make sure feature and help documents work.

Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/build.properties
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/build.properties	2009-08-14 19:51:48 UTC (rev 1164)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/build.properties	2009-08-19 15:49:30 UTC (rev 1165)
@@ -1,5 +1,6 @@
 bin.includes = feature.xml,\
                feature.properties,\
                LEGAL.txt,\
-               AUTHORS.txt
+               AUTHORS.txt,\
+               feature.png
 src.includes = LEGAL.txt

Deleted: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/feature.png
===================================================================
(Binary files differ)

Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/feature.xml
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/feature.xml	2009-08-14 19:51:48 UTC (rev 1164)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.feature/feature.xml	2009-08-19 15:49:30 UTC (rev 1165)
@@ -2,9 +2,13 @@
 <feature
       id="org.jboss.dna.web.jcr.rest.client.swt.feature"
       label="%featureName"
-      version="1.0.0.v20090708"
-      provider-name="%featureProvider">
+      version="1.0.0.v20090819"
+      image="feature.png"
+      provider-name="%featureProvider"
+      plugin="org.jboss.dna.web.jcr.rest.client.swt">
 
+<!-- NOTE: above image is found in the branding plugin -->
+
    <description url="http://www.jboss.org/dna/">
       %description
    </description>
@@ -28,6 +32,6 @@
          download-size="0"
          install-size="0"
          version="0.0.0"
-         unpack="false"/>
+         unpack="true"/>
 
 </feature>


From dna-commits at lists.jboss.org  Wed Aug 19 11:49:59 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 19 Aug 2009 11:49:59 -0400
Subject: [dna-commits] DNA SVN: r1166 -
	branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite.
Message-ID: <200908191549.n7JFnxOT007493@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-19 11:49:59 -0400 (Wed, 19 Aug 2009)
New Revision: 1166

Modified:
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/site.xml
Log:
Fixed problems with feature and feature image not showing up in About dialog. Tested update site archive in a new eclipse to make sure feature and help documents work.

Modified: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/site.xml
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/site.xml	2009-08-19 15:49:30 UTC (rev 1165)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/site.xml	2009-08-19 15:49:59 UTC (rev 1166)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <site>
-   <feature url="features/org.jboss.dna.web.jcr.rest.client.swt.feature_1.0.0.v20090708.jar" id="org.jboss.dna.web.jcr.rest.client.swt.feature" version="1.0.0.v20090708"/>
+   <feature url="features/org.jboss.dna.web.jcr.rest.client.swt.feature_1.0.0.v20090819.jar" id="org.jboss.dna.web.jcr.rest.client.swt.feature" version="1.0.0.v20090819"/>
 </site>


From dna-commits at lists.jboss.org  Wed Aug 19 11:55:11 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 19 Aug 2009 11:55:11 -0400
Subject: [dna-commits] DNA SVN: r1167 -
	branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite.
Message-ID: <200908191555.n7JFtBlK008316@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-19 11:55:10 -0400 (Wed, 19 Aug 2009)
New Revision: 1167

Removed:
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/features/
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/plugins/
Log:
Deleting features and plugins directories as these are generated. Also the artifacts.xml and content.xml files have been deleted as these are also generated.

Deleted: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml	2009-08-19 15:49:59 UTC (rev 1166)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/artifacts.xml	2009-08-19 15:55:10 UTC (rev 1167)
@@ -1,62 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<?artifactRepository class='org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository' version='1.0.0'?>
-<repository name='JBoss DNA REST Eclipse SWT Client' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1.0.0'>
-  <properties size='2'>
-    <property name='p2.compressed' value='false'/>
-    <property name='p2.timestamp' value='1250277630246'/>
-  </properties>
-  <mappings size='3'>
-    <rule filter='(&amp; (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
-    <rule filter='(&amp; (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
-    <rule filter='(&amp; (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
-  </mappings>
-  <artifacts size='7'>
-    <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
-      <properties size='3'>
-        <property name='artifact.size' value='85068'/>
-        <property name='download.size' value='85068'/>
-        <property name='download.contentType' value='application/zip'/>
-      </properties>
-    </artifact>
-    <artifact classifier='org.eclipse.update.feature' id='org.jboss.dna.web.jcr.rest.client.swt.feature' version='1.0.0.v20090708'>
-      <properties size='2'>
-        <property name='artifact.size' value='1859'/>
-        <property name='download.size' value='1859'/>
-      </properties>
-    </artifact>
-    <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
-      <properties size='3'>
-        <property name='artifact.size' value='85010'/>
-        <property name='download.size' value='85010'/>
-        <property name='download.contentType' value='application/zip'/>
-      </properties>
-    </artifact>
-    <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
-      <properties size='3'>
-        <property name='artifact.size' value='9959017'/>
-        <property name='download.size' value='9959017'/>
-        <property name='download.contentType' value='application/zip'/>
-      </properties>
-    </artifact>
-    <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
-      <properties size='3'>
-        <property name='artifact.size' value='10911490'/>
-        <property name='download.size' value='10911490'/>
-        <property name='download.contentType' value='application/zip'/>
-      </properties>
-    </artifact>
-    <artifact classifier='org.eclipse.update.feature' id='org.jboss.dna.web.jcr.rest.client.swt.feature' version='1.0.0.v20090708'>
-      <properties size='2'>
-        <property name='artifact.size' value='1848'/>
-        <property name='download.size' value='1848'/>
-      </properties>
-    </artifact>
-    <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
-      <properties size='3'>
-        <property name='artifact.size' value='73732'/>
-        <property name='download.size' value='73732'/>
-        <property name='download.contentType' value='application/zip'/>
-      </properties>
-    </artifact>
-  </artifacts>
-</repository>

Deleted: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml
===================================================================
--- branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml	2009-08-19 15:49:59 UTC (rev 1166)
+++ branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/content.xml	2009-08-19 15:55:10 UTC (rev 1167)
@@ -1,353 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<?metadataRepository class='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'?>
-<repository name='JBoss DNA REST Eclipse SWT Client' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
-  <properties size='2'>
-    <property name='p2.compressed' value='false'/>
-    <property name='p2.timestamp' value='1250277630248'/>
-  </properties>
-  <units size='8'>
-    <unit id='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.jar' version='1.0.0.v20090708'>
-      <update id='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.jar' range='[0.0.0,1.0.0.v20090708)' severity='0'/>
-      <properties size='9'>
-        <property name='org.eclipse.equinox.p2.name' value='%featureName'/>
-        <property name='org.eclipse.equinox.p2.description' value='%description'/>
-        <property name='org.eclipse.equinox.p2.description.url' value='http://www.jboss.org/dna/'/>
-        <property name='org.eclipse.equinox.p2.provider' value='%featureProvider'/>
-        <property name='df_LT.featureName' value='JBoss DNA JCR REST Eclipse SWT Client'/>
-        <property name='df_LT.copyright' value='JBoss DNA JCR REST Eclipse SWT Client (http://www.jboss.org/dna/) is copyright of Red Hat, Inc.'/>
-        <property name='df_LT.featureProvider' value='Red Hat, Inc.'/>
-        <property name='df_LT.description' value='The JBoss DNA JCR REST Eclipse Client provides a resource publishing and unpublishing capability to DNA repositories.'/>
-        <property name='df_LT.license' value='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.&#xA;&#xA;Some portions may be licensed to Red Hat, Inc. under one or more contributor license agreements.'/>
-      </properties>
-      <provides size='4'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.jar' version='1.0.0.v20090708'/>
-        <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' version='1.0.0'/>
-        <provided namespace='org.eclipse.update.feature' name='org.jboss.dna.web.jcr.rest.client.swt.feature' version='1.0.0.v20090708'/>
-        <provided namespace='org.eclipse.equinox.p2.localization' name='df_LT' version='1.0.0'/>
-      </provides>
-      <filter>
-        (org.eclipse.update.install.features=true)
-      </filter>
-      <artifacts size='1'>
-        <artifact classifier='org.eclipse.update.feature' id='org.jboss.dna.web.jcr.rest.client.swt.feature' version='1.0.0.v20090708'/>
-      </artifacts>
-      <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
-      <touchpointData size='1'>
-        <instructions size='1'>
-          <instruction key='zipped'>
-            true
-          </instruction>
-        </instructions>
-      </touchpointData>
-      <licenses size='1'>
-        <license url='http://www.example.com/license'>
-          %license
-        </license>
-      </licenses>
-      <copyright url='http://www.example.com/copyright'>
-        %copyright
-      </copyright>
-    </unit>
-    <unit id='tooling.source.default' version='1.0.0' singleton='false'>
-      <hostRequirements size='1'>
-        <required namespace='org.eclipse.equinox.p2.eclipse.type' name='source' range='0.0.0' optional='true' multiple='true' greedy='false'/>
-      </hostRequirements>
-      <properties size='1'>
-        <property name='org.eclipse.equinox.p2.type.fragment' value='true'/>
-      </properties>
-      <provides size='2'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='tooling.source.default' version='1.0.0'/>
-        <provided namespace='org.eclipse.equinox.p2.flavor' name='tooling' version='1.0.0'/>
-      </provides>
-      <requires size='1'>
-        <required namespace='org.eclipse.equinox.p2.eclipse.type' name='source' range='0.0.0' optional='true' multiple='true' greedy='false'/>
-      </requires>
-      <touchpoint id='null' version='0.0.0'/>
-      <touchpointData size='1'>
-        <instructions size='2'>
-          <instruction key='install'>
-            addSourceBundle(bundle:${artifact})
-          </instruction>
-          <instruction key='uninstall'>
-            removeSourceBundle(bundle:${artifact})
-          </instruction>
-        </instructions>
-      </touchpointData>
-    </unit>
-    <unit id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'>
-      <update id='org.jboss.dna.web.jcr.rest.client.swt' range='[0.0.0,1.0.0)' severity='0'/>
-      <properties size='4'>
-        <property name='df_LT.bundleVendor' value='Red Hat, Inc.'/>
-        <property name='df_LT.bundleName' value='DNA Eclipse Publishing UI Plug-in'/>
-        <property name='org.eclipse.equinox.p2.name' value='%bundleName'/>
-        <property name='org.eclipse.equinox.p2.provider' value='%bundleVendor'/>
-      </properties>
-      <provides size='4'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'/>
-        <provided namespace='osgi.bundle' name='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'/>
-        <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
-        <provided namespace='org.eclipse.equinox.p2.localization' name='df_LT' version='1.0.0'/>
-      </provides>
-      <requires size='3'>
-        <required namespace='osgi.bundle' name='org.eclipse.ui' range='0.0.0'/>
-        <required namespace='osgi.bundle' name='org.eclipse.core.runtime' range='0.0.0'/>
-        <required namespace='osgi.bundle' name='org.eclipse.core.resources' range='0.0.0'/>
-      </requires>
-      <artifacts size='1'>
-        <artifact classifier='osgi.bundle' id='org.jboss.dna.web.jcr.rest.client.swt' version='1.0.0'/>
-      </artifacts>
-      <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
-      <touchpointData size='1'>
-        <instructions size='1'>
-          <instruction key='manifest'>
-            Bundle-ManifestVersion: 2&#xA;Bundle-RequiredExecutionEnvironment: JavaSE-1.6&#xA;Bundle-Localization: plugin&#xA;Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,org.eclipse.core.resources&#xA;Bundle-Activator: org.jboss.dna.web.jcr.rest.client.swt.Activator&#xA;Bundle-Name: %bundleName&#xA;Bundle-Version: 1.0.0&#xA;Bundle-Vendor: %bundleVendor&#xA;Bundle-SymbolicName: org.jboss.dna.web.jcr.rest.client.swt;singleton:=true&#xA;Bundle-ActivationPolicy: lazy&#xA;Bundle-ClassPath: dna-web-jcr-rest-client-0.6-SNAPSHOT.jar,dnaPublishUi.jar&#xA;Manifest-Version: 1.0
-          </instruction>
-        </instructions>
-      </touchpointData>
-    </unit>
-    <unit id='tooling.osgi.bundle.default' version='1.0.0' singleton='false'>
-      <hostRequirements size='1'>
-        <required namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' range='0.0.0' multiple='true' greedy='false'/>
-      </hostRequirements>
-      <properties size='1'>
-        <property name='org.eclipse.equinox.p2.type.fragment' value='true'/>
-      </properties>
-      <provides size='2'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='tooling.osgi.bundle.default' version='1.0.0'/>
-        <provided namespace='org.eclipse.equinox.p2.flavor' name='tooling' version='1.0.0'/>
-      </provides>
-      <requires size='1'>
-        <required namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' range='0.0.0' multiple='true' greedy='false'/>
-      </requires>
-      <touchpoint id='null' version='0.0.0'/>
-      <touchpointData size='1'>
-        <instructions size='4'>
-          <instruction key='install'>
-            installBundle(bundle:${artifact})
-          </instruction>
-          <instruction key='uninstall'>
-            uninstallBundle(bundle:${artifact})
-          </instruction>
-          <instruction key='unconfigure'>
-
-          </instruction>
-          <instruction key='configure'>
-            setStartLevel(startLevel:4);
-          </instruction>
-        </instructions>
-      </touchpointData>
-    </unit>
-    <unit id='tooling.org.eclipse.update.feature.default' version='1.0.0' singleton='false'>
-      <hostRequirements size='1'>
-        <required namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' range='0.0.0' optional='true' multiple='true' greedy='false'/>
-      </hostRequirements>
-      <properties size='1'>
-        <property name='org.eclipse.equinox.p2.type.fragment' value='true'/>
-      </properties>
-      <provides size='2'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='tooling.org.eclipse.update.feature.default' version='1.0.0'/>
-        <provided namespace='org.eclipse.equinox.p2.flavor' name='tooling' version='1.0.0'/>
-      </provides>
-      <requires size='1'>
-        <required namespace='org.eclipse.equinox.p2.eclipse.type' name='feature' range='0.0.0' optional='true' multiple='true' greedy='false'/>
-      </requires>
-      <filter>
-        (org.eclipse.update.install.features=true)
-      </filter>
-      <touchpoint id='null' version='0.0.0'/>
-      <touchpointData size='1'>
-        <instructions size='2'>
-          <instruction key='install'>
-            installFeature(feature:${artifact},featureId:default,featureVersion:default)
-          </instruction>
-          <instruction key='uninstall'>
-            uninstallFeature(feature:${artifact},featureId:default,featureVersion:default)
-          </instruction>
-        </instructions>
-      </touchpointData>
-    </unit>
-    <unit id='config.a.jre' version='1.6.0' singleton='false'>
-      <hostRequirements size='1'>
-        <required namespace='org.eclipse.equinox.p2.iu' name='a.jre' range='1.6.0'/>
-      </hostRequirements>
-      <properties size='1'>
-        <property name='org.eclipse.equinox.p2.type.fragment' value='true'/>
-      </properties>
-      <provides size='1'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='config.a.jre' version='1.6.0'/>
-      </provides>
-      <requires size='1'>
-        <required namespace='org.eclipse.equinox.p2.iu' name='a.jre' range='1.6.0'/>
-      </requires>
-      <touchpoint id='org.eclipse.equinox.p2.native' version='1.0.0'/>
-      <touchpointData size='1'>
-        <instructions size='1'>
-          <instruction key='install'>
-
-          </instruction>
-        </instructions>
-      </touchpointData>
-    </unit>
-    <unit id='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.group' version='1.0.0.v20090708' singleton='false'>
-      <update id='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.group' range='[0.0.0,1.0.0.v20090708)' severity='0'/>
-      <properties size='10'>
-        <property name='org.eclipse.equinox.p2.name' value='%featureName'/>
-        <property name='org.eclipse.equinox.p2.description' value='%description'/>
-        <property name='org.eclipse.equinox.p2.description.url' value='http://www.jboss.org/dna/'/>
-        <property name='org.eclipse.equinox.p2.provider' value='%featureProvider'/>
-        <property name='org.eclipse.equinox.p2.type.group' value='true'/>
-        <property name='df_LT.featureName' value='JBoss DNA JCR REST Eclipse SWT Client'/>
-        <property name='df_LT.copyright' value='JBoss DNA JCR REST Eclipse SWT Client (http://www.jboss.org/dna/) is copyright of Red Hat, Inc.'/>
-        <property name='df_LT.featureProvider' value='Red Hat, Inc.'/>
-        <property name='df_LT.description' value='The JBoss DNA JCR REST Eclipse Client provides a resource publishing and unpublishing capability to DNA repositories.'/>
-        <property name='df_LT.license' value='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.&#xA;&#xA;Some portions may be licensed to Red Hat, Inc. under one or more contributor license agreements.'/>
-      </properties>
-      <provides size='2'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.group' version='1.0.0.v20090708'/>
-        <provided namespace='org.eclipse.equinox.p2.localization' name='df_LT' version='1.0.0'/>
-      </provides>
-      <requires size='5'>
-        <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.ui' range='0.0.0'/>
-        <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.core.runtime' range='0.0.0'/>
-        <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.core.resources' range='0.0.0'/>
-        <required namespace='org.eclipse.equinox.p2.iu' name='org.jboss.dna.web.jcr.rest.client.swt' range='[1.0.0,1.0.0]'/>
-        <required namespace='org.eclipse.equinox.p2.iu' name='org.jboss.dna.web.jcr.rest.client.swt.feature.feature.jar' range='[1.0.0.v20090708,1.0.0.v20090708]'>
-          <filter>
-            (org.eclipse.update.install.features=true)
-          </filter>
-        </required>
-      </requires>
-      <touchpoint id='null' version='0.0.0'/>
-      <licenses size='1'>
-        <license url='http://www.example.com/license'>
-          %license
-        </license>
-      </licenses>
-      <copyright url='http://www.example.com/copyright'>
-        %copyright
-      </copyright>
-    </unit>
-    <unit id='a.jre' version='1.6.0' singleton='false'>
-      <provides size='117'>
-        <provided namespace='org.eclipse.equinox.p2.iu' name='a.jre' version='1.6.0'/>
-        <provided namespace='java.package' name='javax.accessibility' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.activity' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.crypto' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.crypto.interfaces' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.crypto.spec' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio.event' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio.metadata' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio.plugins.bmp' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio.plugins.jpeg' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio.spi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.imageio.stream' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.loading' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.modelmbean' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.monitor' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.openmbean' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.relation' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.remote' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.remote.rmi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.management.timer' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.naming' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.naming.directory' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.naming.event' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.naming.ldap' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.naming.spi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.net' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.net.ssl' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.print' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.print.attribute' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.print.attribute.standard' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.print.event' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.rmi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.rmi.CORBA' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.rmi.ssl' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.auth' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.auth.callback' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.auth.kerberos' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.auth.login' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.auth.spi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.auth.x500' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.cert' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.security.sasl' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sound.midi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sound.midi.spi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sound.sampled' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sound.sampled.spi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sql' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sql.rowset' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sql.rowset.serial' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.sql.rowset.spi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.border' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.colorchooser' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.event' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.filechooser' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.plaf' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.plaf.basic' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.plaf.metal' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.plaf.multi' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.plaf.synth' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.table' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.text' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.text.html' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.text.html.parser' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.text.rtf' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.tree' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.swing.undo' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.transaction' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.transaction.xa' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.datatype' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.namespace' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.parsers' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.transform' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.transform.dom' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.transform.sax' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.transform.stream' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.validation' version='0.0.0'/>
-        <provided namespace='java.package' name='javax.xml.xpath' version='0.0.0'/>
-        <provided namespace='java.package' name='org.ietf.jgss' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA_2_3' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA_2_3.portable' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA.DynAnyPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA.ORBPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA.portable' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CORBA.TypeCodePackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CosNaming' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CosNaming.NamingContextExtPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.CosNaming.NamingContextPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.Dynamic' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.DynamicAny' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.DynamicAny.DynAnyFactoryPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.DynamicAny.DynAnyPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.IOP' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.IOP.CodecFactoryPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.IOP.CodecPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.Messaging' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableInterceptor' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableInterceptor.ORBInitInfoPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableServer' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableServer.CurrentPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableServer.POAManagerPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableServer.POAPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableServer.portable' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.PortableServer.ServantLocatorPackage' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.SendingContext' version='0.0.0'/>
-        <provided namespace='java.package' name='org.omg.stub.java.rmi' version='0.0.0'/>
-        <provided namespace='java.package' name='org.w3c.dom' version='0.0.0'/>
-        <provided namespace='java.package' name='org.w3c.dom.bootstrap' version='0.0.0'/>
-        <provided namespace='java.package' name='org.w3c.dom.events' version='0.0.0'/>
-        <provided namespace='java.package' name='org.w3c.dom.ls' version='0.0.0'/>
-        <provided namespace='java.package' name='org.xml.sax' version='0.0.0'/>
-        <provided namespace='java.package' name='org.xml.sax.ext' version='0.0.0'/>
-        <provided namespace='java.package' name='org.xml.sax.helpers' version='0.0.0'/>
-      </provides>
-      <touchpoint id='org.eclipse.equinox.p2.native' version='1.0.0'/>
-    </unit>
-  </units>
-</repository>


From dna-commits at lists.jboss.org  Wed Aug 19 12:07:35 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 19 Aug 2009 12:07:35 -0400
Subject: [dna-commits] DNA SVN: r1168 -
	branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite.
Message-ID: <200908191607.n7JG7ZYk011400@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-19 12:07:34 -0400 (Wed, 19 Aug 2009)
New Revision: 1168

Added:
   branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/dnaRestClientUpdateSite.v20090819.zip
Log:
This is an update site archive that can be installed into Eclipse using the Update Manager.

Added: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/dnaRestClientUpdateSite.v20090819.zip
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.web.jcr.rest.client.swt.updatesite/dnaRestClientUpdateSite.v20090819.zip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream


From dna-commits at lists.jboss.org  Wed Aug 19 12:26:06 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 19 Aug 2009 12:26:06 -0400
Subject: [dna-commits] DNA SVN: r1169 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt: docs and 6
	other directories.
Message-ID: <200908191626.n7JGQ6ZE015548@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-19 12:26:03 -0400 (Wed, 19 Aug 2009)
New Revision: 1169

Added:
   branches/eclipse/org.jboss.dna.publish.ui.swt/about.ini
   branches/eclipse/org.jboss.dna.publish.ui.swt/about.mappings
   branches/eclipse/org.jboss.dna.publish.ui.swt/about.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaConsole.html
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaServerView.html
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaToc.html
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/PublishDialog.html
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ResourceContextMenu.html
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ServerDialog.html
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/helpContexts.xml
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/DnaConsole.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/PublishDialog.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ResourceDnaContextMenu.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ServerDialog.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ServerView.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/collapse_all.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/delete_server.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/edit_server.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/new_server.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/refresh.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/docs/toc.xml
   branches/eclipse/org.jboss.dna.publish.ui.swt/feature.png
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/error_overlay.gif
Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java
Log:
Added first cut at dynamic help. Now feature shows up in About dialog. Added an image decorator that indicates when a server can't be connected to.

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/about.ini
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/about.ini	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/about.ini	2009-08-19 16:26:03 UTC (rev 1169)
@@ -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: branches/eclipse/org.jboss.dna.publish.ui.swt/about.ini
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/about.mappings
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/about.mappings	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/about.mappings	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,3 @@
+#Thu Feb 26 11:28:46 CST 2009
+1=
+0=3126

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/about.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/about.properties	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/about.properties	2009-08-19 16:26:03 UTC (rev 1169)
@@ -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: branches/eclipse/org.jboss.dna.publish.ui.swt/about.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/build.properties	2009-08-19 16:26:03 UTC (rev 1169)
@@ -13,7 +13,13 @@
                LEGAL.txt,\
                AUTHORS.txt,\
                dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar,\
-               src/log4j.properties
+               src/log4j.properties,\
+               docs/helpContexts.xml,\
+               docs/,\
+               about.ini,\
+               about.mappings,\
+               about.properties,\
+               feature.png
 src.includes = src/,\
                LEGAL.txt
 source.dnaPublishUi.jar = src/

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaConsole.html
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaConsole.html	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaConsole.html	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,35 @@
+<h2>DNA Console</h2>
+
+<p>The DNA Console is shown in the Workbench Console view. Entries in this view show the output of the publishing or unpublishing operations. For each operation there is an entry at the start of the operation and another entry at the end of the operation. Inbetween those entries will be an entry for each file involved in the operation.</p>
+
+<p>The following symbols indicate the type of outcome for each file:</p>
+
+<table border="1">
+<tr>
+	<td align="center"><strong>+</strong>&nbsp;</td>
+	<td>if the file was successfully published (uploaded)</td>
+</tr>
+<tr>
+	<td align="center"><strong>-</strong>&nbsp;</td>
+	<td>if the file was successfully unpublished (removed)</td>
+</tr>
+<tr>
+	<td align="center"><strong>*</strong>&nbsp;</td>
+	<td>if there was an error publishing or unpublishing the file</td>
+</tr>
+<tr>
+	<td align="center"><strong>w</strong>&nbsp;</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>
+
+<p>Here is what the DNA Console in the Console view looks like:</p>
+
+<img src="images/DnaConsole.png" width="610" height="168" 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 DNA Console.</p>
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publishing and Unpublishing Dialog</a></li>
+</ul>


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaConsole.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaServerView.html
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaServerView.html	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaServerView.html	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,15 @@
+<h2>Server View</h2>
+
+<p>The DNA Server View 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" width="16" height="16" border="0" alt="">), edit a selected server's properties (<img src="images/edit_server.gif" width="16" height="16" border="0" alt="">), delete one or more selected servers (<img src="images/delete_server.gif" width="16" height="16" border="0" alt="">), refresh, which attempts to connect to all the selected servers (<img src="images/refresh.gif" width="16" height="16" border="0" alt="">), and collapse all servers so that their repositories and workspaces can't be seen (<img src="images/collapse_all.gif" width="16" height="16" border="0" alt="">).</p>
+
+<p>Here is what the DNA Server View looks like:</p>
+
+<img src="images/ServerView.png" width="532" height="166" border="0" alt="">
+
+<p>If a connection to a server cannot be established that server icon will be decorated with an error overlay image. There is also a context menu with actions to create a new server (always enabled), edit server properties (enabled only when one server is selected), and delete one or more selected servers.</p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="ServerDialog.html">Server Dialog</a></li>
+</ul>


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaServerView.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaToc.html
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaToc.html	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaToc.html	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,9 @@
+<h2>DNA Publishing</h2>
+
+<ul>
+<li><a href="ResourceContextMenu.html">Resource Context Menu</a></li>
+<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>
+</ul>
\ No newline at end of file


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/DnaToc.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/PublishDialog.html
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/PublishDialog.html	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/PublishDialog.html	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,45 @@
+<h2>Publish/Unpublish Dialog</h2>
+
+<p>The DNA Publish/Unpublish Dialog 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).</p>
+
+<p>The dialog consists of the following controls:</p>
+
+<table border="1">
+<tr>
+	<td align="right"><strong>Server Combo</strong>&nbsp;</td>
+	<td>allows selection of a registered server</td>
+</tr>
+<tr>
+	<td align="right"><strong>New Server Button</strong>&nbsp;</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>&nbsp;</td>
+	<td>allows selection of a repository found hosted on the selected server</td>
+</tr>
+<tr>
+	<td align="right"><strong>Workspace Combo</strong>&nbsp;</td>
+	<td>allows selection of a workspace of the selected repository</td>
+</tr>
+<tr>
+	<td align="right"><strong>Resources List</strong>&nbsp;</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>&nbsp;</td>
+	<td>when checked will recursively select all files within any selected folders</td>
+</tr>
+</table>
+
+<p>Here is what the DNA Publish/Unpublish Dialog looks like:</p>
+
+<img src="images/PublishDialog.png" width="525" height="405" border="0" alt="">
+
+<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>
+</ul>


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/PublishDialog.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ResourceContextMenu.html
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ResourceContextMenu.html	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ResourceContextMenu.html	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,13 @@
+<h2>Resource Context Menu</h2>
+
+<p>The Resource Context Menu consists of two actions: publish and unpublish. Each action 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).</p>
+
+<p>Here is what the Resource Context Menu looks like:</p>
+
+<img src="images/ResourceDnaContextMenu.png" width="358" height="118" border="0" alt="">
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publishing and Unpublishing Dialog</a></li>
+</ul>


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ResourceContextMenu.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ServerDialog.html
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ServerDialog.html	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ServerDialog.html	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,41 @@
+<h2>Server Dialog</h2>
+
+<p>The DNA Server Dialog 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>The dialog consists of the following controls:</p>
+
+<table border="1">
+<tr>
+	<td align="right"><strong>URL Field</strong>&nbsp;</td>
+	<td>enter the server URL where one or more DNA repositories are hosted</td>
+</tr>
+<tr>
+	<td align="right"><strong>User Field</strong>&nbsp;</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>&nbsp;</td>
+	<td>enter the password to use when logging in to the server</td>
+</tr>
+<tr>
+	<td align="right"><strong>Save Password Checkbox</strong>&nbsp;</td>
+	<td>when checked the password will be saved in clear-text on the local machined</td>
+</tr>
+<tr>
+	<td align="right"><strong>Test Server Connection Button</strong>&nbsp;</td>
+	<td>when clicked will try and connect to the server</td>
+</tr>
+</table>
+
+<p>Here is what the DNA Server Dialog looks like:</p>
+
+<img src="images/ServerDialog.png" width="525" height="515" border="0" alt="">
+
+<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: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/ServerDialog.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/helpContexts.xml
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/helpContexts.xml	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/helpContexts.xml	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,27 @@
+<!--
+  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"/>
+ </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"/>
+ </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: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/helpContexts.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/DnaConsole.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/DnaConsole.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/PublishDialog.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/PublishDialog.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ResourceDnaContextMenu.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ResourceDnaContextMenu.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ServerDialog.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ServerDialog.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ServerView.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/ServerView.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/collapse_all.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/collapse_all.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/delete_server.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/delete_server.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/edit_server.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/edit_server.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/new_server.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/new_server.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/refresh.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/images/refresh.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/toc.xml
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/docs/toc.xml	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/docs/toc.xml	2009-08-19 16:26:03 UTC (rev 1169)
@@ -0,0 +1,7 @@
+<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="Resource Context Menu" href="docs/ResourceContextMenu.html"/>
+</toc>


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/docs/toc.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/feature.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/feature.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/error_overlay.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/error_overlay.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties	2009-08-19 16:26:03 UTC (rev 1169)
@@ -24,6 +24,8 @@
 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

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-19 16:26:03 UTC (rev 1169)
@@ -78,4 +78,36 @@
       </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.web.jcr.rest.client.swt.views.ServerContentProvider"
+            id="dnaDecorator">
+         <description>
+            %decorator.description
+         </description>
+         <enablement>
+            <objectClass
+                  name="org.jboss.dna.web.jcr.rest.client.domain.IDnaObject">
+            </objectClass>
+         </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>
+
 </plugin>

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Activator.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -163,11 +163,11 @@
         String key = null;
 
         if (object instanceof Workspace) {
-            key = WORKSPACE_IMAGE_PATH;
+            key = WORKSPACE_IMAGE;
         } else if (object instanceof Repository) {
-            key = REPOSITORY_IMAGE_PATH;
+            key = REPOSITORY_IMAGE;
         } else if (object instanceof Server) {
-            key = SERVER_IMAGE_PATH;
+            key = SERVER_IMAGE;
         } else if (object instanceof IDnaObject) {
             // should have an icon for every business object
             assert false;
@@ -205,11 +205,11 @@
         String key = null;
 
         if (object instanceof Workspace) {
-            key = WORKSPACE_IMAGE_PATH;
+            key = WORKSPACE_IMAGE;
         } else if (object instanceof Repository) {
-            key = REPOSITORY_IMAGE_PATH;
+            key = REPOSITORY_IMAGE;
         } else if (object instanceof Server) {
-            key = SERVER_IMAGE_PATH;
+            key = SERVER_IMAGE;
         } else if (object instanceof IDnaObject) {
             // should have an icon for every business object
             assert false;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -35,50 +35,66 @@
      */
     String PLUGIN_ID = "org.jboss.dna.web.jcr.rest.client.swt"; //$NON-NLS-1$
 
-    String ICON_PATH = "icons/"; //$NON-NLS-1$
+    String ICON_FOLDER = "icons/"; //$NON-NLS-1$
 
     //
     // /icons/objects/
     //
 
-    String OBJECT_ICONS_FOLDER = ICON_PATH + "objects/"; //$NON-NLS-1$
+    String OBJECT_ICONS_FOLDER = ICON_FOLDER + "objects/"; //$NON-NLS-1$
 
-    String CHECKMARK_IMAGE_PATH = OBJECT_ICONS_FOLDER + "checkmark.gif"; //$NON-NLS-1$
+    String CHECKMARK_IMAGE = OBJECT_ICONS_FOLDER + "checkmark.gif"; //$NON-NLS-1$
 
-    String REPOSITORY_IMAGE_PATH = OBJECT_ICONS_FOLDER + "repository.gif"; //$NON-NLS-1$
+    String REPOSITORY_IMAGE = OBJECT_ICONS_FOLDER + "repository.gif"; //$NON-NLS-1$
 
-    String SERVER_IMAGE_PATH = OBJECT_ICONS_FOLDER + "server.gif"; //$NON-NLS-1$
+    String SERVER_IMAGE = OBJECT_ICONS_FOLDER + "server.gif"; //$NON-NLS-1$
 
-    String WORKSPACE_IMAGE_PATH = OBJECT_ICONS_FOLDER + "workspace.gif"; //$NON-NLS-1$
+    String WORKSPACE_IMAGE = OBJECT_ICONS_FOLDER + "workspace.gif"; //$NON-NLS-1$
 
     //
     // /icons/views/
     //
 
-    String VIEWS_ICON_FOLDER = ICON_PATH + "views/"; //$NON-NLS-1$
+    String VIEWS_ICON_FOLDER = ICON_FOLDER + "views/"; //$NON-NLS-1$
 
-    String COLLAPSE_ALL_IMAGE_PATH = VIEWS_ICON_FOLDER + "collapse_all.gif"; //$NON-NLS-1$
+    String COLLAPSE_ALL_IMAGE = VIEWS_ICON_FOLDER + "collapse_all.gif"; //$NON-NLS-1$
 
-    String DELETE_SERVER_IMAGE_PATH = VIEWS_ICON_FOLDER + "delete_server.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_PATH = VIEWS_ICON_FOLDER + "edit_server.gif"; //$NON-NLS-1$
+    String EDIT_SERVER_IMAGE = VIEWS_ICON_FOLDER + "edit_server.gif"; //$NON-NLS-1$
 
-    String NEW_SERVER_IMAGE_PATH = VIEWS_ICON_FOLDER + "new_server.gif"; //$NON-NLS-1$
+    String ERROR_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "error_overlay.gif"; //$NON-NLS-1$
 
-    String PUBLISH_IMAGE_PATH = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
+    String NEW_SERVER_IMAGE = VIEWS_ICON_FOLDER + "new_server.gif"; //$NON-NLS-1$
 
-    String REFRESH_IMAGE_PATH = VIEWS_ICON_FOLDER + "refresh.gif"; //$NON-NLS-1$
+    String PUBLISH_IMAGE = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
 
-    String UNPUBLISH_IMAGE_PATH = VIEWS_ICON_FOLDER + "unpublish.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_PATH + "wizards/"; //$NON-NLS-1$
+    String WIZARD_ICONS_FOLDER = ICON_FOLDER + "wizards/"; //$NON-NLS-1$
 
-    String DNA_WIZARD_BANNER_IMAGE_PATH = WIZARD_ICONS_FOLDER + "dna_wizard_banner.gif"; //$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 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$
 
 }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -24,6 +24,7 @@
 package org.jboss.dna.web.jcr.rest.client.swt;
 
 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;
@@ -135,6 +136,27 @@
         return null;
     }
 
+    /**
+     * The image can be used to decorate an existing image.
+     * 
+     * @param status the status whose image overlay is being requested
+     * @return the image descriptor or <code>null</code> if none found for the status severity
+     * @since 0.6
+     */
+    public static ImageDescriptor getOverlayImage( Status status ) {
+        String imageId = null;
+
+        if (status.isError()) {
+            imageId = IUiConstants.ERROR_OVERLAY_IMAGE;
+        }
+
+        if (imageId != null) {
+            return Activator.getDefault().getImageDescriptor(imageId);
+        }
+
+        return null;
+    }
+
     // ===========================================================================================================================
     // Constructors
     // ===========================================================================================================================

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/DeleteServerAction.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DELETE_SERVER_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DELETE_SERVER_IMAGE;
 import java.util.ArrayList;
 import java.util.List;
 import org.eclipse.jface.dialogs.Dialog;
@@ -84,7 +84,7 @@
                                ServerManager serverManager ) {
         super(RestClientI18n.deleteServerActionText.text());
         setToolTipText(RestClientI18n.deleteServerActionToolTip.text());
-        setImageDescriptor(Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE_PATH));
+        setImageDescriptor(Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE));
         setEnabled(false);
 
         this.serversToDelete = new ArrayList<Server>(5);

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/EditServerAction.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -24,7 +24,7 @@
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.EDIT_SERVER_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.EDIT_SERVER_IMAGE;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
@@ -80,7 +80,7 @@
                              ServerManager serverManager ) {
         super(RestClientI18n.editServerActionText.text());
         setToolTipText(RestClientI18n.editServerActionToolTip.text());
-        setImageDescriptor(Activator.getDefault().getImageDescriptor(EDIT_SERVER_IMAGE_PATH));
+        setImageDescriptor(Activator.getDefault().getImageDescriptor(EDIT_SERVER_IMAGE));
         setEnabled(false);
 
         this.shell = shell;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/NewServerAction.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -24,7 +24,7 @@
 package org.jboss.dna.web.jcr.rest.client.swt.actions;
 
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.NEW_SERVER_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.NEW_SERVER_IMAGE;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.actions.BaseSelectionListenerAction;
@@ -72,7 +72,7 @@
                             ServerManager serverManager ) {
         super(RestClientI18n.newServerActionText.text());
         setToolTipText(RestClientI18n.newServerActionToolTip.text());
-        setImageDescriptor(Activator.getDefault().getImageDescriptor(NEW_SERVER_IMAGE_PATH));
+        setImageDescriptor(Activator.getDefault().getImageDescriptor(NEW_SERVER_IMAGE));
 
         this.shell = shell;
         this.serverManager = serverManager;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,12 +23,16 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.views;
 
-import org.eclipse.jface.dialogs.MessageDialog;
+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.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;
@@ -38,13 +42,14 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.Utils;
 
 /**
  * The <code>ServerContentProvider</code> is a content and label provider for DNA repositories.
  * 
  * @since 0.6
  */
-public final class ServerContentProvider extends ColumnLabelProvider implements ITreeContentProvider {
+public final class ServerContentProvider extends ColumnLabelProvider implements ILightweightLabelDecorator, ITreeContentProvider {
 
     // ===========================================================================================================================
     // Fields
@@ -57,23 +62,15 @@
      */
     private final ServerManager serverManager;
 
-    /**
-     * The viewer using this content provider.
-     * 
-     * @since 0.6
-     */
-    private Viewer viewer;
-
     // ===========================================================================================================================
     // Constructors
     // ===========================================================================================================================
 
     /**
-     * @param serverManager the server manager being used to find servers, repositories, and workspaces
      * @since 0.6
      */
-    public ServerContentProvider( ServerManager serverManager ) {
-        this.serverManager = serverManager;
+    public ServerContentProvider() {
+        this.serverManager = Activator.getDefault().getServerManager();
     }
 
     // ===========================================================================================================================
@@ -94,6 +91,45 @@
     /**
      * {@inheritDoc}
      * 
+     * @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object, org.eclipse.jface.viewers.IDecoration)
+     * @since 0.6
+     */
+    @Override
+    public void decorate( final Object element,
+                          IDecoration decoration ) {
+        final Display display = Display.getDefault();
+
+        if (display.isDisposed()) {
+            return;
+        }
+
+        // must be an IDnaObject
+        if (element instanceof Server) {
+            Status status = Activator.getDefault().getServerManager().ping((Server)element);
+
+            if (status.isError()) {
+                ImageDescriptor overlay = Utils.getOverlayImage(status);
+
+                if (overlay != null) {
+                    decoration.addOverlay(overlay);
+                }
+            }
+
+            display.asyncExec(new Runnable() {
+                @SuppressWarnings( "synthetic-access" )
+                @Override
+                public void run() {
+                    if (!display.isDisposed()) {
+                        fireLabelProviderChanged(new LabelProviderChangedEvent(ServerContentProvider.this, element));
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
      * @see org.eclipse.jface.viewers.IContentProvider#dispose()
      * @since 0.6
      */
@@ -119,10 +155,6 @@
         } catch (Exception e) {
             String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(((Server)parentElement).getShortDescription());
             Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
-
-            if (this.viewer.getControl().isVisible()) {
-                MessageDialog.openError(this.viewer.getControl().getShell(), RestClientI18n.errorDialogTitle.text(), msg);
-            }
         }
 
         try {
@@ -132,10 +164,6 @@
         } catch (Exception e) {
             String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text();
             Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
-
-            if (this.viewer.getControl().isVisible()) {
-                MessageDialog.openError(this.viewer.getControl().getShell(), RestClientI18n.errorDialogTitle.text(), msg);
-            }
         }
 
         return new Object[0];
@@ -256,7 +284,7 @@
     public void inputChanged( Viewer viewer,
                               Object oldInput,
                               Object newInput ) {
-        this.viewer = viewer;
+        // nothing to do
     }
 
     /**

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,15 +23,18 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.views;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.COLLAPSE_ALL_IMAGE_PATH;
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.REFRESH_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.COLLAPSE_ALL_IMAGE;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.REFRESH_IMAGE;
+import static org.jboss.dna.web.jcr.rest.client.swt.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;
@@ -41,6 +44,7 @@
 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.web.jcr.rest.client.IServerRegistryListener;
 import org.jboss.dna.web.jcr.rest.client.ServerManager;
@@ -127,18 +131,24 @@
         };
 
         this.collapseAllAction.setToolTipText(RestClientI18n.collapseActionToolTip.text());
-        this.collapseAllAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(COLLAPSE_ALL_IMAGE_PATH));
+        this.collapseAllAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(COLLAPSE_ALL_IMAGE));
 
         // the refresh action is always enabled
         this.refreshAction = new Action() {
             @Override
             public void run() {
-                getViewer().refresh();
+                IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
+                
+                if (selection.size() == 1) {
+                    getViewer().refresh(selection.getFirstElement());
+                } else {
+                    getViewer().refresh();
+                }
             }
         };
 
         this.refreshAction.setToolTipText(RestClientI18n.refreshActionToolTip.text());
-        this.refreshAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE_PATH));
+        this.refreshAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE));
 
         // the shell used for dialogs that the actions display
         Shell shell = this.getSite().getShell();
@@ -188,11 +198,12 @@
      * @since 0.6
      */
     private void constructTreeViewer( Composite parent ) {
-        this.provider = new ServerContentProvider(getServerManager());
+        this.provider = new ServerContentProvider();
         this.viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
 
         this.viewer.setContentProvider(this.provider);
-        this.viewer.setLabelProvider(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() {
@@ -229,6 +240,10 @@
 
         // 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);
     }
 
     /**

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,6 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.PLUGIN_ID;
 import java.io.File;
 import java.util.List;
 import org.eclipse.core.resources.IFile;
@@ -39,7 +40,6 @@
 import org.jboss.dna.web.jcr.rest.client.Status;
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.IUiConstants;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
@@ -79,7 +79,7 @@
      * 
      * @since 0.6
      */
-    private static final String CONSOLE_NAME = RestClientI18n.publishJobConsoleName.text();
+    static final String CONSOLE_NAME = RestClientI18n.publishJobConsoleName.text();
 
     // ===========================================================================================================================
     // Class Methods
@@ -246,7 +246,7 @@
                 msg = RestClientI18n.publishJobUnexpectedErrorMsg.text();
             }
 
-            return new org.eclipse.core.runtime.Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, msg, e);
+            return new org.eclipse.core.runtime.Status(IStatus.ERROR, PLUGIN_ID, msg, e);
         } finally {
             monitor.done();
             // add done msg
@@ -327,7 +327,7 @@
 
         // create DNA console if necessary
         if (console == null) {
-            console = new MessageConsole(CONSOLE_NAME, null);
+            console = new DnaConsole();
             consoleMgr.addConsoles(new IConsole[] {console});
         }
 
@@ -339,4 +339,16 @@
         out.println(message);
     }
 
+    // ===========================================================================================================================
+    // Inner Class
+    // ===========================================================================================================================
+
+    class DnaConsole extends MessageConsole {
+
+        public DnaConsole() {
+            super(CONSOLE_NAME, null);
+        }
+
+    }
+
 }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,6 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.PUBLISH_DIALOG_HELP_CONTEXT;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -52,6 +53,7 @@
 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.web.jcr.rest.client.IServerRegistryListener;
 import org.jboss.dna.web.jcr.rest.client.ServerManager;
 import org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent;
@@ -543,7 +545,11 @@
         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);
+
         // load the UI with data
         refreshServers();
     }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishWizard.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WIZARD_BANNER_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WIZARD_BANNER_IMAGE;
 import java.util.List;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
@@ -90,7 +90,7 @@
         this.serverManager = serverManager;
 
         setWindowTitle((type == Type.PUBLISH) ? RestClientI18n.publishWizardPublishTitle.text() : RestClientI18n.publishWizardUnpublishTitle.text());
-        setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE_PATH));
+        setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE));
     }
 
     // ===========================================================================================================================

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerPage.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,6 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.SERVER_DIALOG_HELP_CONTEXT;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.IMessageProvider;
 import org.eclipse.jface.dialogs.MessageDialog;
@@ -43,10 +44,12 @@
 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.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;
+import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
 
 /**
@@ -311,6 +314,10 @@
         constructAuthenticationPanel(pnlMain);
         constructTestConnectionPanel(pnlMain);
         setControl(pnlMain);
+
+        // register with the help system
+        IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+        helpSystem.setHelp(pnlMain, SERVER_DIALOG_HELP_CONTEXT);
     }
 
     /**

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java	2009-08-19 16:07:34 UTC (rev 1168)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/ServerWizard.java	2009-08-19 16:26:03 UTC (rev 1169)
@@ -23,7 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WIZARD_BANNER_IMAGE_PATH;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_WIZARD_BANNER_IMAGE;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.wizard.Wizard;
 import org.jboss.dna.web.jcr.rest.client.ServerManager;
@@ -76,7 +76,7 @@
         this.page = new ServerPage();
         this.serverManager = serverManager;
 
-        setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE_PATH));
+        setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(DNA_WIZARD_BANNER_IMAGE));
         setWindowTitle(RestClientI18n.serverWizardNewServerTitle.text());
     }
 


From dna-commits at lists.jboss.org  Fri Aug 21 18:08:40 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 21 Aug 2009 18:08:40 -0400
Subject: [dna-commits] DNA SVN: r1170 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt:
	src/org/jboss/dna/web/jcr/rest/client/swt and 1 other directories.
Message-ID: <200908212208.n7LM8ePq030541@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-21 18:08:39 -0400 (Fri, 21 Aug 2009)
New Revision: 1170

Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
Log:
Added hyperlinks to the DNA Message Console view. Hyperlinks now exist for each file that was published or unpublished. Clicking on the hyperlink opens the file in the default editor.

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF	2009-08-19 16:26:03 UTC (rev 1169)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/META-INF/MANIFEST.MF	2009-08-21 22:08:39 UTC (rev 1170)
@@ -10,7 +10,8 @@
  org.eclipse.core.runtime,
  org.eclipse.core.resources,
  org.eclipse.ui.console,
- org.eclipse.jface.text
+ org.eclipse.jface.text,
+ org.eclipse.debug.ui
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Bundle-ClassPath: dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar,

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-19 16:26:03 UTC (rev 1169)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-21 22:08:39 UTC (rev 1170)
@@ -35,6 +35,13 @@
      */
     String PLUGIN_ID = "org.jboss.dna.web.jcr.rest.client.swt"; //$NON-NLS-1$
 
+    /**
+     * The identifier and type of the DNA Message Console. This is where publishing and unpublishing operations are logged.
+     * 
+     * @since 0.6
+     */
+    String DNA_CONSOLE_ID = "org.jboss.dna.web.jcr.rest.client.swt.views.DnaConsole"; //$NON-NLS-1$
+
     String ICON_FOLDER = "icons/"; //$NON-NLS-1$
 
     //
@@ -82,19 +89,30 @@
     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 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.
+     * 
+     * @since 0.6
+     */
+    String DNA_PUBLISHING_JOB_FAMILY = "dna.publishing.job.family"; //$NON-NLS-1$
+
 }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-19 16:26:03 UTC (rev 1169)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-21 22:08:39 UTC (rev 1170)
@@ -55,9 +55,10 @@
     public static I18n newServerActionText;
     public static I18n newServerActionToolTip;
     
-    public static I18n publishJobPublishCanceledMsg;
     public static I18n publishJobConsoleName;
     public static I18n publishJobPublish;
+    public static I18n publishJobPublishCanceledMsg;
+    public static I18n publishJobProblemCreatingHyperlinkMsg;
     public static I18n publishJobPublishFile;
     public static I18n publishJobPublishFileFailed;
     public static I18n publishJobPublishFileInfo;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-19 16:26:03 UTC (rev 1169)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-21 22:08:39 UTC (rev 1170)
@@ -45,23 +45,24 @@
 newServerActionToolTip = Create a new server
 
 publishJobConsoleName = DNA
-publishJobPublish = Publishing {3} file(s) to server "{0}" (repository "{1}", workspace "{2}") ...
-publishJobPublishCanceledMsg = i  Publishing to server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.\n
-publishJobPublishFile = \t+  Published file "{0}" to location "{1}"
-publishJobPublishFileFailed = \t*  ERROR publishing file "{0}" to location "{1}"
-publishJobPublishFileInfo = \ti  {0}
-publishJobPublishFileWarning = \tw  {0}
-publishJobPublishFinishedMsg = Done publishing ({3} milliseconds) to server "{0}" (repository "{1}", workspace "{2}").\n
-publishJobPublishName = DNA Publish
+publishJobProblemCreatingHyperlinkMsg = Unexpected problem creating hyperlink in DNA Console view
+publishJobPublish = [{0}] Publishing {4} file(s) to server "{1}" (repository "{2}", workspace "{3}") ...
+publishJobPublishCanceledMsg = [{0}] ! Publishing to server "{1}" (repository "{2}", workspace "{3}") was canceled after {4} file(s) out of {5} were processed.\n
+publishJobPublishFile = \t[{0}] + Published file "{1}"
+publishJobPublishFileFailed = \t[{0}] * Publishing file "{1}" generated an ERROR message. See log.
+publishJobPublishFileInfo = \t[{0}] i Publishing file "{1}" generated an INFO message. See log.
+publishJobPublishFileWarning = \t[{0}] w Publishing file "{1}" generated a WARNING message. See log.
+publishJobPublishFinishedMsg = [{0}] Done publishing ({4} milliseconds) to server "{1}" (repository "{2}", workspace "{3}").\n
+publishJobPublishName = DNA Publish 
 publishJobPublishTaskName = Publishing resources
 publishJobUnexpectedErrorMsg = Unexpected error occurred. See log for more details.
-publishJobUnpublish = Unpublishing {3} file(s) from server "{0}" (repository "{1}", workspace "{2}") ...
-publishJobUnpublishCanceledMsg = *  Unpublishing from server "{0}" (repository "{1}", workspace "{2}") was canceled after {3} file(s) out of {4} were processed.\n
-publishJobUnpublishFile = \t-  Unpublished file "{0}" from location "{1}"
-publishJobUnpublishFileFailed = \t*  ERROR unpublished file "{0}" from location "{1}"
-publishJobUnpublishFileInfo = \ti  {0}
-publishJobUnpublishFileWarning = \tw  {0}
-publishJobUnpublishFinishedMsg = Done unpublishing ({3} milliseconds) from server "{0}" (repository "{1}", workspace "{2}").\n
+publishJobUnpublish = [{0}] Unpublishing {4} file(s) from server "{1}" (repository "{2}", workspace "{3}") ...
+publishJobUnpublishCanceledMsg = [{0}] ! Unpublishing from server "{1}" (repository "{2}", workspace "{3}") was canceled after {4} file(s) out of {5} were processed.\n
+publishJobUnpublishFile = \t[{0}] - Unpublished file "{1}"
+publishJobUnpublishFileFailed = \t[{0}] * Unpublishing file "{0}" generated an ERROR message. See log.
+publishJobUnpublishFileInfo = \t[{0}] i Unpublishing file "{1}" generated an INFO message. See log.
+publishJobUnpublishFileWarning = \t[{0}] w Unpublishing file "{1}" generated a WARNING message. See log.
+publishJobUnpublishFinishedMsg = [{0}] Done unpublishing ({4} milliseconds) from server "{1}" (repository "{2}", workspace "{3}").\n
 publishJobUnpublishName = DNA Unpublish
 publishJobUnpublishTaskName = Unpublishing resources
 

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-19 16:26:03 UTC (rev 1169)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-21 22:08:39 UTC (rev 1170)
@@ -23,13 +23,23 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_CONSOLE_ID;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_PUBLISHING_JOB_FAMILY;
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.PLUGIN_ID;
 import java.io.File;
 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.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.ui.console.ConsolePlugin;
 import org.eclipse.ui.console.IConsole;
 import org.eclipse.ui.console.IConsoleManager;
@@ -38,6 +48,7 @@
 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.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
@@ -81,6 +92,13 @@
      */
     static final String CONSOLE_NAME = RestClientI18n.publishJobConsoleName.text();
 
+    /**
+     * A unique job identifier given to each publishing/unpublishing job.
+     * 
+     * @since 0.6
+     */
+    private static final AtomicInteger JOB_ID = new AtomicInteger(1);
+
     // ===========================================================================================================================
     // Class Methods
     // ===========================================================================================================================
@@ -155,6 +173,45 @@
     // ===========================================================================================================================
 
     /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
+     * @since 0.6
+     */
+    @Override
+    public boolean belongsTo( Object family ) {
+        return DNA_PUBLISHING_JOB_FAMILY.equals(family);
+    }
+
+    /**
+     * Note: The <code>DnaConsole</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
+     * @since 0.6
+     */
+    private DnaConsole getDnaConsole() {
+        DnaConsole console = null;
+        IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
+        IConsole[] consoles = consoleMgr.getConsoles();
+
+        // see if DNA console already exists
+        for (int i = 0; i < consoles.length; ++i) {
+            if (CONSOLE_NAME.equals(consoles[i].getName())) {
+                console = (DnaConsole)consoles[i];
+                break;
+            }
+        }
+
+        // create DNA console if necessary
+        if (console == null) {
+            console = new DnaConsole();
+            consoleMgr.addConsoles(new IConsole[] {console});
+        }
+
+        return console;
+    }
+
+    /**
      * @return <code>true</code> if a publishing job
      * @since 0.6
      */
@@ -171,6 +228,7 @@
     @Override
     protected IStatus run( IProgressMonitor monitor ) {
         assert (this.workspace != null);
+        int jobId = JOB_ID.getAndIncrement();
         long startTime = System.currentTimeMillis();
 
         try {
@@ -180,15 +238,17 @@
 
             // write initial message to console
             if (isPublishing()) {
-                writeToConsole(RestClientI18n.publishJobPublish.text(this.workspace.getServer().getUrl(),
-                                                                     this.workspace.getRepository().getName(),
-                                                                     this.workspace.getName(),
-                                                                     this.files.size()));
+                writeToConsole(getDnaConsole(), RestClientI18n.publishJobPublish.text(jobId,
+                                                                                      this.workspace.getServer().getUrl(),
+                                                                                      this.workspace.getRepository().getName(),
+                                                                                      this.workspace.getName(),
+                                                                                      this.files.size()));
             } else {
-                writeToConsole(RestClientI18n.publishJobUnpublish.text(this.workspace.getServer().getUrl(),
-                                                                       this.workspace.getRepository().getName(),
-                                                                       this.workspace.getName(),
-                                                                       this.files.size()));
+                writeToConsole(getDnaConsole(), RestClientI18n.publishJobUnpublish.text(jobId,
+                                                                                        this.workspace.getServer().getUrl(),
+                                                                                        this.workspace.getRepository().getName(),
+                                                                                        this.workspace.getName(),
+                                                                                        this.files.size()));
             }
 
             // process the files
@@ -199,20 +259,22 @@
                     String msg = null;
 
                     if (isPublishing()) {
-                        msg = RestClientI18n.publishJobPublishCanceledMsg.text(this.workspace.getServer().getUrl(),
+                        msg = RestClientI18n.publishJobPublishCanceledMsg.text(jobId,
+                                                                               this.workspace.getServer().getUrl(),
                                                                                this.workspace.getRepository().getName(),
                                                                                this.workspace.getName(),
                                                                                numProcessed,
                                                                                this.files.size());
                     } else {
-                        msg = RestClientI18n.publishJobUnpublishCanceledMsg.text(this.workspace.getServer().getUrl(),
+                        msg = RestClientI18n.publishJobUnpublishCanceledMsg.text(jobId,
+                                                                                 this.workspace.getServer().getUrl(),
                                                                                  this.workspace.getRepository().getName(),
                                                                                  this.workspace.getName(),
                                                                                  numProcessed,
                                                                                  this.files.size());
                     }
 
-                    writeToConsole(msg); // write cancel msg to console
+                    writeToConsole(getDnaConsole(), msg); // write cancel msg to console
                     throw new InterruptedException(msg);
                 }
 
@@ -232,8 +294,8 @@
                 ++numProcessed;
                 monitor.worked(1);
 
-                // write success msg to console
-                writeToConsole(file, eclipseFile.getParent().getFullPath().toString(), status);
+                // write outcome msg to console
+                writeToConsole(jobId, eclipseFile, status);
             }
 
             return org.eclipse.core.runtime.Status.OK_STATUS;
@@ -249,17 +311,22 @@
             return new org.eclipse.core.runtime.Status(IStatus.ERROR, PLUGIN_ID, msg, e);
         } finally {
             monitor.done();
-            // add done msg
+
+            // add operation done msg
             // TODO need to format this duration better
             long duration = System.currentTimeMillis() - startTime;
 
             if (isPublishing()) {
-                writeToConsole(RestClientI18n.publishJobPublishFinishedMsg.text(this.workspace.getServer().getUrl(),
+                writeToConsole(getDnaConsole(),
+                               RestClientI18n.publishJobPublishFinishedMsg.text(jobId,
+                                                                                this.workspace.getServer().getUrl(),
                                                                                 this.workspace.getRepository().getName(),
                                                                                 this.workspace.getName(),
                                                                                 duration));
             } else {
-                writeToConsole(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.workspace.getServer().getUrl(),
+                writeToConsole(getDnaConsole(),
+                               RestClientI18n.publishJobUnpublishFinishedMsg.text(jobId,
+                                                                                  this.workspace.getServer().getUrl(),
                                                                                   this.workspace.getRepository().getName(),
                                                                                   this.workspace.getName(),
                                                                                   duration));
@@ -268,69 +335,104 @@
     }
 
     /**
+     * @param jobId the job ID
      * @param file the file involved in the publishing operation
-     * @param workspacePath the path in the workspace where the file is located
      * @param status the status of the publishing operation
      * @since 0.6
      */
-    private void writeToConsole( File file,
-                                 String workspacePath,
+    private void writeToConsole( int jobId,
+                                 final IFile file,
                                  Status status ) {
         String msg = null;
 
         if (status.isOk()) {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFile.text(file.getAbsolutePath(), workspacePath);
+                msg = RestClientI18n.publishJobPublishFile.text(jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFile.text(file.getAbsolutePath(), workspacePath);
+                msg = RestClientI18n.publishJobUnpublishFile.text(jobId, file.getFullPath());
             }
         } else if (status.isError()) {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFileFailed.text(file.getAbsolutePath(), workspacePath);
+                msg = RestClientI18n.publishJobPublishFileFailed.text(jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFileFailed.text(file.getAbsolutePath(), workspacePath);
+                msg = RestClientI18n.publishJobUnpublishFileFailed.text(jobId, file.getFullPath());
             }
+
+            // log
+            Activator.getDefault().log(status);
         } else if (status.isWarning()) {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFileWarning.text(status.getMessage());
+                msg = RestClientI18n.publishJobPublishFileWarning.text(jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFileWarning.text(status.getMessage());
+                msg = RestClientI18n.publishJobUnpublishFileWarning.text(jobId, file.getFullPath());
             }
-        } else if (status.isInfo()) {
+
+            // log
+            Activator.getDefault().log(status);
+        } else {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFileInfo.text(status.getMessage());
+                msg = RestClientI18n.publishJobPublishFileInfo.text(jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFileInfo.text(status.getMessage());
+                msg = RestClientI18n.publishJobUnpublishFileInfo.text(jobId, file.getFullPath());
             }
+
+            // log
+            Activator.getDefault().log(status);
         }
 
-        // TODO create hyperlink in console for the file
-        writeToConsole(msg);
+        // write to DNA Console
+        final DnaConsole dnaConsole = getDnaConsole();
+        final String consoleMsg = msg;
+        final IDocument doc = dnaConsole.getDocument();
+
+        // add listener that will add the hyperlink in the console for the file just published/unpublished
+        doc.addDocumentListener(new IDocumentListener() {
+            @Override
+            public void documentAboutToBeChanged( DocumentEvent event ) {
+                // nothing to do
+            }
+
+            @Override
+            public void documentChanged( DocumentEvent event ) {
+                try {
+                    // add hyperlink to console
+                    int startIndex = consoleMsg.indexOf('"');
+
+                    if (startIndex != -1) {
+                        ++startIndex; // move after the '""
+                        int lastIndex = consoleMsg.lastIndexOf('"');
+
+                        if (lastIndex != -1) {
+                            --lastIndex; // move before the '"'
+                            FindReplaceDocumentAdapter finder = new FindReplaceDocumentAdapter(doc);
+                            IRegion region = finder.find(0, consoleMsg, true, true, false, false);
+
+                            if (region != null) {
+                                dnaConsole.addHyperlink(new FileLink(file, null, -1, -1, -1),
+                                                        (region.getOffset() + startIndex),
+                                                        (lastIndex - startIndex + 1));
+                                doc.removeDocumentListener(this);
+                            }
+                        }
+                    }
+                } catch (BadLocationException e) {
+                    Activator.getDefault().log(new Status(Severity.ERROR,
+                                                          RestClientI18n.publishJobProblemCreatingHyperlinkMsg.text(), e));
+                    doc.removeDocumentListener(this);
+                }
+            }
+        });
+
+        writeToConsole(dnaConsole, msg);
     }
 
     /**
-     * @param message the message being written to the DNA console
+     * @param console the DNA console being written to
+     * @param message the message being written
      * @since 0.6
      */
-    private void writeToConsole( String message ) {
-        MessageConsole console = null;
-        IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
-        IConsole[] consoles = consoleMgr.getConsoles();
-
-        // see if DNA console already exists
-        for (int i = 0; i < consoles.length; ++i) {
-            if (CONSOLE_NAME.equals(consoles[i].getName())) {
-                console = (MessageConsole)consoles[i];
-                break;
-            }
-        }
-
-        // create DNA console if necessary
-        if (console == null) {
-            console = new DnaConsole();
-            consoleMgr.addConsoles(new IConsole[] {console});
-        }
-
+    private void writeToConsole( MessageConsole console,
+                                 String message ) {
         // show and focus console view
         console.activate();
 
@@ -345,10 +447,23 @@
 
     class DnaConsole extends MessageConsole {
 
+        /**
+         * @since 0.6
+         */
         public DnaConsole() {
             super(CONSOLE_NAME, null);
         }
 
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.ui.console.AbstractConsole#getType()
+         * @since 0.6
+         */
+        @Override
+        public String getType() {
+            return DNA_CONSOLE_ID;
+        }
     }
 
 }


From dna-commits at lists.jboss.org  Mon Aug 24 13:01:52 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Mon, 24 Aug 2009 13:01:52 -0400
Subject: [dna-commits] DNA SVN: r1171 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt: icons/views
	and 3 other directories.
Message-ID: <200908241701.n7OH1qoZ006253@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-24 13:01:51 -0400 (Mon, 24 Aug 2009)
New Revision: 1171

Added:
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.gif
Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
Log:
Added a file image overlay decorator indicating if the file has been published to one or more DNA repositories. This overlay is removed by the decorator when the file is unpublished from all the DNA repositories it was published to. The published state of a file is persisted from session to session.

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-24 17:01:51 UTC (rev 1171)
@@ -93,9 +93,14 @@
             %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>

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-24 17:01:51 UTC (rev 1171)
@@ -78,6 +78,8 @@
 
     String PUBLISH_IMAGE = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
 
+    String PUBLISHED_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "published_overlay.gif"; //$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$

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-24 17:01:51 UTC (rev 1171)
@@ -55,6 +55,8 @@
     public static I18n newServerActionText;
     public static I18n newServerActionToolTip;
     
+    public static I18n publishedResourcePropertyErrorMsg;
+    
     public static I18n publishJobConsoleName;
     public static I18n publishJobPublish;
     public static I18n publishJobPublishCanceledMsg;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-24 17:01:51 UTC (rev 1171)
@@ -44,6 +44,8 @@
 newServerActionText = New Server
 newServerActionToolTip = Create a new server
 
+publishedResourcePropertyErrorMsg = Error obtaining the "published" property from the resource "{0}"
+
 publishJobConsoleName = DNA
 publishJobProblemCreatingHyperlinkMsg = Unexpected problem creating hyperlink in DNA Console view
 publishJobPublish = [{0}] Publishing {4} file(s) to server "{1}" (repository "{2}", workspace "{3}") ...

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-24 17:01:51 UTC (rev 1171)
@@ -23,15 +23,23 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt;
 
+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.IStatus;
+import org.eclipse.core.runtime.QualifiedName;
 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;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
  * @since 0.6
@@ -39,10 +47,71 @@
 public final class Utils {
 
     // ===========================================================================================================================
+    // Constants
+    // ===========================================================================================================================
+
+    /**
+     * Delimiter between a workspace's properties.
+     * 
+     * @since 0.6
+     */
+    private static final String ID_DELIM = "$"; //$NON-NLS-1$
+
+    /**
+     * Delimiter between workspaces.
+     * 
+     * @since 0.6
+     */
+    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.
+     * 
+     * @since 0.6
+     */
+    private static QualifiedName PUBLISHED_RESOURCE_PROPERTY = new QualifiedName(IUiConstants.PLUGIN_ID, "publishedIn"); //$NON-NLS-1$
+
+    // ===========================================================================================================================
     // Class Methods
     // ===========================================================================================================================
 
     /**
+     * @param file the file that was just published
+     * @param workspace the workspace where the file was published
+     * @since 0.6
+     */
+    public static void addPublishedProperty( IFile file,
+                                             Workspace workspace ) {
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+
+        String wsValue = createWorkspaceId(workspace);
+
+        try {
+            Set<String> workspaces = null;
+
+            // get current value
+            String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
+
+            if (value == null) {
+                workspaces = new HashSet<String>(1);
+            } else {
+                workspaces = parsePublishedPropertyValue(value);
+            }
+
+            workspaces.add(wsValue);
+
+            // set new value
+            value = createPublishedPropertyValue(workspaces);
+            file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, value);
+        } catch (CoreException e) {
+            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
+        }
+    }
+
+    /**
      * 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
@@ -80,10 +149,10 @@
 
     /**
      * 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}. A {@link Status.Severity} is
+     * converted to {@link IStatus#CANCEL cancel}.
      * 
      * @param severity the eclipse status severity level
-     * @return the converted severity level
+     * @return the converted severity level (never <code>null</code>)
      * @see IStatus
      * @since 0.6
      */
@@ -99,7 +168,7 @@
      * Converts the Eclipse status severity level to a non-Eclipse severity.
      * 
      * @param severity the eclipse status severity level
-     * @return the converted severity level
+     * @return the converted severity level (never <code>null</code>)
      * @see IStatus
      * @since 0.6
      */
@@ -112,13 +181,43 @@
     }
 
     /**
+     * @param workspaces the workspaces used to create the property value
+     * @return the property value
+     * @since 0.6
+     */
+    private static String createPublishedPropertyValue( Set<String> workspaces ) {
+        StringBuilder value = new StringBuilder();
+
+        for (String workspace : workspaces) {
+            value.append(workspace).append(DELIM);
+        }
+
+        return value.toString();
+    }
+
+    /**
+     * @param workspace the workspace whose identifier is being created
+     * @return the ID
+     * @since 0.6
+     */
+    private static 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();
+    }
+
+    /**
      * The OK status does not have an image.
      * 
-     * @param status the status whose image is being requested
+     * @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
      * @since 0.6
      */
     public static Image getImage( Status status ) {
+        CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
         String imageId = null;
 
         if (status.isError()) {
@@ -139,11 +238,12 @@
     /**
      * The image can be used to decorate an existing image.
      * 
-     * @param status the status whose image overlay is being requested
+     * @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
      * @since 0.6
      */
     public static ImageDescriptor getOverlayImage( Status status ) {
+        CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
         String imageId = null;
 
         if (status.isError()) {
@@ -157,6 +257,72 @@
         return null;
     }
 
+    /**
+     * @param file the file whose published status is being requested
+     * @return <code>true</code> if the file has been published to any DNA repository
+     * @since 0.6
+     */
+    public static boolean isPublished( IFile file ) {
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+
+        try {
+            return (file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY) != null);
+        } catch (CoreException e) {
+            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
+        }
+
+        return false;
+    }
+
+    /**
+     * @param value the property value being parsed
+     * @return a collection of workspace identifiers
+     * @since 0.6
+     */
+    private static Set<String> parsePublishedPropertyValue( String value ) {
+        StringTokenizer st = new StringTokenizer(value, DELIM);
+        Set<String> workspaces = new HashSet<String>(st.countTokens());
+
+        while (st.hasMoreTokens()) {
+            workspaces.add(st.nextToken());
+        }
+
+        return workspaces;
+    }
+
+    /**
+     * @param file the file that was just unpublished
+     * @param workspace the workspace where the file was unpublished
+     * @since 0.6
+     */
+    public static void removePublishedProperty( IFile file,
+                                                Workspace workspace ) {
+        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+
+        String wsValue = createWorkspaceId(workspace);
+
+        try {
+            String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
+
+            if (value != null) {
+                Set<String> workspaces = parsePublishedPropertyValue(value);
+                workspaces.remove(wsValue);
+
+                if (workspaces.isEmpty()) {
+                    // no other workspaces so remove property
+                    file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, null);
+                } else {
+                    // set new value
+                    value = createPublishedPropertyValue(workspaces);
+                    file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, value);
+                }
+            }
+        } catch (CoreException e) {
+            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
+        }
+    }
+
     // ===========================================================================================================================
     // Constructors
     // ===========================================================================================================================

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-24 17:01:51 UTC (rev 1171)
@@ -23,6 +23,8 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.views;
 
+import static org.jboss.dna.web.jcr.rest.client.swt.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;
@@ -97,6 +99,7 @@
     @Override
     public void decorate( final Object element,
                           IDecoration decoration ) {
+        ImageDescriptor overlay = null;
         final Display display = Display.getDefault();
 
         if (display.isDisposed()) {
@@ -106,25 +109,26 @@
         // must be an IDnaObject
         if (element instanceof Server) {
             Status status = Activator.getDefault().getServerManager().ping((Server)element);
+            overlay = Utils.getOverlayImage(status);
+        } else if (element instanceof IFile) {
+            if (Utils.isPublished((IFile)element)) {
+                overlay = Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
+            }
+        }
 
-            if (status.isError()) {
-                ImageDescriptor overlay = Utils.getOverlayImage(status);
+        if (overlay != null) {
+            decoration.addOverlay(overlay);
+        }
 
-                if (overlay != null) {
-                    decoration.addOverlay(overlay);
+        display.asyncExec(new Runnable() {
+            @SuppressWarnings( "synthetic-access" )
+            @Override
+            public void run() {
+                if (!display.isDisposed()) {
+                    fireLabelProviderChanged(new LabelProviderChangedEvent(ServerContentProvider.this, element));
                 }
             }
-
-            display.asyncExec(new Runnable() {
-                @SuppressWarnings( "synthetic-access" )
-                @Override
-                public void run() {
-                    if (!display.isDisposed()) {
-                        fireLabelProviderChanged(new LabelProviderChangedEvent(ServerContentProvider.this, element));
-                    }
-                }
-            });
-        }
+        });
     }
 
     /**

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-24 17:01:51 UTC (rev 1171)
@@ -52,6 +52,7 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.Utils;
 
 /**
  * The <code>PublishJob</code> publishes or unpublishes one or more files using the {@link ServerManager}.
@@ -285,10 +286,20 @@
                     status = Activator.getDefault().getServerManager().publish(this.workspace,
                                                                                eclipseFile.getFullPath().toString(),
                                                                                file);
+
+                    // set persistent property on resource indicating it has been published
+                    if (!status.isError()) {
+                        Utils.addPublishedProperty(eclipseFile, workspace);
+                    }
                 } else {
                     status = Activator.getDefault().getServerManager().unpublish(this.workspace,
                                                                                  eclipseFile.getFullPath().toString(),
                                                                                  file);
+
+                    // clear persistent property on resource indicating it has been unpublished
+                    if (!status.isError()) {
+                        Utils.removePublishedProperty(eclipseFile, workspace);
+                    }
                 }
 
                 ++numProcessed;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-21 22:08:39 UTC (rev 1170)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-24 17:01:51 UTC (rev 1171)
@@ -654,8 +654,13 @@
      * @since 0.6
      */
     void handleServerModified() {
-        this.server = this.servers.get(this.cbxServer.getSelectionIndex());
+        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();
 
@@ -799,6 +804,9 @@
         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()) {


From dna-commits at lists.jboss.org  Mon Aug 24 14:50:21 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Mon, 24 Aug 2009 14:50:21 -0400
Subject: [dna-commits] DNA SVN: r1172 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt:
	src/org/jboss/dna/web/jcr/rest/client/swt and 1 other directory.
Message-ID: <200908241850.n7OIoLst029370@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-24 14:50:21 -0400 (Mon, 24 Aug 2009)
New Revision: 1172

Added:
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.png
Removed:
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.gif
Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
Log:
A new "published" overlay image.

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.gif
===================================================================
(Binary files differ)

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.png
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/published_overlay.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-24 17:01:51 UTC (rev 1171)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-24 18:50:21 UTC (rev 1172)
@@ -78,7 +78,7 @@
 
     String PUBLISH_IMAGE = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
 
-    String PUBLISHED_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "published_overlay.gif"; //$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$
 


From dna-commits at lists.jboss.org  Tue Aug 25 11:04:42 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Tue, 25 Aug 2009 11:04:42 -0400
Subject: [dna-commits] DNA SVN: r1173 - trunk/extensions/dna-sequencer-java.
Message-ID: <200908251504.n7PF4gJY007390@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-25 11:04:41 -0400 (Tue, 25 Aug 2009)
New Revision: 1173

Modified:
   trunk/extensions/dna-sequencer-java/pom.xml
Log:
DNA-502 Non-integration build does not succeed

The extensions/dna-sequencer-java/pom.xml file was change to remove the (unused and unnecessary) dependency on 'dna-integration-test'.  After doing this and clearing my local maven repository, the 'mvn clean install' command now builds successfully (as does 'mvn clean install -P integration').  This fix should resolve the issue.

Modified: trunk/extensions/dna-sequencer-java/pom.xml
===================================================================
--- trunk/extensions/dna-sequencer-java/pom.xml	2009-08-24 18:50:21 UTC (rev 1172)
+++ trunk/extensions/dna-sequencer-java/pom.xml	2009-08-25 15:04:41 UTC (rev 1173)
@@ -44,12 +44,6 @@
 			<type>test-jar</type>
 			<scope>test</scope>
 		</dependency>
-		<dependency>
-			<groupId>org.jboss.dna</groupId>
-			<artifactId>dna-integration-tests</artifactId>
-			<version>0.6-SNAPSHOT</version>
-			<scope>test</scope>
-		</dependency>
 		<!-- 
 			Testing (note the scope)
 		-->


From dna-commits at lists.jboss.org  Wed Aug 26 14:10:37 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 26 Aug 2009 14:10:37 -0400
Subject: [dna-commits] DNA SVN: r1174 - in trunk: dna-integration-tests and
	1 other directories.
Message-ID: <200908261810.n7QIAbCn004425@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-26 14:10:37 -0400 (Wed, 26 Aug 2009)
New Revision: 1174

Added:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ObservationBus.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/SimpleRepositoryContext.java
Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObserver.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObservers.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/NetChangeObserver.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/Observable.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/package-info.java
   trunk/dna-integration-tests/pom.xml
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java
   trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java
Log:
DNA-451 RepositoryService should dynamically keep its RepositorySource instances in sync with changes to the configuration repository

The RepositoryLibrary and RepositoryService classes were changed so that the RepositoryService now behaves as an Observer for changes to the content in the configuration source.  If the configuration content changes, RepositoryService attempts to update the RepositorySource instance(s) that correspond to the changed content.  Of course any removed content for a repository source causes the corresponding RepositorySource object to be removed.

RepositoryService does not own the RepositorySource for the configuration, so it cannot register as a listener on its own.  Instead, RepositoryService is now an Observer, it must be registered appropriately to receive the events; this is usually done by the code that owns the configuration RepositorySource.  In the case of DnaEngine, this was done by using a (new) ObservationBus class (which allows multiple observers on the bus, but the bus is itself an observer so that we have the multiplexing behavior) registered to receive events from the configuration RepositorySource, and to register RepositoryService as an observer on the bus.

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObserver.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObserver.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObserver.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -30,7 +30,7 @@
 
 /**
  * Abstract class that is used to signal that a change set has occurred. This class is typically subclassed by those that wish to
- * observe changes in content, and {@link Observable#register(ChangeObserver) registered} with a {@link Observable}.
+ * observe changes in content, and {@link Observable#register(Observer) registered} with a {@link Observable}.
  * <p>
  * This class maintains a (weak) reference to the ChangeSource instances with which it is registered. Therefore, the observers
  * will not keep a ChangeSource from being garbage collected. And, if a change source is garbage collected, calling
@@ -65,7 +65,7 @@
 
     /**
      * Unregister this listener from all {@link Observable sources} that it was registered with. This is preferred over calling
-     * {@link Observable#unregister(ChangeObserver)} directly.
+     * {@link Observable#unregister(Observer)} directly.
      */
     public void unregister() {
         doUnregister();

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObservers.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObservers.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ChangeObservers.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -46,11 +46,11 @@
     /**
      * {@inheritDoc}
      * 
-     * @see org.jboss.dna.graph.observe.Observable#register(org.jboss.dna.graph.observe.ChangeObserver)
+     * @see org.jboss.dna.graph.observe.Observable#register(org.jboss.dna.graph.observe.Observer)
      */
-    public boolean register( ChangeObserver observer ) {
+    public boolean register( Observer observer ) {
         if (observer != null && !shutdown.get() && observers.addIfAbsent(new ObserverReference(observer))) {
-            observer.registeredWith(this);
+            if (observer instanceof ChangeObserver) ((ChangeObserver)observer).registeredWith(this);
             return true;
         }
         return false;
@@ -59,11 +59,11 @@
     /**
      * {@inheritDoc}
      * 
-     * @see org.jboss.dna.graph.observe.Observable#unregister(org.jboss.dna.graph.observe.ChangeObserver)
+     * @see org.jboss.dna.graph.observe.Observable#unregister(org.jboss.dna.graph.observe.Observer)
      */
-    public boolean unregister( ChangeObserver observer ) {
+    public boolean unregister( Observer observer ) {
         if (observer != null && observers.remove(observer)) {
-            observer.unregisteredWith(this);
+            if (observer instanceof ChangeObserver) ((ChangeObserver)observer).unregisteredWith(this);
             return true;
         }
         return false;
@@ -79,7 +79,10 @@
             observers.clear();
             while (iter.hasNext()) {
                 ObserverReference reference = iter.next();
-                if (reference.get() != null) reference.get().unregisteredWith(this);
+                if (reference.get() != null) {
+                    Observer observer = reference.get();
+                    if (observer instanceof ChangeObserver) ((ChangeObserver)observer).unregisteredWith(this);
+                }
             }
         }
     }
@@ -102,7 +105,7 @@
     public void broadcast( Changes changes ) {
         CheckArg.isNotNull(changes, "changes");
         for (ObserverReference observerReference : observers) {
-            ChangeObserver observer = observerReference.get();
+            Observer observer = observerReference.get();
             if (observer == null) {
                 observers.remove(observerReference);
                 continue;
@@ -118,10 +121,10 @@
     /**
      * A {@link WeakReference} implementation that provides a valid
      */
-    protected final class ObserverReference extends WeakReference<ChangeObserver> {
+    protected final class ObserverReference extends WeakReference<Observer> {
         final int hc;
 
-        protected ObserverReference( ChangeObserver source ) {
+        protected ObserverReference( Observer source ) {
             super(source);
             this.hc = source.hashCode();
         }
@@ -146,12 +149,12 @@
             if (obj == this) return true;
             if (obj instanceof ObserverReference) {
                 ObserverReference that = (ObserverReference)obj;
-                ChangeObserver thisSource = this.get();
-                ChangeObserver thatSource = that.get();
+                Observer thisSource = this.get();
+                Observer thatSource = that.get();
                 return thisSource == thatSource; // reference equality, not object equality!
             }
-            if (obj instanceof ChangeObserver) {
-                ChangeObserver that = (ChangeObserver)obj;
+            if (obj instanceof Observer) {
+                Observer that = (Observer)obj;
                 return this.get() == that; // reference equality, not object equality!
             }
             return false;

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/NetChangeObserver.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/NetChangeObserver.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/NetChangeObserver.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -147,7 +147,7 @@
     /**
      * Method that is called for each net change.
      * 
-     * @param change
+     * @param change the net change; never null
      */
     protected abstract void notify( NetChange change );
 
@@ -228,13 +228,25 @@
             return this.hc;
         }
 
-        public boolean includesAll( ChangeType... jcrEventTypes ) {
+        /**
+         * Determine whether this net change includes all of the supplied types.
+         * 
+         * @param jcrEventTypes the types to check for
+         * @return true if all of the supplied events are included in this net change, or false otherwise
+         */
+        public boolean includesAllOf( ChangeType... jcrEventTypes ) {
             for (ChangeType jcrEventType : jcrEventTypes) {
                 if (!this.eventTypes.contains(jcrEventType)) return false;
             }
             return true;
         }
 
+        /**
+         * Determine whether this net change includes any of the supplied types.
+         * 
+         * @param jcrEventTypes the types to check for
+         * @return true if any of the supplied events are included in this net change, or false otherwise
+         */
         public boolean includes( ChangeType... jcrEventTypes ) {
             for (ChangeType jcrEventType : jcrEventTypes) {
                 if (this.eventTypes.contains(jcrEventType)) return true;
@@ -242,10 +254,6 @@
             return false;
         }
 
-        public boolean is( ChangeType jcrEventTypes ) {
-            return this.eventTypes.contains(jcrEventTypes);
-        }
-
         public boolean isSameNode( NetChange that ) {
             if (that == this) return true;
             if (this.hc != that.hc) return false;

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/Observable.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/Observable.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/Observable.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -39,7 +39,7 @@
      * @return true if the observer was added, or false if the observer was null, if the observer was already registered, or if
      *         the observer could not be added
      */
-    boolean register( ChangeObserver observer );
+    boolean register( Observer observer );
 
     /**
      * Unregister the supplied observer. This method does nothing if the observer reference is null.
@@ -48,6 +48,6 @@
      * @return true if the observer was removed, or false if the observer was null or if the observer was not registered on this
      *         source
      */
-    boolean unregister( ChangeObserver observer );
+    boolean unregister( Observer observer );
 
 }

Added: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ObservationBus.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ObservationBus.java	                        (rev 0)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ObservationBus.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -0,0 +1,81 @@
+/*
+ * 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.graph.observe;
+
+/**
+ * A simple {@link Observer} that is itself {@link Observable}. This class essentially multiplexes the events from a single
+ * Observable to disseminate each event to multiple Observers.
+ */
+public class ObservationBus implements Observable, Observer {
+    private final ChangeObservers observers = new ChangeObservers();
+
+    public ObservationBus() {
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.observe.Observable#register(org.jboss.dna.graph.observe.Observer)
+     */
+    public boolean register( Observer observer ) {
+        return observers.register(observer);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.observe.Observable#unregister(org.jboss.dna.graph.observe.Observer)
+     */
+    public boolean unregister( Observer observer ) {
+        return observers.unregister(observer);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.observe.Observer#notify(org.jboss.dna.graph.observe.Changes)
+     */
+    public void notify( Changes changes ) {
+        if (changes != null) {
+            // Broadcast the changes to the registered observers ...
+            observers.broadcast(changes);
+        }
+    }
+
+    /**
+     * Determine whether this particular bus currently has any observers.
+     * 
+     * @return true if there is at least one observer, or false otherwise
+     */
+    public boolean hasObservers() {
+        return !observers.isEmpty();
+    }
+
+    /**
+     * Unregister all registered observers, and mark this as no longer accepting new registered observers.
+     */
+    public void shutdown() {
+        observers.shutdown();
+    }
+}


Property changes on: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/ObservationBus.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/package-info.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/package-info.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/observe/package-info.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -48,7 +48,7 @@
  * <p>
  * Components that are to recieve notifications of changes are called <i>observers</i>.  To create an observer, simply extend 
  * the {@link ChangeObserver} abstract class and provide an implementation of the {@link ChangeObserver#notify(Changes)} method.
- * Then, register the observer with an {@link Observable} using its {@link Observable#register(ChangeObserver)} method.
+ * Then, register the observer with an {@link Observable} using its {@link Observable#register(Observer)} method.
  * The observer's {@link ChangeObserver#notify(Changes)} method will then be called with the changes that have
  * been made to the Observable.
  * </p>
@@ -56,7 +56,7 @@
  * it was registered.  The {@link ChangeObserver} class automatically tracks which {@link Observable} instances it is
  * registered with, and calling the observer's {@link ChangeObserver#unregister()} will unregister the observer from
  * all of these Observables.  Alternatively, an observer can be unregistered from a single Observable using the
- * Observable's {@link Observable#unregister(ChangeObserver)} method.
+ * Observable's {@link Observable#unregister(Observer)} method.
  * </p>
  * <h3>Changes</h3>
  * <p>

Modified: trunk/dna-integration-tests/pom.xml
===================================================================
--- trunk/dna-integration-tests/pom.xml	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-integration-tests/pom.xml	2009-08-26 18:10:37 UTC (rev 1174)
@@ -71,6 +71,12 @@
 		</dependency>
 		<dependency>
 			<groupId>org.jboss.dna</groupId>
+			<artifactId>dna-connector-filesystem</artifactId>
+			<version>${pom.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.dna</groupId>
 			<artifactId>dna-connector-infinispan</artifactId>
 			<version>${pom.version}</version>
 			<scope>test</scope>

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -46,12 +46,14 @@
 import org.jboss.dna.graph.Subgraph;
 import org.jboss.dna.graph.connector.RepositoryConnection;
 import org.jboss.dna.graph.connector.RepositoryConnectionFactory;
+import org.jboss.dna.graph.connector.RepositoryContext;
 import org.jboss.dna.graph.connector.RepositorySource;
 import org.jboss.dna.graph.connector.RepositorySourceException;
 import org.jboss.dna.graph.mimetype.ExtensionBasedMimeTypeDetector;
 import org.jboss.dna.graph.mimetype.MimeTypeDetector;
 import org.jboss.dna.graph.mimetype.MimeTypeDetectorConfig;
 import org.jboss.dna.graph.mimetype.MimeTypeDetectors;
+import org.jboss.dna.graph.observe.ObservationBus;
 import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.Path;
 import org.jboss.dna.graph.property.PathExpression;
@@ -102,12 +104,20 @@
         detectors.addDetector(new MimeTypeDetectorConfig("ExtensionDetector", "Extension-based MIME type detector",
                                                          ExtensionBasedMimeTypeDetector.class));
 
+        // Create the RepositoryContext that the configuration repository source should use ...
+        ObservationBus configurationChangeBus = new ObservationBus();
+        RepositoryContext configContext = new SimpleRepositoryContext(context, configurationChangeBus, null);
+        final RepositorySource configSource = this.configuration.getRepositorySource();
+        configSource.initialize(configContext);
+
         // Create the RepositoryService, pointing it to the configuration repository ...
         Path pathToConfigurationRoot = this.configuration.getPath();
         String configWorkspaceName = this.configuration.getWorkspace();
-        final RepositorySource configSource = this.configuration.getRepositorySource();
         repositoryService = new RepositoryService(configSource, configWorkspaceName, pathToConfigurationRoot, context, problems);
 
+        // Now register the repository service to be notified of changes to the configuration ...
+        configurationChangeBus.register(repositoryService);
+
         // Create the sequencing service ...
         executorService = new ScheduledThreadPoolExecutor(10); // Use a magic number for now
         sequencingService = new SequencingService();

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -25,11 +25,11 @@
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -43,10 +43,8 @@
 import org.jboss.dna.graph.connector.RepositoryConnectionPool;
 import org.jboss.dna.graph.connector.RepositoryContext;
 import org.jboss.dna.graph.connector.RepositorySource;
-import org.jboss.dna.graph.observe.ChangeObserver;
-import org.jboss.dna.graph.observe.ChangeObservers;
-import org.jboss.dna.graph.observe.Changes;
 import org.jboss.dna.graph.observe.Observable;
+import org.jboss.dna.graph.observe.ObservationBus;
 import org.jboss.dna.graph.observe.Observer;
 import org.jboss.dna.graph.property.Path;
 import org.jboss.dna.repository.service.AbstractServiceAdministrator;
@@ -110,10 +108,10 @@
 
     private final ServiceAdministrator administrator = new Administrator();
     private final ReadWriteLock sourcesLock = new ReentrantReadWriteLock();
-    private final CopyOnWriteArrayList<RepositoryConnectionPool> pools = new CopyOnWriteArrayList<RepositoryConnectionPool>();
+    private final Map<String, RepositoryConnectionPool> pools = new HashMap<String, RepositoryConnectionPool>();
     private RepositoryConnectionFactory delegate;
     private final ExecutionContext executionContext;
-    private final ObservationBus observationBus = new InMemoryObservationBus();
+    private final ObservationBus observationBus = new ObservationBus();
     private final RepositorySource configurationSource;
     private final String configurationWorkspaceName;
     private final Path pathToConfigurationRoot;
@@ -167,19 +165,26 @@
 
     /**
      * {@inheritDoc}
+     * <p>
+     * This can be used to register observers for all of the repository sources managed by this library. The supplied observer
+     * will receive all of the changes originating from these sources.
+     * </p>
      * 
-     * @see org.jboss.dna.graph.observe.Observable#register(org.jboss.dna.graph.observe.ChangeObserver)
+     * @see org.jboss.dna.graph.observe.Observable#register(org.jboss.dna.graph.observe.Observer)
      */
-    public boolean register( ChangeObserver observer ) {
+    public boolean register( Observer observer ) {
         return observationBus.register(observer);
     }
 
     /**
      * {@inheritDoc}
+     * <p>
+     * This can be used to unregister observers for all of the repository sources managed by this library.
+     * </p>
      * 
-     * @see org.jboss.dna.graph.observe.Observable#unregister(org.jboss.dna.graph.observe.ChangeObserver)
+     * @see org.jboss.dna.graph.observe.Observable#unregister(org.jboss.dna.graph.observe.Observer)
      */
-    public boolean unregister( ChangeObserver observer ) {
+    public boolean unregister( Observer observer ) {
         return observationBus.unregister(observer);
     }
 
@@ -212,7 +217,7 @@
         // Close all connections to the pools. This is done inside the pools write lock.
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool pool : this.pools) {
+            for (RepositoryConnectionPool pool : this.pools.values()) {
                 pool.shutdown();
             }
         } finally {
@@ -236,7 +241,7 @@
         // Check whether all source pools are shut down. This is done inside the pools write lock.
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool pool : this.pools) {
+            for (RepositoryConnectionPool pool : this.pools.values()) {
                 if (!pool.awaitTermination(timeout, unit)) return false;
             }
             return true;
@@ -258,7 +263,7 @@
     public boolean isTerminating() {
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool pool : this.pools) {
+            for (RepositoryConnectionPool pool : this.pools.values()) {
                 if (pool.isTerminating()) return true;
             }
             return false;
@@ -276,7 +281,7 @@
     public boolean isTerminated() {
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool pool : this.pools) {
+            for (RepositoryConnectionPool pool : this.pools.values()) {
                 if (!pool.isTerminated()) return false;
             }
             return true;
@@ -291,11 +296,12 @@
      * @return the pools
      */
     public Collection<String> getSourceNames() {
-        Set<String> sourceNames = new HashSet<String>();
-        for (RepositoryConnectionPool pool : this.pools) {
-            sourceNames.add(pool.getRepositorySource().getName());
+        try {
+            this.sourcesLock.readLock().lock();
+            return Collections.unmodifiableCollection(new HashSet<String>(this.pools.keySet()));
+        } finally {
+            this.sourcesLock.readLock().unlock();
         }
-        return Collections.unmodifiableCollection(sourceNames);
     }
 
     /**
@@ -305,10 +311,15 @@
      */
     public Collection<RepositorySource> getSources() {
         List<RepositorySource> sources = new LinkedList<RepositorySource>();
-        for (RepositoryConnectionPool pool : this.pools) {
-            sources.add(pool.getRepositorySource());
+        try {
+            this.sourcesLock.readLock().lock();
+            for (RepositoryConnectionPool pool : this.pools.values()) {
+                sources.add(pool.getRepositorySource());
+            }
+            return Collections.unmodifiableCollection(sources);
+        } finally {
+            this.sourcesLock.readLock().unlock();
         }
-        return Collections.unmodifiableCollection(sources);
     }
 
     /**
@@ -320,14 +331,11 @@
     public RepositorySource getSource( String sourceName ) {
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool existingPool : this.pools) {
-                RepositorySource source = existingPool.getRepositorySource();
-                if (source.getName().equals(sourceName)) return source;
-            }
+            RepositoryConnectionPool existingPool = this.pools.get(sourceName);
+            return existingPool == null ? null : existingPool.getRepositorySource();
         } finally {
             this.sourcesLock.readLock().unlock();
         }
-        return null;
     }
 
     /**
@@ -339,14 +347,10 @@
     public RepositoryConnectionPool getConnectionPool( String sourceName ) {
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool existingPool : this.pools) {
-                RepositorySource source = existingPool.getRepositorySource();
-                if (source.getName().equals(sourceName)) return existingPool;
-            }
+            return this.pools.get(sourceName);
         } finally {
             this.sourcesLock.readLock().unlock();
         }
-        return null;
     }
 
     /**
@@ -357,68 +361,99 @@
      *         supplied name.
      */
     public boolean addSource( RepositorySource source ) {
+        return addSource(source, false);
+    }
+
+    /**
+     * Add the supplied federated source. This method returns false if the source is null.
+     * <p>
+     * If a source with the same name already exists, it will be replaced only if <code>replaceIfExisting</code> is true. If this
+     * is the case, then the existing source will be removed from the connection pool, and that pool will be
+     * {@link RepositoryConnectionPool#shutdown() shutdown} (allowing any in-use connections to be used and finished normally).
+     * </p>
+     * 
+     * @param source the source to add
+     * @param replaceIfExisting true if an existing source should be replaced, or false if this method should return false if
+     *        there is already an existing source with the supplied name.
+     * @return true if the source is added, or false if the reference is null or if there is already an existing source with the
+     *         supplied name.
+     */
+    public boolean addSource( RepositorySource source,
+                              boolean replaceIfExisting ) {
         if (source == null) return false;
-        try {
-            this.sourcesLock.writeLock().lock();
-            final String sourceName = source.getName();
-            for (RepositoryConnectionPool existingPool : this.pools) {
-                if (existingPool.getRepositorySource().getName().equals(sourceName)) return false;
+        final String sourceName = source.getName();
+        if (!replaceIfExisting) {
+            // Don't want to replace existing, so make sure there isn't one already ...
+            try {
+                this.sourcesLock.readLock().lock();
+                if (this.pools.containsKey(sourceName)) return false;
+            } finally {
+                this.sourcesLock.readLock().unlock();
             }
-            // Create a repository context for this source ...
-            final ObservationBus observationBus = this.observationBus;
-            RepositoryContext repositoryContext = new RepositoryContext() {
-                /**
-                 * {@inheritDoc}
-                 * 
-                 * @see org.jboss.dna.graph.connector.RepositoryContext#getExecutionContext()
-                 */
-                public ExecutionContext getExecutionContext() {
-                    return RepositoryLibrary.this.getExecutionContext();
-                }
+        }
+        // Create a repository context for this source ...
+        final ObservationBus observationBus = this.observationBus;
+        RepositoryContext repositoryContext = new RepositoryContext() {
+            /**
+             * {@inheritDoc}
+             * 
+             * @see org.jboss.dna.graph.connector.RepositoryContext#getExecutionContext()
+             */
+            public ExecutionContext getExecutionContext() {
+                return RepositoryLibrary.this.getExecutionContext();
+            }
 
-                /**
-                 * {@inheritDoc}
-                 * 
-                 * @see org.jboss.dna.graph.connector.RepositoryContext#getRepositoryConnectionFactory()
-                 */
-                public RepositoryConnectionFactory getRepositoryConnectionFactory() {
-                    return RepositoryLibrary.this;
-                }
+            /**
+             * {@inheritDoc}
+             * 
+             * @see org.jboss.dna.graph.connector.RepositoryContext#getRepositoryConnectionFactory()
+             */
+            public RepositoryConnectionFactory getRepositoryConnectionFactory() {
+                return RepositoryLibrary.this;
+            }
 
-                /**
-                 * {@inheritDoc}
-                 * 
-                 * @see org.jboss.dna.graph.connector.RepositoryContext#getObserver()
-                 */
-                public Observer getObserver() {
-                    return observationBus.hasObservers() ? observationBus : null;
-                }
+            /**
+             * {@inheritDoc}
+             * 
+             * @see org.jboss.dna.graph.connector.RepositoryContext#getObserver()
+             */
+            public Observer getObserver() {
+                return observationBus.hasObservers() ? observationBus : null;
+            }
 
-                /**
-                 * {@inheritDoc}
-                 * 
-                 * @see org.jboss.dna.graph.connector.RepositoryContext#getConfiguration(int)
-                 */
-                public Subgraph getConfiguration( int depth ) {
-                    Subgraph result = null;
-                    RepositorySource configSource = getConfigurationSource();
-                    if (configSource != null) {
-                        Graph config = Graph.create(configSource, getExecutionContext());
-                        String workspaceName = getConfigurationWorkspaceName();
-                        if (workspaceName != null) {
-                            config.useWorkspace(workspaceName);
-                        }
-                        Path configPath = getPathToConfigurationRoot();
-                        Path sourcePath = getExecutionContext().getValueFactories().getPathFactory().create(configPath,
-                                                                                                            sourceName);
-                        result = config.getSubgraphOfDepth(depth).at(sourcePath);
+            /**
+             * {@inheritDoc}
+             * 
+             * @see org.jboss.dna.graph.connector.RepositoryContext#getConfiguration(int)
+             */
+            public Subgraph getConfiguration( int depth ) {
+                Subgraph result = null;
+                RepositorySource configSource = getConfigurationSource();
+                if (configSource != null) {
+                    Graph config = Graph.create(configSource, getExecutionContext());
+                    String workspaceName = getConfigurationWorkspaceName();
+                    if (workspaceName != null) {
+                        config.useWorkspace(workspaceName);
                     }
-                    return result;
+                    Path configPath = getPathToConfigurationRoot();
+                    Path sourcePath = getExecutionContext().getValueFactories().getPathFactory().create(configPath, sourceName);
+                    result = config.getSubgraphOfDepth(depth).at(sourcePath);
                 }
-            };
-            source.initialize(repositoryContext);
-            RepositoryConnectionPool pool = new RepositoryConnectionPool(source);
-            this.pools.add(pool);
+                return result;
+            }
+        };
+        // Do this before we remove the existing pool ...
+        source.initialize(repositoryContext);
+        RepositoryConnectionPool pool = new RepositoryConnectionPool(source);
+        try {
+            this.sourcesLock.writeLock().lock();
+            // Need to first remove any existing one ...
+            RepositoryConnectionPool existingPool = this.pools.remove(sourceName);
+            if (existingPool != null) {
+                // Then shut down the source gracefully (and don't wait) ...
+                existingPool.shutdown();
+            }
+            this.pools.put(sourceName, pool);
             return true;
         } finally {
             this.sourcesLock.writeLock().unlock();
@@ -450,6 +485,32 @@
     /**
      * Remove from this federated repository the source with the supplied name. This call shuts down the connections in the source
      * in an orderly fashion, allowing those connection currently in use to be used and closed normally, but preventing further
+     * connections from being used. However, this method never waits until the connections are all closed, and is equivalent to
+     * calling <code>removeSource(name,0,TimeUnit.SECONDS)</code>.
+     * 
+     * @param name the name of the source to be removed
+     * @return the source with the supplied name that was removed, or null if no existing source matching the supplied name could
+     *         be found
+     * @see #removeSource(String, long, TimeUnit)
+     */
+    public RepositorySource removeSource( String name ) {
+        try {
+            this.sourcesLock.writeLock().lock();
+            RepositoryConnectionPool existingPool = this.pools.remove(name);
+            if (existingPool != null) {
+                // Then shut down the source gracefully (and don't wait) ...
+                existingPool.shutdown();
+                return existingPool.getRepositorySource();
+            }
+        } finally {
+            this.sourcesLock.writeLock().unlock();
+        }
+        return null;
+    }
+
+    /**
+     * Remove from this federated repository the source with the supplied name. This call shuts down the connections in the source
+     * in an orderly fashion, allowing those connection currently in use to be used and closed normally, but preventing further
      * connections from being used.
      * 
      * @param name the name of the source to be removed
@@ -459,18 +520,18 @@
      * @return the source with the supplied name that was removed, or null if no existing source matching the supplied name could
      *         be found
      * @throws InterruptedException if the thread is interrupted while awaiting closing of the connections
+     * @see #removeSource(String)
      */
     public RepositorySource removeSource( String name,
                                           long timeToAwait,
                                           TimeUnit unit ) throws InterruptedException {
         try {
             this.sourcesLock.writeLock().lock();
-            for (RepositoryConnectionPool existingPool : this.pools) {
-                if (existingPool.getRepositorySource().getName().equals(name)) {
-                    // Shut down the source ...
-                    existingPool.shutdown();
-                    if (timeToAwait > 0L) existingPool.awaitTermination(timeToAwait, unit);
-                }
+            RepositoryConnectionPool existingPool = this.pools.remove(name);
+            if (existingPool != null) {
+                // Then shut down the source gracefully (and don't wait) ...
+                existingPool.shutdown();
+                if (timeToAwait > 0L) existingPool.awaitTermination(timeToAwait, unit);
                 return existingPool.getRepositorySource();
             }
         } finally {
@@ -487,10 +548,8 @@
     public RepositoryConnection createConnection( String sourceName ) {
         try {
             this.sourcesLock.readLock().lock();
-            for (RepositoryConnectionPool existingPool : this.pools) {
-                RepositorySource source = existingPool.getRepositorySource();
-                if (source.getName().equals(sourceName)) return existingPool.getConnection();
-            }
+            RepositoryConnectionPool existingPool = this.pools.get(sourceName);
+            if (existingPool != null) return existingPool.getConnection();
             RepositoryConnectionFactory delegate = this.delegate;
             if (delegate != null) {
                 return delegate.createConnection(sourceName);
@@ -500,65 +559,4 @@
         }
         return null;
     }
-
-    protected interface ObservationBus extends Observable, Observer {
-        boolean hasObservers();
-
-        void shutdown();
-    }
-
-    protected class InMemoryObservationBus implements ObservationBus {
-        private final ChangeObservers observers = new ChangeObservers();
-
-        protected InMemoryObservationBus() {
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.jboss.dna.graph.observe.Observable#register(org.jboss.dna.graph.observe.ChangeObserver)
-         */
-        public boolean register( ChangeObserver observer ) {
-            return observers.register(observer);
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.jboss.dna.graph.observe.Observable#unregister(org.jboss.dna.graph.observe.ChangeObserver)
-         */
-        public boolean unregister( ChangeObserver observer ) {
-            return observers.unregister(observer);
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.jboss.dna.graph.observe.Observer#notify(org.jboss.dna.graph.observe.Changes)
-         */
-        public void notify( Changes changes ) {
-            if (changes != null) {
-                // Broadcast the changes to the registered observers ...
-                observers.broadcast(changes);
-            }
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.jboss.dna.repository.RepositoryLibrary.ObservationBus#hasObservers()
-         */
-        public boolean hasObservers() {
-            return !observers.isEmpty();
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.jboss.dna.repository.RepositoryLibrary.ObservationBus#shutdown()
-         */
-        public void shutdown() {
-            observers.shutdown();
-        }
-    }
 }

Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java	2009-08-25 15:04:41 UTC (rev 1173)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -42,6 +42,9 @@
 import org.jboss.dna.graph.Node;
 import org.jboss.dna.graph.Subgraph;
 import org.jboss.dna.graph.connector.RepositorySource;
+import org.jboss.dna.graph.observe.Changes;
+import org.jboss.dna.graph.observe.NetChangeObserver;
+import org.jboss.dna.graph.observe.Observer;
 import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.Path;
 import org.jboss.dna.graph.property.PathFactory;
@@ -58,7 +61,7 @@
  * @author Randall Hauch
  */
 @ThreadSafe
-public class RepositoryService implements AdministeredService {
+public class RepositoryService implements AdministeredService, Observer {
 
     /**
      * The administrative component for this service.
@@ -104,6 +107,7 @@
     private final String configurationSourceName;
     private final String configurationWorkspaceName;
     private final Path pathToConfigurationRoot;
+    private final ConfigurationChangeObserver configurationChangeObserver;
     private final Administrator administrator = new Administrator();
     private final AtomicBoolean started = new AtomicBoolean(false);
     /** The problem sink used when encountering problems while starting repositories */
@@ -141,26 +145,27 @@
         this.configurationWorkspaceName = configurationWorkspaceName;
         this.context = context;
         this.problems = problems;
+        this.configurationChangeObserver = new ConfigurationChangeObserver();
     }
 
     /**
      * {@inheritDoc}
      */
-    public ServiceAdministrator getAdministrator() {
+    public final ServiceAdministrator getAdministrator() {
         return this.administrator;
     }
 
     /**
      * @return configurationSourceName
      */
-    public String getConfigurationSourceName() {
+    public final String getConfigurationSourceName() {
         return configurationSourceName;
     }
 
     /**
      * @return configurationWorkspaceName
      */
-    public String getConfigurationWorkspaceName() {
+    public final String getConfigurationWorkspaceName() {
         return configurationWorkspaceName;
     }
 
@@ -169,14 +174,21 @@
      * 
      * @return the RepositorySource library; never null
      */
-    public RepositoryLibrary getRepositoryLibrary() {
+    public final RepositoryLibrary getRepositoryLibrary() {
         return sources;
     }
 
     /**
+     * @return pathToConfigurationRoot
+     */
+    protected final Path getPathToConfigurationRoot() {
+        return pathToConfigurationRoot;
+    }
+
+    /**
      * @return env
      */
-    public ExecutionContext getExecutionEnvironment() {
+    public final ExecutionContext getExecutionEnvironment() {
         return context;
     }
 
@@ -186,7 +198,7 @@
     }
 
     protected synchronized void startService() {
-        if (this.started.get() == false) {            
+        if (this.started.get() == false) {
             // ------------------------------------------------------------------------------------
             // Read the configuration ...
             // ------------------------------------------------------------------------------------
@@ -211,7 +223,7 @@
             } catch (Throwable err) {
                 throw new FederationException(RepositoryI18n.errorStartingRepositoryService.text(), err);
             }
-            
+
             this.started.set(true);
         }
     }
@@ -404,4 +416,58 @@
         if (obj == this) return true;
         return false;
     }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.observe.Observer#notify(org.jboss.dna.graph.observe.Changes)
+     */
+    public void notify( Changes changes ) {
+        // Forward the changes to the net change observer ...
+        this.configurationChangeObserver.notify(changes);
+    }
+
+    protected class ConfigurationChangeObserver extends NetChangeObserver {
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.jboss.dna.graph.observe.NetChangeObserver#notify(org.jboss.dna.graph.observe.NetChangeObserver.NetChange)
+         */
+        @Override
+        protected void notify( NetChange change ) {
+            if (!getConfigurationSourceName().equals(change.getRepositorySourceName())) return;
+            if (!getConfigurationWorkspaceName().equals(change.getRepositoryWorkspaceName())) return;
+            Path changedPath = change.getPath();
+            Path configPath = getPathToConfigurationRoot();
+            if (!changedPath.isAtOrBelow(getPathToConfigurationRoot())) return;
+            boolean changedNodeIsPotentiallySource = configPath.size() + 1 == changedPath.size();
+
+            // At this point, we know that something inside the configuration changed, so figure out what happened ...
+            if (changedNodeIsPotentiallySource && change.includes(ChangeType.NODE_REMOVED)) {
+                // Then potentially a source with the supplied name has been removed ...
+                String sourceName = changedPath.getLastSegment().getName().getLocalName();
+                getRepositoryLibrary().removeSource(sourceName);
+            } else {
+                // The add/change/remove is either at or below a source, so try to create a new source for it ...
+                Path sourcePath = changedNodeIsPotentiallySource ? changedPath : changedPath.subpath(0, configPath.size() + 1);
+                Problems problems = new SimpleProblems();
+                // Now read the node and create the source ...
+                Graph graph = Graph.create(getConfigurationSourceName(), getRepositoryLibrary(), getExecutionEnvironment());
+                try {
+                    String workspaceName = getConfigurationWorkspaceName();
+                    if (workspaceName != null) graph.useWorkspace(workspaceName);
+                    Map<Name, Property> properties = graph.getPropertiesByName().on(sourcePath);
+                    RepositorySource source = createRepositorySource(sourcePath, properties, problems);
+                    if (source != null) {
+                        // It was the config for a source, so try to add or replace an existing source ...
+                        getRepositoryLibrary().addSource(source, true);
+                    }
+                } catch (PathNotFoundException e) {
+                    // No source was found, and this is okay (since it may just been deleted)...
+                    String sourceName = changedPath.getLastSegment().getName().getLocalName();
+                    getRepositoryLibrary().removeSource(sourceName);
+                }
+            }
+        }
+    }
 }

Added: trunk/dna-repository/src/main/java/org/jboss/dna/repository/SimpleRepositoryContext.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/SimpleRepositoryContext.java	                        (rev 0)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/SimpleRepositoryContext.java	2009-08-26 18:10:37 UTC (rev 1174)
@@ -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.repository;
+
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.graph.ExecutionContext;
+import org.jboss.dna.graph.Subgraph;
+import org.jboss.dna.graph.connector.RepositoryConnectionFactory;
+import org.jboss.dna.graph.connector.RepositoryContext;
+import org.jboss.dna.graph.observe.Observer;
+
+/**
+ * A simple, immutable {@link RepositoryContext} implementation that uses the references supplied as parameters to the
+ * constructor.
+ */
+ at Immutable
+public class SimpleRepositoryContext implements RepositoryContext {
+
+    private final ExecutionContext context;
+    private final Observer observer;
+    private final RepositoryConnectionFactory connectionFactory;
+
+    public SimpleRepositoryContext( ExecutionContext context,
+                                    Observer observer,
+                                    RepositoryConnectionFactory connectionFactory ) {
+        this.context = context;
+        this.observer = observer;
+        this.connectionFactory = connectionFactory;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.connector.RepositoryContext#getConfiguration(int)
+     */
+    public Subgraph getConfiguration( int depth ) {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.connector.RepositoryContext#getExecutionContext()
+     */
+    public ExecutionContext getExecutionContext() {
+        return context;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.connector.RepositoryContext#getObserver()
+     */
+    public Observer getObserver() {
+        return observer;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.connector.RepositoryContext#getRepositoryConnectionFactory()
+     */
+    public RepositoryConnectionFactory getRepositoryConnectionFactory() {
+        return connectionFactory;
+    }
+
+}


Property changes on: trunk/dna-repository/src/main/java/org/jboss/dna/repository/SimpleRepositoryContext.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF


From dna-commits at lists.jboss.org  Wed Aug 26 16:43:46 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 26 Aug 2009 16:43:46 -0400
Subject: [dna-commits] DNA SVN: r1175 - in trunk:
	dna-graph/src/main/java/org/jboss/dna/graph/property/basic
	and 6 other directories.
Message-ID: <200908262043.n7QKhk0E002390@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-26 16:43:45 -0400 (Wed, 26 Aug 2009)
New Revision: 1175

Added:
   trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java
   trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNIntegrationTest.java
Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/Path.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/AbstractPath.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/RootPath.java
   trunk/dna-integration-tests/pom.xml
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
   trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java
   trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java
   trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java
   trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java
Log:
DNA-505 Svn Repository Source with NPE and other issues while opening connection through Jcr
DNA-240 code test case for SVNRepositoryConnection used for connection

One of the NPE issues (DNA-505) was more easily fixed by returning an empty collection; the other was fixed as prescribed in the patch (though there was another situation that required a similar change).  A test case was added to the 'dna-connector-svn' project to test using the DNA SVN repository, and this made apparent several other issues.  First, the children for a directory were being computed incorrectly; all of the child directories were fine, but the locations of the nt:file nodes were being skipped and instead the path to the nt:file's jcr:content child node were being returned.  Second, much of the JCR implementation relies upon ReadNodeRequest instead of the ReadAllPropertiesRequest and ReadAllChildrenRequest.  Although the default implementation for ReadNodeRequest uses the other two and is technically correct, it can be quite inefficient, and this was definitely true for the SVN connector.  Therefore, the request processor code was refactored to have a single me!
 thod compute the children and/or the properties for a node.  This not only dramatically reduced the class size, but it dramatically reduced the amount of duplicated code, and it appears to have slightly improved performance (though I think the SVNKit is still the bottleneck).

Finally, a new integration test was added to the 'dna-integration-test' project that very minimally tests using JCR on top of the SVN connector.  This may need to be rounded out in the future, but ideally we wouldn't be hitting a remote SVN repository (simply because of the latency issue).

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/Path.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/Path.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/Path.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -398,6 +398,25 @@
     public Segment getLastSegment();
 
     /**
+     * Determine if the path's {@link #getLastSegment()} has the supplied name and no {@link Segment#getIndex() SNS index}.
+     * 
+     * @param nameOfLastSegment the name
+     * @return return true if the supplied name is the name in the path's last segment (and there is no SNS index), or false
+     *         otherwise
+     */
+    public boolean endsWith( Name nameOfLastSegment );
+
+    /**
+     * Determine if the path's {@link #getLastSegment()} has the supplied name and {@link Segment#getIndex() SNS index}.
+     * 
+     * @param nameOfLastSegment the name
+     * @param snsIndex the SNS index
+     * @return return true if the path's last segment has the supplied name and SNS, or false otherwise
+     */
+    public boolean endsWith( Name nameOfLastSegment,
+                             int snsIndex );
+
+    /**
      * Get the segment at the supplied index.
      * 
      * @param index the index

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/AbstractPath.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/AbstractPath.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/AbstractPath.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -35,6 +35,7 @@
 import org.jboss.dna.common.util.CheckArg;
 import org.jboss.dna.graph.GraphI18n;
 import org.jboss.dna.graph.property.InvalidPathException;
+import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.NamespaceRegistry;
 import org.jboss.dna.graph.property.Path;
 
@@ -187,6 +188,27 @@
     /**
      * {@inheritDoc}
      * 
+     * @see org.jboss.dna.graph.property.Path#endsWith(org.jboss.dna.graph.property.Name)
+     */
+    public boolean endsWith( Name nameOfLastSegment ) {
+        Segment segment = getLastSegment();
+        return segment != null && segment.getName().equals(nameOfLastSegment) && !segment.hasIndex();
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.property.Path#endsWith(org.jboss.dna.graph.property.Name, int)
+     */
+    public boolean endsWith( Name nameOfLastSegment,
+                             int snsIndex ) {
+        Segment segment = getLastSegment();
+        return segment != null && segment.getName().equals(nameOfLastSegment) && segment.getIndex() == snsIndex;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
      * @see org.jboss.dna.graph.property.Path#getParent()
      */
     public Path getParent() {

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/RootPath.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/RootPath.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/basic/RootPath.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -32,6 +32,7 @@
 import org.jboss.dna.common.util.CheckArg;
 import org.jboss.dna.graph.GraphI18n;
 import org.jboss.dna.graph.property.InvalidPathException;
+import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.NamespaceRegistry;
 import org.jboss.dna.graph.property.Path;
 
@@ -114,6 +115,27 @@
     /**
      * {@inheritDoc}
      * 
+     * @see org.jboss.dna.graph.property.basic.AbstractPath#endsWith(org.jboss.dna.graph.property.Name)
+     */
+    @Override
+    public boolean endsWith( Name nameOfLastSegment ) {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.property.basic.AbstractPath#endsWith(org.jboss.dna.graph.property.Name, int)
+     */
+    @Override
+    public boolean endsWith( Name nameOfLastSegment,
+                             int snsIndex ) {
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
      * @see org.jboss.dna.graph.property.Path#getNormalizedPath()
      */
     @Override

Modified: trunk/dna-integration-tests/pom.xml
===================================================================
--- trunk/dna-integration-tests/pom.xml	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-integration-tests/pom.xml	2009-08-26 20:43:45 UTC (rev 1175)
@@ -81,6 +81,12 @@
 			<version>${pom.version}</version>
 			<scope>test</scope>
 		</dependency>
+        <dependency>
+            <groupId>org.jboss.dna</groupId>
+            <artifactId>dna-connector-svn</artifactId>
+            <version>${pom.version}</version>
+            <scope>test</scope>
+        </dependency>
 
 		<!-- 
           JPA Connector Dependencies

Added: trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java
===================================================================
--- trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java	                        (rev 0)
+++ trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -0,0 +1,122 @@
+/*
+ * 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.test.integration;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import javax.jcr.NodeIterator;
+import javax.jcr.Session;
+import org.jboss.dna.connector.svn.SVNRepositorySource;
+import org.jboss.dna.graph.SecurityContext;
+import org.jboss.dna.jcr.JcrConfiguration;
+import org.jboss.dna.jcr.JcrEngine;
+import org.jboss.dna.jcr.SecurityContextCredentials;
+import org.jboss.dna.jcr.JcrRepository.Option;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class SvnAndJcrIntegrationTest {
+    private JcrEngine engine;
+    private Session session;
+
+    @Before
+    public void beforeEach() throws Exception {
+        final String repositoryUrl = "http://anonsvn.jboss.org/repos/dna/";
+        final String[] predefinedWorkspaceNames = {repositoryUrl + "trunk", repositoryUrl + "tags", repositoryUrl + "branches"};
+        final String svnRepositorySource = "svnRepositorySource";
+        final String repositoryName = "svnRepository";
+        final JcrConfiguration configuration = new JcrConfiguration();
+        configuration.repositorySource(svnRepositorySource)
+                     .usingClass(SVNRepositorySource.class)
+                     .setProperty("password", "")
+                     .setProperty("username", "anonymous")
+                     .setProperty("repositoryRootURL", repositoryUrl)
+                     .setProperty("predefinedWorkspaceNames", predefinedWorkspaceNames)
+                     .setProperty("directoryForDefaultWorkspace", predefinedWorkspaceNames[0])
+                     .setProperty("creatingWorkspacesAllowed", false);
+
+        configuration.repository(repositoryName).setSource(svnRepositorySource).setOption(Option.READ_DEPTH, "1");
+        configuration.save();
+        this.engine = configuration.build();
+        this.engine.start();
+
+        this.session = this.engine.getRepository(repositoryName)
+                                  .login(new SecurityContextCredentials(new MyCustomSecurityContext()));
+
+    }
+
+    @After
+    public void afterEach() throws Exception {
+        if (this.session != null) {
+            this.session.logout();
+        }
+        if (this.engine != null) {
+            this.engine.shutdown();
+        }
+    }
+
+    @Test
+    public void shouldIterateOverChildrenOfRoot() throws Exception {
+        NodeIterator nodeIterator = this.session.getRootNode().getNodes();
+
+        while (nodeIterator.hasNext()) {
+            System.out.println(nodeIterator.nextNode().getPath());
+        }
+        assertThat(this.session.getRootNode().getNode("dna-graph"), is(notNullValue()));
+    }
+
+    protected class MyCustomSecurityContext implements SecurityContext {
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.jboss.dna.graph.SecurityContext#getUserName()
+         */
+        public String getUserName() {
+            return "Fred";
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.jboss.dna.graph.SecurityContext#hasRole(java.lang.String)
+         */
+        public boolean hasRole( String roleName ) {
+            return true;
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.jboss.dna.graph.SecurityContext#logout()
+         */
+        public void logout() {
+            // do something
+        }
+    }
+}


Property changes on: trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrRepository.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -132,9 +132,14 @@
          * Also, any use of the '@' character in source and workspace names must be escaped with a preceding backslash.
          * </p>
          */
-        SYSTEM_SOURCE_NAME;
+        SYSTEM_SOURCE_NAME,
 
         /**
+         * The depth of the subgraphs that should be loaded the connectors. The default value is 1.
+         */
+        READ_DEPTH;
+
+        /**
          * Determine the option given the option name. This does more than {@link Option#valueOf(String)}, since this method first
          * tries to match the supplied string to the option's {@link Option#name() name}, then the uppercase version of the
          * supplied string to the option's name, and finally if the supplied string is a camel-case version of the name (e.g.,
@@ -176,6 +181,11 @@
          * The default value for the {@link Option#JAAS_LOGIN_CONFIG_NAME} option is {@value} .
          */
         public static final String JAAS_LOGIN_CONFIG_NAME = "dna-jcr";
+
+        /**
+         * The default value for the {@link Option#READ_DEPTH} option is {@value} .
+         */
+        public static final String READ_DEPTH = "1";
     }
 
     /**
@@ -188,6 +198,7 @@
         EnumMap<Option, String> defaults = new EnumMap<Option, String>(Option.class);
         defaults.put(Option.PROJECT_NODE_TYPES, DefaultOption.PROJECT_NODE_TYPES);
         defaults.put(Option.JAAS_LOGIN_CONFIG_NAME, DefaultOption.JAAS_LOGIN_CONFIG_NAME);
+        defaults.put(Option.READ_DEPTH, DefaultOption.READ_DEPTH);
         DEFAULT_OPTIONS = Collections.<Option, String>unmodifiableMap(defaults);
     }
 

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -76,6 +76,7 @@
 import org.jboss.dna.graph.session.GraphSession.NodeId;
 import org.jboss.dna.graph.session.GraphSession.PropertyInfo;
 import org.jboss.dna.graph.session.GraphSession.Status;
+import org.jboss.dna.jcr.JcrRepository.Option;
 
 /**
  * The class that manages the session's information that has been locally-cached after reading from the underlying {@link Graph
@@ -172,6 +173,12 @@
         // Create the graph session, customized for JCR ...
         this.graphSession = new GraphSession<JcrNodePayload, JcrPropertyPayload>(this.store, this.workspaceName,
                                                                                  new JcrNodeOperations(), new JcrAuthorizer());
+        // Set the read-depth if we can...
+        try {
+            int depth = Integer.parseInt(session.repository().getOptions().get(Option.READ_DEPTH));
+            if (depth > 0) this.graphSession.setDepthForLoadingNodes(depth);
+        } catch (RuntimeException e) {
+        }
     }
 
     final GraphSession<JcrNodePayload, JcrPropertyPayload> graphSession() {
@@ -937,8 +944,7 @@
                                                                 true,
                                                                 skipProtected);
                 if (definition == null) {
-                    throw new ConstraintViolationException(
-                                                           JcrI18n.noDefinition.text("property",
+                    throw new ConstraintViolationException(JcrI18n.noDefinition.text("property",
                                                                                      readable(name),
                                                                                      readable(node.getPath()),
                                                                                      readable(payload.getPrimaryTypeName()),
@@ -1114,8 +1120,7 @@
                                                                 newValues,
                                                                 skipProtected);
                 if (definition == null) {
-                    throw new ConstraintViolationException(
-                                                           JcrI18n.noDefinition.text("property",
+                    throw new ConstraintViolationException(JcrI18n.noDefinition.text("property",
                                                                                      readable(name),
                                                                                      readable(node.getPath()),
                                                                                      readable(payload.getPrimaryTypeName()),
@@ -1249,8 +1254,8 @@
                     // The node definition changed, so try to set the property ...
                     NodeEditor newChildEditor = getEditorFor(existingChild);
                     try {
-                        JcrValue value = new JcrValue(factories(), SessionCache.this, PropertyType.STRING,
-                                                      defn.getId().getString());
+                        JcrValue value = new JcrValue(factories(), SessionCache.this, PropertyType.STRING, defn.getId()
+                                                                                                               .getString());
                         newChildEditor.setProperty(DnaIntLexicon.NODE_DEFINITON, value);
                     } catch (ConstraintViolationException e) {
                         // We can't set this property on the node (according to the node definition).

Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -48,6 +48,7 @@
 import org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource;
 import org.jboss.dna.graph.mimetype.ExtensionBasedMimeTypeDetector;
 import org.jboss.dna.graph.property.Path;
+import org.jboss.dna.jcr.JcrRepository.DefaultOption;
 import org.jboss.dna.jcr.JcrRepository.Option;
 import org.jboss.dna.repository.DnaConfiguration;
 import org.jboss.dna.repository.DnaLexicon;
@@ -246,7 +247,8 @@
 
         Map<Option, String> options = new HashMap<Option, String>();
         options.put(Option.JAAS_LOGIN_CONFIG_NAME, "test");
-        options.put(Option.PROJECT_NODE_TYPES, "false");
+        options.put(Option.PROJECT_NODE_TYPES, DefaultOption.PROJECT_NODE_TYPES);
+        options.put(Option.READ_DEPTH, DefaultOption.READ_DEPTH);
         assertThat(repository.getOptions(), is(options));
     }
 

Modified: trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -29,6 +29,8 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Set;
 import org.jboss.dna.common.i18n.I18n;
 import org.jboss.dna.common.util.Logger;
@@ -63,6 +65,7 @@
 import org.jboss.dna.graph.request.MoveBranchRequest;
 import org.jboss.dna.graph.request.ReadAllChildrenRequest;
 import org.jboss.dna.graph.request.ReadAllPropertiesRequest;
+import org.jboss.dna.graph.request.ReadNodeRequest;
 import org.jboss.dna.graph.request.RenameNodeRequest;
 import org.jboss.dna.graph.request.Request;
 import org.jboss.dna.graph.request.UpdatePropertiesRequest;
@@ -128,188 +131,176 @@
         this.accessData = accessData;
     }
 
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.ReadAllChildrenRequest)
-     */
-    @Override
-    public void process( ReadAllChildrenRequest request ) {
-        logger.trace(request.toString());
+    protected boolean readNode( String workspaceName,
+                                Location myLocation,
+                                List<Property> properties,
+                                List<Location> children,
+                                Request request ) {
 
         // Get the SVNRepository object that represents the workspace ...
-        SVNRepository workspaceRoot = getWorkspaceDirectory(request.inWorkspace());
+        SVNRepository workspaceRoot = getWorkspaceDirectory(workspaceName);
         if (workspaceRoot == null) {
-            request.setError(new InvalidWorkspaceException(
-                                                           SVNRepositoryConnectorI18n.workspaceDoesNotExist.text(request.inWorkspace())));
-            return;
+            request.setError(new InvalidWorkspaceException(SVNRepositoryConnectorI18n.workspaceDoesNotExist.text(workspaceName)));
+            return false;
         }
-        Location myLocation = request.of();
         Path requestedPath = getPathFor(myLocation, request);
-        // svn connector does not support same name sibling
-        checkThePath(requestedPath, request);
-        // requested path is the root
+        checkThePath(requestedPath, request); // same-name-sibling indexes are not supported
+
         if (requestedPath.isRoot()) {
             // workspace root must be a directory
-            final Collection<SVNDirEntry> entries = SVNRepositoryUtil.getDir(workspaceRoot, "");
-            for (SVNDirEntry entry : entries) {
-                // Decide how to represent the children ...
-                if (entry.getKind() == SVNNodeKind.DIR) {
-                    // Create a Location for each file and directory contained by the parent directory ...
+            if (children != null) {
+                final Collection<SVNDirEntry> entries = SVNRepositoryUtil.getDir(workspaceRoot, "");
+                for (SVNDirEntry entry : entries) {
+                    // All of the children of a directory will be another directory or a file, but never a "jcr:content" node ...
                     String localName = entry.getName();
                     Name childName = nameFactory().create(defaultNamespaceUri, localName);
                     Path childPath = pathFactory().create(requestedPath, childName);
-                    request.addChild(Location.create(childPath));
-                } else if (entry.getKind() == SVNNodeKind.FILE) {
-                    // The parent is a file, and the path may refer to the node that is either the "nt:file" parent
-                    // node, or the child "jcr:content" node...
-                    String localName = entry.getName();
-                    Path contentPath = pathFactory().create(BACK_SLASH + localName);
-                    if (!contentPath.getLastSegment().getName().equals(JcrLexicon.CONTENT)) {
-                        Location location = Location.create(pathFactory().create(contentPath, JcrLexicon.CONTENT));
-                        request.addChild(location);
-                    }
+                    children.add(Location.create(childPath));
                 }
             }
+            // There are no properties on the root ...
         } else {
             try {
-                SVNNodeKind kind = getNodeKind(workspaceRoot,
-                                               requestedPath,
-                                               accessData.getRepositoryRootUrl(),
-                                               request.inWorkspace());
+                // Generate the properties for this File object ...
+                PropertyFactory factory = getExecutionContext().getPropertyFactory();
+                DateTimeFactory dateFactory = getExecutionContext().getValueFactories().getDateFactory();
+
+                // Figure out the kind of node this represents ...
+                SVNNodeKind kind = getNodeKind(workspaceRoot, requestedPath, accessData.getRepositoryRootUrl(), workspaceName);
                 if (kind == SVNNodeKind.DIR) {
                     String directoryPath = getPathAsString(requestedPath);
-                    // Decide how to represent the children ...
-                    if (!accessData.getRepositoryRootUrl().equals(request.inWorkspace())) {
+                    if (!accessData.getRepositoryRootUrl().equals(workspaceName)) {
                         directoryPath = directoryPath.substring(1);
                     }
-                    Collection<SVNDirEntry> dirEntries = SVNRepositoryUtil.getDir(workspaceRoot, directoryPath);
-                    for (SVNDirEntry entry : dirEntries) {
+                    if (children != null) {
                         // Decide how to represent the children ...
-                        if (entry.getKind() == SVNNodeKind.DIR) {
-                            // Create a Location for each file and directory contained by the parent directory ...
+                        Collection<SVNDirEntry> dirEntries = SVNRepositoryUtil.getDir(workspaceRoot, directoryPath);
+                        for (SVNDirEntry entry : dirEntries) {
+                            // All of the children of a directory will be another directory or a file,
+                            // but never a "jcr:content" node ...
                             String localName = entry.getName();
                             Name childName = nameFactory().create(defaultNamespaceUri, localName);
                             Path childPath = pathFactory().create(requestedPath, childName);
-                            request.addChild(Location.create(childPath));
-                        } else if (entry.getKind() == SVNNodeKind.FILE) {
-                            // The parent is a file, and the path may refer to the node that is either the "nt:file" parent
-                            // node, or the child "jcr:content" node...
-                            String localName = entry.getName();
-                            Path contentPath = pathFactory().create(getPathAsString(requestedPath) + BACK_SLASH + localName);
-                            Location content = Location.create(pathFactory().create(contentPath, JcrLexicon.CONTENT));
-                            request.addChild(content);
+                            children.add(Location.create(childPath));
                         }
                     }
+                    if (properties != null) {
+                        // Load the properties for this directory ......
+                        properties.add(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FOLDER));
+                        SVNDirEntry entry = getEntryInfo(workspaceRoot, directoryPath);
+                        if (entry != null) {
+                            properties.add(factory.create(JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate())));
+                        }
+                    }
                 } else {
-                    if (!requestedPath.getLastSegment().getName().equals(JcrLexicon.CONTENT)) {
-                        // Use leading '/' on the requested path
-                        // repository root URL is exactly the same as the workspace
-                        // Get the parent path
+                    // It's not a directory, so must be a file; the only child of an nt:file is the "jcr:content" node
+                    // ...
+                    if (requestedPath.endsWith(JcrLexicon.CONTENT)) {
+                        // There are never any children of these nodes, just properties ...
+                        if (properties != null) {
+                            String contentPath = getPathAsString(requestedPath.getParent());
+                            if (!accessData.getRepositoryRootUrl().equals(workspaceName)) {
+                                contentPath = contentPath.substring(1);
+                            }
+                            SVNDirEntry entry = getEntryInfo(workspaceRoot, contentPath);
+                            if (entry != null) {
+                                // The request is to get properties of the "jcr:content" child node ...
+                                properties.add(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.RESOURCE));
+                                properties.add(factory.create(JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate())));
+                            }
+
+                            ByteArrayOutputStream os = new ByteArrayOutputStream();
+                            SVNProperties fileProperties = new SVNProperties();
+                            getData(contentPath, fileProperties, os);
+                            String mimeType = fileProperties.getStringValue(SVNProperty.MIME_TYPE);
+                            if (mimeType == null) mimeType = DEFAULT_MIME_TYPE;
+                            properties.add(factory.create(JcrLexicon.MIMETYPE, mimeType));
+
+                            if (os.toByteArray().length > 0) {
+                                // Now put the file's content into the "jcr:data" property ...
+                                BinaryFactory binaryFactory = getExecutionContext().getValueFactories().getBinaryFactory();
+                                properties.add(factory.create(JcrLexicon.DATA, binaryFactory.create(os.toByteArray())));
+                            }
+                        }
+                    } else {
+                        // Determine the corresponding file path for this object ...
                         String filePath = getPathAsString(requestedPath);
-                        if (!accessData.getRepositoryRootUrl().equals(request.inWorkspace())) {
+                        if (!accessData.getRepositoryRootUrl().equals(workspaceName)) {
                             filePath = filePath.substring(1);
                         }
-                        Path contentPath = pathFactory().create(requestedPath, JcrLexicon.CONTENT);
-                        Location content = Location.create(contentPath);
-                        request.addChild(content);
+                        if (children != null) {
+                            // Not a "jcr:content" child node but rather an nt:file node, so add the child ...
+                            Path contentPath = pathFactory().create(requestedPath, JcrLexicon.CONTENT);
+                            children.add(Location.create(contentPath));
+                        }
+                        if (properties != null) {
+                            // Now add the properties to "nt:file" ...
+                            properties.add(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE));
+                            ByteArrayOutputStream os = new ByteArrayOutputStream();
+                            SVNProperties fileProperties = new SVNProperties();
+                            getData(filePath, fileProperties, os);
+                            String created = fileProperties.getStringValue(SVNProperty.COMMITTED_DATE);
+                            if (created != null) {
+                                properties.add(factory.create(JcrLexicon.CREATED, dateFactory.create(created)));
+                            }
+                        }
                     }
                 }
             } catch (SVNException e) {
                 request.setError(e);
             }
         }
-        request.setActualLocationOfNode(myLocation);
-        setCacheableInfo(request);
+        return true;
     }
 
     /**
      * {@inheritDoc}
      * 
-     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.ReadAllPropertiesRequest)
+     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.ReadNodeRequest)
      */
     @Override
-    public void process( ReadAllPropertiesRequest request ) {
+    public void process( ReadNodeRequest request ) {
         logger.trace(request.toString());
-
-        // Get the SVNRepository object that represents the workspace ...
-        SVNRepository workspaceRoot = getWorkspaceDirectory(request.inWorkspace());
-        if (workspaceRoot == null) {
-            request.setError(new InvalidWorkspaceException(
-                                                           SVNRepositoryConnectorI18n.workspaceDoesNotExist.text(request.inWorkspace())));
-            return;
+        List<Location> children = new LinkedList<Location>();
+        List<Property> properties = new LinkedList<Property>();
+        if (readNode(request.inWorkspace(), request.at(), properties, children, request)) {
+            request.addChildren(children);
+            request.addProperties(properties);
+            request.setActualLocationOfNode(request.at());
+            setCacheableInfo(request);
         }
+    }
 
-        // Find the existing file for the parent ...
-        Location myLocation = request.at();
-        Path requestedPath = getPathFor(myLocation, request);
-        if (requestedPath.isRoot()) {
-            // There are no properties on the root ...
-            request.setActualLocationOfNode(myLocation);
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.ReadAllChildrenRequest)
+     */
+    @Override
+    public void process( ReadAllChildrenRequest request ) {
+        logger.trace(request.toString());
+        List<Location> children = new LinkedList<Location>();
+        if (readNode(request.inWorkspace(), request.of(), null, children, request)) {
+            request.addChildren(children);
+            request.setActualLocationOfNode(request.of());
             setCacheableInfo(request);
-            return;
         }
 
-        try {
+    }
 
-            SVNNodeKind kind = getNodeKind(workspaceRoot, requestedPath, accessData.getRepositoryRootUrl(), request.inWorkspace());
-            // Generate the properties for this File object ...
-            PropertyFactory factory = getExecutionContext().getPropertyFactory();
-            DateTimeFactory dateFactory = getExecutionContext().getValueFactories().getDateFactory();
-            // Note that we don't have 'created' timestamps, just last modified, so we'll have to use them
-            if (kind == SVNNodeKind.DIR) {
-                String directoryPath = getPathAsString(requestedPath);
-                if (!accessData.getRepositoryRootUrl().equals(request.inWorkspace())) {
-                    directoryPath = directoryPath.substring(1);
-                }
-                request.addProperty(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FOLDER));
-                SVNDirEntry entry = getEntryInfo(workspaceRoot, directoryPath);
-                request.addProperty(factory.create(JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate())));
-            } else {
-                if (requestedPath.getLastSegment().getName().equals(JcrLexicon.CONTENT)) {
-                    String contentPath = getPathAsString(requestedPath.getParent());
-                    if (!accessData.getRepositoryRootUrl().equals(request.inWorkspace())) {
-                        contentPath = contentPath.substring(1);
-                    }
-                    SVNDirEntry entry = getEntryInfo(workspaceRoot, contentPath);
-                    // The request is to get properties of the "jcr:content" child node ...
-                    request.addProperty(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.RESOURCE));
-                    request.addProperty(factory.create(JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate())));
-
-                    ByteArrayOutputStream os = new ByteArrayOutputStream();
-                    SVNProperties fileProperties = new SVNProperties();
-                    getData(contentPath, fileProperties, os);
-                    String mimeType = fileProperties.getStringValue(SVNProperty.MIME_TYPE);
-                    if (mimeType == null) mimeType = DEFAULT_MIME_TYPE;
-                    request.addProperty(factory.create(JcrLexicon.MIMETYPE, mimeType));
-
-                    if (os.toByteArray().length > 0) {
-                        // Now put the file's content into the "jcr:data" property ...
-                        BinaryFactory binaryFactory = getExecutionContext().getValueFactories().getBinaryFactory();
-                        request.addProperty(factory.create(JcrLexicon.DATA, binaryFactory.create(os.toByteArray())));
-                    }
-
-                } else {
-                    String filePath = getPathAsString(requestedPath);
-                    if (!accessData.getRepositoryRootUrl().equals(request.inWorkspace())) {
-                        filePath = filePath.substring(1);
-                    }
-                    // The request is to get properties for the node representing the file
-                    request.addProperty(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE));
-                    ByteArrayOutputStream os = new ByteArrayOutputStream();
-                    SVNProperties fileProperties = new SVNProperties();
-                    getData(filePath, fileProperties, os);
-                    String created = fileProperties.getStringValue(SVNProperty.COMMITTED_DATE);
-                    if (created != null) {
-                        request.addProperty(factory.create(JcrLexicon.CREATED, dateFactory.create(created)));
-                    }
-                }
-            }
-            request.setActualLocationOfNode(myLocation);
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.ReadAllPropertiesRequest)
+     */
+    @Override
+    public void process( ReadAllPropertiesRequest request ) {
+        logger.trace(request.toString());
+        List<Property> properties = new LinkedList<Property>();
+        if (readNode(request.inWorkspace(), request.at(), properties, null, request)) {
+            request.addProperties(properties);
+            request.setActualLocationOfNode(request.at());
             setCacheableInfo(request);
-
-        } catch (SVNException e) {
-            request.setError(e);
         }
     }
 
@@ -626,7 +617,7 @@
         String myPath;
         if (getPathAsString(requestedPath).trim().equals("/")) {
             myPath = getPathAsString(requestedPath);
-        } else if (requestedPath.getLastSegment().getName().equals(JcrLexicon.CONTENT)) {
+        } else if (requestedPath.endsWith(JcrLexicon.CONTENT)) {
             myPath = getPathAsString(requestedPath.getParent());
         } else {
             // directory and file
@@ -663,7 +654,7 @@
      * 
      * @param repos
      * @param path - the path
-     * @return - the {@link SVNDirEntry}.
+     * @return - the {@link SVNDirEntry}, or null if there is no such entry
      */
     protected SVNDirEntry getEntryInfo( SVNRepository repos,
                                         String path ) {
@@ -1025,7 +1016,7 @@
         assert repositoryRootUrl != null;
         assert inWorkspace != null;
         // See if the path is a "jcr:content" node ...
-        if (path.getLastSegment().getName().equals(JcrLexicon.CONTENT)) {
+        if (path.endsWith(JcrLexicon.CONTENT)) {
             // We only want to use the parent path to find the actual file ...
             path = path.getParent();
         }

Modified: trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryUtil.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -1,6 +1,7 @@
 package org.jboss.dna.connector.svn;
 
 import java.util.Collection;
+import java.util.Collections;
 import org.jboss.dna.graph.connector.RepositorySourceException;
 import org.jboss.dna.graph.request.InvalidWorkspaceException;
 import org.tmatesoft.svn.core.SVNDirEntry;
@@ -159,16 +160,15 @@
     /**
      * @param repos
      * @param path
-     * @return a collect of entry from directory path.
+     * @return a collect of entry from directory path; never null
      */
     @SuppressWarnings( "unchecked" )
     public static Collection<SVNDirEntry> getDir( SVNRepository repos,
                                                   String path ) {
-        Collection<SVNDirEntry> entries = null;
         try {
             return repos.getDir(path, -1, null, (Collection<SVNDirEntry>)null);
         } catch (SVNException e) {
-            return entries;
+            return Collections.emptyList();
         }
     }
 

Added: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNIntegrationTest.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNIntegrationTest.java	                        (rev 0)
+++ trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNIntegrationTest.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -0,0 +1,79 @@
+/*
+ * 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.connector.svn;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import java.util.Map;
+import org.jboss.dna.graph.ExecutionContext;
+import org.jboss.dna.graph.Graph;
+import org.jboss.dna.graph.Location;
+import org.jboss.dna.graph.Node;
+import org.jboss.dna.graph.property.Name;
+import org.jboss.dna.graph.property.Property;
+import org.junit.Before;
+import org.junit.Test;
+
+public class SVNIntegrationTest {
+
+    private ExecutionContext context;
+    private SVNRepositorySource source;
+    private String repositoryUrl;
+    private String[] predefinedWorkspaceNames;
+
+    @Before
+    public void beforeEach() {
+        repositoryUrl = "http://anonsvn.jboss.org/repos/dna/";
+        predefinedWorkspaceNames = new String[] {repositoryUrl + "trunk", repositoryUrl + "tags", repositoryUrl + "branches"};
+        context = new ExecutionContext();
+        source = new SVNRepositorySource();
+        source.setName("svn repository source");
+        source.setRepositoryRootURL(repositoryUrl);
+        source.setUsername("anonymous");
+        source.setPassword("");
+        source.setCreatingWorkspacesAllowed(true);
+        source.setPredefinedWorkspaceNames(predefinedWorkspaceNames);
+        source.setDirectoryForDefaultWorkspace(predefinedWorkspaceNames[0]);
+        source.setCreatingWorkspacesAllowed(false);
+    }
+
+    @Test
+    public void shouldConnectAndReadRootNode() {
+        Graph graph = Graph.create(source, context);
+        Map<Name, Property> properties = graph.getPropertiesByName().on("/");
+        assertThat(properties, is(notNullValue()));
+
+        Node root = graph.getNodeAt("/");
+        assertThat(root, is(notNullValue()));
+        assertThat(root.getLocation(), is(notNullValue()));
+        assertThat(root.getChildren().isEmpty(), is(false));
+        for (Location childLocation : root.getChildren()) {
+            assertThat(childLocation.getPath().getParent().isRoot(), is(true));
+            // Node child = graph.getNodeAt(childLocation);
+            // assertThat(child.getLocation(), is(childLocation));
+            // assertThat(child.getLocation().getPath().getParent().isRoot(), is(true));
+        }
+    }
+}


Property changes on: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNIntegrationTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java	2009-08-26 18:10:37 UTC (rev 1174)
+++ trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectorCreateWorspaceTest.java	2009-08-26 20:43:45 UTC (rev 1175)
@@ -85,4 +85,10 @@
         assertThat(workspaceNames.isEmpty(), is(true));
     }
 
+    @Test
+    @Override
+    public void shouldReadTheChildrenOfTheRootNodeInEachWorkspace() {
+        super.shouldReadTheChildrenOfTheRootNodeInEachWorkspace();
+    }
+
 }


From dna-commits at lists.jboss.org  Wed Aug 26 16:51:58 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 26 Aug 2009 16:51:58 -0400
Subject: [dna-commits] DNA SVN: r1176 -
	trunk/dna-jcr/src/test/java/org/jboss/dna/jcr.
Message-ID: <200908262051.n7QKpwDK004358@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-26 16:51:58 -0400 (Wed, 26 Aug 2009)
New Revision: 1176

Modified:
   trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
Log:
Removed compilation warning due to unnecessary cast

Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java	2009-08-26 20:43:45 UTC (rev 1175)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java	2009-08-26 20:51:58 UTC (rev 1176)
@@ -210,7 +210,7 @@
 
         Subject subject = login.getSubject();
 
-        Session session = (Session)Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
+        Session session = Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
 
             @SuppressWarnings( "synthetic-access" )
             public Session run() throws Exception {


From dna-commits at lists.jboss.org  Wed Aug 26 16:57:42 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 26 Aug 2009 16:57:42 -0400
Subject: [dna-commits] DNA SVN: r1177 - in
	trunk/extensions/dna-connector-filesystem/src:
	test/java/org/jboss/dna/connector/filesystem and 1 other directory.
Message-ID: <200908262057.n7QKvgV2005159@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-26 16:57:41 -0400 (Wed, 26 Aug 2009)
New Revision: 1177

Modified:
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
   trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
Log:
Merge branch 'quick_patch'

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-26 20:51:58 UTC (rev 1176)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-26 20:57:41 UTC (rev 1177)
@@ -458,7 +458,6 @@
                     } finally {
                         try {
                             if (checkForContents != null) checkForContents.close();
-                            checkForContents.close();
                         } catch (Exception ignore) {
                         }
                     }

Modified: trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-26 20:51:58 UTC (rev 1176)
+++ trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorWritableTest.java	2009-08-26 20:57:41 UTC (rev 1177)
@@ -101,8 +101,11 @@
     @Test
     public void shouldBeAbleToCreateFileWithContent() {
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -111,11 +114,17 @@
     @Test
     public void shouldRespectConflictBehaviorOnCreate() {
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     "Should not overwrite".getBytes()).ifAbsent().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, "Should not overwrite".getBytes())
+             .ifAbsent()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -147,10 +156,13 @@
         assertThat(newFolder.exists(), is(true));
         assertThat(newFolder.isDirectory(), is(true));
         System.out.println("Created new folder at: " + newFolder.getCanonicalPath());
-        
+
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -170,8 +182,11 @@
     @Test
     public void shouldBeAbleToCopyFile() {
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -185,8 +200,11 @@
     public void shouldBeAbleToCopyFolder() {
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -203,8 +221,11 @@
     @Test
     public void shouldBeAbleToMoveFile() {
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -222,8 +243,11 @@
     public void shouldBeAbleToMoveFolder() {
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -245,8 +269,11 @@
     public void shouldBeAbleToDeleteFolderWithContents() {
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFolder = new File(testWorkspaceRoot, "testFolder");
         assertTrue(newFolder.exists());
@@ -264,8 +291,11 @@
     public void shouldBeAbleToDeleteFile() {
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFolder = new File(testWorkspaceRoot, "testFolder");
         assertTrue(newFolder.exists());
@@ -289,8 +319,11 @@
         graph.useWorkspace("otherWorkspace");
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(otherWorkspaceRoot, "testFolder/testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -313,8 +346,11 @@
     public void shouldBeAbleToCloneFile() {
         graph.useWorkspace("otherWorkspace");
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(otherWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -345,11 +381,17 @@
     public void shouldNotBeAbleToReorderFile() {
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
         graph.create("/testFolder/testFile2").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile2/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                 TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile2/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFolder = new File(testWorkspaceRoot, "testFolder");
         assertTrue(newFolder.exists());
@@ -367,8 +409,11 @@
     public void shouldBeAbleToRenameFolder() {
         graph.create("/testFolder").orReplace().and();
         graph.create("/testFolder/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFolder/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                                TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFolder/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFolder/testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -387,8 +432,11 @@
     @Test
     public void shouldBeAbleToRenameFile() {
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -407,8 +455,11 @@
         graph.useWorkspace("newWorkspace");
 
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(newWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -417,8 +468,11 @@
     @Test
     public void shouldBeAbleToCloneWorkspace() {
         graph.create("/testFile").with(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE).orReplace().and();
-        graph.create("/testFile/jcr:content").with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE).and(JcrLexicon.DATA,
-                                                                                                     TEST_CONTENT.getBytes()).orReplace().and();
+        graph.create("/testFile/jcr:content")
+             .with(JcrLexicon.PRIMARY_TYPE, DnaLexicon.RESOURCE)
+             .and(JcrLexicon.DATA, TEST_CONTENT.getBytes())
+             .orReplace()
+             .and();
 
         File newFile = new File(testWorkspaceRoot, "testFile");
         assertContents(newFile, TEST_CONTENT);
@@ -474,9 +528,13 @@
             fail(ioe.getMessage());
             return;
         } finally {
-            try {
-                fis.close();
-            } catch (Exception ignore) {
+            if (fis != null) {
+                try {
+                    fis.close();
+                } catch (Exception ignore) {
+                } finally {
+                    fis = null;
+                }
             }
         }
     }


From dna-commits at lists.jboss.org  Wed Aug 26 17:16:26 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Wed, 26 Aug 2009 17:16:26 -0400
Subject: [dna-commits] DNA SVN: r1178 -
	trunk/dna-jcr/src/test/java/org/jboss/dna/jcr.
Message-ID: <200908262116.n7QLGQ5h008704@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-26 17:16:25 -0400 (Wed, 26 Aug 2009)
New Revision: 1178

Modified:
   trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
Log:
Merge branch 'quick_patch'

Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java	2009-08-26 20:57:41 UTC (rev 1177)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java	2009-08-26 21:16:25 UTC (rev 1178)
@@ -203,6 +203,7 @@
         repository.login();
     }
 
+    @SuppressWarnings( "cast" )
     @Test
     public void shouldAllowLoginWithNoCredentialsInPrivilegedBlock() throws Exception {
         LoginContext login = new LoginContext("dna-jcr", new UserPasswordCallbackHandler("superuser", "superuser".toCharArray()));
@@ -210,7 +211,7 @@
 
         Subject subject = login.getSubject();
 
-        Session session = Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
+        Session session = (Session)Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
 
             @SuppressWarnings( "synthetic-access" )
             public Session run() throws Exception {


From dna-commits at lists.jboss.org  Thu Aug 27 10:04:45 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Thu, 27 Aug 2009 10:04:45 -0400
Subject: [dna-commits] DNA SVN: r1179 - in trunk:
	dna-jcr/src/main/java/org/jboss/dna/jcr and 1 other directories.
Message-ID: <200908271404.n7RE4jVB014915@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-27 10:04:45 -0400 (Thu, 27 Aug 2009)
New Revision: 1179

Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
   trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java
Log:
DNA-478 Refresh does not properly reflect changes made in other sessions

Several TCK unit tests were reporting this issue as an error.  The problem stemmed from an improperly-coded method that was attempting to refresh the children of a node, where one (or more) of the children had been changed/created locally in the session.  The method was in fact (partially) losing those local changes and was actually corrupting the cached state.  This method has been fixed and now correctly updates those children.  The TCK unit tests were uncommented, since they now pass.

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java	2009-08-26 21:16:25 UTC (rev 1178)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java	2009-08-27 14:04:45 UTC (rev 1179)
@@ -1515,29 +1515,53 @@
                 assert childrenByName != null;
                 org.jboss.dna.graph.Node persistentNode = persistentInfoForRefreshedNodes.getNode(location);
                 assert !persistentNode.getChildren().isEmpty();
-                // Find the map of old Node objects keyed by their identifier ...
-                Map<NodeId, Node<Payload, PropertyPayload>> oldChildren = new HashMap<NodeId, Node<Payload, PropertyPayload>>();
-                for (Node<Payload, PropertyPayload> oldChild : childrenByName.values()) {
-                    oldChildren.put(oldChild.getNodeId(), oldChild);
+
+                // We need to keep the children that have been modified (or are ancestors of modified children),
+                // so build a list of the children that SHOULD NOT be replaced with the persistent info ...
+                Map<Location, Node<Payload, PropertyPayload>> childrenToKeep = new HashMap<Location, Node<Payload, PropertyPayload>>();
+                for (Node<Payload, PropertyPayload> existing : childrenByName.values()) {
+                    if (existing.isChanged(true)) {
+                        childrenToKeep.put(existing.getLocation(), existing);
+                    } else {
+                        // Otherwise, remove the child from the cache since we won't be needing it anymore ...
+                        cache.nodes.remove(existing.getNodeId());
+                        assert !cache.changeDependencies.containsKey(existing.getNodeId());
+                        existing.parent = null;
+                    }
                 }
+
+                // Now, clear the children ...
                 childrenByName.clear();
+
+                // And add the persistent children ...
                 for (Location location : persistentNode.getChildren()) {
                     Name childName = location.getPath().getLastSegment().getName();
-                    NodeId nodeId = cache.idFactory.create();
-                    Node<Payload, PropertyPayload> child = oldChildren.remove(nodeId);
-                    if (child == null) {
-                        child = cache.createNode(this, nodeId, location);
-                        cache.nodes.put(child.getNodeId(), child);
-                        assert child.getName().equals(childName);
+                    List<Node<Payload, PropertyPayload>> currentChildren = childrenByName.get(childName);
+                    // Find if there was an existing child that is supposed to stay ...
+                    Node<Payload, PropertyPayload> existingChild = childrenToKeep.get(location);
+                    if (existingChild != null) {
+                        // The existing child is supposed to stay, since it has changes ...
+                        currentChildren.add(existingChild);
+                        if (currentChildren.size() != existingChild.getPath().getLastSegment().getIndex()) {
+                            // Make sure the SNS index is correct ...
+                            Path.Segment segment = cache.pathFactory.createSegment(childName, currentChildren.size());
+                            existingChild.updateLocation(segment);
+                            // TODO: Can the location be different? If so, doesn't that mean that the change requests
+                            // have to be updated???
+                        }
+                    } else {
+                        // The existing child (if there was one) is to be refreshed ...
+                        NodeId nodeId = cache.idFactory.create();
+                        Node<Payload, PropertyPayload> replacementChild = cache.createNode(this, nodeId, location);
+                        cache.nodes.put(replacementChild.getNodeId(), replacementChild);
+                        assert replacementChild.getName().equals(childName);
+                        assert replacementChild.parent == this;
+                        // Add it to the parent node ...
+                        currentChildren.add(replacementChild);
+                        // Create a segment with the SNS ...
+                        Path.Segment segment = cache.pathFactory.createSegment(childName, currentChildren.size());
+                        replacementChild.updateLocation(segment);
                     }
-                    assert child.parent == this;
-                    List<Node<Payload, PropertyPayload>> currentChildren = childrenByName.get(childName);
-                    currentChildren.add(child);
-                    // Create a segment with the SNS ...
-                    Path.Segment segment = cache.pathFactory.createSegment(childName, currentChildren.size());
-                    child.updateLocation(segment);
-                    // TODO: Can the location be different? If so, doesn't that mean that the change requests
-                    // have to be updated???
                 }
                 return;
             }

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java	2009-08-26 21:16:25 UTC (rev 1178)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java	2009-08-27 14:04:45 UTC (rev 1179)
@@ -1588,8 +1588,8 @@
         if (destChildRelPath != null) {
             Path destPath = pathFactory.create(destChildRelPath);
             if (destPath.isAbsolute() || destPath.size() != 1) {
-                throw new ItemNotFoundException(
-                                                JcrI18n.pathNotFound.text(destPath.getString(cache.context().getNamespaceRegistry()),
+                throw new ItemNotFoundException(JcrI18n.pathNotFound.text(destPath.getString(cache.context()
+                                                                                                  .getNamespaceRegistry()),
                                                                           cache.session().workspace().getName()));
             }
 
@@ -1670,7 +1670,7 @@
      * @see javax.jcr.Item#refresh(boolean)
      */
     public void refresh( boolean keepChanges ) throws RepositoryException {
-        this.cache.refresh(this.nodeId, keepChanges);
+        this.cache.refresh(this.nodeId, location.getPath(), keepChanges);
     }
 
     /**

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-08-26 21:16:25 UTC (rev 1178)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-08-27 14:04:45 UTC (rev 1179)
@@ -281,18 +281,22 @@
      * </p>
      * 
      * @param nodeId the identifier of the node that is to be saved; may not be null
+     * @param absolutePath the absolute path to the node; may not be null
      * @param keepChanges indicates whether changed nodes should be kept or refreshed from the repository.
      * @throws InvalidItemStateException if the node being refreshed no longer exists
      * @throws RepositoryException if any error resulting while saving the changes to the repository
      */
     public void refresh( NodeId nodeId,
+                         Path absolutePath,
                          boolean keepChanges ) throws InvalidItemStateException, RepositoryException {
         assert nodeId != null;
         try {
-            Node<JcrNodePayload, JcrPropertyPayload> node = graphSession.findNodeWith(nodeId);
+            Node<JcrNodePayload, JcrPropertyPayload> node = graphSession.findNodeWith(nodeId, absolutePath);
             graphSession.refresh(node, keepChanges);
         } catch (InvalidStateException e) {
             throw new InvalidItemStateException(e.getLocalizedMessage());
+        } catch (org.jboss.dna.graph.property.PathNotFoundException e) {
+            throw new InvalidItemStateException(e.getLocalizedMessage());
         } catch (RepositorySourceException e) {
             throw new RepositoryException(e.getLocalizedMessage());
         }

Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java	2009-08-26 21:16:25 UTC (rev 1178)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java	2009-08-27 14:04:45 UTC (rev 1179)
@@ -37,11 +37,13 @@
 import org.apache.jackrabbit.test.api.NodeItemIsNewTest;
 import org.apache.jackrabbit.test.api.NodeOrderableChildNodesTest;
 import org.apache.jackrabbit.test.api.NodeRemoveMixinTest;
+import org.apache.jackrabbit.test.api.NodeTest;
 import org.apache.jackrabbit.test.api.PropertyItemIsModifiedTest;
 import org.apache.jackrabbit.test.api.PropertyItemIsNewTest;
 import org.apache.jackrabbit.test.api.PropertyTest;
 import org.apache.jackrabbit.test.api.RepositoryLoginTest;
 import org.apache.jackrabbit.test.api.SerializationTest;
+import org.apache.jackrabbit.test.api.SessionTest;
 import org.apache.jackrabbit.test.api.SetPropertyAssumeTypeTest;
 import org.apache.jackrabbit.test.api.SetPropertyBooleanTest;
 import org.apache.jackrabbit.test.api.SetPropertyCalendarTest;
@@ -190,9 +192,9 @@
             addTestSuite(AddNodeTest.class);
             addTestSuite(NamespaceRegistryTest.class);
             // addTestSuite(ReferencesTest.class);
-            // dna-466 addTestSuite(SessionTest.class);
+            addTestSuite(SessionTest.class);
             // addTestSuite(SessionUUIDTest.class);
-            // dna-466 addTestSuite(NodeTest.class);
+            addTestSuite(NodeTest.class);
             // addTestSuite(NodeUUIDTest.class);
             addTestSuite(NodeOrderableChildNodesTest.class);
             addTestSuite(PropertyTest.class);


From dna-commits at lists.jboss.org  Fri Aug 28 11:26:27 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 28 Aug 2009 11:26:27 -0400
Subject: [dna-commits] DNA SVN: r1180 - in trunk:
	dna-graph/src/main/java/org/jboss/dna/graph/connector/map and
	9 other directories.
Message-ID: <200908281526.n7SFQR5w022081@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-28 11:26:27 -0400 (Fri, 28 Aug 2009)
New Revision: 1180

Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinMirrorRequestProcessor.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinRequestProcessor.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRepository.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRequestProcessor.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapWorkspace.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/CloneBranchRequest.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java
   trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/test/WritableConnectorTest.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java
   trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties
   trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java
   trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatingRequestProcessor.java
   trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
   trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java
Log:
DNA-508 Workspace move/clone referenceable nodes is failing

One of the problems was that the workspace move method implementation (down in GraphSession) was not changing the children (of the new and old parent) to reflect the newly removed/added children.  The correction was simply a call to an existing method (similar to what was being done in copy).

The second problem was the fact that clone was not removing from the session state (again, down in GraphSession) the nodes that were being removed during the clone operation, and therefore the session state had nodes that no longer existed in the persistent store.  Unfortunately, the set of nodes that were indeed removed as part of the clone operation was not available after the fact, so correcting this behavior required adding the Set<Location> of these deleted nodes into the CloneBranchRequest.  This in turn mandated that all writable connector implementations be changed to set this information as part of the processing of these requests.  Once this was done, the GraphSession could be changed to use this information to remove these nodes from its cache.

Incidentally, I discovered another possible error condition regarding clone.  Consider a session node A, which has the same UUID as node B in another workspace.  If that session attempts to clone node B (from the other workspace) and the clone method's removeExisting parameter is true, then node A needs to be removed in order for the clone to succeed.  So far this is the normal situation.  However, if node A has transient changes, then it cannot be removed from the session.  Therefore, I changed the JcrWorkspace.clone(...) method to check for this case and throw a RepositoryException.  (The spec did not delineate this error condition, so I'm assuming that this is the best type of exception to throw.)  Luckily, the method was already checking that the would-be-deleted nodes were not mandatory, so also checking whether the node has local changes was very easy.

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinMirrorRequestProcessor.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinMirrorRequestProcessor.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinMirrorRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -174,7 +174,8 @@
      */
     @Override
     public void process( ReadNextBlockOfChildrenRequest request ) {
-        ReadNextBlockOfChildrenRequest source = (ReadNextBlockOfChildrenRequest)federatedRequest.getFirstProjectedRequest().getRequest();
+        ReadNextBlockOfChildrenRequest source = (ReadNextBlockOfChildrenRequest)federatedRequest.getFirstProjectedRequest()
+                                                                                                .getRequest();
         if (checkErrorOrCancel(request, source)) return;
         request.setActualLocationOfStartingAfterNode(source.getActualLocationOfStartingAfterNode());
         for (Location childInSource : source.getChildren()) {
@@ -324,6 +325,7 @@
         CloneBranchRequest source = (CloneBranchRequest)federatedRequest.getFirstProjectedRequest().getRequest();
         if (checkErrorOrCancel(request, source)) return;
         request.setActualLocations(source.getActualLocationBefore(), source.getActualLocationAfter());
+        request.setRemovedNodes(source.getRemovedNodes());
     }
 
     /**

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinRequestProcessor.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinRequestProcessor.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/JoinRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -24,11 +24,14 @@
 package org.jboss.dna.graph.connector.federation;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.Set;
 import java.util.concurrent.BlockingQueue;
 import net.jcip.annotations.NotThreadSafe;
 import org.jboss.dna.graph.ExecutionContext;
@@ -768,7 +771,7 @@
      * Project the supplied location in a source into its federated location. The projection is used to find the location under
      * the supplied ancestor. Any errors are recorded on the original request.
      * 
-     * @param ancestorInFederation the ancestor in the federated repository; may not be nul
+     * @param ancestorInFederation the ancestor in the federated repository; may not be null
      * @param projection the projection that should be used; may not be null
      * @param actualSourceLocation the actual location in the source that is to be projected back into the federated repository;
      *        may not be null
@@ -795,6 +798,31 @@
     }
 
     /**
+     * Project the supplied location in a source into its federated location. The projection is used to find the location under
+     * the supplied ancestor. Any errors are recorded on the original request.
+     * 
+     * @param projection the projection that should be used; may not be null
+     * @param actualSourceLocation the actual location in the source that is to be projected back into the federated repository;
+     *        may not be null
+     * @param originalRequest the original request, if there are errors; may not be null
+     * @return the location in the federated repository
+     */
+    protected Location projectToFederated( Projection projection,
+                                           Location actualSourceLocation,
+                                           Request originalRequest ) {
+        Path actualPathInSource = actualSourceLocation.getPath();
+        // Project the actual location ...
+        for (Path path : projection.getPathsInRepository(actualPathInSource, pathFactory)) {
+            return actualSourceLocation.with(path);
+        }
+        // Record that there was an error projecting the results ...
+        String whereInSource = actualSourceLocation.getString(getExecutionContext().getNamespaceRegistry());
+        String msg = GraphI18n.unableToProjectSourceInformationIntoWorkspace.text(whereInSource, getSourceName(), projection);
+        originalRequest.setError(new InvalidRequestException(msg));
+        return null;
+    }
+
+    /**
      * {@inheritDoc}
      * 
      * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CreateNodeRequest)
@@ -981,6 +1009,13 @@
         locationBefore = projectToFederated(request.from(), projected.getProjection(), locationBefore, request);
         locationAfter = projectToFederated(request.into(), projected.getSecondProjection(), locationAfter, request);
         request.setActualLocations(locationBefore, locationAfter);
+        if (source.removeExisting()) {
+            Set<Location> removed = new HashSet<Location>();
+            for (Location location : request.getRemovedNodes()) {
+                removed.add(projectToFederated(projected.getSecondProjection(), location, request));
+            }
+            request.setRemovedNodes(Collections.unmodifiableSet(removed));
+        }
     }
 
     /**

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -34,6 +34,7 @@
 import java.util.Set;
 import java.util.UUID;
 import org.jboss.dna.graph.ExecutionContext;
+import org.jboss.dna.graph.Location;
 import org.jboss.dna.graph.connector.UuidAlreadyExistsException;
 import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.NamespaceRegistry;
@@ -357,13 +358,13 @@
         assert this.getRoot().equals(node) != true;
         MapNode oldParent = node.getParent();
         Name oldName = node.getName().getName();
-        
+
         if (this.equals(newAbstractMapWorkspace) && node.getParent().getUuid().equals(newParent.getUuid())
             && node.equals(beforeNode)) {
             // Trivial move of a node to its parent before itself
             return;
         }
-        
+
         if (oldParent != null) {
             boolean removed = oldParent.getChildren().remove(node);
             assert removed == true;
@@ -526,7 +527,7 @@
     /**
      * {@inheritDoc}
      * 
-     * @see MapWorkspace#cloneNode(ExecutionContext, MapNode, MapWorkspace, MapNode, Name, Segment, boolean)
+     * @see MapWorkspace#cloneNode(ExecutionContext, MapNode, MapWorkspace, MapNode, Name, Segment, boolean, Set)
      */
     public MapNode cloneNode( ExecutionContext context,
                               MapNode original,
@@ -534,7 +535,8 @@
                               MapNode newParent,
                               Name desiredName,
                               Segment desiredSegment,
-                              boolean removeExisting ) throws UuidAlreadyExistsException {
+                              boolean removeExisting,
+                              Set<Location> removedExistingNodes ) throws UuidAlreadyExistsException {
         assert context != null;
         assert original != null;
         assert newWorkspace != null;
@@ -543,17 +545,23 @@
         Set<UUID> uuidsInFromBranch = getUuidsUnderNode(original);
         MapNode existing;
 
+        PathFactory pathFactory = context.getValueFactories().getPathFactory();
+
         // TODO: Need to handle removing/throwing root node
         if (removeExisting) {
-
+            // Remove all of the nodes that have a UUID from under the original node, but DO NOT yet remove
+            // a node that has the UUID of the original node (as this will be handled later) ...
             for (UUID uuid : uuidsInFromBranch) {
                 if (null != (existing = newWorkspace.getNode(uuid))) {
                     newWorkspace.removeNode(context, existing);
+                    if (removedExistingNodes != null) {
+                        Path path = pathFor(pathFactory, existing);
+                        removedExistingNodes.add(Location.create(path, uuid));
+                    }
                 }
             }
         } else {
-            PathFactory pathFactory = context.getValueFactories().getPathFactory();
-            uuidsInFromBranch.add(original.getUuid());
+            uuidsInFromBranch.add(original.getUuid()); // uuidsInFromBranch does not include the UUID of the original
             for (UUID uuid : uuidsInFromBranch) {
                 if (null != (existing = newWorkspace.getNode(uuid))) {
                     NamespaceRegistry namespaces = context.getNamespaceRegistry();
@@ -589,17 +597,21 @@
             return newRoot;
         }
 
+        // Now deal with an existing node that has the same UUID as the original node ...
         existing = newWorkspace.getNode(original.getUuid());
-
         if (existing != null) {
             newWorkspace.removeNode(context, existing);
+            if (removedExistingNodes != null) {
+                Path path = pathFor(pathFactory, existing);
+                removedExistingNodes.add(Location.create(path, original.getUuid()));
+            }
         }
         return copyNode(context, original, newWorkspace, newParent, desiredName, true, (Map<UUID, UUID>)null);
     }
 
     /**
-     * Returns all of the UUIDs in the branch rooted at {@code node}. The UUID of {@code node} will not be included in the set of
-     * returned UUIDs.
+     * Returns all of the UUIDs in the branch rooted at {@code node}. The UUID of {@code node} <i>will</i> be included in the set
+     * of returned UUIDs.
      * 
      * @param node the root of the branch
      * @return all of the UUIDs in the branch rooted at {@code node}
@@ -607,7 +619,6 @@
     public Set<UUID> getUuidsUnderNode( MapNode node ) {
         Set<UUID> uuids = new HashSet<UUID>();
         uuidsUnderNode(node, uuids);
-
         return uuids;
     }
 

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRepository.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRepository.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRepository.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -248,7 +248,7 @@
             // Loop over each child and call this method to copy the immediate children (and below).
             // Note that this makes the copy have the same UUID as the original.
             for (MapNode originalNode : origRoot.getChildren()) {
-                original.cloneNode(context, originalNode, workspace, root, originalNode.getName().getName(), null, true);
+                original.cloneNode(context, originalNode, workspace, root, originalNode.getName().getName(), null, true, null);
             }
         }
 

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRequestProcessor.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRequestProcessor.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -23,6 +23,7 @@
  */
 package org.jboss.dna.graph.connector.map;
 
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -132,17 +133,20 @@
         // Look up the new parent, which must exist ...
         Path newParentPath = request.into().getPath();
         MapNode newParent = newWorkspace.getNode(newParentPath);
+        Set<Location> removedExistingNodes = new HashSet<Location>();
         MapNode newNode = workspace.cloneNode(getExecutionContext(),
                                               node,
                                               newWorkspace,
                                               newParent,
                                               request.desiredName(),
                                               request.desiredSegment(),
-                                              request.removeExisting());
+                                              request.removeExisting(),
+                                              removedExistingNodes);
         Path newPath = getExecutionContext().getValueFactories().getPathFactory().create(newParentPath, newNode.getName());
         Location oldLocation = getActualLocation(request.from(), node);
         Location newLocation = Location.create(newPath, newNode.getUuid());
         request.setActualLocations(oldLocation, newLocation);
+        request.setRemovedNodes(Collections.unmodifiableSet(removedExistingNodes));
         recordChange(request);
     }
 
@@ -278,6 +282,7 @@
         MapNode beforeNode = request.before() != null ? getTargetNode(workspace, request, request.before()) : null;
         MapNode node = getTargetNode(workspace, request, request.from());
         if (node == null) return;
+        if (request.hasError()) return; // if beforeNode could not be found
         // Look up the new parent, which must exist ...
         Path newParentPath;
 
@@ -298,6 +303,12 @@
         }
 
         MapNode newParent = workspace.getNode(newParentPath);
+        if (newParent == null) {
+            Path lowestExisting = workspace.getLowestExistingPath(newParentPath);
+            request.setError(new PathNotFoundException(request.into(), lowestExisting,
+                                                       GraphI18n.inMemoryNodeDoesNotExist.text(newParentPath)));
+            return;
+        }
         workspace.moveNode(getExecutionContext(), node, request.desiredName(), workspace, newParent, beforeNode);
         assert node.getParent() == newParent;
         Path newPath = getExecutionContext().getValueFactories().getPathFactory().create(newParentPath, node.getName());

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapWorkspace.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapWorkspace.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/map/MapWorkspace.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -23,8 +23,10 @@
  */
 package org.jboss.dna.graph.connector.map;
 
+import java.util.Set;
 import java.util.UUID;
 import org.jboss.dna.graph.ExecutionContext;
+import org.jboss.dna.graph.Location;
 import org.jboss.dna.graph.connector.UuidAlreadyExistsException;
 import org.jboss.dna.graph.property.Name;
 import org.jboss.dna.graph.property.Path;
@@ -162,6 +164,8 @@
      * @param removeExisting true if existing nodes in the new workspace with the same UUIDs as nodes in the branch rooted at
      *        {@code original} should be removed; if false, a UuidAlreadyExistsException will be thrown if a UUID conflict is
      *        detected
+     * @param removedExistingNodes the set into which should be placed all of the existing nodes that were removed as a result of
+     *        this clone operation, or null if these nodes need not be collected
      * @return the new node, which is the top of the new subgraph
      * @throws UuidAlreadyExistsException if {@code removeExisting} is true and and a UUID in the source tree already exists in
      *         the new workspace
@@ -172,7 +176,8 @@
                        MapNode newParent,
                        Name desiredName,
                        Path.Segment desiredSegment,
-                       boolean removeExisting ) throws UuidAlreadyExistsException;
+                       boolean removeExisting,
+                       Set<Location> removedExistingNodes ) throws UuidAlreadyExistsException;
 
     /**
      * Find the lowest existing node along the path.

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/CloneBranchRequest.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/CloneBranchRequest.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/CloneBranchRequest.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -1,5 +1,7 @@
 package org.jboss.dna.graph.request;
 
+import java.util.Collections;
+import java.util.Set;
 import org.jboss.dna.common.util.CheckArg;
 import org.jboss.dna.common.util.HashCode;
 import org.jboss.dna.graph.GraphI18n;
@@ -33,6 +35,7 @@
     private final Name desiredName;
     private final Path.Segment desiredSegment;
     private final boolean removeExisting;
+    private Set<Location> removedExistingNodes;
     private Location actualFromLocation;
     private Location actualIntoLocation;
 
@@ -225,6 +228,24 @@
     }
 
     /**
+     * Set the locations of the nodes that were removed by this operation, if {@link #removeExisting()} is true.
+     * 
+     * @param existingNodesThatWereRemoved the (immutable) set of existing node locations; may be null
+     */
+    public void setRemovedNodes( Set<Location> existingNodesThatWereRemoved ) {
+        this.removedExistingNodes = existingNodesThatWereRemoved;
+    }
+
+    /**
+     * Get the set of nodes that were removed because of this clone operation.
+     * 
+     * @return the immutable set of locations of the nodes that were removed; never null but possibly empty
+     */
+    public Set<Location> getRemovedNodes() {
+        return removedExistingNodes != null ? removedExistingNodes : Collections.<Location>emptySet();
+    }
+
+    /**
      * {@inheritDoc}
      * 
      * @see org.jboss.dna.graph.request.ChangeRequest#changes(java.lang.String, org.jboss.dna.graph.property.Path)

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -62,6 +62,7 @@
 import org.jboss.dna.graph.request.CloneBranchRequest;
 import org.jboss.dna.graph.request.CopyBranchRequest;
 import org.jboss.dna.graph.request.InvalidWorkspaceException;
+import org.jboss.dna.graph.request.MoveBranchRequest;
 import org.jboss.dna.graph.request.Request;
 import org.jboss.dna.graph.session.GraphSession.Authorizer.Action;
 import com.google.common.collect.ListMultimap;
@@ -486,7 +487,17 @@
         authorizer.checkPermissions(newParentPath, Action.ADD_NODE);
         authorizer.checkPermissions(nodeToMove.getParent(), Action.REMOVE);
 
-        store.move(nodeToMove).as(newName).into(newParentPath);
+        // Perform the move operation, but use a batch so that we can read the latest list of children ...
+        Results results = store.batch().move(nodeToMove).as(newName).into(newParentPath).execute();
+        MoveBranchRequest moveRequest = (MoveBranchRequest)results.getRequests().get(0);
+        Location locationAfter = moveRequest.getActualLocationAfter();
+
+        // Find the parent node in the session ...
+        Node<Payload, PropertyPayload> parent = this.findNodeWith(locationAfter.getPath().getParent(), false);
+        if (parent != null && parent.isLoaded()) {
+            // Update the children to make them match the latest snapshot from the store ...
+            parent.synchronizeWithNewlyPersistedNode(locationAfter);
+        }
     }
 
     /**
@@ -633,6 +644,12 @@
         CloneBranchRequest request = (CloneBranchRequest)results.getRequests().get(0);
         Location locationOfCopy = request.getActualLocationAfter();
 
+        // Remove from the session all of the nodes that were removed as part of this clone ...
+        for (Location removed : request.getRemovedNodes()) {
+            Node<Payload, PropertyPayload> removedNode = findNodeWith(removed.getPath(), false);
+            if (removedNode != null) removedNode.remove(false);
+        }
+
         // Find the parent node in the session ...
         Node<Payload, PropertyPayload> parent = this.findNodeWith(locationOfCopy.getPath().getParent(), false);
         if (parent != null && parent.isLoaded()) {
@@ -2097,13 +2114,26 @@
          * is added to a different parent. However, the locations of same-name-siblings under the parent <i>are</i> updated.
          */
         protected void remove() {
+            remove(true);
+        }
+
+        /**
+         * Remove this node from it's parent. Note that locations are <i>not</i> updated, since they will be updated if this node
+         * is added to a different parent. However, the locations of same-name-siblings under the parent <i>are</i> updated.
+         * 
+         * @param markParentAsChanged true if the parent should be marked as being changed (i.e., when changes are initiated from
+         *        within this session), or false otherwise (i.e., when changes are made to reflect the persistent state)
+         */
+        protected void remove( boolean markParentAsChanged ) {
             assert !isStale();
             assert this.parent != null;
             assert this.parent.isLoaded();
             assert this.parent.childrenByName != null;
             assert this.parent.childrenByName != cache.NO_CHILDREN;
-            this.parent.markAsChanged();
-            this.markAsChanged();
+            if (markParentAsChanged) {
+                this.parent.markAsChanged();
+                this.markAsChanged();
+            }
             Name name = getName();
             List<Node<Payload, PropertyPayload>> childrenWithSameName = this.parent.childrenByName.get(name);
             this.parent = null;

Modified: trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/test/WritableConnectorTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/test/WritableConnectorTest.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/test/WritableConnectorTest.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -1001,7 +1001,7 @@
         graph.create("/segmentTestUuids/node1", propFactory.create(name("identifier"), "backup copy")).and();
 
         // Copy again to test the behavior now that the UUIDs are already in the default workspace
-        // This should remove /newUuids/node1/shouldBeRemoved
+        // This should remove /segmentTestUuids/node1[1]
         graph.clone("/node1")
              .fromWorkspace(workspaceName)
              .as(segment("node1[1]"))
@@ -1011,7 +1011,9 @@
         /*
          * Focus on testing node structure, since shouldCopyNodeWithChildren tests that properties get copied
          */
-        // /newUuids/node1 should have been removed when the new node was added with the same UUID
+        // /segmentTestUuids/node1[1] should have been removed when the new node was added with the same UUID
+        // Now "/segmentTestUuids/node1[1]" (which was "/segmentTestUuids/node1[2]") should have same UUID as the
+        // node with "identifier=backup copy" property
         assertThat(graph.getNodeAt("/segmentTestUuids").getChildren(), hasChildren(segment("node1"), segment("node1[2]")));
         assertThat(graph.getNodeAt("/segmentTestUuids/node1[1]").getProperty("identifier"), is(nullValue()));
         assertThat(graph.getNodeAt("/segmentTestUuids/node1[2]").getProperty("identifier").getFirstValue().toString(),
@@ -1092,7 +1094,7 @@
         graph.move("/node2").before("/node2");
 
         assertThat(graph.getChildren().of("/"), hasChildren(segment("node1"), segment("node2"), segment("node3")));
-    }    
+    }
 
     @Test
     public void shouldMoveNodes() {
@@ -1859,7 +1861,7 @@
         Stopwatch sw = new Stopwatch();
         boolean batch = true;
         createSubgraph(graph, initialPath, depth, numChildrenPerNode, numPropertiesPerNode, batch, sw, System.out, null);
-        
+
         assertThat(graph.getChildren().of("/"), hasChildren(segment("node1")));
         Subgraph subgraph = graph.getSubgraphOfDepth(2).at("/");
         assertThat(subgraph, is(notNullValue()));
@@ -1888,7 +1890,7 @@
         Stopwatch sw = new Stopwatch();
         boolean batch = true;
         createSubgraph(graph, initialPath, depth, numChildrenPerNode, numPropertiesPerNode, batch, sw, System.out, null);
-        
+
         assertThat(graph.getChildren().of("/"), hasChildren(segment("node1")));
 
         graph.addValue("foo").andValue("bar").to("newProperty").on("node1");
@@ -1912,7 +1914,7 @@
         Stopwatch sw = new Stopwatch();
         boolean batch = true;
         createSubgraph(graph, initialPath, depth, numChildrenPerNode, numPropertiesPerNode, batch, sw, System.out, null);
-        
+
         assertThat(graph.getChildren().of("/"), hasChildren(segment("node1")));
 
         graph.removeValue("The quick brown fox jumped over the moon. What? ").andValue("bar").from("property1").on("node1");
@@ -1934,7 +1936,7 @@
         Stopwatch sw = new Stopwatch();
         boolean batch = true;
         createSubgraph(graph, initialPath, depth, numChildrenPerNode, numPropertiesPerNode, batch, sw, System.out, null);
-        
+
         assertThat(graph.getChildren().of("/"), hasChildren(segment("node1")));
 
         graph.removeValue("The quick brown fox jumped over the moon. What? ").from("noSuchProperty").on("node1");

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -96,6 +96,7 @@
     public static I18n unableToSaveBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch;
     public static I18n allPropertyValuesMustHaveSameType;
     public static I18n cannotRemoveNodeFromClone;
+    public static I18n cannotRemoveNodeFromCloneDueToChangesInSession;
 
     public static I18n cannotRemoveParentNodeOfTarget;
     public static I18n invalidPropertyType;

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -346,6 +346,12 @@
                             String path = node.getPath().getString(context.getNamespaceRegistry());
                             throw new ConstraintViolationException(JcrI18n.cannotRemoveNodeFromClone.text(path, uuid));
                         }
+                        // Check whether the node has any local changes ...
+                        if (node.isChanged(true)) {
+                            // This session has changes on nodes that will be removed as a result of the clone ...
+                            String path = node.getPath().getString(context.getNamespaceRegistry());
+                            throw new RepositoryException(JcrI18n.cannotRemoveNodeFromCloneDueToChangesInSession.text(path, uuid));
+                        }
                     }
                 }
             }

Modified: trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties
===================================================================
--- trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties	2009-08-28 15:26:27 UTC (rev 1180)
@@ -86,6 +86,7 @@
 unableToSaveBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch = Unable to save "{0}" in workspace "{1}" because it contains changes that depend on changes to nodes outside of this branch
 allPropertyValuesMustHaveSameType = All values of property "{0}" on node "{3}" in workspace "{4}" must all be {2} values (values were: {1})
 cannotRemoveNodeFromClone = The node at "{0}" with UUID "{1}" exists in the current workspace but cannot be removed because it is a mandatory child node
+cannotRemoveNodeFromCloneDueToChangesInSession = The node at "{0}" with UUID "{1}" already exists in the current workspace and would be removed by the clone, but that node has been changed within this session and therefore cannot be removed
 cannotRemoveParentNodeOfTarget = The node at "{0}" with UUID "{1}" is a parent of the target node for this operation "{2}"
 invalidPropertyType = Invalid property type: {0}
  

Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrTckTest.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -65,6 +65,7 @@
 import org.apache.jackrabbit.test.api.SetValueValueFormatExceptionTest;
 import org.apache.jackrabbit.test.api.SetValueVersionExceptionTest;
 import org.apache.jackrabbit.test.api.ValueFactoryTest;
+import org.apache.jackrabbit.test.api.WorkspaceCloneReferenceableTest;
 import org.apache.jackrabbit.test.api.WorkspaceCloneSameNameSibsTest;
 import org.apache.jackrabbit.test.api.WorkspaceCloneVersionableTest;
 import org.apache.jackrabbit.test.api.WorkspaceCopyBetweenWorkspacesReferenceableTest;
@@ -74,6 +75,7 @@
 import org.apache.jackrabbit.test.api.WorkspaceCopyReferenceableTest;
 import org.apache.jackrabbit.test.api.WorkspaceCopySameNameSibsTest;
 import org.apache.jackrabbit.test.api.WorkspaceCopyVersionableTest;
+import org.apache.jackrabbit.test.api.WorkspaceMoveReferenceableTest;
 import org.apache.jackrabbit.test.api.WorkspaceMoveSameNameSibsTest;
 import org.apache.jackrabbit.test.api.WorkspaceMoveVersionableTest;
 
@@ -230,7 +232,7 @@
             addTestSuite(NodeCanAddMixinTest.class);
             addTestSuite(NodeRemoveMixinTest.class);
 
-            // dna-466 addTestSuite(WorkspaceCloneReferenceableTest.class);
+            addTestSuite(WorkspaceCloneReferenceableTest.class);
             addTestSuite(WorkspaceCloneSameNameSibsTest.class);
             // addTestSuite(WorkspaceCloneTest.class);
             addTestSuite(WorkspaceCloneVersionableTest.class);
@@ -242,7 +244,7 @@
             addTestSuite(WorkspaceCopySameNameSibsTest.class);
             // addTestSuite(WorkspaceCopyTest.class);
             addTestSuite(WorkspaceCopyVersionableTest.class);
-            // dna-466 addTestSuite(WorkspaceMoveReferenceableTest.class);
+            addTestSuite(WorkspaceMoveReferenceableTest.class);
             addTestSuite(WorkspaceMoveSameNameSibsTest.class);
             // addTestSuite(WorkspaceMoveTest.class);
             addTestSuite(WorkspaceMoveVersionableTest.class);

Modified: trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatingRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatingRequestProcessor.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/extensions/dna-connector-federation/src/main/java/org/jboss/dna/connector/federation/FederatingRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -325,8 +325,8 @@
         }
 
         // Delete in the cache ...
-        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.at(),
-                                                                   workspace.getCacheProjection().getWorkspaceName());
+        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.at(), workspace.getCacheProjection()
+                                                                                          .getWorkspaceName());
         executeInCache(cacheRequest, workspace);
     }
 
@@ -380,8 +380,8 @@
         }
 
         // Delete from the cache the parent of the new location ...
-        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.into(),
-                                                                   fromWorkspace.getCacheProjection().getWorkspaceName());
+        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.into(), fromWorkspace.getCacheProjection()
+                                                                                                .getWorkspaceName());
         executeInCache(cacheRequest, fromWorkspace);
     }
 
@@ -433,11 +433,14 @@
         } else {
             request.setActualLocations(fromProjection.convertToRepository(sourceRequest.getActualLocationBefore()),
                                        intoProjection.convertToRepository(sourceRequest.getActualLocationAfter()));
+            if (sourceRequest.removeExisting()) {
+                request.setRemovedNodes(Collections.unmodifiableSet(intoProjection.convertToRepository(sourceRequest.getRemovedNodes())));
+            }
         }
 
         // Delete from the cache the parent of the new location ...
-        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.into(),
-                                                                   fromWorkspace.getCacheProjection().getWorkspaceName());
+        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.into(), fromWorkspace.getCacheProjection()
+                                                                                                .getWorkspaceName());
         executeInCache(cacheRequest, fromWorkspace);
     }
 
@@ -484,8 +487,8 @@
                                        intoProjection.convertToRepository(sourceRequest.getActualLocationAfter()));
         }
         // Delete from the cache ...
-        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.from(),
-                                                                   workspace.getCacheProjection().getWorkspaceName());
+        DeleteBranchRequest cacheRequest = new DeleteBranchRequest(request.from(), workspace.getCacheProjection()
+                                                                                            .getWorkspaceName());
         executeInCache(cacheRequest, workspace);
         // Mark the new parent node as being expired ...
         cacheRequest = new DeleteBranchRequest(request.into(), workspace.getCacheProjection().getWorkspaceName());
@@ -520,8 +523,8 @@
         }
 
         // Update the cache ...
-        UpdatePropertiesRequest cacheRequest = new UpdatePropertiesRequest(request.on(),
-                                                                           workspace.getCacheProjection().getWorkspaceName(),
+        UpdatePropertiesRequest cacheRequest = new UpdatePropertiesRequest(request.on(), workspace.getCacheProjection()
+                                                                                                  .getWorkspaceName(),
                                                                            request.properties());
         executeInCache(cacheRequest, workspace);
     }
@@ -598,7 +601,7 @@
             this.pathInSource = pathInSource;
         }
 
-        protected Location convertToRepository( Location sourceLocation ) {
+        protected final Location convertToRepository( Location sourceLocation ) {
             assert sourceLocation != null;
             if (sourceLocation.hasPath()) {
                 Set<Path> paths = projection.getPathsInRepository(sourceLocation.getPath(), pathFactory);
@@ -607,6 +610,15 @@
             }
             return sourceLocation;
         }
+
+        protected Set<Location> convertToRepository( Set<Location> sourceLocations ) {
+            assert sourceLocations != null;
+            Set<Location> results = new HashSet<Location>();
+            for (Location sourceLocation : sourceLocations) {
+                results.add(convertToRepository(sourceLocation));
+            }
+            return results;
+        }
     }
 
     protected SingleProjection asSingleProjection( FederatedWorkspace federatedWorkspace,
@@ -1206,9 +1218,9 @@
                              readable(registry, create.properties()));
             } else if (request instanceof UpdatePropertiesRequest) {
                 UpdatePropertiesRequest update = (UpdatePropertiesRequest)request;
-                logger.trace("  updating {0} with properties {1}",
-                             update.on().getString(registry),
-                             readable(registry, update.properties().values()));
+                logger.trace("  updating {0} with properties {1}", update.on().getString(registry), readable(registry,
+                                                                                                             update.properties()
+                                                                                                                   .values()));
             } else {
                 logger.trace("  " + request.toString());
             }
@@ -1227,9 +1239,9 @@
                          readable(registry, create.properties()));
         } else if (request instanceof UpdatePropertiesRequest) {
             UpdatePropertiesRequest update = (UpdatePropertiesRequest)request;
-            logger.trace("  updating {0} with properties {1}",
-                         update.on().getString(registry),
-                         readable(registry, update.properties().values()));
+            logger.trace("  updating {0} with properties {1}", update.on().getString(registry), readable(registry,
+                                                                                                         update.properties()
+                                                                                                               .values()));
         } else {
             logger.trace("  " + request.toString());
         }

Modified: trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -703,6 +703,7 @@
         }
 
         request.setActualLocations(copy.getActualLocationBefore(), copy.getActualLocationAfter());
+        request.setRemovedNodes(null);
     }
 
     /**

Modified: trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java	2009-08-27 14:04:45 UTC (rev 1179)
+++ trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
@@ -961,7 +961,7 @@
                             oos.close();
                         }
                     }
-                    
+
                     // The new large values were recorded and associated with the properties entity during reserialization.
                     // However, any values no longer used now need to be removed ...
                     if (hadLargeValues) {
@@ -1427,6 +1427,7 @@
         logger.trace(request.toString());
         Location actualFromLocation = null;
         Location actualToLocation = null;
+        Set<Location> removedLocations = null;
         try {
             // Find the workspaces ...
             WorkspaceEntity fromWorkspace = getExistingWorkspace(request.fromWorkspace(), request);
@@ -1652,6 +1653,7 @@
                         }
                         // Remove from the cache of children locations all entries for deleted nodes ...
                         cache.removeBranch(intoWorkspaceId, deletedLocations.values());
+                        removedLocations = Collections.unmodifiableSet(new HashSet<Location>(deletedLocations.values()));
                     }
                     LargeValueEntity.deleteUnused(entities);
                 }
@@ -1668,6 +1670,7 @@
             return;
         }
         request.setActualLocations(actualFromLocation, actualToLocation);
+        request.setRemovedNodes(removedLocations);
         recordChange(request);
     }
 
@@ -1932,7 +1935,7 @@
         }
 
         assert beforeEntity != null;
-        
+
         Name childName = oldPath.getLastSegment().getName();
         String childLocalName = fromEntity.getChildName();
         NamespaceEntity ns = fromEntity.getChildNamespace();
@@ -2084,8 +2087,8 @@
                 } else {
 
                     ActualLocation actualBeforeLocation = getActualLocation(workspace, beforeLocation);
-                    ActualLocation actualIntoLocation = getActualLocation(workspace,
-                                                                          Location.create(beforeLocation.getPath().getParent()));
+                    ActualLocation actualIntoLocation = getActualLocation(workspace, Location.create(beforeLocation.getPath()
+                                                                                                                   .getParent()));
 
                     actualNewLocation = moveNodeBefore(workspace, actualLocation, actualIntoLocation, actualBeforeLocation);
                 }
@@ -2429,7 +2432,7 @@
 
             props.setData(baos.toByteArray());
             props.setPropertyCount(numProperties);
-            
+
             // Record the changes to the references ...
             if (refs != null && refs.hasWritten()) {
                 for (Reference reference : refs.getWritten()) {
@@ -2555,7 +2558,7 @@
                 }
             }
             Path fullPath = pathFactory.createAbsolutePath(segments);
-            Location newLocation = original.with(fullPath); 
+            Location newLocation = original.with(fullPath);
             cache.addNewNode(workspaceId, newLocation);
             return new ActualLocation(newLocation, nodeUuidString, originalEntity);
         }
@@ -2578,13 +2581,13 @@
         if (cachedParent != null) {
             // We know the UUID of the parent, so we can find the child a little faster ...
             ChildEntity child = findByPathSegment(workspaceId, cachedParent.getUuid().toString(), path.getLastSegment());
-            
+
             // If there is no matching child, throw an exception
             if (child == null) {
                 // Could not find the node given the supplied path, so find the lowest path that does exist ...
                 throw new PathNotFoundException(original, cachedParent.getPath(), JpaConnectorI18n.nodeDoesNotExist.text(path));
             }
-            
+
             uuidString = child.getId().getChildUuidString();
             Location newLocation = original.with(UUID.fromString(uuidString));
             cache.addNewNode(workspaceId, newLocation);
@@ -2614,7 +2617,8 @@
         return new ActualLocation(newLocation, uuidString, child);
     }
 
-    protected ChildEntity findNode( long workspaceId, String uuidString) {
+    protected ChildEntity findNode( long workspaceId,
+                                    String uuidString ) {
         Query query = entities.createNamedQuery("ChildEntity.findByChildUuid");
         query.setParameter("workspaceId", workspaceId);
         query.setParameter("childUuidString", uuidString);
@@ -2625,7 +2629,7 @@
             return null;
         }
     }
-    
+
     /**
      * Find the node with the supplied path segment that is a child of the supplied parent.
      * 


From dna-commits at lists.jboss.org  Fri Aug 28 11:55:29 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Fri, 28 Aug 2009 11:55:29 -0400
Subject: [dna-commits] DNA SVN: r1181 - in trunk:
	dna-jcr/src/main/java/org/jboss/dna/jcr and 1 other directories.
Message-ID: <200908281555.n7SFtTjV026318@svn01.web.mwc.hst.phx2.redhat.com>

Author: rhauch
Date: 2009-08-28 11:55:28 -0400 (Fri, 28 Aug 2009)
New Revision: 1181

Modified:
   trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
   trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java
Log:
DNA-505 Svn Repository Source with NPE and other issues while opening connection through Jcr

A user reported an NPE, which I wasn't able to reproduce, but I changed AbstractJcrNode.toString() to better handle this situation if it should arise.  However, it shouldn't really be happening in the first place, so I've made a few other changes to try and further prevent this NPE.

First, the PropertyIterator should never expose a null Property, so the code that is creating this (and the underlying collection of Property objects) was changed to never add a null reference to the collection.

Second, the SVN connector had one case where it *might* add a null property object to the resulting nodes, so the code was changed to handle this case.

Modified: trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java
===================================================================
--- trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java	2009-08-28 15:26:27 UTC (rev 1180)
+++ trunk/dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SvnAndJcrIntegrationTest.java	2009-08-28 15:55:28 UTC (rev 1181)
@@ -83,10 +83,11 @@
 
     @Test
     public void shouldIterateOverChildrenOfRoot() throws Exception {
+        System.out.println("Getting the root node and it's children ...");
         NodeIterator nodeIterator = this.session.getRootNode().getNodes();
 
         while (nodeIterator.hasNext()) {
-            System.out.println(nodeIterator.nextNode().getPath());
+            System.out.println(nodeIterator.nextNode());
         }
         assertThat(this.session.getRootNode().getNode("dna-graph"), is(notNullValue()));
     }

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java	2009-08-28 15:26:27 UTC (rev 1180)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java	2009-08-28 15:55:28 UTC (rev 1181)
@@ -1690,7 +1690,7 @@
             StringBuffer propertyBuff = new StringBuffer();
             while (iter.hasNext()) {
                 AbstractJcrProperty prop = (AbstractJcrProperty)iter.nextProperty();
-                propertyBuff.append(prop.toString()).append(", ");
+                propertyBuff.append(prop).append(", ");
             }
             return this.getPath() + " {" + propertyBuff.toString() + "}";
         } catch (RepositoryException re) {

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-08-28 15:26:27 UTC (rev 1180)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-08-28 15:55:28 UTC (rev 1181)
@@ -599,7 +599,8 @@
                 Name propertyName = property.getName();
                 if (propertyName.equals(JcrLexicon.UUID) && !isReferenceable(node)) continue;
                 if (!propertyName.getNamespaceUri().equals(DnaIntLexicon.Namespace.URI)) {
-                    result.add(property.getPayload().getJcrProperty());
+                    AbstractJcrProperty prop = property.getPayload().getJcrProperty();
+                    if (prop != null) result.add(prop);
                 }
             }
             return result;

Modified: trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java	2009-08-28 15:26:27 UTC (rev 1180)
+++ trunk/extensions/dna-connector-svn/src/main/java/org/jboss/dna/connector/svn/SVNRepositoryRequestProcessor.java	2009-08-28 15:55:28 UTC (rev 1181)
@@ -131,6 +131,15 @@
         this.accessData = accessData;
     }
 
+    protected void addProperty( List<Property> properties,
+                                PropertyFactory factory,
+                                Name propertyName,
+                                Object value ) {
+        if (value != null) {
+            properties.add(factory.create(propertyName, value));
+        }
+    }
+
     protected boolean readNode( String workspaceName,
                                 Location myLocation,
                                 List<Property> properties,
@@ -186,10 +195,10 @@
                     }
                     if (properties != null) {
                         // Load the properties for this directory ......
-                        properties.add(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FOLDER));
+                        addProperty(properties, factory, JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FOLDER);
                         SVNDirEntry entry = getEntryInfo(workspaceRoot, directoryPath);
                         if (entry != null) {
-                            properties.add(factory.create(JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate())));
+                            addProperty(properties, factory, JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate()));
                         }
                     }
                 } else {
@@ -205,8 +214,8 @@
                             SVNDirEntry entry = getEntryInfo(workspaceRoot, contentPath);
                             if (entry != null) {
                                 // The request is to get properties of the "jcr:content" child node ...
-                                properties.add(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.RESOURCE));
-                                properties.add(factory.create(JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate())));
+                                addProperty(properties, factory, JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.RESOURCE);
+                                addProperty(properties, factory, JcrLexicon.LAST_MODIFIED, dateFactory.create(entry.getDate()));
                             }
 
                             ByteArrayOutputStream os = new ByteArrayOutputStream();
@@ -214,12 +223,12 @@
                             getData(contentPath, fileProperties, os);
                             String mimeType = fileProperties.getStringValue(SVNProperty.MIME_TYPE);
                             if (mimeType == null) mimeType = DEFAULT_MIME_TYPE;
-                            properties.add(factory.create(JcrLexicon.MIMETYPE, mimeType));
+                            addProperty(properties, factory, JcrLexicon.MIMETYPE, mimeType);
 
                             if (os.toByteArray().length > 0) {
                                 // Now put the file's content into the "jcr:data" property ...
                                 BinaryFactory binaryFactory = getExecutionContext().getValueFactories().getBinaryFactory();
-                                properties.add(factory.create(JcrLexicon.DATA, binaryFactory.create(os.toByteArray())));
+                                addProperty(properties, factory, JcrLexicon.DATA, binaryFactory.create(os.toByteArray()));
                             }
                         }
                     } else {
@@ -235,14 +244,12 @@
                         }
                         if (properties != null) {
                             // Now add the properties to "nt:file" ...
-                            properties.add(factory.create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE));
+                            addProperty(properties, factory, JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.FILE);
                             ByteArrayOutputStream os = new ByteArrayOutputStream();
                             SVNProperties fileProperties = new SVNProperties();
                             getData(filePath, fileProperties, os);
                             String created = fileProperties.getStringValue(SVNProperty.COMMITTED_DATE);
-                            if (created != null) {
-                                properties.add(factory.create(JcrLexicon.CREATED, dateFactory.create(created)));
-                            }
+                            addProperty(properties, factory, JcrLexicon.CREATED, dateFactory.create(created));
                         }
                     }
                 }


From dna-commits at lists.jboss.org  Mon Aug 31 09:46:22 2009
From: dna-commits at lists.jboss.org (dna-commits at lists.jboss.org)
Date: Mon, 31 Aug 2009 09:46:22 -0400
Subject: [dna-commits] DNA SVN: r1182 - in
	branches/eclipse/org.jboss.dna.publish.ui.swt: icons/views
	and 5 other directories.
Message-ID: <200908311346.n7VDkMMS031878@svn01.web.mwc.hst.phx2.redhat.com>

Author: elvisisking
Date: 2009-08-31 09:46:22 -0400 (Mon, 31 Aug 2009)
New Revision: 1182

Added:
   branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/blank.gif
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/DnaResourceHelper.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ReconnectToServerAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ShowPublishedLocationsAction.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishedLocationsDialog.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaContentProvider.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaMessageConsole.java
Removed:
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
Modified:
   branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
   branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
   branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
Log:
Created a show published locations action and dialog that shows the workspaces the selected file has been published to. The dialog also allows the user to copy the workspace URL where the selected file is published at. The published locations are persisted across sessions. Refactored the content/label provider name from ServerContentProvider to DnaContentProvider. Refactored the DnaMessageConsole to be its own class. Added a job ID to all console messages. Added refresh (now called reconnect) to the context menu of the server view.

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/dna-web-jcr-rest-client-0.6-SNAPSHOT-jar-with-dependencies.jar
===================================================================
(Binary files differ)

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/blank.gif
===================================================================
(Binary files differ)


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/icons/views/blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.properties	2009-08-31 13:46:22 UTC (rev 1182)
@@ -29,4 +29,5 @@
 dnaCategory = DNA
 publishAction.label = Publish
 serverView = DNA Servers
+showPublishedLocationsAction.label = Show Published Locations
 unpublishAction.label = Unpublish
\ No newline at end of file

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/plugin.xml	2009-08-31 13:46:22 UTC (rev 1182)
@@ -17,6 +17,22 @@
             </separator>
          </menu>
          
+         <!-- Show Published Locations action -->
+         <action
+               id="org.jboss.dna.web.jcr.rest.client.swt.showPublishedLocationsAction"
+               label="%showPublishedLocationsAction.label"
+               class="org.jboss.dna.web.jcr.rest.client.swt.actions.ShowPublishedLocationsAction"
+               icon="icons/views/blank.gif"
+               menubarPath="org.jboss.dna.web.jcr.rest.client.swt.contextMenu/group1"
+               enablesFor="1">
+               <enablement>
+                   <and>
+                      <objectClass name="org.eclipse.core.resources.IFile" />
+                      <objectState name="persistentProperty" value="org.jboss.dna.web.jcr.rest.client.swt.publishedIn" />
+                   </and>
+               </enablement>
+         </action>
+        
          <!-- Unpublish action -->
          <action
                id="org.jboss.dna.web.jcr.rest.client.swt.unpublishAction"
@@ -87,8 +103,8 @@
             adaptable="true"
             label="%decorator.label"
             state="true"
-            class="org.jboss.dna.web.jcr.rest.client.swt.views.ServerContentProvider"
-            id="dnaDecorator">
+            class="org.jboss.dna.web.jcr.rest.client.swt.views.DnaContentProvider"
+            id="org.jboss.dna.web.jcr.rest.client.swt.dnaDecorator">
          <description>
             %decorator.description
          </description>
@@ -97,7 +113,7 @@
             <objectClass
                   name="org.jboss.dna.web.jcr.rest.client.domain.IDnaObject">
             </objectClass>
-              <objectClass
+            <objectClass
                   name="org.eclipse.core.resources.IFile">
             </objectClass>
          </or>

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/DnaResourceHelper.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/DnaResourceHelper.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/DnaResourceHelper.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -0,0 +1,258 @@
+/*
+ * 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.web.jcr.rest.client.swt;
+
+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.
+ * 
+ * @since 0.6
+ */
+public final class DnaResourceHelper {
+
+    // ===========================================================================================================================
+    // Constants
+    // ===========================================================================================================================
+
+    /**
+     * Delimiter between a workspace's properties.
+     * 
+     * @since 0.6
+     */
+    private static final String ID_DELIM = "$"; //$NON-NLS-1$
+
+    /**
+     * Delimiter between workspaces.
+     * 
+     * @since 0.6
+     */
+    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.
+     * 
+     * @since 0.6
+     */
+    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.
+     * 
+     * @since 0.6
+     */
+    private final ServerManager serverManager;
+
+    // ===========================================================================================================================
+    // Constructors
+    // ===========================================================================================================================
+
+    /**
+     * @param serverManager the server manager used by this helper (never <code>null</code>)
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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);
+    }
+
+    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: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/DnaResourceHelper.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/IUiConstants.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -35,13 +35,6 @@
      */
     String PLUGIN_ID = "org.jboss.dna.web.jcr.rest.client.swt"; //$NON-NLS-1$
 
-    /**
-     * The identifier and type of the DNA Message Console. This is where publishing and unpublishing operations are logged.
-     * 
-     * @since 0.6
-     */
-    String DNA_CONSOLE_ID = "org.jboss.dna.web.jcr.rest.client.swt.views.DnaConsole"; //$NON-NLS-1$
-
     String ICON_FOLDER = "icons/"; //$NON-NLS-1$
 
     //
@@ -64,6 +57,8 @@
 
     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$

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -45,6 +45,10 @@
     public static I18n deleteServerDialogOneServerMsg;
     public static I18n deleteServerDialogTitle;
 
+    public static I18n dnaConsoleName;
+    public static I18n dnaConsoleProblemCreatingHyperlinkMsg;
+    public static I18n dnaConsoleFilePathNotFoundMsg;
+
     public static I18n editServerActionText;
     public static I18n editServerActionToolTip;
 
@@ -54,14 +58,27 @@
 
     public static I18n newServerActionText;
     public static I18n newServerActionToolTip;
+
+    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 publishJobConsoleName;
+    public static I18n publishJobCanceled;
+    public static I18n publishJobLongDurationMsg;
+    public static I18n publishJobShortDurationMsg;
     public static I18n publishJobPublish;
     public static I18n publishJobPublishCanceledMsg;
-    public static I18n publishJobProblemCreatingHyperlinkMsg;
     public static I18n publishJobPublishFile;
+    public static I18n publishJobPublishFile2;
     public static I18n publishJobPublishFileFailed;
     public static I18n publishJobPublishFileInfo;
     public static I18n publishJobPublishFileWarning;
@@ -111,8 +128,6 @@
     public static I18n publishWizardUnpublishTitle;
     public static I18n publishWizardUnpublishErrorMsg;
 
-    public static I18n refreshActionToolTip;
-
     public static I18n serverManagerGetRepositoriesExceptionMsg;
     public static I18n serverManagerGetWorkspacesExceptionMsg;
 
@@ -136,12 +151,17 @@
     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;

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/RestClientI18n.properties	2009-08-31 13:46:22 UTC (rev 1182)
@@ -26,7 +26,7 @@
 
 collapseActionToolTip = Collapse All
 
-deleteServerActionText = Delete Server
+deleteServerActionText = Discard
 deleteServerActionToolTip = Delete server from the server registry
 
 deleteServerDialogErrorsOccurredMsg = There were errors deleting servers from the server registry. See log for more details.
@@ -37,6 +37,10 @@
 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.
+
 errorDialogTitle = Error
 
 missingImage = The following image cannot be found "{0}"
@@ -44,29 +48,42 @@
 newServerActionText = New Server
 newServerActionToolTip = Create a new server
 
+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}"
 
-publishJobConsoleName = DNA
-publishJobProblemCreatingHyperlinkMsg = Unexpected problem creating hyperlink in DNA Console view
+publishJobCanceled = Job {0} was canceled. See log for details.
+publishJobLongDurationMsg = {0} hour(s), {1} minute(s), {2} second(s)
+publishJobShortDurationMsg = less than 1 second
 publishJobPublish = [{0}] Publishing {4} file(s) to server "{1}" (repository "{2}", workspace "{3}") ...
-publishJobPublishCanceledMsg = [{0}] ! Publishing to server "{1}" (repository "{2}", workspace "{3}") was canceled after {4} file(s) out of {5} were processed.\n
-publishJobPublishFile = \t[{0}] + Published file "{1}"
-publishJobPublishFileFailed = \t[{0}] * Publishing file "{1}" generated an ERROR message. See log.
-publishJobPublishFileInfo = \t[{0}] i Publishing file "{1}" generated an INFO message. See log.
-publishJobPublishFileWarning = \t[{0}] w Publishing file "{1}" generated a WARNING message. See log.
-publishJobPublishFinishedMsg = [{0}] Done publishing ({4} milliseconds) to server "{1}" (repository "{2}", workspace "{3}").\n
-publishJobPublishName = DNA Publish 
-publishJobPublishTaskName = Publishing resources
+publishJobPublishCanceledMsg = [{0}] !! Publishing to server "{1}" (repository "{2}", workspace "{3}") was canceled after {4} file(s) out of {5} were processed.\n
+publishJobPublishFile = \t[{0}]    ++ Published file "{1}" to URL\ 
+publishJobPublishFile2 = "{0}"
+publishJobPublishFileFailed = \t[{0}] ERROR Publishing file "{1}" generated an ERROR message. See log.
+publishJobPublishFileInfo = \t[{0}]  INFO Publishing file "{1}" generated an INFO message. See log.
+publishJobPublishFileWarning = \t[{0}]  WARN 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}] ! Unpublishing from server "{1}" (repository "{2}", workspace "{3}") was canceled after {4} file(s) out of {5} were processed.\n
-publishJobUnpublishFile = \t[{0}] - Unpublished file "{1}"
-publishJobUnpublishFileFailed = \t[{0}] * Unpublishing file "{0}" generated an ERROR message. See log.
-publishJobUnpublishFileInfo = \t[{0}] i Unpublishing file "{1}" generated an INFO message. See log.
-publishJobUnpublishFileWarning = \t[{0}] w Unpublishing file "{1}" generated a WARNING message. See log.
-publishJobUnpublishFinishedMsg = [{0}] Done unpublishing ({4} milliseconds) from server "{1}" (repository "{2}", workspace "{3}").\n
-publishJobUnpublishName = DNA Unpublish
-publishJobUnpublishTaskName = Unpublishing resources
+publishJobUnpublishCanceledMsg = [{0}] !! Unpublishing from server "{1}" (repository "{2}", workspace "{3}") was canceled after {4} file(s) out of {5} were processed.\n
+publishJobUnpublishFile = \t[{0}]    -- Unpublished file "{1}"
+publishJobUnpublishFileFailed = \t[{0}] ERROR Unpublishing file "{0}" generated an ERROR message. See log.
+publishJobUnpublishFileInfo = \t[{0}]  INFO Unpublishing file "{1}" generated an INFO message. See log.
+publishJobUnpublishFileWarning = \t[{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
@@ -100,7 +117,8 @@
 publishWizardUnpublishErrorMsg = Error Unpublishing
 publishWizardUnpublishTitle = Unpublish
 
-refreshActionToolTip = Refresh
+serverReconnectActionText = Reconnect
+serverReconnectActionToolTip = Reconnect to selected servers or all servers if no servers selected
 
 serverManagerGetRepositoriesExceptionMsg = There was a problem obtaining repositories for the server "{0}."
 serverManagerGetWorkspacesExceptionMsg = There was a problem obtaining workspaces for repository "{0}."
@@ -132,5 +150,7 @@
 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

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/Utils.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -23,13 +23,7 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt;
 
-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.IStatus;
-import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
@@ -39,7 +33,6 @@
 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;
-import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
 
 /**
  * @since 0.6
@@ -47,71 +40,10 @@
 public final class Utils {
 
     // ===========================================================================================================================
-    // Constants
-    // ===========================================================================================================================
-
-    /**
-     * Delimiter between a workspace's properties.
-     * 
-     * @since 0.6
-     */
-    private static final String ID_DELIM = "$"; //$NON-NLS-1$
-
-    /**
-     * Delimiter between workspaces.
-     * 
-     * @since 0.6
-     */
-    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.
-     * 
-     * @since 0.6
-     */
-    private static QualifiedName PUBLISHED_RESOURCE_PROPERTY = new QualifiedName(IUiConstants.PLUGIN_ID, "publishedIn"); //$NON-NLS-1$
-
-    // ===========================================================================================================================
     // Class Methods
     // ===========================================================================================================================
 
     /**
-     * @param file the file that was just published
-     * @param workspace the workspace where the file was published
-     * @since 0.6
-     */
-    public static void addPublishedProperty( IFile file,
-                                             Workspace workspace ) {
-        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
-        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
-
-        String wsValue = createWorkspaceId(workspace);
-
-        try {
-            Set<String> workspaces = null;
-
-            // get current value
-            String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
-
-            if (value == null) {
-                workspaces = new HashSet<String>(1);
-            } else {
-                workspaces = parsePublishedPropertyValue(value);
-            }
-
-            workspaces.add(wsValue);
-
-            // set new value
-            value = createPublishedPropertyValue(workspaces);
-            file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, value);
-        } catch (CoreException e) {
-            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
-        }
-    }
-
-    /**
      * 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
@@ -181,35 +113,6 @@
     }
 
     /**
-     * @param workspaces the workspaces used to create the property value
-     * @return the property value
-     * @since 0.6
-     */
-    private static String createPublishedPropertyValue( Set<String> workspaces ) {
-        StringBuilder value = new StringBuilder();
-
-        for (String workspace : workspaces) {
-            value.append(workspace).append(DELIM);
-        }
-
-        return value.toString();
-    }
-
-    /**
-     * @param workspace the workspace whose identifier is being created
-     * @return the ID
-     * @since 0.6
-     */
-    private static 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();
-    }
-
-    /**
      * The OK status does not have an image.
      * 
      * @param status the status whose image is being requested (never <code>null</code>)
@@ -257,72 +160,6 @@
         return null;
     }
 
-    /**
-     * @param file the file whose published status is being requested
-     * @return <code>true</code> if the file has been published to any DNA repository
-     * @since 0.6
-     */
-    public static boolean isPublished( IFile file ) {
-        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
-
-        try {
-            return (file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY) != null);
-        } catch (CoreException e) {
-            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
-        }
-
-        return false;
-    }
-
-    /**
-     * @param value the property value being parsed
-     * @return a collection of workspace identifiers
-     * @since 0.6
-     */
-    private static Set<String> parsePublishedPropertyValue( String value ) {
-        StringTokenizer st = new StringTokenizer(value, DELIM);
-        Set<String> workspaces = new HashSet<String>(st.countTokens());
-
-        while (st.hasMoreTokens()) {
-            workspaces.add(st.nextToken());
-        }
-
-        return workspaces;
-    }
-
-    /**
-     * @param file the file that was just unpublished
-     * @param workspace the workspace where the file was unpublished
-     * @since 0.6
-     */
-    public static void removePublishedProperty( IFile file,
-                                                Workspace workspace ) {
-        CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
-        CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
-
-        String wsValue = createWorkspaceId(workspace);
-
-        try {
-            String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
-
-            if (value != null) {
-                Set<String> workspaces = parsePublishedPropertyValue(value);
-                workspaces.remove(wsValue);
-
-                if (workspaces.isEmpty()) {
-                    // no other workspaces so remove property
-                    file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, null);
-                } else {
-                    // set new value
-                    value = createPublishedPropertyValue(workspaces);
-                    file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, value);
-                }
-            }
-        } catch (CoreException e) {
-            Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
-        }
-    }
-
     // ===========================================================================================================================
     // Constructors
     // ===========================================================================================================================

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ReconnectToServerAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ReconnectToServerAction.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ReconnectToServerAction.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -0,0 +1,106 @@
+/*
+ * 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.web.jcr.rest.client.swt.actions;
+
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.REFRESH_IMAGE;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.jboss.dna.web.jcr.rest.client.IServerRegistryListener;
+import org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent;
+import org.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+
+/**
+ * The <code>ReconnectToServerAction</code> tries to reconnect to one or more selected servers or to all servers if none are
+ * selected. This action must be registered to received server registry events.
+ * 
+ * @since 0.6
+ */
+public final class ReconnectToServerAction extends Action implements IServerRegistryListener {
+
+    // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    /**
+     * The server view tree viewer.
+     * 
+     * @since 0.6
+     */
+    private final TreeViewer viewer;
+
+    // ===========================================================================================================================
+    // Constructors
+    // ===========================================================================================================================
+
+    /**
+     * @param viewer the server view tree viewer
+     * @since 0.6
+     */
+    public ReconnectToServerAction( TreeViewer viewer ) {
+        super(RestClientI18n.serverReconnectActionText.text());
+        setToolTipText(RestClientI18n.serverReconnectActionToolTip.text());
+        setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE));
+        setEnabled(false);
+
+        this.viewer = viewer;
+    }
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.action.Action#run()
+     * @since 0.6
+     */
+    @Override
+    public void run() {
+        IStructuredSelection selection = (IStructuredSelection)this.viewer.getSelection();
+
+        if (selection.size() == 0) {
+            this.viewer.refresh();
+        } else {
+            for (Object server : selection.toArray()) {
+                this.viewer.refresh(server);
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.jboss.dna.web.jcr.rest.client.IServerRegistryListener#serverRegistryChanged(org.jboss.dna.web.jcr.rest.client.ServerRegistryEvent)
+     * @since 0.6
+     */
+    @Override
+    public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
+        setEnabled(!event.getServerManager().getServers().isEmpty());
+        return null;
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ReconnectToServerAction.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ShowPublishedLocationsAction.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ShowPublishedLocationsAction.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ShowPublishedLocationsAction.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -0,0 +1,141 @@
+/*
+ * 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.web.jcr.rest.client.swt.actions;
+
+import static org.jboss.dna.web.jcr.rest.client.swt.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.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;
+import org.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.DnaResourceHelper;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.dialogs.PublishedLocationsDialog;
+
+/**
+ * The <code>PublishAction</code> controls the publishing of one or more {@link org.eclipse.core.resources.IResource}s to a DNA
+ * repository.
+ * 
+ * @since 0.6
+ */
+public final class ShowPublishedLocationsAction extends Action implements IObjectActionDelegate {
+
+    // ===========================================================================================================================
+    // Fields
+    // ===========================================================================================================================
+
+    /**
+     * The current workspace selection.
+     * 
+     * @since 0.6
+     */
+    private IStructuredSelection selection;
+
+    /**
+     * The active part's Shell.
+     * 
+     * @since 0.6
+     */
+    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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public void setActivePart( IAction action,
+                               IWorkbenchPart targetPart ) {
+        this.shell = targetPart.getSite().getShell();
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/actions/ShowPublishedLocationsAction.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/DeleteServerDialog.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -38,6 +38,7 @@
 import org.jboss.dna.web.jcr.rest.client.domain.Server;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.Utils;
 
 /**
  * The <code>DeleteServerDialog</code> class provides a UI for deleting a {@link Server server}.
@@ -126,4 +127,16 @@
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
+     * @since 0.6
+     */
+    @Override
+    protected void initializeBounds() {
+        super.initializeBounds();
+        Utils.centerAndSizeShellRelativeToDisplay(getShell(), 75, 75);
+    }
+
 }

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishedLocationsDialog.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishedLocationsDialog.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishedLocationsDialog.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -0,0 +1,513 @@
+/*
+ * 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.web.jcr.rest.client.swt.dialogs;
+
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.BLANK_IMAGE;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_IMAGE_16x;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.REPOSITORY_IMAGE;
+import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.SERVER_IMAGE;
+import static org.jboss.dna.web.jcr.rest.client.swt.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.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;
+import org.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.Utils;
+
+/**
+ * The <code>PublishedLocationsDialog</code> class provides a UI for viewing a list of {@link Server servers} a selected file has
+ * been published to.
+ * 
+ * @since 0.6
+ */
+public final class PublishedLocationsDialog extends MessageDialog {
+
+    // ===========================================================================================================================
+    // Constants
+    // ===========================================================================================================================
+
+    /**
+     * The column index of the server URL.
+     * 
+     * @since 0.6
+     */
+    private static final int SERVER_URL_COL = 0;
+
+    /**
+     * The column index of the server user.
+     * 
+     * @since 0.6
+     */
+    private static final int USER_COL = 1;
+
+    /**
+     * The column index of the repository name.
+     * 
+     * @since 0.6
+     */
+    private static final int REPOSITORY_COL = 2;
+
+    /**
+     * The column index of the workspace name.
+     * 
+     * @since 0.6
+     */
+    private static final int WORKSPACE_COL = 3;
+
+    /**
+     * The column index of the URL where the file was published.
+     * 
+     * @since 0.6
+     */
+    private static final int FILE_URL_COL = 4;
+
+    /**
+     * The column indexes of all columns.
+     * 
+     * @since 0.6
+     */
+    private static final int[] COLUMNS = {SERVER_URL_COL, USER_COL, REPOSITORY_COL, WORKSPACE_COL, FILE_URL_COL};
+
+    /**
+     * The column headers.
+     * 
+     * @since 0.6
+     */
+    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.
+     * 
+     * @since 0.6
+     */
+    private Button btnCopy;
+
+    /**
+     * The file whose workspaces it was published to is being displayed by this dialog.
+     * 
+     * @since 0.6
+     */
+    private final IFile file;
+
+    /**
+     * The server manager who can obtain the URL for the file at each of the workspaces.
+     * 
+     * @since 0.6
+     */
+    private final ServerManager serverManager;
+
+    /**
+     * The viewer of the table holding the published locations.
+     * 
+     * @since 0.6
+     */
+    private TableViewer viewer;
+
+    /**
+     * Collection of workspaces the selected file has been published to.
+     * 
+     * @since 0.6
+     */
+    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>)
+     * @since 0.6
+     */
+    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)
+     * @since 0.6
+     */
+    @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)
+             * @since 0.6
+             */
+            @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)
+             * @since 0.6
+             */
+            @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>)
+     * @since 0.6
+     */
+    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>)
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    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>)
+     * @since 0.6
+     */
+    Object[] getWorkspaces() {
+        return this.workspaces.toArray();
+    }
+
+    /**
+     * Handler for when the copy URL button is clicked.
+     * 
+     * @since 0.6
+     */
+    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.
+     * 
+     * @since 0.6
+     */
+    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()
+     * @since 0.6
+     */
+    @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.
+     * 
+     * @since 0.6
+     */
+    class LocationsTableProvider implements IStructuredContentProvider, ITableLabelProvider {
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+         * @since 0.6
+         */
+        @Override
+        public void addListener( ILabelProviderListener listener ) {
+            // nothing to do
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+         * @since 0.6
+         */
+        @Override
+        public void dispose() {
+            // nothing to do
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+         * @since 0.6
+         */
+        @Override
+        public Image getColumnImage( Object element,
+                                     int columnIndex ) {
+            return null;
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+         * @since 0.6
+         */
+        @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)
+         * @since 0.6
+         */
+        @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)
+         * @since 0.6
+         */
+        @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)
+         * @since 0.6
+         */
+        @Override
+        public boolean isLabelProperty( Object element,
+                                        String property ) {
+            return false;
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+         * @since 0.6
+         */
+        @Override
+        public void removeListener( ILabelProviderListener listener ) {
+            // nothing to do
+        }
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/dialogs/PublishedLocationsDialog.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaContentProvider.java (from rev 1171, branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java)
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaContentProvider.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaContentProvider.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -0,0 +1,355 @@
+/*
+ * 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.web.jcr.rest.client.swt.views;
+
+import static org.jboss.dna.web.jcr.rest.client.swt.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.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.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.DnaResourceHelper;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+import org.jboss.dna.web.jcr.rest.client.swt.Utils;
+
+/**
+ * The <code>DnaContentProvider</code> is a content and label provider for DNA repositories.
+ * 
+ * @since 0.6
+ */
+public final class DnaContentProvider extends ColumnLabelProvider implements ILightweightLabelDecorator, ITreeContentProvider {
+
+    // ===========================================================================================================================
+    // Constants
+    // ===========================================================================================================================
+
+    /**
+     * The decorator ID.
+     * 
+     * @since 0.6
+     */
+    private static final String ID = "org.jboss.dna.web.jcr.rest.client.swt.dnaDecorator"; //$NON-NLS-1$
+
+    // ===========================================================================================================================
+    // Class Methods
+    // ===========================================================================================================================
+
+    /**
+     * @return the DNA decorator
+     * @since 0.6
+     */
+    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.
+     * 
+     * @since 0.6
+     */
+    private ServerManager serverManager;
+
+    // ===========================================================================================================================
+    // Methods
+    // ===========================================================================================================================
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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()
+     * @since 0.6
+     */
+    @Override
+    public void dispose() {
+        // nothing to do
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+     * @since 0.6
+     */
+    @Override
+    public Object[] getChildren( Object parentElement ) {
+        assert (parentElement instanceof IDnaObject);
+
+        try {
+            if ((parentElement instanceof Server) && (getServerManager() != null)) {
+                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) && (getServerManager() != null)) {
+                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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public Image getImage( Object element ) {
+        return Activator.getDefault().getImage(element);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+     * @since 0.6
+     */
+    @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>
+     * @since 0.6
+     */
+    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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public Image getToolTipImage( Object object ) {
+        return getImage(object);
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @Override
+    public int getToolTipTimeDisplayed( Object object ) {
+        return 3000;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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)
+     * @since 0.6
+     */
+    @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() {
+            @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)
+     * @since 0.6
+     */
+    @Override
+    public void removeListener( ILabelProviderListener listener ) {
+        // nothing to do
+    }
+
+}


Property changes on: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaContentProvider.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaMessageConsole.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaMessageConsole.java	                        (rev 0)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaMessageConsole.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -0,0 +1,359 @@
+/*
+ * 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.web.jcr.rest.client.swt.views;
+
+import static org.jboss.dna.web.jcr.rest.client.swt.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.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.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
+
+/**
+ * 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.
+ * 
+ * @since 0.6
+ */
+public final class DnaMessageConsole extends MessageConsole {
+
+    // =======================================================================================================================
+    // Constants
+    // =======================================================================================================================
+
+    /**
+     * The identifier and type of the DNA Message Console.
+     * 
+     * @since 0.6
+     */
+    private static final String ID = "org.jboss.dna.web.jcr.rest.client.swt.views.DnaMessageConsole"; //$NON-NLS-1$
+
+    /**
+     * The message console name.
+     * 
+     * @since 0.6
+     */
+    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>)
+     * @since 0.6
+     */
+    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;
+    }
+
+    /**
+     * @param message the message being written to the console (never <code>null</code>)
+     * @param emphasize indicates if the message should be emphasized in the console
+     * @since 0.6
+     */
+    public static void write( String message,
+                              boolean emphasize ) {
+        CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
+        DnaMessageConsole console = getDnaConsole();
+        console.print(message, emphasize, false, null);
+    }
+
+    /**
+     * @param message the message being written to the console
+     * @param file the file whose full path, which is contained in the message, will be made into a hyperlink (may be
+     *        <code>null</code>)
+     * @since 0.6
+     */
+    public static void write( String message,
+                              IFile file ) {
+        CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
+
+        DnaMessageConsole console = getDnaConsole();
+        console.print(message, false, false, file);
+    }
+
+    /**
+     * 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>)
+     * @since 0.6
+     */
+    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>)
+     * @since 0.6
+     */
+    public static void writeln( String message,
+                                IFile file ) {
+        CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
+
+        DnaMessageConsole console = getDnaConsole();
+        console.print(message, false, true, file);
+    }
+
+    // =======================================================================================================================
+    // Constructors
+    // =======================================================================================================================
+
+    /**
+     * @since 0.6
+     */
+    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
+     * @since 0.6
+     */
+    void addDocumentListener( String message,
+                              IFile file ) {
+        getDocument().addDocumentListener(new HyperlinkCreator(message, this, file));
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.ui.console.AbstractConsole#getType()
+     * @since 0.6
+     */
+    @Override
+    public String getType() {
+        return ID;
+    }
+
+    /**
+     * @param message the message being written to the console (never <code>null</code>)
+     * @param emphasize a flag indicating if the message should be emphasized
+     * @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>)
+     * @since 0.6
+     */
+    private void print( final String message,
+                        final boolean emphasize,
+                        final boolean doLineFeedAtEnd,
+                        final IFile file ) {
+        final Display display = Display.getDefault();
+
+        if (!display.isDisposed()) {
+            display.asyncExec(new Runnable() {
+                /**
+                 * {@inheritDoc}
+                 * 
+                 * @see java.lang.Runnable#run()
+                 * @since 0.6
+                 */
+                @Override
+                public void run() {
+                    if (!display.isDisposed()) {
+                        MessageConsoleStream stream = setup();
+
+                        // configure stream
+                        if (emphasize) {
+                            stream.setColor(display.getSystemColor(SWT.COLOR_BLUE));
+                        }
+
+                        // register document listener before writing to console
+                        if (file != null) {
+                            addDocumentListener(message, file);
+                        }
+
+                        // write message
+                        if (doLineFeedAtEnd) {
+                            stream.println(message);
+                        } else {
+                            stream.print(message);
+                        }
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     * Performs any setup required before writing to the console.
+     * 
+     * @return the stream that can be written to
+     * @since 0.6
+     */
+    MessageConsoleStream setup() {
+        activate(); // show and focus console view
+        return newMessageStream();
+    }
+
+    // ===========================================================================================================================
+    // 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.
+     * 
+     * @since 0.6
+     */
+    class HyperlinkCreator implements IDocumentListener {
+
+        // =======================================================================================================================
+        // Fields
+        // =======================================================================================================================
+
+        /**
+         * The console where the message is printed to and the hyperlink will be created.
+         * 
+         * @since 0.6
+         */
+        private final DnaMessageConsole console;
+
+        /**
+         * The file whose full path will become a hyperlink.
+         * 
+         * @since 0.6
+         */
+        private final IFile file;
+
+        /**
+         * The message where the file path is located in.
+         * 
+         * @since 0.6
+         */
+        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
+         * @since 0.6
+         */
+        public HyperlinkCreator( String message,
+                                 DnaMessageConsole console,
+                                 IFile file ) {
+            this.message = message;
+            this.console = console;
+            this.file = file;
+        }
+
+        // =======================================================================================================================
+        // Methods
+        // =======================================================================================================================
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+         * @since 0.6
+         */
+        @Override
+        public void documentAboutToBeChanged( DocumentEvent arg0 ) {
+            // nothing to do
+        }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
+         * @since 0.6
+         */
+        @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() + 1, 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: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/DnaMessageConsole.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerContentProvider.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -1,317 +0,0 @@
-/*
- * 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.web.jcr.rest.client.swt.views;
-
-import static org.jboss.dna.web.jcr.rest.client.swt.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.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.jboss.dna.web.jcr.rest.client.swt.Activator;
-import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
-import org.jboss.dna.web.jcr.rest.client.swt.Utils;
-
-/**
- * The <code>ServerContentProvider</code> is a content and label provider for DNA repositories.
- * 
- * @since 0.6
- */
-public final class ServerContentProvider extends ColumnLabelProvider implements ILightweightLabelDecorator, ITreeContentProvider {
-
-    // ===========================================================================================================================
-    // Fields
-    // ===========================================================================================================================
-
-    /**
-     * The server manager where the server registry is managed.
-     * 
-     * @since 0.6
-     */
-    private final ServerManager serverManager;
-
-    // ===========================================================================================================================
-    // Constructors
-    // ===========================================================================================================================
-
-    /**
-     * @since 0.6
-     */
-    public ServerContentProvider() {
-        this.serverManager = Activator.getDefault().getServerManager();
-    }
-
-    // ===========================================================================================================================
-    // Methods
-    // ===========================================================================================================================
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
-     * @since 0.6
-     */
-    @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)
-     * @since 0.6
-     */
-    @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 (element instanceof Server) {
-            Status status = Activator.getDefault().getServerManager().ping((Server)element);
-            overlay = Utils.getOverlayImage(status);
-        } else if (element instanceof IFile) {
-            if (Utils.isPublished((IFile)element)) {
-                overlay = Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
-            }
-        }
-
-        if (overlay != null) {
-            decoration.addOverlay(overlay);
-        }
-
-        display.asyncExec(new Runnable() {
-            @SuppressWarnings( "synthetic-access" )
-            @Override
-            public void run() {
-                if (!display.isDisposed()) {
-                    fireLabelProviderChanged(new LabelProviderChangedEvent(ServerContentProvider.this, element));
-                }
-            }
-        });
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-     * @since 0.6
-     */
-    @Override
-    public void dispose() {
-        // nothing to do
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
-     * @since 0.6
-     */
-    @Override
-    public Object[] getChildren( Object parentElement ) {
-        assert (parentElement instanceof IDnaObject);
-
-        try {
-            if (parentElement instanceof Server) {
-                return this.serverManager.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 this.serverManager.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)
-     * @since 0.6
-     */
-    @Override
-    public Object[] getElements( Object inputElement ) {
-        return this.serverManager.getServers().toArray();
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-     * @since 0.6
-     */
-    @Override
-    public Image getImage( Object element ) {
-        return Activator.getDefault().getImage(element);
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
-     * @since 0.6
-     */
-    @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;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-     * @since 0.6
-     */
-    @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)
-     * @since 0.6
-     */
-    @Override
-    public Image getToolTipImage( Object object ) {
-        return getImage(object);
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
-     * @since 0.6
-     */
-    @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)
-     * @since 0.6
-     */
-    @Override
-    public int getToolTipTimeDisplayed( Object object ) {
-        return 3000;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
-     * @since 0.6
-     */
-    @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)
-     * @since 0.6
-     */
-    @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)
-     * @since 0.6
-     */
-    @Override
-    public boolean isLabelProperty( Object element,
-                                    String property ) {
-        return false;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
-     * @since 0.6
-     */
-    @Override
-    public void removeListener( ILabelProviderListener listener ) {
-        // nothing to do
-    }
-
-}

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/views/ServerView.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -24,7 +24,6 @@
 package org.jboss.dna.web.jcr.rest.client.swt.views;
 
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.COLLAPSE_ALL_IMAGE;
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.REFRESH_IMAGE;
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.SERVER_VIEW_HELP_CONTEXT;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -55,6 +54,7 @@
 import org.jboss.dna.web.jcr.rest.client.swt.actions.DeleteServerAction;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.EditServerAction;
 import org.jboss.dna.web.jcr.rest.client.swt.actions.NewServerAction;
+import org.jboss.dna.web.jcr.rest.client.swt.actions.ReconnectToServerAction;
 
 /**
  * The <code>ServerView</code> shows all defined servers and their DNA repositories.
@@ -100,14 +100,14 @@
      * 
      * @since 0.6
      */
-    private ServerContentProvider provider;
+    private DnaContentProvider provider;
 
     /**
-     * Refreshes the tree.
+     * Refreshes the server connections.
      * 
      * @since 0.6
      */
-    private IAction refreshAction;
+    private ReconnectToServerAction reconnectAction;
 
     /**
      * @since 0.6
@@ -134,22 +134,9 @@
         this.collapseAllAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(COLLAPSE_ALL_IMAGE));
 
         // the refresh action is always enabled
-        this.refreshAction = new Action() {
-            @Override
-            public void run() {
-                IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
-                
-                if (selection.size() == 1) {
-                    getViewer().refresh(selection.getFirstElement());
-                } else {
-                    getViewer().refresh();
-                }
-            }
-        };
+        this.reconnectAction = new ReconnectToServerAction(this.viewer);
+        getServerManager().addRegistryListener(this.reconnectAction);
 
-        this.refreshAction.setToolTipText(RestClientI18n.refreshActionToolTip.text());
-        this.refreshAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE));
-
         // the shell used for dialogs that the actions display
         Shell shell = this.getSite().getShell();
 
@@ -174,7 +161,7 @@
         menuMgr.add(this.newAction);
         menuMgr.add(this.editAction);
         menuMgr.add(this.deleteAction);
-        // menuMgr.setRemoveAllWhenShown(true);
+        menuMgr.add(this.reconnectAction);
 
         Menu menu = menuMgr.createContextMenu(this.viewer.getTree());
         this.viewer.getTree().setMenu(menu);
@@ -189,7 +176,7 @@
         toolBar.add(this.newAction);
         toolBar.add(this.editAction);
         toolBar.add(this.deleteAction);
-        toolBar.add(this.refreshAction);
+        toolBar.add(this.reconnectAction);
         toolBar.add(this.collapseAllAction);
     }
 
@@ -198,7 +185,7 @@
      * @since 0.6
      */
     private void constructTreeViewer( Composite parent ) {
-        this.provider = new ServerContentProvider();
+        this.provider = new DnaContentProvider();
         this.viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
 
         this.viewer.setContentProvider(this.provider);

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishJob.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -23,36 +23,25 @@
  */
 package org.jboss.dna.web.jcr.rest.client.swt.wizards;
 
-import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_CONSOLE_ID;
 import static org.jboss.dna.web.jcr.rest.client.swt.IUiConstants.DNA_PUBLISHING_JOB_FAMILY;
 import static org.jboss.dna.web.jcr.rest.client.swt.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.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.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.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;
 import org.jboss.dna.web.jcr.rest.client.swt.Activator;
+import org.jboss.dna.web.jcr.rest.client.swt.DnaResourceHelper;
 import org.jboss.dna.web.jcr.rest.client.swt.RestClientI18n;
-import org.jboss.dna.web.jcr.rest.client.swt.Utils;
+import org.jboss.dna.web.jcr.rest.client.swt.views.DnaContentProvider;
+import org.jboss.dna.web.jcr.rest.client.swt.views.DnaMessageConsole;
 
 /**
  * The <code>PublishJob</code> publishes or unpublishes one or more files using the {@link ServerManager}.
@@ -87,13 +76,6 @@
     }
 
     /**
-     * The name of the message console that is written to.
-     * 
-     * @since 0.6
-     */
-    static final String CONSOLE_NAME = RestClientI18n.publishJobConsoleName.text();
-
-    /**
      * A unique job identifier given to each publishing/unpublishing job.
      * 
      * @since 0.6
@@ -106,18 +88,20 @@
 
     /**
      * @param type the job type (never <code>null</code>)
+     * @param jobId the job identifier
      * @return the job name
      * @since 0.6
      */
-    private static String getJobName( Type type ) {
+    private static String getJobName( Type type,
+                                      int jobId ) {
         CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
 
         if (Type.PUBLISH == type) {
-            return RestClientI18n.publishJobPublishName.text();
+            return RestClientI18n.publishJobPublishName.text(jobId);
         }
 
         // unpublish
-        return RestClientI18n.publishJobUnpublishName.text();
+        return RestClientI18n.publishJobUnpublishName.text(jobId);
     }
 
     // ===========================================================================================================================
@@ -132,6 +116,13 @@
     private final List<IFile> files;
 
     /**
+     * The unique job identifier.
+     * 
+     * @since 0.6
+     */
+    private final int jobId;
+
+    /**
      * The job type.
      * 
      * @since 0.6
@@ -158,13 +149,14 @@
     public PublishJob( Type type,
                        List<IFile> files,
                        Workspace workspace ) {
-        super(getJobName(type));
+        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
     }
@@ -185,31 +177,11 @@
     }
 
     /**
-     * Note: The <code>DnaConsole</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
+     * @return the server manager
      * @since 0.6
      */
-    private DnaConsole getDnaConsole() {
-        DnaConsole console = null;
-        IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
-        IConsole[] consoles = consoleMgr.getConsoles();
-
-        // see if DNA console already exists
-        for (int i = 0; i < consoles.length; ++i) {
-            if (CONSOLE_NAME.equals(consoles[i].getName())) {
-                console = (DnaConsole)consoles[i];
-                break;
-            }
-        }
-
-        // create DNA console if necessary
-        if (console == null) {
-            console = new DnaConsole();
-            consoleMgr.addConsoles(new IConsole[] {console});
-        }
-
-        return console;
+    private ServerManager getServerManager() {
+        return Activator.getDefault().getServerManager();
     }
 
     /**
@@ -229,84 +201,99 @@
     @Override
     protected IStatus run( IProgressMonitor monitor ) {
         assert (this.workspace != null);
-        int jobId = JOB_ID.getAndIncrement();
         long startTime = System.currentTimeMillis();
 
         try {
-            String name = (isPublishing() ? RestClientI18n.publishJobPublishTaskName.text() : RestClientI18n.publishJobUnpublishTaskName.text());
-            monitor.beginTask(name, this.files.size());
+            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()) {
-                writeToConsole(getDnaConsole(), RestClientI18n.publishJobPublish.text(jobId,
-                                                                                      this.workspace.getServer().getUrl(),
-                                                                                      this.workspace.getRepository().getName(),
-                                                                                      this.workspace.getName(),
-                                                                                      this.files.size()));
+                DnaMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
+                                                                                serverUrl,
+                                                                                repositoryName,
+                                                                                workspaceName,
+                                                                                fileCount));
             } else {
-                writeToConsole(getDnaConsole(), RestClientI18n.publishJobUnpublish.text(jobId,
-                                                                                        this.workspace.getServer().getUrl(),
-                                                                                        this.workspace.getRepository().getName(),
-                                                                                        this.workspace.getName(),
-                                                                                        this.files.size()));
+                DnaMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
+                                                                                  serverUrl,
+                                                                                  repositoryName,
+                                                                                  workspaceName,
+                                                                                  fileCount));
             }
 
-            // process the files
+            DnaResourceHelper resourceHelper = new DnaResourceHelper(getServerManager());
             int numProcessed = 0;
 
+            // process the files
             for (IFile eclipseFile : this.files) {
                 if (monitor.isCanceled()) {
-                    String msg = null;
-
                     if (isPublishing()) {
-                        msg = RestClientI18n.publishJobPublishCanceledMsg.text(jobId,
-                                                                               this.workspace.getServer().getUrl(),
-                                                                               this.workspace.getRepository().getName(),
-                                                                               this.workspace.getName(),
-                                                                               numProcessed,
-                                                                               this.files.size());
+                        DnaMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
+                                                                                                   serverUrl,
+                                                                                                   repositoryName,
+                                                                                                   workspaceName,
+                                                                                                   numProcessed,
+                                                                                                   fileCount));
                     } else {
-                        msg = RestClientI18n.publishJobUnpublishCanceledMsg.text(jobId,
-                                                                                 this.workspace.getServer().getUrl(),
-                                                                                 this.workspace.getRepository().getName(),
-                                                                                 this.workspace.getName(),
-                                                                                 numProcessed,
-                                                                                 this.files.size());
+                        DnaMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
+                                                                                                     serverUrl,
+                                                                                                     repositoryName,
+                                                                                                     workspaceName,
+                                                                                                     numProcessed,
+                                                                                                     fileCount));
                     }
 
-                    writeToConsole(getDnaConsole(), msg); // write cancel msg to console
-                    throw new InterruptedException(msg);
+                    throw new InterruptedException(RestClientI18n.publishJobCanceled.text(jobId));
                 }
 
                 File file = eclipseFile.getLocation().toFile();
+                String path = eclipseFile.getParent().getFullPath().toString();
                 Status status = null;
 
                 if (isPublishing()) {
-                    status = Activator.getDefault().getServerManager().publish(this.workspace,
-                                                                               eclipseFile.getFullPath().toString(),
-                                                                               file);
+                    status = getServerManager().publish(this.workspace, path, file);
 
                     // set persistent property on resource indicating it has been published
                     if (!status.isError()) {
-                        Utils.addPublishedProperty(eclipseFile, workspace);
+                        resourceHelper.addPublishedProperty(eclipseFile, workspace);
+                        DnaContentProvider decorator = DnaContentProvider.getDecorator();
+
+                        if (decorator != null) {
+                            // decorator.refresh(eclipseFile);
+                        }
                     }
                 } else {
-                    status = Activator.getDefault().getServerManager().unpublish(this.workspace,
-                                                                                 eclipseFile.getFullPath().toString(),
-                                                                                 file);
+                    status = getServerManager().unpublish(this.workspace, path, file);
 
                     // clear persistent property on resource indicating it has been unpublished
                     if (!status.isError()) {
-                        Utils.removePublishedProperty(eclipseFile, workspace);
+                        resourceHelper.removePublishedProperty(eclipseFile, workspace);
+                        DnaContentProvider decorator = DnaContentProvider.getDecorator();
+
+                        if (decorator != null) {
+                            // decorator.refresh(eclipseFile);
+                        }
                     }
                 }
 
                 ++numProcessed;
                 monitor.worked(1);
 
-                // write outcome msg to console
-                writeToConsole(jobId, eclipseFile, status);
+                // 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;
@@ -323,158 +310,79 @@
         } finally {
             monitor.done();
 
-            // add operation done msg
-            // TODO need to format this duration better
-            long duration = System.currentTimeMillis() - startTime;
+            // 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 ((seconds > 0) || (minutes > 0) || (hours > 0)) {
+                duration = RestClientI18n.publishJobLongDurationMsg.text(hours, minutes, seconds);
+            } else {
+                duration = RestClientI18n.publishJobShortDurationMsg.text();
+            }
+
             if (isPublishing()) {
-                writeToConsole(getDnaConsole(),
-                               RestClientI18n.publishJobPublishFinishedMsg.text(jobId,
-                                                                                this.workspace.getServer().getUrl(),
-                                                                                this.workspace.getRepository().getName(),
-                                                                                this.workspace.getName(),
-                                                                                duration));
+                DnaMessageConsole.writeln(RestClientI18n.publishJobPublishFinishedMsg.text(this.jobId, duration));
             } else {
-                writeToConsole(getDnaConsole(),
-                               RestClientI18n.publishJobUnpublishFinishedMsg.text(jobId,
-                                                                                  this.workspace.getServer().getUrl(),
-                                                                                  this.workspace.getRepository().getName(),
-                                                                                  this.workspace.getName(),
-                                                                                  duration));
+                DnaMessageConsole.writeln(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.jobId, duration));
             }
         }
     }
 
     /**
-     * @param jobId the job ID
+     * 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
      * @since 0.6
      */
-    private void writeToConsole( int jobId,
-                                 final IFile file,
+    private void writeToConsole( final IFile file,
+                                 URL url,
                                  Status status ) {
-        String msg = null;
+        String message = null;
 
         if (status.isOk()) {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFile.text(jobId, file.getFullPath());
+                DnaMessageConsole.write(RestClientI18n.publishJobPublishFile.text(this.jobId, file.getFullPath()), false);
+                DnaMessageConsole.write(RestClientI18n.publishJobPublishFile2.text(url.toString()), true);
+                message = ""; //$NON-NLS-1$
             } else {
-                msg = RestClientI18n.publishJobUnpublishFile.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobUnpublishFile.text(this.jobId, file.getFullPath());
             }
         } else if (status.isError()) {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFileFailed.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobPublishFileFailed.text(this.jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFileFailed.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobUnpublishFileFailed.text(this.jobId, file.getFullPath());
             }
 
             // log
             Activator.getDefault().log(status);
         } else if (status.isWarning()) {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFileWarning.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobPublishFileWarning.text(this.jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFileWarning.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobUnpublishFileWarning.text(this.jobId, file.getFullPath());
             }
 
             // log
             Activator.getDefault().log(status);
         } else {
             if (isPublishing()) {
-                msg = RestClientI18n.publishJobPublishFileInfo.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobPublishFileInfo.text(this.jobId, file.getFullPath());
             } else {
-                msg = RestClientI18n.publishJobUnpublishFileInfo.text(jobId, file.getFullPath());
+                message = RestClientI18n.publishJobUnpublishFileInfo.text(this.jobId, file.getFullPath());
             }
 
             // log
             Activator.getDefault().log(status);
         }
 
-        // write to DNA Console
-        final DnaConsole dnaConsole = getDnaConsole();
-        final String consoleMsg = msg;
-        final IDocument doc = dnaConsole.getDocument();
-
-        // add listener that will add the hyperlink in the console for the file just published/unpublished
-        doc.addDocumentListener(new IDocumentListener() {
-            @Override
-            public void documentAboutToBeChanged( DocumentEvent event ) {
-                // nothing to do
-            }
-
-            @Override
-            public void documentChanged( DocumentEvent event ) {
-                try {
-                    // add hyperlink to console
-                    int startIndex = consoleMsg.indexOf('"');
-
-                    if (startIndex != -1) {
-                        ++startIndex; // move after the '""
-                        int lastIndex = consoleMsg.lastIndexOf('"');
-
-                        if (lastIndex != -1) {
-                            --lastIndex; // move before the '"'
-                            FindReplaceDocumentAdapter finder = new FindReplaceDocumentAdapter(doc);
-                            IRegion region = finder.find(0, consoleMsg, true, true, false, false);
-
-                            if (region != null) {
-                                dnaConsole.addHyperlink(new FileLink(file, null, -1, -1, -1),
-                                                        (region.getOffset() + startIndex),
-                                                        (lastIndex - startIndex + 1));
-                                doc.removeDocumentListener(this);
-                            }
-                        }
-                    }
-                } catch (BadLocationException e) {
-                    Activator.getDefault().log(new Status(Severity.ERROR,
-                                                          RestClientI18n.publishJobProblemCreatingHyperlinkMsg.text(), e));
-                    doc.removeDocumentListener(this);
-                }
-            }
-        });
-
-        writeToConsole(dnaConsole, msg);
+        // write to console creating a hyperlink
+        DnaMessageConsole.writeln(message, file);
     }
 
-    /**
-     * @param console the DNA console being written to
-     * @param message the message being written
-     * @since 0.6
-     */
-    private void writeToConsole( MessageConsole console,
-                                 String message ) {
-        // show and focus console view
-        console.activate();
-
-        // write message
-        MessageConsoleStream out = console.newMessageStream();
-        out.println(message);
-    }
-
-    // ===========================================================================================================================
-    // Inner Class
-    // ===========================================================================================================================
-
-    class DnaConsole extends MessageConsole {
-
-        /**
-         * @since 0.6
-         */
-        public DnaConsole() {
-            super(CONSOLE_NAME, null);
-        }
-
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.ui.console.AbstractConsole#getType()
-         * @since 0.6
-         */
-        @Override
-        public String getType() {
-            return DNA_CONSOLE_ID;
-        }
-    }
-
 }

Modified: branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java
===================================================================
--- branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-28 15:55:28 UTC (rev 1181)
+++ branches/eclipse/org.jboss.dna.publish.ui.swt/src/org/jboss/dna/web/jcr/rest/client/swt/wizards/PublishPage.java	2009-08-31 13:46:22 UTC (rev 1182)
@@ -430,9 +430,6 @@
                     btnNewServer.removeSelectionListener(this);
                 }
             });
-
-            // register to receive server registry events that will be generated when the new server dialog is run
-            getServerManager().addRegistryListener(this);
         }
 
         { // row 2: repository row
@@ -550,8 +547,8 @@
         IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
         helpSystem.setHelp(pnlMain, PUBLISH_DIALOG_HELP_CONTEXT);
 
-        // load the UI with data
-        refreshServers();
+        // register to receive server registry events (this will populate the UI)
+        getServerManager().addRegistryListener(this);
     }
 
     /**


From dna-commits at lists.jboss.org  Mon Aug 31 21:36:42 2009
From: dna-commits at lists.jboss.org (© VIAGRA ® Official Site)
Date: Mon, 31 Aug 2009 21:36:42 -0400
Subject: [dna-commits] Dear dna-commits@lists.jboss.org 72% 0FF on Pfizer !
Message-ID: <200909010136.n811agv6019519@lists01.dmz-a.mwc.hst.phx2.redhat.com>

An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/dna-commits/attachments/20090831/e2f95800/attachment.html 

