JBoss Tools SVN: r31576 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.doc.user.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:25:18 -0400 (Sat, 28 May 2011)
New Revision: 31576
Added:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.doc.user/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.doc.user/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.doc.user/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.doc.user/.gitignore 2011-05-28 22:25:18 UTC (rev 31576)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31575 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:25:06 -0400 (Sat, 28 May 2011)
New Revision: 31575
Added:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.core/.gitignore 2011-05-28 22:25:06 UTC (rev 31575)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31574 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.ui.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:24:54 -0400 (Sat, 28 May 2011)
New Revision: 31574
Added:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/.gitignore 2011-05-28 22:24:54 UTC (rev 31574)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31573 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.core.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:24:42 -0400 (Sat, 28 May 2011)
New Revision: 31573
Added:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.core/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.core/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.core/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.classpath.core/.gitignore 2011-05-28 22:24:42 UTC (rev 31573)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31572 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:24:30 -0400 (Sat, 28 May 2011)
New Revision: 31572
Added:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.archives.webtools/.gitignore 2011-05-28 22:24:30 UTC (rev 31572)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31571 - branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.test.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:24:18 -0400 (Sat, 28 May 2011)
New Revision: 31571
Added:
branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.test.feature/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.test.feature/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.test.feature/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.test.feature/.gitignore 2011-05-28 22:24:18 UTC (rev 31571)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31570 - branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-28 18:24:06 -0400 (Sat, 28 May 2011)
New Revision: 31570
Added:
branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.feature/.gitignore
Log:
.gitignore file
Added: branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.feature/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.feature/.gitignore (rev 0)
+++ branches/jbosstools-3.2.x/as/features/org.jboss.ide.eclipse.as.feature/.gitignore 2011-05-28 22:24:06 UTC (rev 31570)
@@ -0,0 +1 @@
+target
13 years, 7 months
JBoss Tools SVN: r31569 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-05-28 07:42:51 -0400 (Sat, 28 May 2011)
New Revision: 31569
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeDomainObject.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServer.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/WorkspaceArea.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/package-info.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/ModeShapePropertySource.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNames.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/package-info.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/domain/
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServerTest.java
Removed:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PersistedServer.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/PersistedServerTest.java
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerRegistryEvent.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerManagerTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerRegistryEventTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java
Log:
JBIDE-8808 Create PropertyPage To Display ModeShape Repository Metadata. Added property page support for all objects displayed in the ModeShape View. Added more Eclipse NLS comments.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2011-05-28 11:42:51 UTC (rev 31569)
@@ -12,7 +12,8 @@
org.eclipse.ui.console,
org.eclipse.jface.text,
org.eclipse.debug.ui,
- org.jboss.tools.usage;bundle-version="1.0.0";resolution:=optional
+ org.jboss.tools.usage;bundle-version="1.0.0";resolution:=optional,
+ org.eclipse.ui.views
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: modeshape-client.jar,
@@ -20,6 +21,7 @@
.
Export-Package: javax.jcr.nodetype,
org.jboss.tools.modeshape.rest,
+ org.jboss.tools.modeshape.rest.domain,
org.jboss.tools.modeshape.rest.preferences,
org.modeshape.common.i18n,
org.modeshape.web.jcr.rest.client,
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -21,13 +21,13 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.IModeShapeObject;
-import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
import org.osgi.framework.BundleContext;
/**
@@ -119,13 +119,13 @@
public Image getImage( Object object ) {
String key = null;
- if (object instanceof Workspace) {
+ if (object instanceof ModeShapeWorkspace) {
key = WORKSPACE_IMAGE;
- } else if (object instanceof Repository) {
+ } else if (object instanceof ModeShapeRepository) {
key = REPOSITORY_IMAGE;
- } else if (object instanceof Server) {
+ } else if (object instanceof ModeShapeServer) {
key = SERVER_IMAGE;
- } else if (object instanceof IModeShapeObject) {
+ } else if (object instanceof ModeShapeDomainObject) {
// should have an icon for every business object
assert false;
} else if (object instanceof String) {
@@ -160,13 +160,13 @@
public ImageDescriptor getImageDescriptor( Object object ) {
String key = null;
- if (object instanceof Workspace) {
+ if (object instanceof ModeShapeWorkspace) {
key = WORKSPACE_IMAGE;
- } else if (object instanceof Repository) {
+ } else if (object instanceof ModeShapeRepository) {
key = REPOSITORY_IMAGE;
- } else if (object instanceof Server) {
+ } else if (object instanceof ModeShapeServer) {
key = SERVER_IMAGE;
- } else if (object instanceof IModeShapeObject) {
+ } else if (object instanceof ModeShapeDomainObject) {
// should have an icon for every business object
assert false;
} else if (object instanceof String) {
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PersistedServer.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PersistedServer.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PersistedServer.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -1,78 +0,0 @@
-/*
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * This software is made available by Red Hat, Inc. under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution and is
- * available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- */
-package org.jboss.tools.modeshape.rest;
-
-import net.jcip.annotations.Immutable;
-import org.modeshape.web.jcr.rest.client.domain.Server;
-
-/**
- * The <code>PersistedServer</code> class adds the concept of allowing a server's password to be persisted or not.
- */
-@Immutable
-public final class PersistedServer extends Server {
-
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
- /**
- * Indicates if the password should be stored locally when the server is persisted.
- */
- private final boolean persistPassword;
-
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
- /**
- * Constructs a new <code>PersistedServer</code>.
- *
- * @param url the server URL (never <code>null</code>)
- * @param user the server user (never <code>null</code>)
- * @param password the server password (may be <code>null</code>)
- * @param persistPassword <code>true</code> if the password should be stored
- * @throws IllegalArgumentException if URL or user is <code>null</code> or empty
- */
- public PersistedServer( String url,
- String user,
- String password,
- boolean persistPassword ) {
- super(url, user, password);
- this.persistPassword = persistPassword;
- }
-
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
- /**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.domain.Server#equals(java.lang.Object)
- */
- @Override
- public boolean equals( Object obj ) {
- if (super.equals(obj)) {
- return (this.persistPassword == ((PersistedServer)obj).persistPassword);
- }
-
- return false;
- }
-
- /**
- * @return persistPassword <code>true</code> if the password is being persisted
- */
- public boolean isPasswordBeingPersisted() {
- return this.persistPassword;
- }
-
-}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -15,16 +15,17 @@
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.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
import org.modeshape.common.util.CheckArg;
import org.modeshape.common.util.HashCode;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
* The <code>PublishedResourceHelper</code> knows how to get and set the property on a resource that indicates it has been
@@ -32,52 +33,36 @@
*/
public final class PublishedResourceHelper {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* Delimiter between a workspace's properties.
*/
- private static final String ID_DELIM = "$";
+ private static final String ID_DELIM = "$"; //$NON-NLS-1$
/**
* Delimiter between workspaces.
*/
- private static final String DELIM = "|";
+ 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 repository. The value of the property is a list of repository workspaces where this
* file has been published.
*/
- private static QualifiedName PUBLISHED_RESOURCE_PROPERTY = new QualifiedName(IUiConstants.PLUGIN_ID, "publishedLocations");
+ private static QualifiedName PUBLISHED_RESOURCE_PROPERTY = new QualifiedName(IUiConstants.PLUGIN_ID, "publishedLocations"); //$NON-NLS-1$
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The server manager used by the helper to obtain workspaces.
*/
private final ServerManager serverManager;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param serverManager the server manager used by this helper (never <code>null</code>)
*/
public PublishedResourceHelper( ServerManager serverManager ) {
- CheckArg.isNotNull(serverManager, "serverManager");
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
this.serverManager = serverManager;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* @param file the file that was just published (never <code>null</code>)
* @param workspace the workspace where the file was published (never <code>null</code>)
@@ -85,11 +70,11 @@
* @throws Exception if there is a problem setting the property
*/
public void addPublishedProperty( IFile file,
- Workspace workspace,
+ ModeShapeWorkspace workspace,
String url ) throws Exception {
- CheckArg.isNotNull(file, "file");
- CheckArg.isNotNull(workspace, "workspace");
- CheckArg.isNotNull(url, "url");
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(url, "url"); //$NON-NLS-1$
Set<WorkspaceLocation> workspaceLocations = getPublishedWorkspaceLocations(file);
workspaceLocations.add(new WorkspaceLocation(workspace, url));
@@ -117,7 +102,7 @@
* @return the ID
*/
private String createWorkspaceLocationId( WorkspaceLocation workspaceLocation ) {
- Workspace workspace = workspaceLocation.getWorkspace();
+ ModeShapeWorkspace workspace = workspaceLocation.getWorkspace();
StringBuilder result = new StringBuilder();
result.append(workspace.getServer().getUrl()).append(ID_DELIM).append(workspace.getServer().getUser()).append(ID_DELIM);
@@ -135,7 +120,7 @@
* manager
*/
public Set<WorkspaceLocation> getPublishedWorkspaceLocations( IFile file ) throws Exception {
- CheckArg.isNotNull(file, "file");
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
Set<WorkspaceLocation> publishedWorkspaceLocations = null;
String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
@@ -154,24 +139,24 @@
String user = propsTokenizer.nextToken();
// find server
- Server server = this.serverManager.findServer(url, user);
+ ModeShapeServer server = this.serverManager.findServer(url, user);
if ((server != null) && this.serverManager.ping(server).isOk()) {
- Collection<Repository> repositories = this.serverManager.getRepositories(server);
+ Collection<ModeShapeRepository> repositories = this.serverManager.getRepositories(server);
// find repository
if (!repositories.isEmpty()) {
String repositoryName = propsTokenizer.nextToken();
- for (Repository repository : repositories) {
+ for (ModeShapeRepository repository : repositories) {
if (repository.getName().equals(repositoryName)) {
- Collection<Workspace> workspaces = this.serverManager.getWorkspaces(repository);
+ Collection<ModeShapeWorkspace> workspaces = this.serverManager.getWorkspaces(repository);
// find workspace
if (!workspaces.isEmpty()) {
String workspaceName = propsTokenizer.nextToken();
- for (Workspace workspace : workspaces) {
+ for (ModeShapeWorkspace workspace : workspaces) {
if (workspace.getName().equals(workspaceName)) {
// get URL
String publishedUrl = propsTokenizer.nextToken();
@@ -200,7 +185,7 @@
* @return <code>true</code> if the file has been published to a repository
*/
public boolean isPublished( IFile file ) {
- CheckArg.isNotNull(file, "file");
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
try {
return !getPublishedWorkspaceLocations(file).isEmpty();
@@ -218,11 +203,11 @@
* @throws Exception if there is a problem changing the property value
*/
public void removePublishedProperty( IFile file,
- Workspace workspace,
+ ModeShapeWorkspace workspace,
String url ) throws Exception {
- CheckArg.isNotNull(file, "file");
- CheckArg.isNotNull(workspace, "workspace");
- CheckArg.isNotNull(url, "url");
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(url, "url"); //$NON-NLS-1$
Set<WorkspaceLocation> workspaceLocations = getPublishedWorkspaceLocations(file);
workspaceLocations.remove(new WorkspaceLocation(workspace, url));
@@ -260,11 +245,11 @@
*/
public class WorkspaceLocation {
- private final Workspace workspace;
+ private final ModeShapeWorkspace workspace;
private final String url;
- public WorkspaceLocation( Workspace workspace,
+ public WorkspaceLocation( ModeShapeWorkspace workspace,
String url ) {
this.workspace = workspace;
this.url = url;
@@ -283,8 +268,8 @@
WorkspaceLocation thatLocation = (WorkspaceLocation)obj;
if (this.workspace.equals(thatLocation.workspace)) {
- if ((this.url == null) || this.url.equals("")) {
- return ((thatLocation.url == null) || thatLocation.url.equals(""));
+ if ((this.url == null) || this.url.equals("")) { //$NON-NLS-1$
+ return ((thatLocation.url == null) || thatLocation.url.equals("")); //$NON-NLS-1$
}
return this.url.equals(thatLocation.url);
@@ -296,21 +281,21 @@
/**
* @return the repository where the workspace is located (never <code>null</code>)
*/
- public Repository getRepository() {
+ public ModeShapeRepository getRepository() {
return this.workspace.getRepository();
}
/**
* @return the server where the workspace is located (never <code>null</code>)
*/
- public Server getServer() {
+ public ModeShapeServer getServer() {
return this.workspace.getServer();
}
/**
* @return the workspace where published (never <code>null</code>)
*/
- public Workspace getWorkspace() {
+ public ModeShapeWorkspace getWorkspace() {
return this.workspace;
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -78,6 +78,8 @@
public static I18n preferencePageEnableVersioningEditorToolTip;
public static I18n preferencePageMessage;
public static I18n preferencePageTitle;
+
+ public static I18n propertiesBundleLoadErrorMsg;
public static I18n publishJobCanceled;
public static I18n publishJobDurationMsg;
@@ -149,6 +151,8 @@
public static I18n serverEmptyUserMsg;
public static I18n serverExistsMsg;
public static I18n serverInvalidUrlMsg;
+ public static I18n serverInvalidUrlHostMsg;
+ public static I18n serverInvalidUrlPortMsg;
public static I18n serverManagerConnectionEstablishedMsg;
public static I18n serverManagerConnectionFailedMsg;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-05-28 11:42:51 UTC (rev 31569)
@@ -71,6 +71,8 @@
preferencePageMessage = ModeShape
preferencePageTitle = ModeShape
+propertiesBundleLoadErrorMsg = There was a problem loading the property names resource bundle.
+
publishJobCanceled = Job {0} was canceled. See log for details.
publishJobDurationMsg = {0} hour(s), {1} minute(s), {2} second(s)
publishJobDurationNoHoursMsg = {0} minute(s), {1} second(s)
@@ -140,7 +142,9 @@
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
+serverInvalidUrlMsg = The value "{0}" is not a valid server URL
+serverInvalidUrlHostMsg = The server URL host is invalid
+serverInvalidUrlPortMsg = The server URL port is invalid
serverReconnectActionText = Reconnect
serverReconnectActionToolTip = Reconnect to the selected server
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -19,12 +19,10 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-import javax.jcr.nodetype.NodeType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
@@ -36,6 +34,10 @@
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
+import org.jboss.tools.modeshape.rest.domain.WorkspaceArea;
import org.modeshape.common.util.Base64;
import org.modeshape.common.util.CheckArg;
import org.modeshape.common.util.Logger;
@@ -45,7 +47,6 @@
import org.modeshape.web.jcr.rest.client.Status.Severity;
import org.modeshape.web.jcr.rest.client.domain.QueryRow;
import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
import org.modeshape.web.jcr.rest.client.domain.Workspace;
import org.modeshape.web.jcr.rest.client.json.JsonRestClient;
import org.w3c.dom.Document;
@@ -58,7 +59,7 @@
* The <code>ServerManager</code> class manages the creation, deletion, and editing of servers hosting ModeShape repositories.
*/
@ThreadSafe
-public final class ServerManager implements IRestClient {
+public final class ServerManager {
/**
* The tag used to persist a server's login password.
@@ -119,8 +120,8 @@
/**
* The server registry.
*/
- @GuardedBy( "serverLock" )
- private final List<Server> servers;
+ @GuardedBy("serverLock")
+ private final List<ModeShapeServer> servers;
/**
* Lock used for when accessing the server registry.
@@ -128,15 +129,15 @@
private final ReadWriteLock serverLock = new ReentrantReadWriteLock();
/**
- * @param stateLocationPath the directory where the {@link Server} registry} is persisted (may be <code>null</code> if
- * persistence is not desired)
+ * @param stateLocationPath the directory where the {@link ModeShapeServer} registry} is persisted (may be <code>null</code> if
+ * persistence is not desired)
* @param restClient the client that will communicate with the REST server (never <code>null</code>)
*/
public ServerManager( String stateLocationPath,
IRestClient restClient ) {
CheckArg.isNotNull(restClient, "restClient"); //$NON-NLS-1$
- this.servers = new ArrayList<Server>();
+ this.servers = new ArrayList<ModeShapeServer>();
this.stateLocationPath = stateLocationPath;
this.delegate = restClient;
this.listeners = new CopyOnWriteArrayList<IServerRegistryListener>();
@@ -145,8 +146,8 @@
/**
* This server manager uses the default REST Client.
*
- * @param stateLocationPath the directory where the {@link Server} registry is persisted (may be <code>null</code> if
- * persistence is not desired)
+ * @param stateLocationPath the directory where the {@link ModeShapeServer} registry is persisted (may be <code>null</code> if
+ * persistence is not desired)
*/
public ServerManager( String stateLocationPath ) {
this(stateLocationPath, new JsonRestClient());
@@ -163,7 +164,7 @@
boolean result = this.listeners.addIfAbsent(listener);
// inform new listener of registered servers
- for (Server server : getServers()) {
+ for (ModeShapeServer server : getServers()) {
listener.serverRegistryChanged(ServerRegistryEvent.createNewEvent(this, server));
}
@@ -171,12 +172,12 @@
}
/**
- * Registers the specified <code>PersistedServer</code>.
+ * Registers the specified <code>ModeShapeServer</code>.
*
* @param server the server being added (never <code>null</code>)
* @return a status indicating if the server was added to the registry
*/
- public Status addServer( PersistedServer server ) {
+ public Status addServer( ModeShapeServer server ) {
CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
return internalAddServer(server, true);
}
@@ -186,12 +187,12 @@
* @param user the user ID of the server being requested (never <code>null</code>)
* @return the requested server or <code>null</code> if not found in the registry
*/
- public Server findServer( String url,
- String user ) {
+ public ModeShapeServer findServer( String url,
+ String user ) {
CheckArg.isNotNull(url, "url"); //$NON-NLS-1$
CheckArg.isNotNull(user, "user"); //$NON-NLS-1$
- for (Server server : getServers()) {
+ for (ModeShapeServer server : getServers()) {
if (url.equals(server.getUrl()) && user.equals(server.getUser())) {
return server;
}
@@ -203,10 +204,10 @@
/**
* @return an unmodifiable collection of registered servers (never <code>null</code>)
*/
- public Collection<Server> getServers() {
+ public Collection<ModeShapeServer> getServers() {
try {
this.serverLock.readLock().lock();
- return Collections.unmodifiableCollection(new ArrayList<Server>(this.servers));
+ return Collections.unmodifiableCollection(new ArrayList<ModeShapeServer>(this.servers));
} finally {
this.serverLock.readLock().unlock();
}
@@ -226,22 +227,26 @@
}
/**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#getRepositories(org.modeshape.web.jcr.rest.client.domain.Server)
- * @throws RuntimeException if the server is not registered
- * @see #isRegistered(Server)
+ * @param server the server whose repositories are being requested (cannot be <code>null</code>)
+ * @return the repositories (never <code>null</code>)
+ * @throws Exception if server is not registered or if there is an unexpected problem obtaining the repositories
*/
- @Override
- public Collection<Repository> getRepositories( Server server ) throws Exception {
+ public Collection<ModeShapeRepository> getRepositories( ModeShapeServer server ) throws Exception {
CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
try {
this.serverLock.readLock().lock();
if (isRegistered(server)) {
- Collection<Repository> repositories = this.delegate.getRepositories(server);
- return Collections.unmodifiableCollection(new ArrayList<Repository>(repositories));
+ // need to wrap each repository
+ Collection<Repository> repositories = this.delegate.getRepositories(server.getDelegate());
+ Collection<ModeShapeRepository> result = new ArrayList<ModeShapeRepository>(repositories.size());
+
+ for (Repository repository : repositories) {
+ result.add(new ModeShapeRepository(repository, server));
+ }
+
+ return Collections.unmodifiableCollection(result);
}
// server must be registered in order to obtain it's repositories
@@ -252,16 +257,16 @@
}
/**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#getUrl(java.io.File, java.lang.String,
- * org.modeshape.web.jcr.rest.client.domain.Workspace)
+ * @param file the file whose URL is being requested (cannot be <code>null</code>)
+ * @param path the repository path where the file path should start from
+ * @param workspace the workspace where the file is published (cannot be <code>null</code>)
+ * @return the URL where the file was published
+ * @throws Exception if there is a problem obtaining the URL
*/
- @Override
public URL getUrl( File file,
String path,
- Workspace workspace ) throws Exception {
- return this.delegate.getUrl(file, path, workspace);
+ ModeShapeWorkspace workspace ) throws Exception {
+ return this.delegate.getUrl(file, path, workspace.getDelegate());
}
/**
@@ -269,11 +274,11 @@
* @return the workspace areas (never <code>null</code>)
* @throws Exception if there is a problem obtaining the workspace areas
*/
- public WorkspaceArea[] getWorkspaceAreas( Workspace workspace ) throws Exception {
+ public WorkspaceArea[] getWorkspaceAreas( ModeShapeWorkspace workspace ) throws Exception {
final String path = "jcr:path"; //$NON-NLS-1$
final String title = "jcr:title"; //$NON-NLS-1$
final String statement = "SELECT [" + path + "], " + '[' + title + ']' + " FROM [mode:publishArea]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- List<QueryRow> rows = query(workspace, IJcrConstants.JCR_SQL2, statement);
+ List<QueryRow> rows = this.delegate.query(workspace.getDelegate(), IJcrConstants.JCR_SQL2, statement);
WorkspaceArea[] workspaceAreas = new WorkspaceArea[rows.size()];
for (int numRows = rows.size(), i = 0; i < numRows; ++i) {
@@ -285,22 +290,26 @@
}
/**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#getWorkspaces(org.modeshape.web.jcr.rest.client.domain.Repository)
- * @throws RuntimeException if the server is not registered
- * @see #isRegistered(Server)
+ * @param repository the repository whose workspaces are being requested (cannot be <code>null</code>)
+ * @return the workspaces (never <code>null</code>)
+ * @throws Exception if server is not registered or if there is an unexpected problem obtaining the workspaces
*/
- @Override
- public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
+ public Collection<ModeShapeWorkspace> getWorkspaces( ModeShapeRepository repository ) throws Exception {
CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
try {
this.serverLock.readLock().lock();
if (isRegistered(repository.getServer())) {
- Collection<Workspace> workspaces = this.delegate.getWorkspaces(repository);
- return Collections.unmodifiableCollection(new ArrayList<Workspace>(workspaces));
+ // wrap workspaces
+ Collection<Workspace> workspaces = this.delegate.getWorkspaces(repository.getDelegate());
+ Collection<ModeShapeWorkspace> result = new ArrayList<ModeShapeWorkspace>(workspaces.size());
+
+ for (Workspace workspace : workspaces) {
+ result.add(new ModeShapeWorkspace(workspace, repository));
+ }
+
+ return Collections.unmodifiableCollection(result);
}
// a repository's server must be registered in order to obtain it's workspaces
@@ -318,7 +327,7 @@
* @param notifyListeners indicates if registry listeners should be notified
* @return a status indicating if the server was added to the registry
*/
- private Status internalAddServer( Server server,
+ private Status internalAddServer( ModeShapeServer server,
boolean notifyListeners ) {
boolean added = false;
@@ -359,7 +368,7 @@
* @param notifyListeners indicates if registry listeners should be notified
* @return a status indicating if the specified server was removed from the registry
*/
- private Status internalRemoveServer( Server server,
+ private Status internalRemoveServer( ModeShapeServer server,
boolean notifyListeners ) {
boolean removed = false;
@@ -367,7 +376,7 @@
this.serverLock.writeLock().lock();
// see if registered server has the same key
- for (Server registeredServer : this.servers) {
+ for (ModeShapeServer registeredServer : this.servers) {
if (registeredServer.hasSameKey(server)) {
removed = this.servers.remove(registeredServer);
break;
@@ -394,21 +403,22 @@
// server could not be removed
return new Status(Severity.ERROR,
- RestClientI18n.serverManagerRegistryRemoveUnexpectedError.text(server.getShortDescription()), null);
+ RestClientI18n.serverManagerRegistryRemoveUnexpectedError.text(server.getShortDescription()),
+ null);
}
/**
* @param server the server being tested (never <code>null</code>)
* @return <code>true</code> if the server has been registered
*/
- public boolean isRegistered( Server server ) {
+ public boolean isRegistered( ModeShapeServer server ) {
CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
try {
this.serverLock.readLock().lock();
// check to make sure no other registered server has the same key
- for (Server registeredServer : this.servers) {
+ for (ModeShapeServer registeredServer : this.servers) {
if (registeredServer.hasSameKey(server)) {
return true;
}
@@ -475,13 +485,13 @@
*
* @param server the server being pinged (never <code>null</code>)
* @return a status indicating if the server can be connected to
- * @see #isRegistered(Server)
+ * @see #isRegistered(ModeShapeServer)
*/
- public Status ping( Server server ) {
+ public Status ping( ModeShapeServer server ) {
CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
try {
- this.delegate.getRepositories(server);
+ this.delegate.getRepositories(server.getDelegate());
return new Status(Severity.OK, RestClientI18n.serverManagerConnectionEstablishedMsg.text(), null);
} catch (Exception e) {
return new Status(Severity.ERROR, RestClientI18n.serverManagerConnectionFailedMsg.text(e), null);
@@ -489,51 +499,37 @@
}
/**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#publish(org.modeshape.web.jcr.rest.client.domain.Workspace,
- * java.lang.String, java.io.File)
- * @see #isRegistered(Server)
+ * @param workspace the workspace where the file should be published (cannot be <code>null</code>)
+ * @param path the starting path in the repository (cannot be <code>null</code>)
+ * @param file the file being published (cannot be <code>null</code>)
+ * @param version <code>true</code> if the file should be put under version control by ModeShape
+ * @return the status of the outcome of this publishing operation
*/
- @Override
- public Status publish( Workspace workspace,
+ public Status publish( ModeShapeWorkspace workspace,
String path,
- File file ) {
- return publish(workspace, path, file, false);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#publish(org.modeshape.web.jcr.rest.client.domain.Workspace,
- * java.lang.String, java.io.File, boolean)
- */
- @Override
- public Status publish( Workspace workspace,
- String path,
File file,
- boolean version) {
- CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
- CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
- CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+ boolean version ) {
+ 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();
+ ModeShapeServer server = workspace.getServer();
- if (isRegistered(server)) {
- if (version) {
- return this.delegate.publish(workspace, path, file, true);
- }
+ if (isRegistered(server)) {
+ if (version) {
+ return this.delegate.publish(workspace.getDelegate(), path, file, true);
+ }
- // If version is false it could mean that versioning is not supported by the repository, or it is not enabled by the
- // by the repository, or that the user does not want the file versioned. If repository is running on an older server
- // that did not have versioning, then the only publishing method available on the server was the publish method without
- // the version parameter.
- return this.delegate.publish(workspace, path, file);
- }
+ // If version is false it could mean that versioning is not supported by the repository, or it is not enabled by the
+ // by the repository, or that the user does not want the file versioned. If repository is running on an older server
+ // that did not have versioning, then the only publishing method available on the server was the publish method without
+ // the version parameter.
+ return this.delegate.publish(workspace.getDelegate(), path, file);
+ }
- // server must be registered in order to publish
- throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
- }
+ // server must be registered in order to publish
+ throw new RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
+ }
/**
* @param listener the listener being unregistered and will no longer receive events (never <code>null</code>)
@@ -548,7 +544,7 @@
* @param server the server being removed (never <code>null</code>)
* @return a status indicating if the specified server was removed from the registry (never <code>null</code>)
*/
- public Status removeServer( Server server ) {
+ public Status removeServer( ModeShapeServer server ) {
CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
return internalRemoveServer(server, true);
}
@@ -572,7 +568,8 @@
if (server.getNodeType() != Node.TEXT_NODE) {
NamedNodeMap attributeMap = server.getAttributes();
- if (attributeMap == null) continue;
+ if (attributeMap == null)
+ continue;
Node urlNode = attributeMap.getNamedItem(URL_TAG);
Node userNode = attributeMap.getNamedItem(USER_TAG);
@@ -581,7 +578,7 @@
"UTF-8")); //$NON-NLS-1$
// add server to registry
- addServer(new PersistedServer(urlNode.getNodeValue(), userNode.getNodeValue(), pswd, (pswd != null)));
+ addServer(new ModeShapeServer(urlNode.getNodeValue(), userNode.getNodeValue(), pswd, (pswd != null)));
}
}
} catch (Exception e) {
@@ -595,7 +592,7 @@
}
/**
- * Saves the {@link Server} registry to the file system.
+ * Saves the {@link ModeShapeServer} registry to the file system.
*
* @return a status indicating if the registry was successfully saved
*/
@@ -610,14 +607,14 @@
Element root = doc.createElement(SERVERS_TAG);
doc.appendChild(root);
- for (Server server : getServers()) {
+ for (ModeShapeServer server : getServers()) {
Element serverElement = doc.createElement(SERVER_TAG);
root.appendChild(serverElement);
serverElement.setAttribute(URL_TAG, server.getUrl());
serverElement.setAttribute(USER_TAG, server.getUser());
- if ((server instanceof PersistedServer) && ((PersistedServer)server).isPasswordBeingPersisted()) {
+ if (server.isPasswordBeingPersisted()) {
serverElement.setAttribute(PASSWORD_TAG, Base64.encodeBytes(server.getPassword().getBytes()));
}
}
@@ -652,26 +649,22 @@
}
/**
- * {@inheritDoc}
- * <p>
- * Only tries to unpublish if the workspace's {@link Server server} is registered.
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#unpublish(org.modeshape.web.jcr.rest.client.domain.Workspace,
- * java.lang.String, java.io.File)
- * @see #isRegistered(Server)
+ * @param workspace the workspace where the file should be unpublished from (cannot be <code>null</code>)
+ * @param path the starting path in the repository (cannot be <code>null</code>)
+ * @param file the file being unpublished (cannot be <code>null</code>)
+ * @return the status of the outcome of this unpublishing operation
*/
- @Override
- public Status unpublish( Workspace workspace,
+ public Status unpublish( ModeShapeWorkspace workspace,
String path,
File 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();
+ ModeShapeServer server = workspace.getServer();
if (isRegistered(server)) {
- return this.delegate.unpublish(workspace, path, file);
+ return this.delegate.unpublish(workspace.getDelegate(), path, file);
}
// server must be registered in order to unpublish
@@ -685,8 +678,8 @@
* @param newServerVersion the new version of the server being put in the server registry (never <code>null</code>)
* @return a status indicating if the server was updated in the registry (never <code>null</code>)
*/
- public Status updateServer( Server previousServerVersion,
- Server newServerVersion ) {
+ public Status updateServer( ModeShapeServer previousServerVersion,
+ ModeShapeServer newServerVersion ) {
CheckArg.isNotNull(previousServerVersion, "previousServerVersion"); //$NON-NLS-1$
CheckArg.isNotNull(newServerVersion, "newServerVersion"); //$NON-NLS-1$
@@ -701,14 +694,14 @@
if (status.isOk()) {
// all good so notify listeners
- Exception[] errors = notifyRegistryListeners(ServerRegistryEvent.createUpdateEvent(this,
- previousServerVersion,
+ Exception[] errors = notifyRegistryListeners(ServerRegistryEvent.createUpdateEvent(this, previousServerVersion,
newServerVersion));
return processRegistryListenerErrors(errors);
}
// unexpected problem adding new version of server to registry
- return new Status(Severity.ERROR, RestClientI18n.serverManagerRegistryUpdateAddError.text(status.getMessage()),
+ return new Status(Severity.ERROR,
+ RestClientI18n.serverManagerRegistryUpdateAddError.text(status.getMessage()),
status.getException());
}
} finally {
@@ -716,69 +709,9 @@
}
// unexpected problem removing server from registry
- return new Status(Severity.ERROR, RestClientI18n.serverManagerRegistryUpdateRemoveError.text(status.getMessage()),
+ return new Status(Severity.ERROR,
+ RestClientI18n.serverManagerRegistryUpdateRemoveError.text(status.getMessage()),
status.getException());
}
- /**
- * {@inheritDoc}
- *
- * @throws UnsupportedOperationException if this method is called
- * @see org.modeshape.web.jcr.rest.client.IRestClient#getNodeTypes(org.modeshape.web.jcr.rest.client.domain.Repository)
- */
- @Override
- public Map<String, NodeType> getNodeTypes( Repository repository ) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
- * java.lang.String, java.lang.String)
- */
- @Override
- public List<QueryRow> query( Workspace workspace,
- String language,
- String statement ) throws Exception {
- return this.delegate.query(workspace, language, statement);
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * <strong>This method is unsupported and should not be called.</strong>
- *
- * @throws UnsupportedOperationException if this method is called
- * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
- * java.lang.String, java.lang.String, int, int)
- */
- @Override
- public List<QueryRow> query( Workspace workspace,
- String language,
- String statement,
- int offset,
- int limit ) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * <strong>This method is unsupported and should not be called.</strong>
- *
- * @throws UnsupportedOperationException if this method is called
- * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
- * java.lang.String, java.lang.String, int, int, java.util.Map)
- */
- @Override
- public List<QueryRow> query( Workspace workspace,
- String language,
- String statement,
- int offset,
- int limit,
- Map<String, String> variables ) throws Exception {
- throw new UnsupportedOperationException();
- }
-
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerRegistryEvent.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerRegistryEvent.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerRegistryEvent.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -11,8 +11,8 @@
*/
package org.jboss.tools.modeshape.rest;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.common.util.CheckArg;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
* The <code>ServerRegistryEvent</code> class is the event that is broadcast from the {@link ServerManager server manager} when a
@@ -20,10 +20,6 @@
*/
public final class ServerRegistryEvent {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* The status severity levels.
*/
@@ -44,10 +40,6 @@
UPDATE
}
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
/**
* @param serverManager the server manager sourcing this event (never <code>null</code>)
* @param newServer the server that was added to the server registry (never <code>null</code>)
@@ -55,9 +47,9 @@
* @see Type#NEW
*/
public static ServerRegistryEvent createNewEvent( ServerManager serverManager,
- Server newServer ) {
- CheckArg.isNotNull(serverManager, "serverManager");
- CheckArg.isNotNull(newServer, "newServer");
+ ModeShapeServer newServer ) {
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
+ CheckArg.isNotNull(newServer, "newServer"); //$NON-NLS-1$
return new ServerRegistryEvent(serverManager, Type.NEW, newServer);
}
@@ -68,9 +60,9 @@
* @see Type#REMOVE
*/
public static ServerRegistryEvent createRemoveEvent( ServerManager serverManager,
- Server removedServer ) {
- CheckArg.isNotNull(serverManager, "serverManager");
- CheckArg.isNotNull(removedServer, "removedServer");
+ ModeShapeServer removedServer ) {
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
+ CheckArg.isNotNull(removedServer, "removedServer"); //$NON-NLS-1$
return new ServerRegistryEvent(serverManager, Type.REMOVE, removedServer);
}
@@ -82,25 +74,21 @@
* @see Type#UPDATE
*/
public static ServerRegistryEvent createUpdateEvent( ServerManager serverManager,
- Server previousServerVersion,
- Server newServerVersion ) {
- CheckArg.isNotNull(serverManager, "serverManager");
- CheckArg.isNotNull(previousServerVersion, "previousServerVersion");
- CheckArg.isNotNull(newServerVersion, "newServerVersion");
+ ModeShapeServer previousServerVersion,
+ ModeShapeServer newServerVersion ) {
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
+ CheckArg.isNotNull(previousServerVersion, "previousServerVersion"); //$NON-NLS-1$
+ CheckArg.isNotNull(newServerVersion, "newServerVersion"); //$NON-NLS-1$
ServerRegistryEvent event = new ServerRegistryEvent(serverManager, Type.UPDATE, previousServerVersion);
event.updatedServer = newServerVersion;
return event;
}
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The server being added, removed, or updated.
*/
- private final Server server;
+ private final ModeShapeServer server;
/**
* The server manager in charge of the server registry the event is associated with.
@@ -115,12 +103,8 @@
/**
* The server that is replacing an existing server. Will be <code>null</code> for all types except {@link Type#UPDATE update}.
*/
- private Server updatedServer;
+ private ModeShapeServer updatedServer;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param serverManager the server manager sourcing this event
* @param type the event type
@@ -128,24 +112,20 @@
*/
private ServerRegistryEvent( ServerManager serverManager,
Type type,
- Server server ) {
+ ModeShapeServer server ) {
assert (serverManager != null);
assert (type != null);
assert (server != null);
-
+
this.serverManager = serverManager;
this.type = type;
this.server = server;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* @return the added, removed, or the old version of the server that has been updated
*/
- public Server getServer() {
+ public ModeShapeServer getServer() {
return this.server;
}
@@ -161,7 +141,7 @@
* @throws UnsupportedOperationException if method is called when the type is not an update
* @see Type#UPDATE
*/
- public Server getUpdatedServer() {
+ public ModeShapeServer getUpdatedServer() {
if (this.type != Type.UPDATE) {
throw new UnsupportedOperationException();
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -154,7 +154,21 @@
}
try {
- new URL(url);
+ URL testUrl = new URL(url);
+
+ // make sure there is a host
+ String host = testUrl.getHost();
+
+ if ((host == null) || "".equals(host)) { //$NON-NLS-1$
+ return new Status(Severity.ERROR, RestClientI18n.serverInvalidUrlHostMsg.text(), null);
+ }
+
+ // make sure there is a port
+ int port = testUrl.getPort();
+
+ if (port == -1) {
+ return new Status(Severity.ERROR, RestClientI18n.serverInvalidUrlPortMsg.text(), null);
+ }
} catch (Exception e) {
return new Status(Severity.ERROR, RestClientI18n.serverInvalidUrlMsg.text(url), e);
}
@@ -174,10 +188,6 @@
return Status.OK_STATUS;
}
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* Don't allow construction.
*/
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -1,63 +0,0 @@
-package org.jboss.tools.modeshape.rest;
-
-import org.modeshape.common.util.CheckArg;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
-
-/**
- * The <code>WorkspaceArea</code> represents a known area in a ModeShape repository where sequencing of resources occurs.
- */
-public final class WorkspaceArea {
-
- /**
- * The path within the workspace where this area is found (never <code>null</code>).
- */
- private final String path;
-
- /**
- * An optional workspace area title (can be <code>null</code> or empty).
- */
- private final String title;
-
- /**
- * The workspace where this area is found (never <code>null</code>).
- */
- private final Workspace workspace;
-
- /**
- * @param workspace the workspace where this area is found (never <code>null</code>)
- * @param path the workspace path where this area is found (never <code>null</code>)
- * @param title the workspace area title (can be <code>null</code> or empty)
- */
- public WorkspaceArea( Workspace workspace,
- String path,
- String title ) {
- CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
- CheckArg.isNotEmpty(path, "path"); //$NON-NLS-1$
-
- this.workspace = workspace;
- this.path = path;
- this.title = title;
- }
-
- /**
- * @return path the workspace path where this area is found (never <code>null</code>)
- */
- public String getPath() {
- return this.path;
- }
-
- /**
- * @return title the workspace area title (can be <code>null</code> or empty)
- */
- public String getTitle() {
- return this.title;
- }
-
- /**
- * @return workspace the workspace where this area is found (never <code>null</code>)
- */
- public Workspace getWorkspace() {
- return this.workspace;
- }
-
-}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -12,8 +12,10 @@
package org.jboss.tools.modeshape.rest.actions;
import static org.jboss.tools.modeshape.rest.IUiConstants.DELETE_SERVER_IMAGE;
+
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -24,18 +26,14 @@
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
import org.jboss.tools.modeshape.rest.dialogs.DeleteServerDialog;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
* The <code>DeleteServerAction</code> deletes one or more servers from the server registry.
*/
public final class DeleteServerAction extends BaseSelectionListenerAction {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The server manager used to delete servers.
*/
@@ -44,17 +42,13 @@
/**
* The servers being deleted (never <code>null</code>).
*/
- private final List<Server> serversToDelete;
+ private final List<ModeShapeServer> serversToDelete;
/**
* The shell used to display the delete confirmation dialog.
*/
private final Shell shell;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param shell the parent shell used to display the confirmation dialog
* @param serverManager the server manager to use when deleting servers
@@ -66,15 +60,11 @@
setImageDescriptor(Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE));
setEnabled(false);
- this.serversToDelete = new ArrayList<Server>(5);
+ this.serversToDelete = new ArrayList<ModeShapeServer>(5);
this.shell = shell;
this.serverManager = serverManager;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -87,7 +77,7 @@
if (dialog.open() == Window.OK) {
boolean errorsOccurred = false;
- for (Server server : this.serversToDelete) {
+ for (ModeShapeServer server : this.serversToDelete) {
Status status = this.serverManager.removeServer(server);
if (!status.isOk()) {
@@ -124,8 +114,8 @@
// disable if one non-server is found
for (Object obj : selection.toArray()) {
- if (obj instanceof Server) {
- this.serversToDelete.add((Server)obj);
+ if (obj instanceof ModeShapeServer) {
+ this.serversToDelete.add((ModeShapeServer)obj);
} else {
this.serversToDelete.clear();
return false;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -13,29 +13,26 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.EDIT_SERVER_IMAGE;
import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
+
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.PersistedServer;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.jboss.tools.modeshape.rest.wizards.ServerWizard;
/**
- * The <code>EditServerAction</code> runs a UI that allows {@link PersistedServer server} properties to be changed.
+ * The <code>EditServerAction</code> runs a UI that allows {@link ModeShapeServer server} properties to be changed.
*/
public final class EditServerAction extends BaseSelectionListenerAction {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The selected server being edited.
*/
- private PersistedServer serverBeingEdited;
+ private ModeShapeServer serverBeingEdited;
/**
* The server manager used to create and edit servers.
@@ -47,10 +44,6 @@
*/
private final Shell shell;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param shell the parent shell used to display the dialog
* @param serverManager the server manager to use when creating and editing servers
@@ -66,10 +59,6 @@
this.serverManager = serverManager;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -110,8 +99,8 @@
Object obj = selection.getFirstElement();
// enable if server is selected
- if (obj instanceof PersistedServer) {
- this.serverBeingEdited = (PersistedServer)obj;
+ if (obj instanceof ModeShapeServer) {
+ this.serverBeingEdited = (ModeShapeServer)obj;
return true;
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -13,24 +13,21 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
import static org.jboss.tools.modeshape.rest.IUiConstants.NEW_SERVER_IMAGE;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.PersistedServer;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.jboss.tools.modeshape.rest.wizards.ServerWizard;
/**
- * The <code>NewServerAction</code> runs a UI that allows the user to create a new {@link PersistedServer server}.
+ * The <code>NewServerAction</code> runs a UI that allows the user to create a new {@link ModeShapeServer server}.
*/
public final class NewServerAction extends Action {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The server manager used to create and edit servers.
*/
@@ -41,10 +38,6 @@
*/
private final Shell shell;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param shell the parent shell used to display the dialog
* @param serverManager the server manager to use when creating and editing servers
@@ -59,10 +52,6 @@
this.serverManager = serverManager;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -12,6 +12,7 @@
package org.jboss.tools.modeshape.rest.actions;
import static org.jboss.tools.modeshape.rest.IUiConstants.REFRESH_IMAGE;
+
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -21,27 +22,19 @@
import org.eclipse.ui.actions.BaseSelectionListenerAction;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.RestClientI18n;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.jboss.tools.modeshape.rest.jobs.ReconnectJob;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
* The <code>ReconnectToServerAction</code> tries to reconnect to a selected server.
*/
public final class ReconnectToServerAction extends BaseSelectionListenerAction {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The server view tree viewer.
*/
private final TreeViewer viewer;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param viewer the server view tree viewer
*/
@@ -54,10 +47,6 @@
this.viewer = viewer;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* @return the view's tree viewer
*/
@@ -68,7 +57,7 @@
/**
* @param server the server being connected to
*/
- void refresh( final Server server ) {
+ void refresh( final ModeShapeServer server ) {
final Display display = this.viewer.getControl().getDisplay();
if (!display.isDisposed()) {
@@ -94,7 +83,7 @@
*/
@Override
public void run() {
- final Server server = (Server)getStructuredSelection().getFirstElement();
+ final ModeShapeServer server = (ModeShapeServer)getStructuredSelection().getFirstElement();
final ReconnectJob job = new ReconnectJob(server);
// add listener so we can refresh tree
@@ -125,7 +114,7 @@
*/
@Override
protected boolean updateSelection( IStructuredSelection selection ) {
- return ((selection.size() == 1) && (selection.getFirstElement() instanceof Server));
+ return ((selection.size() == 1) && (selection.getFirstElement() instanceof ModeShapeServer));
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -12,7 +12,9 @@
package org.jboss.tools.modeshape.rest.dialogs;
import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
+
import java.util.Collection;
+
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
@@ -24,48 +26,35 @@
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.RestClientI18n;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.common.util.CheckArg;
-import org.modeshape.web.jcr.rest.client.domain.IModeShapeObject;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
- * The <code>DeleteServerDialog</code> class provides a UI for deleting a {@link Server server}.
+ * The <code>DeleteServerDialog</code> class provides a UI for deleting a {@link ModeShapeServer server}.
*/
public final class DeleteServerDialog extends MessageDialog {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* Collection of servers which will be deleted.
*/
- private final Collection<Server> serversBeingDeleted;
+ private final Collection<ModeShapeServer> serversBeingDeleted;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param parentShell the dialog parent
* @param serversBeingDeleted the servers being deleted (never <code>null</code>)
*/
public DeleteServerDialog( Shell parentShell,
- Collection<Server> serversBeingDeleted ) {
+ Collection<ModeShapeServer> serversBeingDeleted ) {
super(parentShell, RestClientI18n.deleteServerDialogTitle.text(), Activator.getDefault().getImage(ModeShape_IMAGE_16x),
- null, MessageDialog.QUESTION, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0);
+ null, MessageDialog.QUESTION, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
- CheckArg.isNotNull(serversBeingDeleted, "serversBeingDeleted");
+ CheckArg.isNotNull(serversBeingDeleted, "serversBeingDeleted"); //$NON-NLS-1$
this.serversBeingDeleted = serversBeingDeleted;
// make sure dialog is resizable
setShellStyle(getShellStyle() | SWT.RESIZE);
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -79,7 +68,7 @@
String msg;
if (this.serversBeingDeleted.size() == 1) {
- Server server = this.serversBeingDeleted.iterator().next();
+ ModeShapeServer server = this.serversBeingDeleted.iterator().next();
msg = RestClientI18n.deleteServerDialogOneServerMsg.text(server.getName(), server.getUser());
} else {
msg = RestClientI18n.deleteServerDialogMultipleServersMsg.text(this.serversBeingDeleted.size());
@@ -102,7 +91,7 @@
gd.horizontalIndent = 40;
serverList.setLayoutData(gd);
- for (IModeShapeObject server : this.serversBeingDeleted) {
+ for (ModeShapeServer server : this.serversBeingDeleted) {
serverList.add(server.getName());
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -50,19 +50,15 @@
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.jboss.tools.modeshape.rest.RestClientI18n;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.common.util.CheckArg;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
- * The <code>PublishedLocationsDialog</code> class provides a UI for viewing a list of {@link Server servers} a selected file has
+ * The <code>PublishedLocationsDialog</code> class provides a UI for viewing a list of {@link ModeShapeServer servers} a selected file has
* been published to.
*/
public final class PublishedLocationsDialog extends MessageDialog {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* The column index of the server URL.
*/
@@ -102,10 +98,6 @@
RestClientI18n.publishedLocationsDialogWorkspaceColumnHeader.text(),
RestClientI18n.publishedLocationsDialogFileUrlColumnHeader.text(),};
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The button that copies the file URL to the clipboard.
*/
@@ -121,10 +113,6 @@
*/
private final Collection<WorkspaceLocation> workspaceLocations;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param parentShell the dialog parent
* @param file the file whose workspaces it has been published on is being requested (never <code>null</code>)
@@ -145,10 +133,6 @@
setShellStyle(getShellStyle() | SWT.RESIZE);
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -284,10 +268,6 @@
}
}
- // ===========================================================================================================================
- // Inner Class
- // ===========================================================================================================================
-
/**
* The <code>LocationsTableProvider</code> provides content, labels, and images for the table.
*/
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeDomainObject.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeDomainObject.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeDomainObject.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -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.
+ */
+package org.jboss.tools.modeshape.rest.domain;
+
+/**
+ * The <code>ModeShapeDomainObject</code> class is used to wrap object types coming from the ModeShape server. This is done
+ * to add more functionality to each type. One example is that these wrapper objects know how to display their properties
+ * in Eclipse.
+ */
+public interface ModeShapeDomainObject {
+
+ /**
+ * @return the name of the object (never <code>null</code>)
+ */
+ String getName();
+
+ /**
+ * @return a short description of the object that is typically used as a tooltip (can be <code>null</code> or empty)
+ */
+ String getShortDescription();
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeDomainObject.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,131 @@
+/*
+ * 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.
+ */
+package org.jboss.tools.modeshape.rest.domain;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.modeshape.rest.properties.ModeShapePropertySource;
+import org.modeshape.common.util.CheckArg;
+import org.modeshape.web.jcr.rest.client.domain.Repository;
+
+/**
+ *
+ */
+public final class ModeShapeRepository implements IAdaptable, ModeShapeDomainObject {
+
+ /**
+ * The ModeShape server's repository object (never <code>null</code>).
+ */
+ private final Repository delegate;
+
+ /**
+ * The wrapped ModeShape server's server object (never <code>null</code>).
+ */
+ private final ModeShapeServer server;
+
+ /**
+ * @param repository the ModeShape server's repository object being wrapped (cannot be <code>null</code>)
+ * @param server the wrapped ModeShape server object (cannot be <code>null</code>)
+ */
+ public ModeShapeRepository( Repository repository,
+ ModeShapeServer server ) {
+ CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
+ CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
+
+ this.delegate = repository;
+ this.server = server;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ return this.delegate.equals(obj);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter( Class adapter ) {
+ if (adapter == IPropertySource.class) {
+ return new ModeShapePropertySource(this);
+ }
+
+ return null;
+ }
+
+ /**
+ * @return the ModeShape server's repository object (never <code>null</code>)
+ */
+ public Repository getDelegate() {
+ return this.delegate;
+ }
+
+ /**
+ * @return the repository properties (never <code>null</code>)
+ */
+ public Map<String, Object> getProperties() {
+ return this.delegate.getMetadata();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getName()
+ */
+ @Override
+ public String getName() {
+ return this.delegate.getName();
+ }
+
+ /**
+ * @return the wrapped server (never <code>null</code>)
+ */
+ public ModeShapeServer getServer() {
+ return this.server;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getShortDescription()
+ */
+ @Override
+ public String getShortDescription() {
+ return this.delegate.getShortDescription();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return this.delegate.hashCode();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return this.delegate.toString();
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServer.java (from rev 30209, trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PersistedServer.java)
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServer.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServer.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,173 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution and is
+ * available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.domain;
+
+import net.jcip.annotations.Immutable;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.modeshape.rest.properties.ModeShapePropertySource;
+import org.modeshape.web.jcr.rest.client.domain.Server;
+
+/**
+ * The <code>ModeShapeServer</code> class adds the concept of allowing a server's password to be persisted or not.
+ */
+@Immutable
+public final class ModeShapeServer implements IAdaptable, ModeShapeDomainObject {
+
+ /**
+ * The ModeShape server's server object (never <code>null</code>).
+ */
+ private final Server delegate;
+
+ /**
+ * Indicates if the password should be stored locally when the server is persisted.
+ */
+ private final boolean persistPassword;
+
+ /**
+ * Constructs a new <code>ModeShapeServer</code>.
+ *
+ * @param url the server URL (never <code>null</code>)
+ * @param user the server user (never <code>null</code>)
+ * @param password the server password (may be <code>null</code>)
+ * @param persistPassword <code>true</code> if the password should be stored
+ * @throws IllegalArgumentException if URL or user is <code>null</code> or empty
+ */
+ public ModeShapeServer( String url,
+ String user,
+ String password,
+ boolean persistPassword ) {
+ this.delegate = new Server(url, user, password);
+ this.persistPassword = persistPassword;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (obj == null) {
+ return false;
+ }
+
+ if (!this.getClass().equals(obj.getClass())) {
+ return false;
+ }
+
+ ModeShapeServer that = (ModeShapeServer)obj;
+
+ if (this.delegate.equals(that.delegate)) {
+ return (this.persistPassword == that.persistPassword);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter( Class adapter ) {
+ if (adapter == IPropertySource.class) {
+ return new ModeShapePropertySource(this);
+ }
+
+ return null;
+ }
+
+ /**
+ * @return the ModeShape server's server object (never <code>null</code>)
+ */
+ public Server getDelegate() {
+ return this.delegate;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getName()
+ */
+ @Override
+ public String getName() {
+ return this.delegate.getName();
+ }
+
+ /**
+ * @return the user's server password (maybe <code>null</code> or empty)
+ * @see Server#getPassword()
+ */
+ public String getPassword() {
+ return this.delegate.getPassword();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getShortDescription()
+ */
+ @Override
+ public String getShortDescription() {
+ return this.delegate.getShortDescription();
+ }
+
+ /**
+ * @return the server URL (never <code>null</code>)
+ * @see Server#getUrl()
+ */
+ public String getUrl() {
+ return this.delegate.getUrl();
+ }
+
+ /**
+ * @return the server's user login (never <code>null</code>)
+ * @see Server#getUser()
+ */
+ public String getUser() {
+ return this.delegate.getUser();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return this.delegate.hashCode();
+ }
+
+ /**
+ * @param server the server whose key is being compared to
+ * @return <code>true</code> if the server's have the same key
+ * @see Server#hasSameKey(Server)
+ */
+ public boolean hasSameKey( ModeShapeServer server ) {
+ return this.delegate.hasSameKey(server.getDelegate());
+ }
+
+ /**
+ * @return persistPassword <code>true</code> if the password is being persisted
+ */
+ public boolean isPasswordBeingPersisted() {
+ return this.persistPassword;
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+package org.jboss.tools.modeshape.rest.domain;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.modeshape.rest.properties.ModeShapePropertySource;
+import org.modeshape.common.util.CheckArg;
+import org.modeshape.web.jcr.rest.client.domain.Workspace;
+
+/**
+ *
+ */
+public final class ModeShapeWorkspace implements IAdaptable, ModeShapeDomainObject {
+
+ /**
+ * The ModeShape server's workspace object (never <code>null</code>).
+ */
+ private final Workspace delegate;
+
+ /**
+ * The wrapped ModeShape server's repository object (never <code>null</code>).
+ */
+ private final ModeShapeRepository repository;
+
+ /**
+ * @param workspace the ModeShape server's workspace object being wrapped (cannot be <code>null</code>)
+ * @param repository the wrapped ModeShape repository object (cannot be <code>null</code>)
+ */
+ public ModeShapeWorkspace( Workspace workspace,
+ ModeShapeRepository repository ) {
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
+
+ this.delegate = workspace;
+ this.repository = repository;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ return this.delegate.equals(obj);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter( Class adapter ) {
+ if (adapter == IPropertySource.class) {
+ return new ModeShapePropertySource(this);
+ }
+
+ return null;
+ }
+
+ /**
+ * @return the ModeShape server's workspace object (never <code>null</code>)
+ */
+ public Workspace getDelegate() {
+ return this.delegate;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getName()
+ */
+ @Override
+ public String getName() {
+ return this.delegate.getName();
+ }
+
+ /**
+ * @return the wrapped repository (never <code>null</code>)
+ */
+ public ModeShapeRepository getRepository() {
+ return this.repository;
+ }
+
+ /**
+ * @return the wrapped server (never <code>null</code>)
+ */
+ public ModeShapeServer getServer() {
+ return this.repository.getServer();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getShortDescription()
+ */
+ @Override
+ public String getShortDescription() {
+ return this.delegate.getShortDescription();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return this.delegate.hashCode();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return this.delegate.toString();
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/WorkspaceArea.java (from rev 30219, trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java)
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/WorkspaceArea.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/WorkspaceArea.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,82 @@
+package org.jboss.tools.modeshape.rest.domain;
+
+import org.modeshape.common.util.CheckArg;
+
+/**
+ * The <code>WorkspaceArea</code> represents a known area in a ModeShape repository where sequencing of resources occurs.
+ */
+public final class WorkspaceArea implements ModeShapeDomainObject {
+
+ /**
+ * The path within the workspace where this area is found (never <code>null</code>).
+ */
+ private final String path;
+
+ /**
+ * An optional workspace area title (can be <code>null</code> or empty).
+ */
+ private final String title;
+
+ /**
+ * The workspace where this area is found (never <code>null</code>).
+ */
+ private final ModeShapeWorkspace workspace;
+
+ /**
+ * @param workspace the workspace where this area is found (never <code>null</code>)
+ * @param path the workspace path where this area is found (never <code>null</code>)
+ * @param title the workspace area title (can be <code>null</code> or empty)
+ */
+ public WorkspaceArea( ModeShapeWorkspace workspace,
+ String path,
+ String title ) {
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotEmpty(path, "path"); //$NON-NLS-1$
+
+ this.workspace = workspace;
+ this.path = path;
+ this.title = title;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getName()
+ */
+ @Override
+ public String getName() {
+ return getPath();
+ }
+
+ /**
+ * @return path the workspace path where this area is found (never <code>null</code>)
+ */
+ public String getPath() {
+ return this.path;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject#getShortDescription()
+ */
+ @Override
+ public String getShortDescription() {
+ return getPath();
+ }
+
+ /**
+ * @return title the workspace area title (can be <code>null</code> or empty)
+ */
+ public String getTitle() {
+ return this.title;
+ }
+
+ /**
+ * @return workspace the workspace where this area is found (never <code>null</code>)
+ */
+ public ModeShapeWorkspace getWorkspace() {
+ return this.workspace;
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/WorkspaceArea.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/package-info.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/package-info.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/package-info.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,16 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution and is
+ * available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+/**
+ * The ModeShape REST Client Eclipse domain package contains object wrapper classes that allow ModeShape Tools to customize
+ * the objects coming from the ModeShape server.
+ */
+package org.jboss.tools.modeshape.rest.domain;
\ No newline at end of file
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -27,11 +27,11 @@
import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
import org.jboss.tools.modeshape.rest.views.ModeShapeContentProvider;
import org.jboss.tools.modeshape.rest.views.ModeShapeMessageConsole;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
* The <code>PublishJob</code> publishes or unpublishes one or more files using the {@link ServerManager}.
@@ -98,7 +98,7 @@
/**
* The workspace to use when publishing or unpublishing.
*/
- private final Workspace workspace;
+ private final ModeShapeWorkspace workspace;
/**
* The path segment prepended to the resource project path (never <code>null</code> but can be empty)
@@ -114,7 +114,7 @@
*/
public PublishJob( Type type,
List<IFile> files,
- Workspace workspace,
+ ModeShapeWorkspace workspace,
String workspaceArea,
boolean version ) {
super(getJobName(type, JOB_ID.incrementAndGet()));
@@ -189,17 +189,11 @@
// write initial message to console
if (isPublishing()) {
- ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
- serverUrl,
- repositoryName,
- workspaceName,
- fileCount));
+ ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId, serverUrl, repositoryName,
+ workspaceName, fileCount));
} else {
- ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
- serverUrl,
- repositoryName,
- workspaceName,
- fileCount));
+ ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId, serverUrl, repositoryName,
+ workspaceName, fileCount));
}
PublishedResourceHelper resourceHelper = new PublishedResourceHelper(getServerManager());
@@ -283,15 +277,11 @@
if (canceled) {
if (isPublishing()) {
- ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
- numProcessed,
- this.files.size(),
- duration));
+ ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId, numProcessed,
+ this.files.size(), duration));
} else {
- ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
- numProcessed,
- this.files.size(),
- duration));
+ ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId, numProcessed,
+ this.files.size(), duration));
}
} else {
if (isPublishing()) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -14,6 +14,7 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.PLUGIN_ID;
import static org.jboss.tools.modeshape.rest.IUiConstants.PUBLISHING_JOB_FAMILY;
import static org.jboss.tools.modeshape.rest.RestClientI18n.reconnectJobTaskName;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;
@@ -21,39 +22,27 @@
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
import org.jboss.tools.modeshape.rest.Utils;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
- * The <code>ReconnectJob</code> attempts to reconnect to the selected {@link Server server(s)}.
+ * The <code>ReconnectJob</code> attempts to reconnect to the selected {@link ModeShapeServer server(s)}.
*/
public final class ReconnectJob extends Job {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The server being reconnected to.
*/
- private final Server server;
+ private final ModeShapeServer server;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param server the server being connected to (never <code>null</code>)
*/
- public ReconnectJob( Server server ) {
+ public ReconnectJob( ModeShapeServer server ) {
super(reconnectJobTaskName.text(server.getShortDescription()));
this.server = server;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/ModeShapePropertySource.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/ModeShapePropertySource.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/ModeShapePropertySource.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,203 @@
+/*
+ * 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.
+ */
+package org.jboss.tools.modeshape.rest.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
+import org.modeshape.common.util.CheckArg;
+
+/**
+ * The <code>ModeShapePropertySource</code> class is the property source for all ModeShape objects appearing in ModeShape View.
+ */
+public final class ModeShapePropertySource implements IPropertySource {
+
+ private static final String SERVER_PASSWORD_PERSISTED = "server.passwordPersisted"; //$NON-NLS-1$
+ private static final String SERVER_URL = "server.url"; //$NON-NLS-1$
+ private static final String SERVER_USER = "server.user"; //$NON-NLS-1$
+
+ private static final String WORKSPACE_NAME = "workspace.name"; //$NON-NLS-1$
+ private static final String WORKSPACE_REPOSITORY = "workspace.repository"; //$NON-NLS-1$
+
+ private IPropertyDescriptor[] descriptors;
+
+ /**
+ * The object this property source is being used for.
+ */
+ private final ModeShapeDomainObject modeShapeObject;
+
+ /**
+ * @param modeShapeObject the object whose properties are being requested (cannot be <code>null</code>)
+ */
+ public ModeShapePropertySource( ModeShapeDomainObject modeShapeObject ) {
+ CheckArg.isNotNull(modeShapeObject, "modeShapeObject"); //$NON-NLS-1$
+ this.modeShapeObject = modeShapeObject;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
+ */
+ @Override
+ public Object getEditableValue() {
+ return null; // nothing is editable
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+ */
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (this.descriptors == null) {
+ List<IPropertyDescriptor> temp = new ArrayList<IPropertyDescriptor>();
+
+ if (this.modeShapeObject instanceof ModeShapeServer) {
+ // add URL
+ PropertyDescriptor descriptor = new PropertyDescriptor(SERVER_URL,
+ PropertyDisplayNameProvider.getDisplayName(SERVER_URL));
+ descriptor.setCategory(PropertyDisplayNameProvider.getCategory(SERVER_URL));
+ temp.add(descriptor);
+
+ // add user
+ descriptor = new PropertyDescriptor(SERVER_USER, PropertyDisplayNameProvider.getDisplayName(SERVER_USER));
+ descriptor.setCategory(PropertyDisplayNameProvider.getCategory(SERVER_USER));
+ temp.add(descriptor);
+
+ // add password persisted
+ descriptor = new PropertyDescriptor(SERVER_PASSWORD_PERSISTED,
+ PropertyDisplayNameProvider.getDisplayName(SERVER_PASSWORD_PERSISTED));
+ descriptor.setCategory(PropertyDisplayNameProvider.getCategory(SERVER_PASSWORD_PERSISTED));
+ temp.add(descriptor);
+ } else if (this.modeShapeObject instanceof ModeShapeRepository) {
+ for (String propKey : ((ModeShapeRepository)this.modeShapeObject).getProperties().keySet()) {
+ PropertyDescriptor descriptor = new PropertyDescriptor(propKey,
+ PropertyDisplayNameProvider.getDisplayName(propKey));
+ descriptor.setCategory(PropertyDisplayNameProvider.getCategory(propKey));
+ temp.add(descriptor);
+ }
+ } else if (this.modeShapeObject instanceof ModeShapeWorkspace) {
+ // add name
+ PropertyDescriptor descriptor = new PropertyDescriptor(WORKSPACE_NAME,
+ PropertyDisplayNameProvider.getDisplayName(WORKSPACE_NAME));
+ descriptor.setCategory(PropertyDisplayNameProvider.getCategory(WORKSPACE_NAME));
+ temp.add(descriptor);
+
+ // add repository name
+ descriptor = new PropertyDescriptor(WORKSPACE_REPOSITORY,
+ PropertyDisplayNameProvider.getDisplayName(WORKSPACE_REPOSITORY));
+ descriptor.setCategory(PropertyDisplayNameProvider.getCategory(WORKSPACE_REPOSITORY));
+ temp.add(descriptor);
+ }
+
+ this.descriptors = temp.toArray(new IPropertyDescriptor[temp.size()]);
+ }
+
+ return this.descriptors;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+ */
+ @Override
+ public Object getPropertyValue( Object id ) {
+ if (this.modeShapeObject instanceof ModeShapeServer) {
+ ModeShapeServer server = (ModeShapeServer)this.modeShapeObject;
+
+ if (SERVER_URL.equals(id)) {
+ return server.getUrl();
+ }
+
+ if (SERVER_USER.equals(id)) {
+ return server.getUser();
+ }
+
+ if (SERVER_PASSWORD_PERSISTED.equals(id)) {
+ return server.isPasswordBeingPersisted();
+ }
+ } else if (this.modeShapeObject instanceof ModeShapeRepository) {
+ Object value = ((ModeShapeRepository)this.modeShapeObject).getProperties().get(id);
+
+ if (value instanceof String) {
+ return value;
+ }
+
+ if (value.getClass().isArray()) {
+ Object[] values = (Object[])value;
+ StringBuilder txt = new StringBuilder();
+
+ for (int i = 0, size = values.length; i < size; ++i) {
+ txt.append(values[i]);
+
+ if (i < (size - 1)) {
+ txt.append(", "); //$NON-NLS-1$
+ }
+ }
+
+ return txt.toString();
+ }
+
+ return value.toString();
+ } else if (this.modeShapeObject instanceof ModeShapeWorkspace) {
+ ModeShapeWorkspace workspace = (ModeShapeWorkspace)this.modeShapeObject;
+
+ if (WORKSPACE_NAME.equals(id)) {
+ return workspace.getName();
+ }
+
+ if (WORKSPACE_REPOSITORY.equals(id)) {
+ return workspace.getRepository().getName();
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
+ */
+ @Override
+ public boolean isPropertySet( Object id ) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
+ */
+ @Override
+ public void resetPropertyValue( Object id ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void setPropertyValue( Object id,
+ Object value ) {
+ // nothing to do
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/ModeShapePropertySource.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+package org.jboss.tools.modeshape.rest.properties;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.jboss.tools.modeshape.rest.Activator;
+import org.jboss.tools.modeshape.rest.RestClientI18n;
+import org.modeshape.common.util.CheckArg;
+import org.modeshape.web.jcr.rest.client.Status;
+import org.modeshape.web.jcr.rest.client.Status.Severity;
+
+/**
+ * The <code>PropertyDisplayNameProvider</code> class provides localized names for properties and property categories.
+ */
+public final class PropertyDisplayNameProvider {
+
+ /**
+ * Constant appended to a property ID and used to obtain the property category.
+ */
+ private static final String CATEGORY_SUFFIX = ".CATEGORY"; //$NON-NLS-1$;
+
+ /**
+ * The name of the properties file.
+ */
+ private static final String RESOURCE_BUNDLE = PropertyDisplayNameProvider.class.getPackage().getName() + ".PropertyDisplayNames"; //$NON-NLS-1$
+
+ /**
+ * The properties file used for the display names and categories. Will be <code>null</code> if not loaded.
+ */
+ private static ResourceBundle bundle;
+
+ /**
+ * Indicates if the file has been loaded.
+ */
+ private static boolean loaded = false;
+
+ /**
+ * @param propertyId the property whose category is being requested (cannot be <code>null</code>)
+ * @return the category or <code>null</code> if not categorized
+ */
+ public static String getCategory( String propertyId ) {
+ return getDisplayName((propertyId + CATEGORY_SUFFIX), false);
+ }
+
+ /**
+ * @param propertyId the property whose category is being requested (cannot be <code>null</code>)
+ * @param idIfNotFound <code>true</code> if the ID should be returned if the property is not found
+ * @return the display name or <code>null</code> if not found
+ */
+ private static String getDisplayName( String propertyId,
+ boolean idIfNotFound ) {
+ CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
+
+ if (!loaded) {
+ load();
+ }
+
+ String displayName = null;
+
+ if (bundle != null) {
+ try {
+ displayName = bundle.getString(propertyId);
+ } catch (MissingResourceException e) {
+ // nothing to do
+ }
+ }
+
+ return ((idIfNotFound && (displayName == null)) ? propertyId : displayName);
+ }
+
+ /**
+ * @param propertyId the property whose category is being requested (cannot be <code>null</code>)
+ * @return the display name or, if the property is not found, the property ID (never <code>null</code>)
+ */
+ public static String getDisplayName( String propertyId ) {
+ return getDisplayName(propertyId, true);
+ }
+
+ private static void load() {
+ try {
+ bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
+ } catch (Exception e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.propertiesBundleLoadErrorMsg.text(), e));
+ }
+ }
+
+ /**
+ * Don't allow construction.
+ */
+ private PropertyDisplayNameProvider() {
+ // nothing to do
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNames.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNames.properties (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNames.properties 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,185 @@
+# ModeShape category
+
+custom.rep.name = Repository Name
+custom.rep.name.CATEGORY = ModeShape
+
+custom.rep.workspace.names = Workspace Names
+custom.rep.workspace.names.CATEGORY = ModeShape
+
+server.passwordPersisted = Password Persisted
+server.passwordPersisted.CATEGORY = ModeShape
+
+server.url = URL
+server.url.CATEGORY = ModeShape
+
+server.user = User
+server.user.CATEGORY = ModeShape
+
+workspace.name = Name
+workspace.name.CATEGORY = ModeShape
+
+workspace.repository = Repository
+workspace.repository.CATEGORY = ModeShape
+
+#
+# See JCR v2.0 Specification for categories below
+#
+
+# Repository Information category
+
+jcr.repository.version = Version
+jcr.repository.version.CATEGORY = Repository Information
+
+jcr.specification.name = JCR Specification Name
+jcr.specification.name.CATEGORY = Repository Information
+
+jcr.repository.name = JCR Implementation Name
+jcr.repository.name.CATEGORY = Repository Information
+
+jcr.repository.vendor = Vendor
+jcr.repository.vendor.CATEGORY = Repository Information
+
+jcr.repository.vendor.url = Vendor URL
+jcr.repository.vendor.url.CATEGORY = Repository Information
+
+jcr.specification.version = JCR Specification Version
+jcr.specification.version.CATEGORY = Repository Information
+
+# General category
+
+write.supported = Supports Writes
+write.supported.CATEGORY = General
+
+identifier.stability = Identifier Stability
+identifier.stability.CATEGORY = General
+
+option.xml.import.supported = Supports XML Import
+option.xml.import.supported.CATEGORY = General
+
+option.xml.export.supported = Supports XML Export
+option.xml.export.supported.CATEGORY = General
+
+option.unfiled.content.supported = Supports Unfiled Content
+option.unfiled.content.supported.CATEGORY = General
+
+option.versioning.supported = Supports Versioning
+option.versioning.supported.CATEGORY = General
+
+option.simple.versioning.supported = Supports Simple Versioning
+option.simple.versioning.supported.CATEGORY = General
+
+option.access.control.supported = Supports Access Control
+option.access.control.supported.CATEGORY = General
+
+option.activities.supported = Supports Activities
+option.activities.supported.CATEGORY = General
+
+option.baselines.supported = Supports Baselines
+option.baselines.supported.CATEGORY = General
+
+option.locking.supported = Supports Locking
+option.locking.supported.CATEGORY = General
+
+option.observation.supported = Supports Observation
+option.observation.supported.CATEGORY = General
+
+option.journaled.observation.supported = Supports Journaled Observation
+option.journaled.observation.supported.CATEGORY = General
+
+option.retention.supported = Supports Retention
+option.retention.supported.CATEGORY = General
+
+option.lifecycle.supported = Supports Lifecycle
+option.lifecycle.supported.CATEGORY = General
+
+option.transactions.supported = Supports Transactions
+option.transactions.supported.CATEGORY = General
+
+option.workspace.management.supported = Supports Workspace Management
+option.workspace.management.supported.CATEGORY = General
+
+option.node.and.property.with.same.name.supported = Supports Same-Name Node And Property
+option.node.and.property.with.same.name.supported.CATEGORY = General
+
+# Node Operations category
+
+option.update.primary.node.type.supported = Supports Primary Node Type Update
+option.update.primary.node.type.supported.CATEGORY = Node Operations
+
+option.update.mixin.node.types.supported = Supports Mixin Node Type Update
+option.update.mixin.node.types.supported.CATEGORY = Node Operations
+
+option.shareable.nodes.supported = Supports Shareable Nodes
+option.shareable.nodes.supported.CATEGORY = Node Operations
+
+# Node Type Management properties category
+
+option.node.type.management.supported = Supports Node Type Management
+option.node.type.management.supported.CATEGORY = Node Type Management
+
+node.type.management.inheritance = Supports Inheritance
+node.type.management.inheritance.CATEGORY = Node Type Management
+
+node.type.management.overrides.supported = Supports Overrides
+node.type.management.overrides.supported.CATEGORY = Node Type Management
+
+node.type.management.primary.item.name.supported = Supports Primary Item Name
+node.type.management.primary.item.name.supported.CATEGORY = Node Type Management
+
+node.type.management.orderable.child.nodes.supported = Supports Orderable Child Nodes
+node.type.management.orderable.child.nodes.supported.CATEGORY = Node Type Management
+
+node.type.management.residual.definitions.supported = Supports Residual Definitions
+node.type.management.residual.definitions.supported.CATEGORY = Node Type Management
+
+node.type.management.autocreated.definitions.supported = Supports Autocreated Definitions
+node.type.management.autocreated.definitions.supported.CATEGORY = Node Type Management
+
+node.type.management.same.name.siblings.supported = Supports Same-Name Siblings
+node.type.management.same.name.siblings.supported.CATEGORY = Node Type Management
+
+node.type.management.property.types = Supports Property Types
+node.type.management.property.types.CATEGORY = Node Type Management
+
+node.type.management.multivalued.properties.supported = Supports Multivalued Properties
+node.type.management.multivalued.properties.supported.CATEGORY = Node Type Management
+
+node.type.management.multiple.binary.properties.supported = Supports Multiple Binary Properties
+node.type.management.multiple.binary.properties.supported.CATEGORY = Node Type Management
+
+node.type.management.value.constraints.supported = Supports Value Constraints
+node.type.management.value.constraints.supported.CATEGORY = Node Type Management
+
+node.type.management.update.in.use.suported = Supports Update In Use
+node.type.management.update.in.use.suported.CATEGORY = Node Type Management
+
+# Query category
+
+query.languages = Supported Query Languages
+query.languages.CATEGORY = Query
+
+query.stored.queries.supported = Supports Stored Queries
+query.stored.queries.supported.CATEGORY = Query
+
+query.full.text.search.supported = Supports Full Text Search
+query.full.text.search.supported.CATEGORY = Query
+
+query.joins = Query Join Level
+query.joins.CATEGORY = Query
+
+# Deprecated Descriptors category
+
+level.1.supported = Supports JCR Level 1
+level.1.supported.CATEGORY = Deprecated Descriptors
+
+level.2.supported = Supports JCR Level 2
+level.2.supported.CATEGORY = Deprecated Descriptors
+
+option.query.sql.supported = Supports SQL Query
+option.query.sql.supported.CATEGORY = Deprecated Descriptors
+
+query.xpath.pos.index = Supports Index Position Notation For Same-Name Siblings
+query.xpath.pos.index.CATEGORY = Deprecated Descriptors
+
+query.xpath.doc.order = Supports XPATH Results In Document Order
+query.xpath.doc.order.CATEGORY = Deprecated Descriptors
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNames.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/package-info.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/package-info.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/package-info.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,16 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution and is
+ * available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+/**
+ * The ModeShape REST Client Eclipse properties package provides support for displaying
+ * {@link org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject} properties.
+ */
+package org.jboss.tools.modeshape.rest.properties;
\ No newline at end of file
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -12,11 +12,14 @@
package org.jboss.tools.modeshape.rest.views;
import static org.jboss.tools.modeshape.rest.IUiConstants.PUBLISHED_OVERLAY_IMAGE;
+
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+
import net.jcip.annotations.GuardedBy;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ColumnLabelProvider;
@@ -35,38 +38,30 @@
import org.jboss.tools.modeshape.rest.ServerManager;
import org.jboss.tools.modeshape.rest.ServerRegistryEvent;
import org.jboss.tools.modeshape.rest.Utils;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.IModeShapeObject;
-import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
- * The <code>ModeShapeContentProvider</code> is a content and label provider for the repositories. This class
- * <strong>MUST</strong> be registered, and then unregistered, to receive server registry events.
+ * The <code>ModeShapeContentProvider</code> is a content and label provider for the repositories. This class <strong>MUST</strong>
+ * be registered, and then unregistered, to receive server registry events.
*/
-public final class ModeShapeContentProvider extends ColumnLabelProvider
- implements ILightweightLabelDecorator, IServerRegistryListener, ITreeContentProvider {
+public final class ModeShapeContentProvider extends ColumnLabelProvider implements ILightweightLabelDecorator,
+ IServerRegistryListener, ITreeContentProvider {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* The decorator ID.
*/
- private static final String ID = "org.jboss.tools.modeshape.rest.decorator";
+ private static final String ID = "org.jboss.tools.modeshape.rest.decorator"; //$NON-NLS-1$
/**
* If a server connection cannot be established, wait this amount of time before trying again.
*/
private static final long RETRY_DURATION = 2000;
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
/**
* @return the decorator
*/
@@ -80,15 +75,11 @@
return null;
}
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* Servers that a connection can't be established. Value is the last time a establishing a connection was tried.
*/
- @GuardedBy( "offlineServersLock" )
- private final Map<Server, Long> offlineServerMap = new HashMap<Server, Long>();
+ @GuardedBy("offlineServersLock")
+ private final Map<ModeShapeServer, Long> offlineServerMap = new HashMap<ModeShapeServer, Long>();
/**
* Lock used for when accessing the offline server map. The map will be accessed in different threads as the decorator runs in
@@ -101,14 +92,10 @@
*/
private ServerManager serverManager;
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* @param server the server that is offline
*/
- private void addOfflineServer( Server server ) {
+ private void addOfflineServer( ModeShapeServer server ) {
try {
this.offlineServersLock.writeLock().lock();
this.offlineServerMap.put(server, System.currentTimeMillis());
@@ -133,8 +120,8 @@
}
if (getServerManager() != null) {
- if (element instanceof Server) {
- Server server = (Server)element;
+ if (element instanceof ModeShapeServer) {
+ ModeShapeServer server = (ModeShapeServer)element;
if (isOkToConnect(server)) {
Status status = getServerManager().ping(server);
@@ -148,7 +135,7 @@
IFile file = (IFile)element;
if (file.exists() && !file.isHidden()
- && new PublishedResourceHelper(getServerManager()).isPublished((IFile)element)) {
+ && new PublishedResourceHelper(getServerManager()).isPublished((IFile)element)) {
overlay = Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
}
}
@@ -176,11 +163,11 @@
*/
@Override
public Object[] getChildren( Object parentElement ) {
- assert (parentElement instanceof IModeShapeObject);
+ assert (parentElement instanceof ModeShapeDomainObject);
if (getServerManager() != null) {
- if (parentElement instanceof Server) {
- Server server = (Server)parentElement;
+ if (parentElement instanceof ModeShapeServer) {
+ ModeShapeServer server = (ModeShapeServer)parentElement;
if (isOkToConnect(server)) {
try {
@@ -191,8 +178,8 @@
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
}
}
- } else if (parentElement instanceof Repository) {
- Repository repository = (Repository)parentElement;
+ } else if (parentElement instanceof ModeShapeRepository) {
+ ModeShapeRepository repository = (ModeShapeRepository)parentElement;
if (isOkToConnect(repository.getServer())) {
try {
@@ -236,14 +223,14 @@
*/
@Override
public Object getParent( Object element ) {
- assert (element instanceof IModeShapeObject);
+ assert (element instanceof ModeShapeDomainObject);
- if (element instanceof Workspace) {
- return ((Workspace)element).getRepository();
+ if (element instanceof ModeShapeWorkspace) {
+ return ((ModeShapeWorkspace)element).getRepository();
}
- if (element instanceof Repository) {
- return ((Repository)element).getServer();
+ if (element instanceof ModeShapeRepository) {
+ return ((ModeShapeRepository)element).getServer();
}
// server
@@ -268,8 +255,8 @@
*/
@Override
public String getText( Object element ) {
- assert (element instanceof IModeShapeObject);
- return ((IModeShapeObject)element).getName();
+ assert (element instanceof ModeShapeDomainObject);
+ return ((ModeShapeDomainObject)element).getName();
}
/**
@@ -289,8 +276,8 @@
*/
@Override
public String getToolTipText( Object element ) {
- if (element instanceof IModeShapeObject) {
- return ((IModeShapeObject)element).getShortDescription();
+ if (element instanceof ModeShapeDomainObject) {
+ return ((ModeShapeDomainObject)element).getShortDescription();
}
return super.getToolTipText(element);
@@ -342,7 +329,7 @@
*
* @see java.lang.Runnable#run()
*/
- @SuppressWarnings( "synthetic-access" )
+ @SuppressWarnings("synthetic-access")
@Override
public void run() {
fireLabelProviderChanged(new LabelProviderChangedEvent(ModeShapeContentProvider.this, element));
@@ -356,7 +343,7 @@
* @param server the server being checked
* @return <code>true</code> if it is OK to try and connect
*/
- private boolean isOkToConnect( Server server ) {
+ private boolean isOkToConnect( ModeShapeServer server ) {
boolean check = false; // check map for time
try {
@@ -406,7 +393,7 @@
this.offlineServersLock.writeLock().lock();
this.offlineServerMap.remove(event.getServer());
} catch (Exception e) {
- errors = new Exception[] {e};
+ errors = new Exception[] { e };
} finally {
this.offlineServersLock.writeLock().unlock();
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -12,6 +12,7 @@
package org.jboss.tools.modeshape.rest.views;
import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.debug.ui.console.FileLink;
import org.eclipse.jface.text.BadLocationException;
@@ -40,34 +41,26 @@
*/
public final class ModeShapeMessageConsole extends MessageConsole {
- // =======================================================================================================================
- // Constants
- // =======================================================================================================================
-
/**
* Start tag for adding emphasis to a message. Tag will appear in a properties file.
*/
- private static final String EMPHASIS_START_TAG = "<em>";
+ private static final String EMPHASIS_START_TAG = "<em>"; //$NON-NLS-1$
/**
* End tag for adding emphasis to a message. Tag will appear in a properties file.
*/
- private static final String EMPHASIS_END_TAG = "</em>";
+ private static final String EMPHASIS_END_TAG = "</em>"; //$NON-NLS-1$
/**
* The identifier and type of the Message Console.
*/
- private static final String ID = "org.jboss.tools.modeshape.rest.views.ModeShapeMessageConsole";
+ private static final String ID = "org.jboss.tools.modeshape.rest.views.ModeShapeMessageConsole"; //$NON-NLS-1$
/**
* The message console name.
*/
private static final String NAME = RestClientI18n.publishingConsoleName.text();
- // =======================================================================================================================
- // Class Methods
- // =======================================================================================================================
-
/**
* Note: The <code>ModeShapeMessageConsole</code> should <strong>NOT</strong> be cached as the user can open/close/create instances.
*
@@ -101,7 +94,7 @@
* @param message the message being written to the console (never <code>null</code>)
*/
public static void writeln( String message ) {
- CheckArg.isNotNull(message, "message");
+ CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
writeln(message, null);
}
@@ -114,16 +107,12 @@
*/
public static void writeln( String message,
IFile file ) {
- CheckArg.isNotNull(message, "message");
+ CheckArg.isNotNull(message, "message"); //$NON-NLS-1$
ModeShapeMessageConsole console = getMessageConsole();
console.print(message, true, file);
}
- // =======================================================================================================================
- // Constructors
- // =======================================================================================================================
-
/**
* Prevent construction.
*/
@@ -131,10 +120,6 @@
super(NAME, Activator.getDefault().getImageDescriptor(ModeShape_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
@@ -233,20 +218,12 @@
}
}
- // ===========================================================================================================================
- // Inner Class
- // ===========================================================================================================================
-
/**
* The <code>HyperlinkCreator</code> creates a hyperlink in a Message Console for the first occurrence of the full path of
* a specified file.
*/
class HyperlinkCreator implements IDocumentListener {
- // =======================================================================================================================
- // Fields
- // =======================================================================================================================
-
/**
* The console where the message is printed to and the hyperlink will be created.
*/
@@ -262,10 +239,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
@@ -274,15 +247,11 @@
public HyperlinkCreator( String message,
ModeShapeMessageConsole console,
IFile file ) {
- this.message = message.replaceAll("<em>", "").replaceAll("\\Q</em>\\E", "");
+ this.message = message.replaceAll("<em>", "").replaceAll("\\Q</em>\\E", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
this.console = console;
this.file = file;
}
- // =======================================================================================================================
- // Methods
- // =======================================================================================================================
-
/**
* {@inheritDoc}
*
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -47,7 +47,7 @@
import org.jboss.tools.modeshape.rest.actions.EditServerAction;
import org.jboss.tools.modeshape.rest.actions.NewServerAction;
import org.jboss.tools.modeshape.rest.actions.ReconnectToServerAction;
-import org.modeshape.web.jcr.rest.client.domain.IModeShapeObject;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeDomainObject;
/**
* The <code>ServerView</code> shows all defined servers and their repositories.
@@ -180,6 +180,9 @@
// need to call this (doesn't matter what the param is) to bootstrap the provider.
this.viewer.setInput(this);
+
+ // need to do this so that properties page will work
+ getSite().setSelectionProvider(this.viewer);
}
/**
@@ -253,6 +256,7 @@
* @param event the event being processed
*/
void handleSelectionChanged( SelectionChangedEvent event ) {
+ assert (((IStructuredSelection)event.getSelection()).getFirstElement() instanceof ModeShapeDomainObject);
updateStatusLine((IStructuredSelection)event.getSelection());
}
@@ -318,7 +322,7 @@
* @param selection the current viewer selection (never <code>null</code>)
*/
private void updateStatusLine( IStructuredSelection selection ) {
- String msg = (selection.size() != 1 ? "" : ((IModeShapeObject)selection.getFirstElement()).getShortDescription()); //$NON-NLS-1$
+ String msg = (selection.size() != 1 ? "" : ((ModeShapeDomainObject)selection.getFirstElement()).getShortDescription()); //$NON-NLS-1$
getViewSite().getActionBars().getStatusLineManager().setMessage(msg);
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -54,1210 +54,1173 @@
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
import org.jboss.tools.modeshape.rest.ServerRegistryEvent;
-import org.jboss.tools.modeshape.rest.WorkspaceArea;
import org.jboss.tools.modeshape.rest.actions.NewServerAction;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
+import org.jboss.tools.modeshape.rest.domain.WorkspaceArea;
import org.jboss.tools.modeshape.rest.jobs.PublishJob.Type;
import org.jboss.tools.modeshape.rest.preferences.IgnoredResourcesModel;
import org.jboss.tools.modeshape.rest.preferences.PublishingFileFilter;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
- * The <code>PublishPage</code> is a UI for publishing or unpublishing one or
- * more files to a repository.
+ * The <code>PublishPage</code> is a UI for publishing or unpublishing one or more files to a repository.
*/
public final class PublishPage extends WizardPage implements IServerRegistryListener, ModifyListener {
-
- /**
- * The default repository workspace area where files are published.
- */
- private static final String DEFAULT_WORKSPACE_AREA = "/files"; //$NON-NLS-1$
- /**
- * The key in the wizard <code>IDialogSettings</code> for the recurse flag.
- */
- private static final String RECURSE_KEY = "recurse"; //$NON-NLS-1$
+ /**
+ * The default repository workspace area where files are published.
+ */
+ private static final String DEFAULT_WORKSPACE_AREA = "/files"; //$NON-NLS-1$
- /**
- * The key in the wizard <code>IDialogSettings</code> for the workspace area
- * path segment.
- */
- private static final String WORKSPACE_AREA_KEY = "workspaceArea"; //$NON-NLS-1$
+ /**
+ * The key in the wizard <code>IDialogSettings</code> for the recurse flag.
+ */
+ private static final String RECURSE_KEY = "recurse"; //$NON-NLS-1$
- /**
- * Indicates if the file filter should be used.
- */
- private static boolean filterFiles = true;
+ /**
+ * The key in the wizard <code>IDialogSettings</code> for the workspace area path segment.
+ */
+ private static final String WORKSPACE_AREA_KEY = "workspaceArea"; //$NON-NLS-1$
- /**
- * @param container
- * the project or folder whose files are being requested
- * @param recurse
- * the flag indicating if child containers should be traversed
- * @param filter
- * the file filter or <code>null</code> if not used
- * @return the list of files contained in the specified container (never
- * <code>null</code>)
- * @throws CoreException
- * if there is a problem finding the files
- */
- private static List<IFile> findFiles(IContainer container, boolean recurse, PublishingFileFilter filter)
- throws CoreException {
- List<IFile> result = new ArrayList<IFile>();
+ /**
+ * Indicates if the file filter should be used.
+ */
+ private static boolean filterFiles = true;
- if (((container instanceof IProject) && !((IProject) container).isOpen())
- || ((filter != null) && !filter.accept(container))) {
- return result;
- }
+ /**
+ * @param container the project or folder whose files are being requested
+ * @param recurse the flag indicating if child containers should be traversed
+ * @param filter the file filter or <code>null</code> if not used
+ * @return the list of files contained in the specified container (never <code>null</code>)
+ * @throws CoreException if there is a problem finding the files
+ */
+ private static List<IFile> findFiles( IContainer container,
+ boolean recurse,
+ PublishingFileFilter filter ) throws CoreException {
+ List<IFile> result = new ArrayList<IFile>();
- // process container members
- for (IResource member : container.members()) {
- if (recurse && (member instanceof IContainer)) {
- // don't select closed projects
- if ((member instanceof IProject) && !((IProject) member).isOpen()) {
- continue;
- }
+ if (((container instanceof IProject) && !((IProject)container).isOpen()) || ((filter != null) && !filter.accept(container))) {
+ return result;
+ }
- result.addAll(findFiles((IContainer) member, recurse, filter));
- } else if ((member instanceof IFile) && ((IFile) member).getLocation().toFile().exists()) {
- if ((filter == null) || filter.accept(member)) {
- result.add((IFile) member);
- }
- }
- }
+ // process container members
+ for (IResource member : container.members()) {
+ if (recurse && (member instanceof IContainer)) {
+ // don't select closed projects
+ if ((member instanceof IProject) && !((IProject)member).isOpen()) {
+ continue;
+ }
- return result;
- }
+ result.addAll(findFiles((IContainer)member, recurse, filter));
+ } else if ((member instanceof IFile) && ((IFile)member).getLocation().toFile().exists()) {
+ if ((filter == null) || filter.accept(member)) {
+ result.add((IFile)member);
+ }
+ }
+ }
- /**
- * Processes the specified list of files and for (1) each file found adds it
- * to the result and (2) for each project or folder adds all contained
- * files. For projects and folders processing will be recursive based on
- * saved wizard settings.
- *
- * @param resources
- * the resources being processed (never <code>null</code>)
- * @param recurse
- * the flag indicating if child containers should be traversed
- * @param filter
- * the file filter or <code>null</code> if not used
- * @return the files being published or unpublished (never <code>null</code>
- * )
- * @throws CoreException
- * if there is a problem processing the resources
- */
- private static List<IFile> processResources(List<IResource> resources, boolean recurse, PublishingFileFilter filter)
- throws CoreException {
- assert (resources != null);
- List<IFile> result = new ArrayList<IFile>();
+ return result;
+ }
- // Project Map - the outer map. Its keys are IProjects and its values
- // are a Parent Map
- // Parent Map - the inner map. Its keys are IContainers (IProject,
- // IFolder) and its values are a list of files
- Map<IProject, Map<IContainer, List<IFile>>> projectMap = new HashMap<IProject, Map<IContainer, List<IFile>>>();
+ /**
+ * Processes the specified list of files and for (1) each file found adds it to the result and (2) for each project or folder
+ * adds all contained files. For projects and folders processing will be recursive based on saved wizard settings.
+ *
+ * @param resources the resources being processed (never <code>null</code>)
+ * @param recurse the flag indicating if child containers should be traversed
+ * @param filter the file filter or <code>null</code> if not used
+ * @return the files being published or unpublished (never <code>null</code> )
+ * @throws CoreException if there is a problem processing the resources
+ */
+ private static List<IFile> processResources( List<IResource> resources,
+ boolean recurse,
+ PublishingFileFilter filter ) throws CoreException {
+ assert (resources != null);
+ List<IFile> result = new ArrayList<IFile>();
- // Step 1: Process resources
- // - For each file make sure there is a project entry and parent entry
- // then add the file to the Parent Map.
- // - For each folder make sure there is a project entry then add folder
- // entry.
- // - For each project make sure there is a project entry.
- //
- // Step 2: Process maps
- // - In the Project Map, when the recurse flag is set, entries for
- // projects that have a null value (parent map) will be
- // traversed finding all child files and them to results.
- // - In the internal parent map, when the recurse flag is set, entries
- // for parents that have a null value (child
- // collection) will be traversed finding all child files and add them to
- // results.
- //
- // Step 3: Add files from Step 1 to results
+ // Project Map - the outer map. Its keys are IProjects and its values
+ // are a Parent Map
+ // Parent Map - the inner map. Its keys are IContainers (IProject,
+ // IFolder) and its values are a list of files
+ Map<IProject, Map<IContainer, List<IFile>>> projectMap = new HashMap<IProject, Map<IContainer, List<IFile>>>();
- // Step 1 (see above for processing description)
- for (IResource resource : resources) {
- IFile file = null;
- IProject project = null;
- List<IFile> files = null;
- Map<IContainer, List<IFile>> parentMap = null;
+ // Step 1: Process resources
+ // - For each file make sure there is a project entry and parent entry
+ // then add the file to the Parent Map.
+ // - For each folder make sure there is a project entry then add folder
+ // entry.
+ // - For each project make sure there is a project entry.
+ //
+ // Step 2: Process maps
+ // - In the Project Map, when the recurse flag is set, entries for
+ // projects that have a null value (parent map) will be
+ // traversed finding all child files and them to results.
+ // - In the internal parent map, when the recurse flag is set, entries
+ // for parents that have a null value (child
+ // collection) will be traversed finding all child files and add them to
+ // results.
+ //
+ // Step 3: Add files from Step 1 to results
- // see if resource is filtered
- if ((filter != null) && !filter.accept(resource)) {
- continue;
- }
+ // Step 1 (see above for processing description)
+ for (IResource resource : resources) {
+ IFile file = null;
+ IProject project = null;
+ List<IFile> files = null;
+ Map<IContainer, List<IFile>> parentMap = null;
- if (resource instanceof IFile) {
- IContainer parent = null; // project or folder
- file = (IFile) resource;
- parent = file.getParent();
- project = file.getProject();
+ // see if resource is filtered
+ if ((filter != null) && !filter.accept(resource)) {
+ continue;
+ }
- // make sure there is a project entry
- if (!projectMap.containsKey(project)) {
- projectMap.put(project, null);
- }
+ if (resource instanceof IFile) {
+ IContainer parent = null; // project or folder
+ file = (IFile)resource;
+ parent = file.getParent();
+ project = file.getProject();
- parentMap = projectMap.get(project);
+ // make sure there is a project entry
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
- // make sure there is a parent entry
- if (parentMap == null) {
- parentMap = new HashMap<IContainer, List<IFile>>();
- projectMap.put(project, parentMap);
- }
+ parentMap = projectMap.get(project);
- files = parentMap.get(parent);
+ // make sure there is a parent entry
+ if (parentMap == null) {
+ parentMap = new HashMap<IContainer, List<IFile>>();
+ projectMap.put(project, parentMap);
+ }
- // make sure there is a files collection
- if (files == null) {
- files = new ArrayList<IFile>();
- parentMap.put(parent, files);
- }
+ files = parentMap.get(parent);
- // add file
- files.add(file);
- } else if (resource instanceof IFolder) {
- IFolder folder = (IFolder) resource;
- project = folder.getProject();
+ // make sure there is a files collection
+ if (files == null) {
+ files = new ArrayList<IFile>();
+ parentMap.put(parent, files);
+ }
- // make sure there is a project entry
- if (!projectMap.containsKey(project)) {
- projectMap.put(project, null);
- }
+ // add file
+ files.add(file);
+ } else if (resource instanceof IFolder) {
+ IFolder folder = (IFolder)resource;
+ project = folder.getProject();
- parentMap = projectMap.get(project);
+ // make sure there is a project entry
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
- // make sure there is a folder entry
- if (parentMap == null) {
- parentMap = new HashMap<IContainer, List<IFile>>();
- projectMap.put(project, parentMap);
- }
+ parentMap = projectMap.get(project);
- // add folder only if not already there
- if (!parentMap.containsKey(folder)) {
- parentMap.put(folder, null);
- }
- } else if (resource instanceof IProject) {
- project = (IProject) resource;
+ // make sure there is a folder entry
+ if (parentMap == null) {
+ parentMap = new HashMap<IContainer, List<IFile>>();
+ projectMap.put(project, parentMap);
+ }
- // if map does not have entry create one
- if (!projectMap.containsKey(project)) {
- projectMap.put(project, null);
- }
- }
- }
+ // add folder only if not already there
+ if (!parentMap.containsKey(folder)) {
+ parentMap.put(folder, null);
+ }
+ } else if (resource instanceof IProject) {
+ project = (IProject)resource;
- // Step 2 (see above for processing description)
- // Process projects that have nothing under them selected
- for (IProject project : projectMap.keySet()) {
- Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
+ // if map does not have entry create one
+ if (!projectMap.containsKey(project)) {
+ projectMap.put(project, null);
+ }
+ }
+ }
- if (parentMap == null) {
- result.addAll(findFiles(project, recurse, filter));
- } else {
- // process folders with no folder entries
- for (IContainer folder : parentMap.keySet()) {
- List<IFile> files = parentMap.get(folder);
+ // Step 2 (see above for processing description)
+ // Process projects that have nothing under them selected
+ for (IProject project : projectMap.keySet()) {
+ Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
- if (files == null) {
- result.addAll(findFiles(folder, recurse, filter));
- }
- }
- }
- }
+ if (parentMap == null) {
+ result.addAll(findFiles(project, recurse, filter));
+ } else {
+ // process folders with no folder entries
+ for (IContainer folder : parentMap.keySet()) {
+ List<IFile> files = parentMap.get(folder);
- // Step 3 (see above for processing description)
- for (IProject project : projectMap.keySet()) {
- Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
+ if (files == null) {
+ result.addAll(findFiles(folder, recurse, filter));
+ }
+ }
+ }
+ }
- if (parentMap != null) {
- for (Entry<IContainer, List<IFile>> entry : parentMap.entrySet()) {
- if (entry.getValue() != null) {
- result.addAll(entry.getValue());
- }
- }
- }
- }
+ // Step 3 (see above for processing description)
+ for (IProject project : projectMap.keySet()) {
+ Map<IContainer, List<IFile>> parentMap = projectMap.get(project);
- return result;
- }
+ if (parentMap != null) {
+ for (Entry<IContainer, List<IFile>> entry : parentMap.entrySet()) {
+ if (entry.getValue() != null) {
+ result.addAll(entry.getValue());
+ }
+ }
+ }
+ }
- /**
- * The repository chooser control.
- */
- private Combo cbxRepository;
+ return result;
+ }
- /**
- * The server chooser control.
- */
- private Combo cbxServer;
+ /**
+ * The repository chooser control.
+ */
+ private Combo cbxRepository;
- /**
- * The workspace chooser control.
- */
- private Combo cbxWorkspace;
+ /**
+ * The server chooser control.
+ */
+ private Combo cbxServer;
- /**
- * The workspace area chooser control.
- */
- private Combo cbxWorkspaceAreas;
+ /**
+ * The workspace chooser control.
+ */
+ private Combo cbxWorkspace;
- /**
- * The control indicating if the user wants to version resources (will be <code>null</code> when unpublishing).
- */
- private Button chkVersioning;
+ /**
+ * The workspace area chooser control.
+ */
+ private Combo cbxWorkspaceAreas;
- /**
- * The files being published or unpublished (never <code>null</code>).
- */
- private List<IFile> files;
+ /**
+ * The control indicating if the user wants to version resources (will be <code>null</code> when unpublishing).
+ */
+ private Button chkVersioning;
- /**
- * The filter used to determine if a file should be included in publishing
- * operations (may be <code>null</code>).
- */
- private PublishingFileFilter filter;
-
- /**
- * A hyperlink to the preference page (will be <code>null</code> when unpublishing).
- */
- private Link linkPrefs;
+ /**
+ * The files being published or unpublished (never <code>null</code>).
+ */
+ private List<IFile> files;
- /**
- * The control containing all the files being published or unpublished.
- */
- private org.eclipse.swt.widgets.List lstResources;
+ /**
+ * The filter used to determine if a file should be included in publishing operations (may be <code>null</code>).
+ */
+ private PublishingFileFilter filter;
- /**
- * Indicates if resources should be found recursively.
- */
- private boolean recurse = true;
+ /**
+ * A hyperlink to the preference page (will be <code>null</code> when unpublishing).
+ */
+ private Link linkPrefs;
- /**
- * A collection of repositories for the selected server (never
- * <code>null</code>).
- */
- private List<Repository> repositories;
+ /**
+ * The control containing all the files being published or unpublished.
+ */
+ private org.eclipse.swt.widgets.List lstResources;
- /**
- * The repository where the workspace is located.
- */
- private Repository repository;
+ /**
+ * Indicates if resources should be found recursively.
+ */
+ private boolean recurse = true;
- /**
- * <code>true</code> if the selected repository supports versioning
- */
- private boolean repositorySupportsVersioning;
+ /**
+ * A collection of repositories for the selected server (never <code>null</code>).
+ */
+ private List<ModeShapeRepository> repositories;
- /**
- * The collection of resources selected by the user to be published or
- * unpublished.
- */
- private final List<IResource> resources;
+ /**
+ * The repository where the workspace is located.
+ */
+ private ModeShapeRepository repository;
- /**
- * The server where the repository is located.
- */
- private Server server;
+ /**
+ * <code>true</code> if the selected repository supports versioning
+ */
+ private boolean repositorySupportsVersioning;
- /**
- * A collection of servers from the server registry (never <code>null</code>
- * ).
- */
- private List<Server> servers;
+ /**
+ * The collection of resources selected by the user to be published or unpublished.
+ */
+ private final List<IResource> resources;
- /**
- * The current validation status.
- */
- private Status status;
+ /**
+ * The server where the repository is located.
+ */
+ private ModeShapeServer server;
- /**
- * Indicates if publishing or unpublishing is being done.
- */
- private final Type type;
+ /**
+ * A collection of servers from the server registry (never <code>null</code> ).
+ */
+ private List<ModeShapeServer> servers;
- /**
- * Indicates if versioning of published resources should be done.
- */
- private boolean versioning = true;
+ /**
+ * The current validation status.
+ */
+ private Status status;
- /**
- * The workspace where the resources are being published/unpublished (may be
- * <code>null</code>).
- */
- private Workspace workspace;
+ /**
+ * Indicates if publishing or unpublishing is being done.
+ */
+ private final Type type;
- /**
- * The path segment prepended to the resource project path.
- */
- private String workspaceArea;
+ /**
+ * Indicates if versioning of published resources should be done.
+ */
+ private boolean versioning = true;
- /**
- * A collection of workspaces for the selected server repository (never
- * <code>null</code>).
- */
- private List<Workspace> workspaces;
+ /**
+ * The workspace where the resources are being published/unpublished (may be <code>null</code>).
+ */
+ private ModeShapeWorkspace workspace;
- /**
- * @param type
- * indicates if publishing or unpublishing is being done
- * @param resources
- * the resources being published or unpublished (never
- * <code>null</code>)
- * @throws CoreException
- * if there is a problem processing the input resources
- */
- public PublishPage(Type type, List<IResource> resources) throws CoreException {
- super(PublishPage.class.getSimpleName());
- CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
- setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
- : RestClientI18n.publishPageUnpublishTitle.text());
- setPageComplete(false);
+ /**
+ * The path segment prepended to the resource project path.
+ */
+ private String workspaceArea;
- this.type = type;
- this.resources = resources;
+ /**
+ * A collection of workspaces for the selected server repository (never <code>null</code>).
+ */
+ private List<ModeShapeWorkspace> workspaces;
+ /**
+ * @param type indicates if publishing or unpublishing is being done
+ * @param resources the resources being published or unpublished (never <code>null</code>)
+ * @throws CoreException if there is a problem processing the input resources
+ */
+ public PublishPage( Type type,
+ List<IResource> resources ) throws CoreException {
+ super(PublishPage.class.getSimpleName());
+ CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
+ setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
+ : RestClientI18n.publishPageUnpublishTitle.text());
+ setPageComplete(false);
+
+ this.type = type;
+ this.resources = resources;
+
// load filter with current preference value
IgnoredResourcesModel model = new IgnoredResourcesModel();
model.load(Activator.getDefault().getPreferenceStore().getString(IGNORED_RESOURCES_PREFERENCE));
this.filter = (filterFiles ? new PublishingFileFilter(model) : null);
- }
+ }
- private void constructLocationPanel(Composite parent) {
- Group pnl = new Group(parent, SWT.NONE);
- pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
- pnl.setLayout(new GridLayout(2, false));
- pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ private void constructLocationPanel( Composite parent ) {
+ Group pnl = new Group(parent, SWT.NONE);
+ pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
+ pnl.setLayout(new GridLayout(2, false));
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- // row 1: label combobox button
- // row 2: label combobox
- // row 3: label combobox
- // row 4: label textbox
+ // row 1: label combobox button
+ // row 2: label combobox
+ // row 3: label combobox
+ // row 4: label combobox
- { // row 1: server row
- Composite pnlServer = new Composite(pnl, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- pnlServer.setLayout(layout);
- GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gd.horizontalSpan = 2;
- pnlServer.setLayoutData(gd);
+ { // row 1: server row
+ Composite pnlServer = new Composite(pnl, SWT.NONE);
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ pnlServer.setLayout(layout);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd.horizontalSpan = 2;
+ pnlServer.setLayoutData(gd);
- Label lblServer = new Label(pnlServer, SWT.LEFT);
- lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblServer.setText(RestClientI18n.publishPageServerLabel.text());
+ Label lblServer = new Label(pnlServer, SWT.LEFT);
+ lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblServer.setText(RestClientI18n.publishPageServerLabel.text());
- this.cbxServer = new Combo(pnlServer, SWT.DROP_DOWN | SWT.READ_ONLY);
- this.cbxServer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip.text());
+ this.cbxServer = new Combo(pnlServer, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxServer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip.text());
- final IAction action = new NewServerAction(this.getShell(), getServerManager());
- final Button btnNewServer = new Button(pnlServer, SWT.PUSH);
- btnNewServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
- btnNewServer.setToolTipText(action.getToolTipText());
- btnNewServer.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- action.run();
- }
- });
+ final IAction action = new NewServerAction(this.getShell(), getServerManager());
+ final Button btnNewServer = new Button(pnlServer, SWT.PUSH);
+ btnNewServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
+ btnNewServer.setToolTipText(action.getToolTipText());
+ btnNewServer.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ action.run();
+ }
+ });
- // update page message first time selected to get rid of initial
- // message by forcing validation
- btnNewServer.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateInitialMessage();
- btnNewServer.removeSelectionListener(this);
- }
- });
- }
+ // update page message first time selected to get rid of initial
+ // message by forcing validation
+ btnNewServer.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ updateInitialMessage();
+ btnNewServer.removeSelectionListener(this);
+ }
+ });
+ }
- { // row 2: repository row
- Label lblRepository = new Label(pnl, SWT.LEFT);
- lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblRepository.setText(RestClientI18n.publishPageRepositoryLabel.text());
+ { // row 2: repository row
+ Label lblRepository = new Label(pnl, SWT.LEFT);
+ lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblRepository.setText(RestClientI18n.publishPageRepositoryLabel.text());
- this.cbxRepository = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
- this.cbxRepository.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip.text());
- }
+ this.cbxRepository = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxRepository.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip.text());
+ }
- { // row 3: workspace row
- Label lblWorkspace = new Label(pnl, SWT.LEFT);
- lblWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel.text());
+ { // row 3: workspace row
+ Label lblWorkspace = new Label(pnl, SWT.LEFT);
+ lblWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel.text());
- this.cbxWorkspace = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
- this.cbxWorkspace.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxWorkspace = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
+ this.cbxWorkspace.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- if (type == Type.PUBLISH) {
- this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
- } else {
- this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
- }
- }
+ if (type == Type.PUBLISH) {
+ this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
+ } else {
+ this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
+ }
+ }
- { // row 4: workspace area
- Label lblWorkspaceArea = new Label(pnl, SWT.LEFT);
- lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
+ { // row 4: workspace area
+ Label lblWorkspaceArea = new Label(pnl, SWT.LEFT);
+ lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
- this.cbxWorkspaceAreas = new Combo(pnl, SWT.DROP_DOWN);
- this.cbxWorkspaceAreas.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- this.cbxWorkspaceAreas.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
- }
- }
+ this.cbxWorkspaceAreas = new Combo(pnl, SWT.DROP_DOWN);
+ this.cbxWorkspaceAreas.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxWorkspaceAreas.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
+ }
+ }
- private void constructResourcesPanel(Composite parent) {
- Composite pnl = new Composite(parent, SWT.NONE);
- pnl.setLayout(new GridLayout());
- pnl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ private void constructResourcesPanel( Composite parent ) {
+ Composite pnl = new Composite(parent, SWT.NONE);
+ pnl.setLayout(new GridLayout());
+ pnl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- // pnl layout:
- // row 1: lbl
- // row 2: lstResources
- // row 3: recurse chkbox
- // row 4: versioning chkbox and link (only when publishing)
+ // pnl layout:
+ // row 1: lbl
+ // row 2: lstResources
+ // row 3: recurse chkbox
+ // row 4: versioning chkbox and link (only when publishing)
- { // row 1
- Label lbl = new Label(pnl, SWT.LEFT);
- lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ { // row 1
+ Label lbl = new Label(pnl, SWT.LEFT);
+ lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- if (type == Type.PUBLISH) {
- lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
- } else {
- lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
- }
- }
+ if (type == Type.PUBLISH) {
+ lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
+ } else {
+ lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
+ }
+ }
- { // row 2
- this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.horizontalSpan = 2;
- gd.minimumHeight = this.lstResources.getItemHeight() * 2; // set min
- // height
- gd.heightHint = this.lstResources.getItemHeight() * 10; // set
- // preferred
- // height
- this.lstResources.setLayoutData(gd);
- final org.eclipse.swt.widgets.List finalLst = this.lstResources;
+ { // row 2
+ this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.horizontalSpan = 2;
+ gd.minimumHeight = this.lstResources.getItemHeight() * 2; // set min
+ // height
+ gd.heightHint = this.lstResources.getItemHeight() * 10; // set
+ // preferred
+ // height
+ this.lstResources.setLayoutData(gd);
+ final org.eclipse.swt.widgets.List finalLst = this.lstResources;
- // update page message first time selected to get rid of initial
- // message by forcing validation
- this.lstResources.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- // do the very first time to get rid of initial message then
- // remove listener
- updateInitialMessage();
- finalLst.removeSelectionListener(this);
- }
- });
+ // update page message first time selected to get rid of initial
+ // message by forcing validation
+ this.lstResources.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ // do the very first time to get rid of initial message then
+ // remove listener
+ updateInitialMessage();
+ finalLst.removeSelectionListener(this);
+ }
+ });
- // load list with initial files
- loadFiles();
- }
+ // load list with initial files
+ loadFiles();
+ }
- { // row 3 recurse chkbox
- Button chkRecurse = new Button(pnl, SWT.CHECK);
- chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
- chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
+ { // row 3 recurse chkbox
+ Button chkRecurse = new Button(pnl, SWT.CHECK);
+ chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
+ chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
- // set the recurse flag based on dialog settings
- if (getDialogSettings().get(RECURSE_KEY) != null) {
- this.recurse = getDialogSettings().getBoolean(RECURSE_KEY);
- }
+ // set the recurse flag based on dialog settings
+ if (getDialogSettings().get(RECURSE_KEY) != null) {
+ this.recurse = getDialogSettings().getBoolean(RECURSE_KEY);
+ }
- chkRecurse.setSelection(this.recurse);
- chkRecurse.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- handleRecurseChanged(((Button) e.widget).getSelection());
- }
- });
+ chkRecurse.setSelection(this.recurse);
+ chkRecurse.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleRecurseChanged(((Button)e.widget).getSelection());
+ }
+ });
- // update page message first time selected to get rid of initial
- // message by forcing validation
- chkRecurse.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateInitialMessage();
- ((Button) e.widget).removeSelectionListener(this);
- }
- });
- }
+ // update page message first time selected to get rid of initial
+ // message by forcing validation
+ chkRecurse.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ updateInitialMessage();
+ ((Button)e.widget).removeSelectionListener(this);
+ }
+ });
+ }
- if (this.type == Type.PUBLISH) {
- // row 4 versioning chkbox and link to open preference page
- Composite pnlVersioning = new Composite(pnl, SWT.NONE);
- pnlVersioning.setLayout(new GridLayout(2, false));
- ((GridLayout) pnlVersioning.getLayout()).marginWidth = 0;
- pnlVersioning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
- ((GridData) pnlVersioning.getLayoutData()).minimumHeight = 30;
+ if (this.type == Type.PUBLISH) {
+ // row 4 versioning chkbox and link to open preference page
+ Composite pnlVersioning = new Composite(pnl, SWT.NONE);
+ pnlVersioning.setLayout(new GridLayout(2, false));
+ ((GridLayout)pnlVersioning.getLayout()).marginWidth = 0;
+ pnlVersioning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
+ ((GridData)pnlVersioning.getLayoutData()).minimumHeight = 30;
- this.chkVersioning = new Button(pnlVersioning, SWT.CHECK);
- this.chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- this.chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
- this.chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
+ this.chkVersioning = new Button(pnlVersioning, SWT.CHECK);
+ this.chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ this.chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
+ this.chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
- // set the version flag based on preference
- this.versioning = Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
+ // set the version flag based on preference
+ this.versioning = Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
- this.chkVersioning.setSelection(this.versioning);
- this.chkVersioning.setEnabled(false);
- this.chkVersioning.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- handleVersioningChanged(((Button) e.widget).getSelection());
- }
- });
+ this.chkVersioning.setSelection(this.versioning);
+ this.chkVersioning.setEnabled(false);
+ this.chkVersioning.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleVersioningChanged(((Button)e.widget).getSelection());
+ }
+ });
- this.linkPrefs = new Link(pnlVersioning, SWT.WRAP);
- this.linkPrefs.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
- this.linkPrefs.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- this.linkPrefs.setEnabled(false);
- this.linkPrefs.addSelectionListener(new SelectionAdapter() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- handleOpenPreferencePage();
- }
- });
- }
- }
+ this.linkPrefs = new Link(pnlVersioning, SWT.WRAP);
+ this.linkPrefs.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
+ this.linkPrefs.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ this.linkPrefs.setEnabled(false);
+ this.linkPrefs.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleOpenPreferencePage();
+ }
+ });
+ }
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createControl(Composite parent) {
- Composite pnlMain = new Composite(parent, SWT.NONE);
- pnlMain.setLayout(new GridLayout());
- pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- constructLocationPanel(pnlMain);
- constructResourcesPanel(pnlMain);
- setControl(pnlMain);
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl( Composite parent ) {
+ Composite pnlMain = new Composite(parent, SWT.NONE);
+ pnlMain.setLayout(new GridLayout());
+ pnlMain.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ constructLocationPanel(pnlMain);
+ constructResourcesPanel(pnlMain);
+ setControl(pnlMain);
- // add combobox listeners
- this.cbxRepository.addModifyListener(this);
- this.cbxServer.addModifyListener(this);
- this.cbxWorkspace.addModifyListener(this);
- this.cbxWorkspaceAreas.addModifyListener(this);
+ // add combobox listeners
+ this.cbxRepository.addModifyListener(this);
+ this.cbxServer.addModifyListener(this);
+ this.cbxWorkspace.addModifyListener(this);
+ this.cbxWorkspaceAreas.addModifyListener(this);
- // register with the help system
- IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
- helpSystem.setHelp(pnlMain, PUBLISH_DIALOG_HELP_CONTEXT);
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(pnlMain, PUBLISH_DIALOG_HELP_CONTEXT);
- // register to receive server registry events (this will populate the
- // UI)
- getServerManager().addRegistryListener(this);
- }
+ // register to receive server registry events (this will populate the UI)
+ getServerManager().addRegistryListener(this);
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- @Override
- public void dispose() {
- getServerManager().removeRegistryListener(this);
- super.dispose();
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ getServerManager().removeRegistryListener(this);
+ super.dispose();
+ }
- /**
- * @return the files to publish or unpublish (never <code>null</code>)
- */
- List<IFile> getFiles() {
- return this.files;
- }
+ /**
+ * @return the files to publish or unpublish (never <code>null</code>)
+ */
+ List<IFile> getFiles() {
+ return this.files;
+ }
- /**
- * @return the server manager obtained from the wizard
- */
- private ServerManager getServerManager() {
- return ((PublishWizard) getWizard()).getServerManager();
- }
+ /**
+ * @return the server manager obtained from the wizard
+ */
+ private ServerManager getServerManager() {
+ return ((PublishWizard)getWizard()).getServerManager();
+ }
- /**
- * @return thw workspace to use when publishing or unpublishing (page must
- * be complete)
- */
- Workspace getWorkspace() {
- assert isPageComplete();
- return this.workspace;
- }
+ /**
+ * @return the workspace to use when publishing or unpublishing (page must be complete)
+ */
+ ModeShapeWorkspace getWorkspace() {
+ assert isPageComplete();
+ return this.workspace;
+ }
- /**
- * @return the path segment prepended to the resource project path (never
- * <code>null</code> but can be empty)
- */
- String getWorkspaceArea() {
- return this.workspaceArea;
- }
+ /**
+ * @return the path segment prepended to the resource project path (never <code>null</code> but can be empty)
+ */
+ String getWorkspaceArea() {
+ return this.workspaceArea;
+ }
- /**
- * Opens the preference page.
- */
- void handleOpenPreferencePage() {
- // open preference page and only allow the pref page where the version
- // setting is
- PreferencesUtil.createPreferenceDialogOn(getShell(), MAIN_PREFERENCE_PAGE_ID,
- new String[] { MAIN_PREFERENCE_PAGE_ID }, null).open();
- }
+ /**
+ * Opens the preference page.
+ */
+ void handleOpenPreferencePage() {
+ // open preference page and only allow the pref page where the version
+ // setting is
+ PreferencesUtil.createPreferenceDialogOn(getShell(), MAIN_PREFERENCE_PAGE_ID, new String[] { MAIN_PREFERENCE_PAGE_ID },
+ null).open();
+ }
- /**
- * Saves the recurse setting and reloads the files to be published or
- * unpublished.
- *
- * @param selected
- * the flag indicating the new recurse setting
- */
- void handleRecurseChanged(boolean selected) {
- this.recurse = selected;
+ /**
+ * Saves the recurse setting and reloads the files to be published or unpublished.
+ *
+ * @param selected the flag indicating the new recurse setting
+ */
+ void handleRecurseChanged( boolean selected ) {
+ this.recurse = selected;
- try {
- this.files = processResources(this.resources, isRecursing(), filter);
- loadFiles();
- } catch (CoreException e) {
- Activator.getDefault().log(
- new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ try {
+ this.files = processResources(this.resources, isRecursing(), filter);
+ loadFiles();
+ } catch (CoreException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
- if (getControl().isVisible()) {
- MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(),
- RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
- }
- }
- }
+ if (getControl().isVisible()) {
+ MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(),
+ RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
+ }
+ }
+ }
- /**
- * Handler for when the repository control value is modified
- */
- void handleRepositoryModified() {
- int index = this.cbxRepository.getSelectionIndex();
+ /**
+ * Handler for when the repository control value is modified
+ */
+ void handleRepositoryModified() {
+ int index = this.cbxRepository.getSelectionIndex();
- // make sure there is a selection
- if (index != -1) {
- this.repository = this.repositories.get(index);
- }
+ // make sure there is a selection
+ if (index != -1) {
+ this.repository = this.repositories.get(index);
+ }
- // repository capabilities could affect the UI
- updateRepositoryCapabilities();
+ // repository capabilities could affect the UI
+ updateRepositoryCapabilities();
- // clear loaded workspaces
- refreshWorkspaces();
+ // clear loaded workspaces
+ refreshWorkspaces();
- // update page state
- updateState();
- }
+ // update page state
+ updateState();
+ }
- /**
- * Handler for when the server control value is modified
- */
- void handleServerModified() {
- int index = this.cbxServer.getSelectionIndex();
+ /**
+ * Handler for when the server control value is modified
+ */
+ void handleServerModified() {
+ int index = this.cbxServer.getSelectionIndex();
- // make sure there is a selection
- if (index != -1) {
- this.server = this.servers.get(index);
- }
+ // make sure there is a selection
+ if (index != -1) {
+ this.server = this.servers.get(index);
+ }
- // need to reload repositories since server changed
- refreshRepositories();
+ // need to reload repositories since server changed
+ refreshRepositories();
- // update page state
- updateState();
- }
+ // update page state
+ updateState();
+ }
- /**
- * Saves the versioning setting.
- *
- * @param selected
- * the flag indicating the new versioning setting
- */
- void handleVersioningChanged(boolean selected) {
- this.versioning = selected;
- }
+ /**
+ * Saves the versioning setting.
+ *
+ * @param selected the flag indicating the new versioning setting
+ */
+ void handleVersioningChanged( boolean selected ) {
+ this.versioning = selected;
+ }
- /**
- * Handler for when the workspace area value is modified.
- */
- void handleWorkspaceAreaModified() {
- int index = this.cbxWorkspaceAreas.getSelectionIndex();
+ /**
+ * Handler for when the workspace area value is modified.
+ */
+ void handleWorkspaceAreaModified() {
+ int index = this.cbxWorkspaceAreas.getSelectionIndex();
- if (index == -1) {
- this.workspaceArea = this.cbxWorkspaceAreas.getText();
- } else {
- this.workspaceArea = this.cbxWorkspaceAreas.getItems()[index];
- }
- }
+ if (index == -1) {
+ this.workspaceArea = this.cbxWorkspaceAreas.getText();
+ } else {
+ this.workspaceArea = this.cbxWorkspaceAreas.getItems()[index];
+ }
+ }
- /**
- * Handler for when the workspace control value is modified.
- */
- void handleWorkspaceModified() {
- int index = this.cbxWorkspace.getSelectionIndex();
+ /**
+ * Handler for when the workspace control value is modified.
+ */
+ void handleWorkspaceModified() {
+ int index = this.cbxWorkspace.getSelectionIndex();
- // make sure there is a selection
- if (index != -1) {
- Workspace newWorkspace = this.workspaces.get(index);
+ // make sure there is a selection
+ if (index != -1) {
+ ModeShapeWorkspace newWorkspace = this.workspaces.get(index);
- if ((this.workspace == null) || !this.workspace.equals(newWorkspace)) {
- this.workspace = newWorkspace;
+ if ((this.workspace == null) || !this.workspace.equals(newWorkspace)) {
+ this.workspace = newWorkspace;
- // update workspace areas
- WorkspaceArea[] workspaceAreas = null;
+ // update workspace areas
+ WorkspaceArea[] workspaceAreas = null;
- try {
- workspaceAreas = getServerManager().getWorkspaceAreas(this.workspace);
- } catch (Exception e) {
- Activator.getDefault().log(
- new Status(Severity.ERROR, RestClientI18n.publishPageUnableToObtainWorkspaceAreas
- .text(this.workspace), e));
- }
+ try {
+ workspaceAreas = getServerManager().getWorkspaceAreas(this.workspace);
+ } catch (Exception e) {
+ Activator.getDefault()
+ .log(new Status(Severity.ERROR,
+ RestClientI18n.publishPageUnableToObtainWorkspaceAreas.text(this.workspace),
+ e));
+ }
- if ((workspaceAreas == null) || (workspaceAreas.length == 0)) {
- // populate with default area name
- this.cbxWorkspaceAreas.setItems(new String[] { DEFAULT_WORKSPACE_AREA });
- } else {
- String[] areaPaths = new String[workspaceAreas.length];
- int i = 0;
+ if ((workspaceAreas == null) || (workspaceAreas.length == 0)) {
+ // populate with default area name
+ this.cbxWorkspaceAreas.setItems(new String[] { DEFAULT_WORKSPACE_AREA });
+ } else {
+ String[] areaPaths = new String[workspaceAreas.length];
+ int i = 0;
- for (WorkspaceArea area : workspaceAreas) {
- areaPaths[i++] = area.getPath();
- }
+ for (WorkspaceArea area : workspaceAreas) {
+ areaPaths[i++] = area.getPath();
+ }
- this.cbxWorkspaceAreas.setItems(areaPaths);
- }
- }
- } else {
- this.workspaceArea = null;
- this.cbxWorkspaceAreas.removeAll();
- }
+ this.cbxWorkspaceAreas.setItems(areaPaths);
+ }
+ }
+ } else {
+ this.workspaceArea = null;
+ this.cbxWorkspaceAreas.removeAll();
+ }
- if (this.cbxWorkspaceAreas.getItemCount() != 0) {
- this.cbxWorkspaceAreas.select(0);
- }
+ if (this.cbxWorkspaceAreas.getItemCount() != 0) {
+ this.cbxWorkspaceAreas.select(0);
+ }
- updateState();
- }
+ updateState();
+ }
- /**
- * @return <code>true</code> if resources found recursively under projects
- * and folders should also be published or unpublished
- */
- boolean isRecursing() {
- return this.recurse;
- }
+ /**
+ * @return <code>true</code> if resources found recursively under projects and folders should also be published or unpublished
+ */
+ boolean isRecursing() {
+ return this.recurse;
+ }
- /**
- * @return <code>true</code> if versioning of published resources should be
- * done
- */
- boolean isVersioning() {
- return (this.repositorySupportsVersioning && this.versioning);
- }
+ /**
+ * @return <code>true</code> if versioning of published resources should be done
+ */
+ boolean isVersioning() {
+ return (this.repositorySupportsVersioning && this.versioning);
+ }
- /**
- * Populates the list of files to be published based on the recurse flag and
- * the list of workspace selected resources. Pre-condition is that
- * {@link #processResources(List, boolean, PublishingFileFilter)} has been
- * called.
- */
- private void loadFiles() {
- this.lstResources.removeAll();
+ /**
+ * Populates the list of files to be published based on the recurse flag and the list of workspace selected resources.
+ * Pre-condition is that {@link #processResources(List, boolean, PublishingFileFilter)} has been called.
+ */
+ private void loadFiles() {
+ this.lstResources.removeAll();
- for (IResource resource : this.files) {
- this.lstResources.add(resource.getFullPath().toString());
- }
- }
+ for (IResource resource : this.files) {
+ this.lstResources.add(resource.getFullPath().toString());
+ }
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText(ModifyEvent e) {
- if (e.widget == this.cbxServer) {
- handleServerModified();
- } else if (e.widget == this.cbxRepository) {
- handleRepositoryModified();
- } else if (e.widget == this.cbxWorkspace) {
- handleWorkspaceModified();
- } else if (e.widget == this.cbxWorkspaceAreas) {
- handleWorkspaceAreaModified();
- } else {
- assert false; // should not happen
- }
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent e ) {
+ if (e.widget == this.cbxServer) {
+ handleServerModified();
+ } else if (e.widget == this.cbxRepository) {
+ handleRepositoryModified();
+ } else if (e.widget == this.cbxWorkspace) {
+ handleWorkspaceModified();
+ } else if (e.widget == this.cbxWorkspaceAreas) {
+ handleWorkspaceAreaModified();
+ } else {
+ assert false; // should not happen
+ }
+ }
- /**
- * Refreshes the repository-related fields and controls based on the server
- * registry. This in turn causes the workspaces to also to be refreshed.
- */
- private void refreshRepositories() {
- this.repository = null;
+ /**
+ * Refreshes the repository-related fields and controls based on the server registry. This in turn causes the workspaces to also
+ * to be refreshed.
+ */
+ private void refreshRepositories() {
+ this.repository = null;
- if (this.server == null) {
- this.repositories = Collections.emptyList();
- } else {
- try {
- this.repositories = new ArrayList<Repository>(getServerManager().getRepositories(this.server));
- } catch (Exception e) {
- this.repositories = Collections.emptyList();
- String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server
- .getShortDescription());
- Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- }
- }
+ if (this.server == null) {
+ this.repositories = Collections.emptyList();
+ } else {
+ try {
+ this.repositories = new ArrayList<ModeShapeRepository>(getServerManager().getRepositories(this.server));
+ } catch (Exception e) {
+ this.repositories = Collections.emptyList();
+ String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server.getShortDescription());
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
- // clear items
- this.cbxRepository.removeAll();
+ // clear items
+ this.cbxRepository.removeAll();
- // reload
- if (this.repositories.isEmpty()) {
- // disable control if necessary
- if (this.cbxRepository.getEnabled()) {
- this.cbxRepository.setEnabled(false);
- }
- } else if (this.repositories.size() == 1) {
- this.repository = this.repositories.get(0);
- this.cbxRepository.add(this.repository.getName());
- this.cbxRepository.select(0);
+ // reload
+ if (this.repositories.isEmpty()) {
+ // disable control if necessary
+ if (this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(false);
+ }
+ } else if (this.repositories.size() == 1) {
+ this.repository = this.repositories.get(0);
+ this.cbxRepository.add(this.repository.getName());
+ this.cbxRepository.select(0);
- // enable control if necessary
- if (!this.cbxRepository.getEnabled()) {
- this.cbxRepository.setEnabled(true);
- }
- } else {
- // add an item for each repository
- for (Repository repository : this.repositories) {
- this.cbxRepository.add(repository.getName());
- }
+ // enable control if necessary
+ if (!this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(true);
+ }
+ } else {
+ // add an item for each repository
+ for (ModeShapeRepository repository : this.repositories) {
+ this.cbxRepository.add(repository.getName());
+ }
- // enable control if necessary
- if (!this.cbxRepository.getEnabled()) {
- this.cbxRepository.setEnabled(true);
- }
- }
-
- // repository capabilities could affect the UI
- updateRepositoryCapabilities();
+ // enable control if necessary
+ if (!this.cbxRepository.getEnabled()) {
+ this.cbxRepository.setEnabled(true);
+ }
+ }
- // must reload workspaces
- refreshWorkspaces();
- }
+ // repository capabilities could affect the UI
+ updateRepositoryCapabilities();
- /**
- * Refreshes the server-related fields and controls based on the server
- * registry. This in turn causes the repositories and workspaces to also to
- * be refreshed.
- */
- void refreshServers() {
- this.server = null;
- this.servers = new ArrayList<Server>(getServerManager().getServers());
+ // must reload workspaces
+ refreshWorkspaces();
+ }
- // clear server combo
- this.cbxServer.removeAll();
+ /**
+ * Refreshes the server-related fields and controls based on the server registry. This in turn causes the repositories and
+ * workspaces to also to be refreshed.
+ */
+ void refreshServers() {
+ this.server = null;
+ this.servers = new ArrayList<ModeShapeServer>(getServerManager().getServers());
- if (this.servers.size() == 0) {
- // disable control if necessary
- if (this.cbxServer.getEnabled()) {
- this.cbxServer.setEnabled(false);
- }
- } else if (this.servers.size() == 1) {
- this.server = this.servers.get(0);
- this.cbxServer.add(this.server.getName());
- this.cbxServer.select(0);
+ // clear server combo
+ this.cbxServer.removeAll();
- // enable control if necessary
- if (!this.cbxServer.getEnabled()) {
- this.cbxServer.setEnabled(true);
- }
- } else {
- // add an item for each server
- for (Server server : this.servers) {
- this.cbxServer.add(server.getName());
- }
+ if (this.servers.size() == 0) {
+ // disable control if necessary
+ if (this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(false);
+ }
+ } else if (this.servers.size() == 1) {
+ this.server = this.servers.get(0);
+ this.cbxServer.add(this.server.getName());
+ this.cbxServer.select(0);
- // enable control if necessary
- if (!this.cbxServer.getEnabled()) {
- this.cbxServer.setEnabled(true);
- }
- }
+ // enable control if necessary
+ if (!this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(true);
+ }
+ } else {
+ // add an item for each server
+ for (ModeShapeServer server : this.servers) {
+ this.cbxServer.add(server.getName());
+ }
- // must reload repositories
- refreshRepositories();
- }
+ // enable control if necessary
+ if (!this.cbxServer.getEnabled()) {
+ this.cbxServer.setEnabled(true);
+ }
+ }
- /**
- * Refreshes the workspace-related fields and controls based on the server
- * registry.
- */
- private void refreshWorkspaces() {
- this.workspace = null;
+ // must reload repositories
+ refreshRepositories();
+ }
- if (this.repository == null) {
- this.workspaces = Collections.emptyList();
- } else {
- try {
- this.workspaces = new ArrayList<Workspace>(getServerManager().getWorkspaces(this.repository));
- } catch (Exception e) {
- this.workspaces = Collections.emptyList();
- String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(this.repository);
- Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- }
- }
+ /**
+ * Refreshes the workspace-related fields and controls based on the server registry.
+ */
+ private void refreshWorkspaces() {
+ this.workspace = null;
- // clear items
- this.cbxWorkspace.removeAll();
- this.cbxWorkspaceAreas.removeAll();
+ if (this.repository == null) {
+ this.workspaces = Collections.emptyList();
+ } else {
+ try {
+ this.workspaces = new ArrayList<ModeShapeWorkspace>(getServerManager().getWorkspaces(this.repository));
+ } catch (Exception e) {
+ this.workspaces = Collections.emptyList();
+ String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(this.repository);
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
- // reload
- if (this.workspaces.isEmpty()) {
- // disable controls if necessary
- if (this.cbxWorkspace.getEnabled()) {
- this.cbxWorkspace.setEnabled(false);
- }
+ // clear items
+ this.cbxWorkspace.removeAll();
+ this.cbxWorkspaceAreas.removeAll();
- if (this.cbxWorkspaceAreas.getEnabled()) {
- this.cbxWorkspaceAreas.setEnabled(false);
- }
- } else if (this.workspaces.size() == 1) {
- Workspace temp = this.workspaces.get(0);
- this.cbxWorkspace.add(temp.getName());
- this.cbxWorkspace.select(0);
+ // reload
+ if (this.workspaces.isEmpty()) {
+ // disable controls if necessary
+ if (this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(false);
+ }
- // enable controls if necessary
- if (!this.cbxWorkspace.getEnabled()) {
- this.cbxWorkspace.setEnabled(true);
- }
+ if (this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(false);
+ }
+ } else if (this.workspaces.size() == 1) {
+ ModeShapeWorkspace temp = this.workspaces.get(0);
+ this.cbxWorkspace.add(temp.getName());
+ this.cbxWorkspace.select(0);
- if (!this.cbxWorkspaceAreas.getEnabled()) {
- this.cbxWorkspaceAreas.setEnabled(true);
- }
- } else {
- // add an item for each workspace
- for (Workspace workspace : this.workspaces) {
- this.cbxWorkspace.add(workspace.getName());
- }
+ // enable controls if necessary
+ if (!this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(true);
+ }
- // enable controls if necessary
- if (!this.cbxWorkspace.getEnabled()) {
- this.cbxWorkspace.setEnabled(true);
- }
+ if (!this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(true);
+ }
+ } else {
+ // add an item for each workspace
+ for (ModeShapeWorkspace workspace : this.workspaces) {
+ this.cbxWorkspace.add(workspace.getName());
+ }
- if (!this.cbxWorkspaceAreas.getEnabled()) {
- this.cbxWorkspaceAreas.setEnabled(true);
- }
- }
- }
+ // enable controls if necessary
+ if (!this.cbxWorkspace.getEnabled()) {
+ this.cbxWorkspace.setEnabled(true);
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
- */
- @Override
- public Exception[] serverRegistryChanged(ServerRegistryEvent event) {
- // should only be a new server event
- if (event.isNew()) {
- refreshServers();
- updateState();
- }
+ if (!this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(true);
+ }
+ }
+ }
- return null;
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
+ */
+ @Override
+ public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
+ // should only be a new server event
+ if (event.isNew()) {
+ refreshServers();
+ updateState();
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
+ return null;
+ }
- if (visible) {
- // set initial status
- validate();
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
+ @Override
+ public void setVisible( boolean visible ) {
+ super.setVisible(visible);
- // update OK/Finish button enablement
- setPageComplete(!this.status.isError());
+ if (visible) {
+ // set initial status
+ validate();
- // set initial message
- if (this.status.isOk()) {
- String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
- setMessage(msg, IMessageProvider.NONE);
- } else {
- setMessage(this.status.getMessage(), IMessageProvider.ERROR);
- }
- }
- }
+ // update OK/Finish button enablement
+ setPageComplete(!this.status.isError());
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.wizard.WizardPage#setWizard(org.eclipse.jface.wizard.IWizard)
- */
- @Override
- public void setWizard(IWizard newWizard) {
- super.setWizard(newWizard);
+ // set initial message
+ if (this.status.isOk()) {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ setMessage(msg, IMessageProvider.NONE);
+ } else {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ }
+ }
+ }
- try {
- this.files = processResources(this.resources, isRecursing(), this.filter);
- } catch (CoreException e) {
- Activator.getDefault().log(
- new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
- }
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#setWizard(org.eclipse.jface.wizard.IWizard)
+ */
+ @Override
+ public void setWizard( IWizard newWizard ) {
+ super.setWizard(newWizard);
- /**
- * Updates the initial page message.
- */
- void updateInitialMessage() {
- String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ try {
+ this.files = processResources(this.resources, isRecursing(), this.filter);
+ } catch (CoreException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ }
+ }
- if (msg.equals(getMessage())) {
- updateState();
- }
- }
-
- /**
- * Some capabilities (like versioning) will not be supported by all repositories. This could affect the UI.
- */
- private void updateRepositoryCapabilities() {
- // versioning
- this.repositorySupportsVersioning = true;
+ /**
+ * Updates the initial page message.
+ */
+ void updateInitialMessage() {
+ String msg = ((this.type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
- if (this.repository == null) {
- this.repositorySupportsVersioning = false;
- } else {
- Object supportsVersioning = this.repository.getMetadata().get(javax.jcr.Repository.OPTION_VERSIONING_SUPPORTED);
-
- if (supportsVersioning == null) {
- this.repositorySupportsVersioning = false;
- } else {
- this.repositorySupportsVersioning = Boolean.parseBoolean(supportsVersioning.toString());
- }
- }
+ if (msg.equals(getMessage())) {
+ updateState();
+ }
+ }
- // update enabled state of versioning controls
- if ((this.chkVersioning != null) && (this.chkVersioning.getEnabled() != this.repositorySupportsVersioning)) {
- this.chkVersioning.setEnabled(this.repositorySupportsVersioning);
- this.linkPrefs.setEnabled(this.repositorySupportsVersioning);
- }
- }
+ /**
+ * Some capabilities (like versioning) will not be supported by all repositories. This could affect the UI.
+ */
+ private void updateRepositoryCapabilities() {
+ // versioning
+ this.repositorySupportsVersioning = true;
- /**
- * Updates message, message icon, and OK button enablement based on
- * validation results
- */
- void updateState() {
- // get the current state
- validate();
+ if (this.repository == null) {
+ this.repositorySupportsVersioning = false;
+ } else {
+ Object supportsVersioning = this.repository.getProperties().get(javax.jcr.Repository.OPTION_VERSIONING_SUPPORTED);
- // update OK/Finish button enablement
- setPageComplete(!this.status.isError());
+ if (supportsVersioning == null) {
+ this.repositorySupportsVersioning = false;
+ } else {
+ this.repositorySupportsVersioning = Boolean.parseBoolean(supportsVersioning.toString());
+ }
+ }
- // update page message
- if (this.status.isError()) {
- setMessage(this.status.getMessage(), IMessageProvider.ERROR);
- } else {
- if (this.status.isWarning()) {
- setMessage(this.status.getMessage(), IMessageProvider.WARNING);
- } else if (this.status.isInfo()) {
- setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
- } else {
- setMessage(this.status.getMessage(), IMessageProvider.NONE);
- }
- }
- }
+ // update enabled state of versioning controls
+ if ((this.chkVersioning != null) && (this.chkVersioning.getEnabled() != this.repositorySupportsVersioning)) {
+ this.chkVersioning.setEnabled(this.repositorySupportsVersioning);
+ this.linkPrefs.setEnabled(this.repositorySupportsVersioning);
+ }
+ }
- /**
- * Validates all inputs and sets the validation status.
- */
- private void validate() {
- String msg = null;
- Severity severity = Severity.ERROR;
+ /**
+ * Updates message, message icon, and OK button enablement based on validation results
+ */
+ void updateState() {
+ // get the current state
+ validate();
- if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
- msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
- : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
- } else if (this.server == null) {
- int count = this.cbxServer.getItemCount();
- msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg.text()
- : RestClientI18n.publishPageMissingServerStatusMsg.text());
- } else if (this.repository == null) {
- int count = this.cbxRepository.getItemCount();
- msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text()
- : RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
- } else if (this.workspace == null) {
- int count = this.cbxWorkspace.getItemCount();
- msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text()
- : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
- } else {
- severity = Severity.OK;
- msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
- : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
- }
+ // update OK/Finish button enablement
+ setPageComplete(!this.status.isError());
- this.status = new Status(severity, msg, null);
- }
+ // update page message
+ if (this.status.isError()) {
+ setMessage(this.status.getMessage(), IMessageProvider.ERROR);
+ } else {
+ if (this.status.isWarning()) {
+ setMessage(this.status.getMessage(), IMessageProvider.WARNING);
+ } else if (this.status.isInfo()) {
+ setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
+ } else {
+ setMessage(this.status.getMessage(), IMessageProvider.NONE);
+ }
+ }
+ }
- /**
- * Processing done after wizard is finished. Wizard was not canceled.
- */
- void wizardFinished() {
- // update dialog settings
- getDialogSettings().put(RECURSE_KEY, this.recurse);
- getDialogSettings().put(WORKSPACE_AREA_KEY, this.workspaceArea);
- }
+ /**
+ * Validates all inputs and sets the validation status.
+ */
+ private void validate() {
+ String msg = null;
+ Severity severity = Severity.ERROR;
+ if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
+ : RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
+ } else if (this.server == null) {
+ int count = this.cbxServer.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg.text()
+ : RestClientI18n.publishPageMissingServerStatusMsg.text());
+ } else if (this.repository == null) {
+ int count = this.cbxRepository.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text()
+ : RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
+ } else if (this.workspace == null) {
+ int count = this.cbxWorkspace.getItemCount();
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text()
+ : RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
+ } else {
+ severity = Severity.OK;
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg.text()
+ : RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ }
+
+ this.status = new Status(severity, msg, null);
+ }
+
+ /**
+ * Processing done after wizard is finished. Wizard was not canceled.
+ */
+ void wizardFinished() {
+ // update dialog settings
+ getDialogSettings().put(RECURSE_KEY, this.recurse);
+ getDialogSettings().put(WORKSPACE_AREA_KEY, this.workspaceArea);
+ }
+
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -23,12 +23,12 @@
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
import org.jboss.tools.modeshape.rest.jobs.PublishJob;
import org.jboss.tools.modeshape.rest.jobs.PublishJob.Type;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
* The <code>PublishWizard</code> is the wizard that published and unpublishes resources.
@@ -128,7 +128,7 @@
}
// run publish job
- Workspace workspace = this.page.getWorkspace();
+ ModeShapeWorkspace workspace = this.page.getWorkspace();
List<IFile> files = this.page.getFiles();
String workspaceArea = this.page.getWorkspaceArea();
PublishJob job = new PublishJob(this.type, files, workspace, workspaceArea, this.page.isVersioning());
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -36,13 +36,12 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.PersistedServer;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
import org.jboss.tools.modeshape.rest.Utils;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
* The <code>ServerPage</code> is used to create or modify a server.
@@ -67,7 +66,7 @@
/**
* The server being editor or <code>null</code> if creating a new server.
*/
- private PersistedServer server;
+ private ModeShapeServer server;
/**
* The current validation status.
@@ -98,7 +97,7 @@
*
* @param server the server being edited
*/
- public ServerPage( PersistedServer server ) {
+ public ServerPage( ModeShapeServer server ) {
super(ServerPage.class.getSimpleName());
setTitle(RestClientI18n.serverPageTitle.text());
@@ -220,6 +219,7 @@
st.setText(RestClientI18n.serverPageSavePasswordLabel.text());
st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
st.setCaret(null);
+ st.setEnabled(false);
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
gd.grabExcessVerticalSpace = false;
gd.horizontalIndent = 4;
@@ -302,6 +302,7 @@
st.setText(RestClientI18n.serverPageUrlTemplateLabel.text());
st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
st.setCaret(null);
+ st.setEnabled(false);
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
gd.grabExcessVerticalSpace = false;
gd.horizontalIndent = 4;
@@ -335,9 +336,9 @@
* @throws RuntimeException if called when all inputs are not valid
* @see #isPageComplete()
*/
- public PersistedServer getServer() {
+ public ModeShapeServer getServer() {
if (!this.status.isError()) {
- return new PersistedServer(this.url, this.user, this.password, this.savePassword);
+ return new ModeShapeServer(this.url, this.user, this.password, this.savePassword);
}
// should never be called if error status
@@ -373,7 +374,7 @@
* are valid.
*/
void handleTestConnection() {
- final Server server = getServer();
+ final ModeShapeServer server = getServer();
final boolean[] success = new boolean[1];
BusyIndicator.showWhile(null, new Runnable() {
@@ -476,17 +477,9 @@
private void validate() {
this.status = Utils.isServerValid(this.url, this.user, this.password);
- // only enable test connection if URL is valid
- if (this.status.isError()) {
- this.btnTestConnection.setEnabled(false);
- } else {
- this.btnTestConnection.setEnabled(true);
- return;
- }
-
// now check to see if a server is already registered
if (this.status.isOk()) {
- Server changedServer = getServer();
+ ModeShapeServer changedServer = getServer();
// don't check if modifying existing server and identifying properties have not changed
if (((this.server == null) || !this.server.hasSameKey(changedServer)) && getServerManager().isRegistered(changedServer)) {
@@ -495,6 +488,9 @@
null);
}
}
+
+ // only enable test connection if URL is valid
+ this.btnTestConnection.setEnabled(!this.status.isError());
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -16,9 +16,9 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.Wizard;
import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.PersistedServer;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.modeshape.web.jcr.rest.client.Status;
/**
@@ -29,7 +29,7 @@
/**
* Non-<code>null</code> if the wizard is editing an existing server.
*/
- private PersistedServer existingServer;
+ private ModeShapeServer existingServer;
/**
* The wizard page containing all the controls that allow editing of server properties.
@@ -61,7 +61,7 @@
* @param server the server whose properties are being edited (never <code>null</code>)
*/
public ServerWizard( ServerManager serverManager,
- PersistedServer server ) {
+ ModeShapeServer server ) {
this.page = new ServerPage(server);
this.serverManager = serverManager;
this.existingServer = server;
@@ -95,7 +95,7 @@
@Override
public boolean performFinish() {
Status status = Status.OK_STATUS;
- PersistedServer server = this.page.getServer();
+ ModeShapeServer server = this.page.getServer();
if (this.existingServer == null) {
status = this.serverManager.addServer(server);
Deleted: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/PersistedServerTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/PersistedServerTest.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/PersistedServerTest.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -1,46 +0,0 @@
-/*
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * This software is made available by Red Hat, Inc. under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution and is
- * available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- */
-package org.jboss.tools.modeshape.rest;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-import org.jboss.tools.modeshape.rest.PersistedServer;
-import org.junit.Test;
-
-public final class PersistedServerTest {
-
- private static final PersistedServer PERSISTED = new PersistedServer("url", "user", "pswd", true);
-
- private static final PersistedServer NOT_PERSISTED = new PersistedServer(PERSISTED.getUrl(), PERSISTED.getUser(),
- PERSISTED.getPassword(), false);
-
- @Test
- public void shouldNotBeEqualIfDifferentPasswordSettings() {
- assertThat(PERSISTED.equals(NOT_PERSISTED), is(false));
- }
-
- @Test
- public void shouldHaveSameHashCodeIfDifferentPasswordSettings() {
- assertThat(PERSISTED.hashCode(), is(NOT_PERSISTED.hashCode()));
- }
-
- @Test
- public void shouldHavePasswordBeingPersisted() {
- assertThat(PERSISTED.isPasswordBeingPersisted(), is(true));
- }
-
- @Test
- public void shouldNotHavePasswordBeingPersisted() {
- assertThat(NOT_PERSISTED.isPasswordBeingPersisted(), is(false));
- }
-
-}
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerManagerTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerManagerTest.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerManagerTest.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -15,21 +15,19 @@
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertThat;
+
+import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.junit.Before;
import org.junit.Test;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
/**
* The <code>ServerManagerTest</code> class is a test class for the {@link ServerManager server manager} object.
*/
public final class ServerManagerTest {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
private static final String URL1 = "file:/tmp/temp.txt"; //$NON-NLS-1$
private static final String URL2 = "http:www.redhat.com"; //$NON-NLS-1$
@@ -39,30 +37,20 @@
private static final String PSWD1 = "pwsd1"; //$NON-NLS-1$
private static final String PSWD2 = "pwsd2"; //$NON-NLS-1$
- private static PersistedServer SERVER1 = new PersistedServer(URL1, USER1, PSWD1, false);
- private static PersistedServer SERVER1_UPDATE = new PersistedServer(SERVER1.getUrl(), SERVER1.getUser(),
- SERVER1.getPassword(), SERVER1.isPasswordBeingPersisted());
- private static PersistedServer SERVER2 = new PersistedServer(URL2, USER2, PSWD2, !SERVER1.isPasswordBeingPersisted());
+ private static ModeShapeServer SERVER1 = new ModeShapeServer(URL1, USER1, PSWD1, false);
+ private static ModeShapeServer SERVER1_UPDATE = new ModeShapeServer(SERVER1.getUrl(),
+ SERVER1.getUser(),
+ SERVER1.getPassword(),
+ SERVER1.isPasswordBeingPersisted());
+ private static ModeShapeServer SERVER2 = new ModeShapeServer(URL2, USER2, PSWD2, !SERVER1.isPasswordBeingPersisted());
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
private ServerManager serverManager;
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
@Before
public void beforeEach() {
this.serverManager = new ServerManager(null, new MockRestClient());
}
- // ===========================================================================================================================
- // Tests
- // ===========================================================================================================================
-
@Test
public void shouldBeRegisteredIfAdded() {
this.serverManager.addServer(SERVER1);
@@ -73,7 +61,10 @@
@Test
public void shouldBeRegisteredIfServerWithSameKeyHasBeenAdded() {
this.serverManager.addServer(SERVER1);
- assertThat(this.serverManager.isRegistered(new Server(SERVER1.getUrl(), SERVER1.getUser(), PSWD2)), is(true));
+ assertThat(this.serverManager.isRegistered(new ModeShapeServer(SERVER1.getUrl(),
+ SERVER1.getUser(),
+ PSWD2,
+ SERVER1.isPasswordBeingPersisted())), is(true));
assertThat(this.serverManager.getServers().size(), is(1));
}
@@ -134,7 +125,7 @@
@Test
public void shouldNotAddServerIfKeysMatch() {
this.serverManager.addServer(SERVER1);
- Status status = this.serverManager.addServer(new PersistedServer(SERVER1.getUrl(), SERVER1.getUser(), PSWD2, true));
+ Status status = this.serverManager.addServer(new ModeShapeServer(SERVER1.getUrl(), SERVER1.getUser(), PSWD2, true));
assertThat(status.isOk(), is(false));
assertThat(this.serverManager.getServers().size(), is(1));
}
@@ -176,14 +167,14 @@
assertThat(this.serverManager.getServers().isEmpty(), is(true));
}
- @Test( expected = RuntimeException.class )
+ @Test(expected = RuntimeException.class)
public void shouldNotObtainRepositoriesForUnregisteredServer() throws Exception {
this.serverManager.getRepositories(SERVER1);
}
- @Test( expected = RuntimeException.class )
+ @Test(expected = RuntimeException.class)
public void shouldNotObtainWorkspacesForUnregisteredServer() throws Exception {
- Repository repository = new Repository("repo", SERVER1);//$NON-NLS-1$
+ ModeShapeRepository repository = new ModeShapeRepository(new Repository("repo", SERVER1.getDelegate()), SERVER1);//$NON-NLS-1$
this.serverManager.getWorkspaces(repository);
}
@@ -237,8 +228,11 @@
RegistryListener listener = new RegistryListener();
this.serverManager.addRegistryListener(listener);
- this.serverManager.updateServer(SERVER1, new PersistedServer(SERVER1.getUrl(), SERVER1.getUser(), PSWD2,
- !SERVER1.isPasswordBeingPersisted()));
+ this.serverManager.updateServer(SERVER1,
+ new ModeShapeServer(SERVER1.getUrl(),
+ SERVER1.getUser(),
+ PSWD2,
+ !SERVER1.isPasswordBeingPersisted()));
assertThat(listener.getEvent().isUpdate(), is(true));
assertThat(listener.getEvent().isNew(), is(false));
assertThat(listener.getEvent().isRemove(), is(false));
@@ -251,12 +245,8 @@
assertThat(this.serverManager.getServers().isEmpty(), is(true));
}
- // ===========================================================================================================================
- // RegistryListener Inner Class
- // ===========================================================================================================================
-
class RegistryListener implements IServerRegistryListener {
- boolean[] notified = new boolean[] {false};
+ boolean[] notified = new boolean[] { false };
ServerRegistryEvent event = null;
public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerRegistryEventTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerRegistryEventTest.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/ServerRegistryEventTest.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -14,57 +14,40 @@
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsSame.sameInstance;
import static org.junit.Assert.assertThat;
-import org.jboss.tools.modeshape.rest.ServerManager;
-import org.jboss.tools.modeshape.rest.ServerRegistryEvent;
+
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.junit.Before;
import org.junit.Test;
-import org.modeshape.web.jcr.rest.client.domain.Server;
public final class ServerRegistryEventTest {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
+ private static ModeShapeServer SERVER = new ModeShapeServer("url", "user", "pswd", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private static Server SERVER = new Server("url", "user", "pswd");
+ private static ModeShapeServer UPDATED_SERVER = new ModeShapeServer("newurl", "newuser", "newpswd", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private static Server UPDATED_SERVER = new Server("newurl", "newuser", "newpswd");
-
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
private ServerManager serverManager;
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
@Before
public void beforeEach() {
this.serverManager = new ServerManager(null, new MockRestClient());
}
- // ===========================================================================================================================
- // Tests
- // ===========================================================================================================================
-
@Test
public void shouldHaveNewType() {
assertThat(ServerRegistryEvent.createNewEvent(this.serverManager, SERVER).isNew(), is(true));
}
- @Test( expected = IllegalArgumentException.class )
+ @Test(expected = IllegalArgumentException.class)
public void shouldNotAllowNullServerManagerWhenCreatingNewEvent() {
ServerRegistryEvent.createNewEvent(null, SERVER);
}
- @Test( expected = IllegalArgumentException.class )
+ @Test(expected = IllegalArgumentException.class)
public void shouldNotAllowNullServerWhenCreatingNewEvent() {
ServerRegistryEvent.createNewEvent(this.serverManager, null);
}
- @Test( expected = UnsupportedOperationException.class )
+ @Test(expected = UnsupportedOperationException.class)
public void shouldNotBeAllowedToGetUpdatedServerOnNewEvent() {
ServerRegistryEvent.createNewEvent(this.serverManager, SERVER).getUpdatedServer();
}
@@ -79,17 +62,17 @@
assertThat(ServerRegistryEvent.createRemoveEvent(this.serverManager, SERVER).isRemove(), is(true));
}
- @Test( expected = IllegalArgumentException.class )
+ @Test(expected = IllegalArgumentException.class)
public void shouldNotAllowNullServerManagerWhenCreatingRemoveEvent() {
ServerRegistryEvent.createRemoveEvent(null, SERVER);
}
- @Test( expected = IllegalArgumentException.class )
+ @Test(expected = IllegalArgumentException.class)
public void shouldNotAllowNullServerWhenCreatingRemoveEvent() {
ServerRegistryEvent.createRemoveEvent(this.serverManager, null);
}
- @Test( expected = UnsupportedOperationException.class )
+ @Test(expected = UnsupportedOperationException.class)
public void shouldNotBeAllowedToGetUpdatedServerOnRemoveEvent() {
ServerRegistryEvent.createRemoveEvent(this.serverManager, SERVER).getUpdatedServer();
}
@@ -104,12 +87,12 @@
assertThat(ServerRegistryEvent.createUpdateEvent(this.serverManager, SERVER, UPDATED_SERVER).isUpdate(), is(true));
}
- @Test( expected = IllegalArgumentException.class )
+ @Test(expected = IllegalArgumentException.class)
public void shouldNotAllowNullServerManagerWhenCreatingUpdateEvent() {
ServerRegistryEvent.createUpdateEvent(null, SERVER, UPDATED_SERVER);
}
- @Test( expected = IllegalArgumentException.class )
+ @Test(expected = IllegalArgumentException.class)
public void shouldNotAllowNullServersWhenCreatingUpdateEvent() {
ServerRegistryEvent.createUpdateEvent(this.serverManager, null, null);
}
Copied: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServerTest.java (from rev 28967, trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/PersistedServerTest.java)
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServerTest.java (rev 0)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServerTest.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -0,0 +1,46 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution and is
+ * available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.domain;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public final class ModeShapeServerTest {
+
+ private static final ModeShapeServer PERSISTED = new ModeShapeServer("url", "user", "pswd", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ private static final ModeShapeServer NOT_PERSISTED = new ModeShapeServer(PERSISTED.getUrl(), PERSISTED.getUser(),
+ PERSISTED.getPassword(), false);
+
+ @Test
+ public void shouldNotBeEqualIfDifferentPasswordSettings() {
+ assertThat(PERSISTED.equals(NOT_PERSISTED), is(false));
+ }
+
+ @Test
+ public void shouldHaveSameHashCodeIfDifferentPasswordSettings() {
+ assertThat(PERSISTED.hashCode(), is(NOT_PERSISTED.hashCode()));
+ }
+
+ @Test
+ public void shouldHavePasswordBeingPersisted() {
+ assertThat(PERSISTED.isPasswordBeingPersisted(), is(true));
+ }
+
+ @Test
+ public void shouldNotHavePasswordBeingPersisted() {
+ assertThat(NOT_PERSISTED.isPasswordBeingPersisted(), is(false));
+ }
+
+}
Property changes on: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/domain/ModeShapeServerTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java 2011-05-28 11:40:30 UTC (rev 31568)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java 2011-05-28 11:42:51 UTC (rev 31569)
@@ -1,8 +1,8 @@
package org.jboss.tools.modeshape.rest.test;
-import org.jboss.tools.modeshape.rest.PersistedServerTest;
import org.jboss.tools.modeshape.rest.ServerManagerTest;
import org.jboss.tools.modeshape.rest.ServerRegistryEventTest;
+import org.jboss.tools.modeshape.rest.domain.ModeShapeServerTest;
import org.jboss.tools.modeshape.rest.preferences.IgnoredResourcesModelTest;
import org.jboss.tools.modeshape.rest.preferences.PublishingFileFilterTest;
import org.jboss.tools.modeshape.rest.preferences.ResourcePatternTest;
@@ -10,7 +10,7 @@
import org.junit.runners.Suite;
@RunWith(Suite.class)
-(a)Suite.SuiteClasses({ IgnoredResourcesModelTest.class, PersistedServerTest.class, PublishingFileFilterTest.class,
+(a)Suite.SuiteClasses({ IgnoredResourcesModelTest.class, ModeShapeServerTest.class, PublishingFileFilterTest.class,
ResourcePatternTest.class, ServerManagerTest.class, ServerRegistryEventTest.class })
public class AllTests {
// nothing to do
13 years, 7 months
JBoss Tools SVN: r31568 - trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-05-28 07:40:30 -0400 (Sat, 28 May 2011)
New Revision: 31568
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
Log:
JBIDE-8242 Change the ModeShape Eclipse plugin to enable resource versioning in the repository. Checking-in ModeShape 2.5.0.Final clien JAR.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
===================================================================
(Binary files differ)
13 years, 7 months
JBoss Tools SVN: r31567 - branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-05-28 06:14:53 -0400 (Sat, 28 May 2011)
New Revision: 31567
Modified:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
Log:
JBIDE-8242 Change the ModeShape Eclipse plugin to enable resource versioning in the repository. Checked in the ModeShape 2.5.0.Final client jar.
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
===================================================================
(Binary files differ)
13 years, 7 months