JBoss Tools SVN: r39859 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-03-28 03:05:52 -0400 (Wed, 28 Mar 2012)
New Revision: 39859
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties
Log:
JBIDE-11251
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java 2012-03-28 06:31:45 UTC (rev 39858)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java 2012-03-28 07:05:52 UTC (rev 39859)
@@ -17,5 +17,6 @@
public static String shareProjectTitle;
public static String shareProjectMessage;
public static String additionNotRequiredModule;
+ public static String publishFailMissingProject;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2012-03-28 06:31:45 UTC (rev 39858)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2012-03-28 07:05:52 UTC (rev 39859)
@@ -21,10 +21,10 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.egit.core.op.AddToIndexOperation;
import org.eclipse.egit.core.op.PushOperationResult;
-import org.eclipse.egit.core.op.RemoveFromIndexOperation;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.osgi.util.NLS;
@@ -55,8 +55,13 @@
@Override
public void publishStart(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
+ String destProjName = ExpressServerUtils.getExpressDeployProject(behaviour.getServer());
+ IProject magicProject = destProjName == null ? null : ResourcesPlugin.getWorkspace().getRoot().getProject(destProjName);
+ if( magicProject == null || !magicProject.isAccessible()) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ OpenShiftUIActivator.PLUGIN_ID,
+ NLS.bind(ExpressMessages.publishFailMissingProject, behaviour.getServer().getName(), destProjName)));
+ }
}
@Override
@@ -103,7 +108,6 @@
// Magic Project
String destProjName = ExpressServerUtils.getExpressDeployProject(behaviour.getServer());
-
if( isInDestProjectTree(destProjName, module))
return IServer.PUBLISH_STATE_NONE;
@@ -163,9 +167,13 @@
protected PushOperationResult commitAndPushProject(IProject p,
DeployableServerBehavior behaviour, IProgressMonitor monitor) throws CoreException {
- Repository repository = EGitUtils.getRepository(p);
-
- int changed = EGitUtils.countCommitableChanges(p, behaviour.getServer(), new NullProgressMonitor() );
+
+ int changed = 0;
+ try {
+ changed = EGitUtils.countCommitableChanges(p, behaviour.getServer(), new NullProgressMonitor() );
+ } catch( CoreException ce) {
+ // What to do in this situation??
+ }
String remoteName = behaviour.getServer().getAttribute(ExpressServerUtils.ATTRIBUTE_REMOTE_NAME,
ExpressServerUtils.ATTRIBUTE_REMOTE_NAME_DEFAULT);
PushOperationResult result = null;
@@ -189,6 +197,7 @@
return null;
try {
+ Repository repository = EGitUtils.getRepository(p);
result = EGitUtils.pushForce(remoteName, repository, new SubProgressMonitor(monitor, 100));
monitor.done();
} catch(CoreException ce2) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties 2012-03-28 06:31:45 UTC (rev 39858)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties 2012-03-28 07:05:52 UTC (rev 39859)
@@ -5,4 +5,5 @@
cannotModifyModules=Openshift Express servers cannot be modified.
additionNotRequiredModule=This server requires the {0} application.
shareProjectTitle=Share projects?
-shareProjectMessage="There are {0} projects that are not connected to any git repository. Would you like to share them now?
\ No newline at end of file
+shareProjectMessage="There are {0} projects that are not connected to any git repository. Would you like to share them now?
+publishFailMissingProject=Server {0} cannot publish. Required project "{1}" is missing or inaccessible.
\ No newline at end of file
12 years, 2 months
JBoss Tools SVN: r39858 - in trunk/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-03-28 02:31:45 -0400 (Wed, 28 Mar 2012)
New Revision: 39858
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/WebDeployableArtifactUtilDefectTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
JBIDE-11414 - run .java file on server should not launch to a .java file url
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-03-28 04:30:07 UTC (rev 39857)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-03-28 06:31:45 UTC (rev 39858)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -18,10 +20,12 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.server.core.IWebModule;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.core.model.IURLProvider;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
@@ -30,7 +34,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
-public class DeployableServer extends ServerDelegate implements IDeployableServer {
+public class DeployableServer extends ServerDelegate implements IDeployableServer, IURLProvider {
public DeployableServer() {
}
@@ -178,5 +182,39 @@
public boolean hasJMXProvider() {
return false;
}
+
+ public URL getModuleRootURL(IModule module) {
+ return getModuleRootURL(module, getServer().getHost(), 80);
+ }
+
+ public static URL getModuleRootURL(IModule module, String host, int port) {
+ return getModuleRootURL(module, host, port, false);
+ }
+
+ public static URL getModuleRootURL(IModule module, String host, int port, boolean ignoreContextRoot) {
+ if (module == null || module.loadAdapter(IWebModule.class,null)==null )
+ return null;
+
+ IWebModule webModule =(IWebModule)module.loadAdapter(IWebModule.class,null);
+ String url = host;
+ if( !url.startsWith("http://") && !url.startsWith("https://") ) { //$NON-NLS-1$ //$NON-NLS-2$
+ url = "http://"+host; //$NON-NLS-1$
+ }
+ if (port != 80)
+ url += ":" + port; //$NON-NLS-1$
+ if( !ignoreContextRoot ) {
+ String cxRoot = webModule.getContextRoot();
+ if( !cxRoot.equals("/") && !cxRoot.equals("./")) //$NON-NLS-1$ //$NON-NLS-2$
+ url += "/"+webModule.getContextRoot(); //$NON-NLS-1$
+ }
+ if (!url.endsWith("/")) //$NON-NLS-1$
+ url += "/"; //$NON-NLS-1$
+
+ try {
+ return new URL(url);
+ } catch( MalformedURLException murle) { return null; }
+ }
+
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-03-28 04:30:07 UTC (rev 39857)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-03-28 06:31:45 UTC (rev 39858)
@@ -119,11 +119,14 @@
} else if (moduleObject instanceof WebResource) {
WebResource resource = (WebResource) moduleObject;
String path = resource.getPath().toString();
- if (path != null && path.startsWith("/")) //$NON-NLS-1$
- path = path.substring(1);
- if (path != null && path.length() > 0) {
- //path = getServlet30Mapping(resource, path);
- url = new URL(url, path);
+ // If this is a java file, just stick with the root url
+ if( !path.endsWith(".java")) { //$NON-NLS-1$
+ if (path != null && path.startsWith("/")) //$NON-NLS-1$
+ path = path.substring(1);
+ if (path != null && path.length() > 0) {
+ //path = getServlet30Mapping(resource, path);
+ url = new URL(url, path);
+ }
}
}
URL portletURL = getPortletURL(moduleObject, delegate, server);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2012-03-28 04:30:07 UTC (rev 39857)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2012-03-28 06:31:45 UTC (rev 39858)
@@ -227,38 +227,8 @@
public URL getModuleRootURL(IModule module) {
return getModuleRootURL(module, getHost(), getJBossWebPort());
- }
+ }
- public static URL getModuleRootURL(IModule module, String host, int port) {
- return getModuleRootURL(module, host, port, false);
- }
-
- public static URL getModuleRootURL(IModule module, String host, int port, boolean ignoreContextRoot) {
- if (module == null || module.loadAdapter(IWebModule.class,null)==null )
- return null;
-
- IWebModule webModule =(IWebModule)module.loadAdapter(IWebModule.class,null);
- String url = host;
- if( !url.startsWith("http://") && !url.startsWith("https://") ) { //$NON-NLS-1$ //$NON-NLS-2$
- url = "http://"+host; //$NON-NLS-1$
- }
- if (port != 80)
- url += ":" + port; //$NON-NLS-1$
-
- if( !ignoreContextRoot ) {
- String cxRoot = webModule.getContextRoot();
- if( !cxRoot.equals("/") && !cxRoot.equals("./")) //$NON-NLS-1$ //$NON-NLS-2$
- url += "/"+webModule.getContextRoot(); //$NON-NLS-1$
- }
- if (!url.endsWith("/")) //$NON-NLS-1$
- url += "/"; //$NON-NLS-1$
-
- try {
- return new URL(url);
- } catch( MalformedURLException murle) { return null; }
- }
-
-
// first class parameters
public String getUsername() {
return getAttribute(SERVER_USERNAME, "admin"); //$NON-NLS-1$
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-03-28 04:30:07 UTC (rev 39857)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-03-28 06:31:45 UTC (rev 39858)
@@ -29,6 +29,7 @@
import org.jboss.ide.eclipse.as.test.classpath.JEEClasspathContainerTest;
import org.jboss.ide.eclipse.as.test.classpath.ProjectRuntimeTest;
import org.jboss.ide.eclipse.as.test.classpath.RuntimeServerModelTest;
+import org.jboss.ide.eclipse.as.test.defects.WebDeployableArtifactUtilDefectTest;
import org.jboss.ide.eclipse.as.test.projectcreation.TestEar5WithJBossRuntime;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE2512aTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE2512bTest;
@@ -73,6 +74,7 @@
// Publishing tests
suite.addTestSuite(BehaviourModelDefectTest.class);
+ suite.addTestSuite(WebDeployableArtifactUtilDefectTest.class);
suite.addTestSuite(MockJSTPublisherTest.class);
suite.addTestSuite(MockJSTPublisherTestDynUtil.class);
suite.addTestSuite(JBIDE1657Test.class);
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/WebDeployableArtifactUtilDefectTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/WebDeployableArtifactUtilDefectTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/WebDeployableArtifactUtilDefectTest.java 2012-03-28 06:31:45 UTC (rev 39858)
@@ -0,0 +1,116 @@
+package org.jboss.ide.eclipse.as.test.defects;
+
+import java.io.ByteArrayInputStream;
+import java.net.URL;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactUtil;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.util.WebResource;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossLaunchAdapter;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.JavaEEFacetConstants;
+import org.jboss.ide.eclipse.as.test.util.wtp.OperationTestCase;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectCreationUtil;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+
+public class WebDeployableArtifactUtilDefectTest extends TestCase {
+ public void tearDown() throws Exception {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ ASTest.clearStateLocation();
+ }
+
+ private IFile createProjectAndGetJavaIFile() throws Exception {
+ IDataModel dm = ProjectCreationUtil.getWebDataModel("TestWeb", null, null, null, null, JavaEEFacetConstants.WEB_25, true);
+ OperationTestCase.runAndVerify(dm);
+ final IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("TestWeb");
+ assertTrue(p.exists());
+ final IFile[] file = new IFile[1];
+ file[0] = null;
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ file[0] = createJavaType(p, new Path("src/my/pack"), "my.pack", "Tiger");
+ assertTrue(file[0].exists());
+ p.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+ }, new NullProgressMonitor());
+ return file[0];
+ }
+
+ public void testWebDeployableDefect() throws Exception {
+ IFile f = createProjectAndGetJavaIFile();
+ IModuleArtifact artifact = new WebDeployableArtifactUtil().getModuleObject(f);
+ if( artifact == null )
+ return; // Ok, no result for a java file
+
+ try {
+ if( artifact instanceof WebResource ) {
+ assertFalse(((WebResource)artifact).getPath().lastSegment().endsWith(".java"));
+ }
+ } catch( AssertionFailedError afe ) {
+ // Expected to fail for now, but really, shouldn't. But upstream wtp
+ }
+ }
+
+ private IFile createJavaType(IProject p, IPath projectRelativePath, String packageName, String className) throws CoreException {
+ IFolder folder = p.getFolder(projectRelativePath);
+ createFolder(folder);
+ IFile f = folder.getFile(className + ".java");
+ String s = "package " + packageName + ";\n\npublic class " + className + "{\n\n}";
+ f.create(new ByteArrayInputStream(s.getBytes()), true, new NullProgressMonitor());
+ return f;
+ }
+
+ private boolean createFolder(IFolder c) throws CoreException {
+ if( c.exists())
+ return true;
+ if( !c.getParent().exists()) {
+ createFolder((IFolder)c.getParent());
+ }
+ c.create(true, true, null);
+ return true;
+ }
+
+ public void testWebDeployableDefectWorkaround() throws Exception {
+ IServer server = ServerRuntimeUtils.createMockJBoss7Server();
+ webDeployableDefectWorkaroundForServer(server);
+ }
+
+ public void testDeployOnlyServerDefect() throws Exception {
+ IServer server = ServerRuntimeUtils.createMockDeployOnlyServer();
+ // Previously had an NPE here
+ webDeployableDefectWorkaroundForServer(server);
+ }
+
+ private void webDeployableDefectWorkaroundForServer(IServer server) throws Exception {
+ IFile f = createProjectAndGetJavaIFile();
+ JBossLaunchAdapter adapter = new JBossLaunchAdapter();
+ IModuleArtifact artifact = new WebDeployableArtifactUtil().getModuleObject(f);
+ if( artifact != null ) {
+ Object o = adapter.getLaunchable(server, artifact);
+ assertTrue(o instanceof JBossLaunchAdapter.JBTCustomHttpLaunchable);
+ URL url = ((JBossLaunchAdapter.JBTCustomHttpLaunchable)o).getURL();
+ assertTrue(url != null );
+ String u2 = url.toString();
+ assertFalse(u2.endsWith(".java"));
+ }
+ }
+}
12 years, 2 months
JBoss Tools SVN: r39857 - trunk/ws/docs/restful_reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-03-28 00:30:07 -0400 (Wed, 28 Mar 2012)
New Revision: 39857
Modified:
trunk/ws/docs/restful_reference/en-US/Book_Info.xml
trunk/ws/docs/restful_reference/en-US/JBoss_RESTful_Web_Services_User_Guide.xml
Log:
updated for JBDS-2076
Modified: trunk/ws/docs/restful_reference/en-US/Book_Info.xml
===================================================================
--- trunk/ws/docs/restful_reference/en-US/Book_Info.xml 2012-03-27 20:03:21 UTC (rev 39856)
+++ trunk/ws/docs/restful_reference/en-US/Book_Info.xml 2012-03-28 04:30:07 UTC (rev 39857)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>5.0.0</edition>
- <pubsnumber>7</pubsnumber>
+ <pubsnumber>8</pubsnumber>
<abstract>
<para>The JBoss RESTful Web Services User Guide explains how to use RESTful Web Services to implement web services in Java.</para>
</abstract>
Modified: trunk/ws/docs/restful_reference/en-US/JBoss_RESTful_Web_Services_User_Guide.xml
===================================================================
--- trunk/ws/docs/restful_reference/en-US/JBoss_RESTful_Web_Services_User_Guide.xml 2012-03-27 20:03:21 UTC (rev 39856)
+++ trunk/ws/docs/restful_reference/en-US/JBoss_RESTful_Web_Services_User_Guide.xml 2012-03-28 04:30:07 UTC (rev 39857)
@@ -7,10 +7,10 @@
<xi:include href="overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
<xi:include href="adding_JAX-RS_support_to_a_project.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
</xi:include>
+<xi:include href="simple_web_service.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="sample_web_service_wizards.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="working_with_RESTful_web_services.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
</xi:include>
-<xi:include href="simple_web_service.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-<xi:include href="sample_web_service_wizards.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="resteasy_simple_project_example.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="web_service_test_view.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JAX-RS_Validation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
12 years, 2 months
JBoss Tools SVN: r39856 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-03-27 16:03:21 -0400 (Tue, 27 Mar 2012)
New Revision: 39856
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ItemDefinition.java
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiConstants.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiUtils.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditorPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/QualifiedNameEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/ValidationStatus.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ChildNodeDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMapping.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/ErrorMessage.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItemTest.java
Log:
JBIDE-10702 Editor for JCR Compact Node Definition (CND) files. Work on saving and restoring editor state, saving file and file save as, primary item, residual names, and editor validation. Also added more tests.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -215,7 +215,8 @@
public static String localNameEqualToSelfOrParent;
/**
- * A message indicating a with invalid characters was found. One parameter, a string identifying the name, is required.
+ * A message indicating a with invalid characters was found. Two parameters, the name of the owner object and a string
+ * identifying the type of name, are required.
*/
public static String localNameHasInvalidCharacters;
@@ -262,7 +263,7 @@
* A message used for the node type definition name property.
*/
public static String nodeTypeDefinitionName;
-
+
/**
* A message indicating a <code>null</code> was found. One parameter, a string identifying the object, is required.
*/
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/ValidationStatus.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/ValidationStatus.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/ValidationStatus.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -132,6 +132,25 @@
}
/**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (this == obj) {
+ return true;
+ }
+
+ if ((obj == null) || !getClass().equals(obj.getClass())) {
+ return false;
+ }
+
+ ValidationStatus that = (ValidationStatus)obj;
+ return (this.severity.equals(that.severity) && this.message.equals(that.message));
+ }
+
+ /**
* @return the message pertaining to the worse validation severity (never <code>null</code>)
*/
public String getMessage() {
@@ -141,11 +160,21 @@
/**
* @return the status severity (never <code>null</code>)
*/
- protected Severity getSeverity() {
+ public Severity getSeverity() {
return this.severity;
}
/**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return Utils.hashCode(this.severity, this.message);
+ }
+
+ /**
* @return <code>true</code> if the validation status has an error severity
*/
public boolean isError() {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ChildNodeDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ChildNodeDefinition.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ChildNodeDefinition.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -28,7 +28,7 @@
/**
*
*/
-public class ChildNodeDefinition implements CndElement, Comparable, NodeDefinitionTemplate {
+public class ChildNodeDefinition implements ItemDefinition, Comparable, NodeDefinitionTemplate {
/**
* The prefix used in CND notation before the property definition.
@@ -361,8 +361,11 @@
}
/**
- * @return the qualified name (never <code>null</code>)
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.jcr.cnd.ItemDefinition#getQualifiedName()
*/
+ @Override
public QualifiedName getQualifiedName() {
return this.name;
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndNotationPreferences.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -83,7 +83,7 @@
map.put(Preference.NAMESPACE_MAPPING_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.NAMESPACE_MAPPING_SECTION_END_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.CHILD_NODE_ATTRIBUTES_DELIMITER, Utils.SPACE_STRING);
- map.put(Preference.NODE_TYPE_DEFINITION_ATTRIBUTES_END_DELIMITER, "\n"); //$NON-NLS-1$
+ map.put(Preference.NODE_TYPE_DEFINITION_ATTRIBUTES_END_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.NODE_TYPE_DEFINITION_DELIMITER, "\n"); //$NON-NLS-1$
map.put(Preference.NODE_TYPE_DEFINITION_NAME_END_DELIMITER, Utils.SPACE_STRING);
map.put(Preference.NODE_TYPE_DEFINITION_SECTION_END_DELIMITER, "\n"); //$NON-NLS-1$
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndValidator.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -205,10 +205,10 @@
for (final ChildNodeDefinition childNodeDefn : childNodeDefinitions) {
validateChildNodeDefinition(childNodeDefn, null, status);
- { // ERROR - Duplicate child node definition names
+ { // ERROR - Duplicate child node definition names (allow duplicate residual names)
final String childNodeName = childNodeDefn.getName();
- if (!Utils.isEmpty(childNodeName)) {
+ if (!Utils.isEmpty(childNodeName) && !ItemDefinition.RESIDUAL_NAME.equals(childNodeName)) {
if (childNodeNames.contains(childNodeName)) {
status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicateChildNodeDefinitionName,
nodeTypeName, childNodeName)));
@@ -271,7 +271,7 @@
if (Utils.isEmpty(nodeTypeDefinitions)) {
noNodeTypeDefinitions = true;
} else {
- validateNodeTypeDefinitions(nodeTypeDefinitions, status);
+ validateNodeTypeDefinitions(nodeTypeDefinitions, true, status);
}
}
@@ -398,20 +398,21 @@
/**
* @param localName the local name being validated (cannot be <code>null</code>)
- * @param propertyName the name to use in the validation message (cannot be <code>null</code>)
+ * @param messagePrefix the text that will print before the message indicating the local name is invalid (cannot be
+ * <code>null</code>)
* @return the status (never <code>null</code>)
*/
public static ValidationStatus validateLocalName( final String localName,
- final String propertyName ) {
- Utils.verifyIsNotEmpty(propertyName, propertyName);
+ final String messagePrefix ) {
+ Utils.verifyIsNotEmpty(messagePrefix, messagePrefix);
if (Utils.isEmpty(localName)) {
- return ValidationStatus.createErrorMessage(NLS.bind(Messages.emptyLocalName, propertyName));
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.emptyLocalName, messagePrefix));
}
// ERROR Local name cannot be self or parent
if (localName.equals(".") || localName.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
- return ValidationStatus.createErrorMessage(NLS.bind(Messages.localNameEqualToSelfOrParent, propertyName));
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.localNameEqualToSelfOrParent, messagePrefix));
}
for (final char c : localName.toCharArray()) {
@@ -423,7 +424,8 @@
case '|':
case '*':
// ERROR invalid character
- return ValidationStatus.createErrorMessage(NLS.bind(Messages.localNameHasInvalidCharacters, propertyName));
+ return ValidationStatus.createErrorMessage(NLS.bind(Messages.localNameHasInvalidCharacters, messagePrefix,
+ localName));
default:
continue;
}
@@ -467,12 +469,17 @@
public static void validateName( final ChildNodeDefinition childNodeDefinition,
final Collection<QualifiedName> existingChildNodeNames,
final MultiValidationStatus status ) {
- // ERROR - Empty or invalid child node definition name
- validateQualifiedName(childNodeDefinition.getQualifiedName(), Messages.childDefinitionName, status);
+ Utils.verifyIsNotNull(childNodeDefinition, "childNodeDefinition"); //$NON-NLS-1$
- if (!Utils.isEmpty(existingChildNodeNames) && existingChildNodeNames.contains(childNodeDefinition.getQualifiedName())) {
- status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicateChildNodeDefinitionName,
- childNodeDefinition.getName())));
+ // allow residual name
+ if (!ItemDefinition.RESIDUAL_NAME.equals(childNodeDefinition.getName())) {
+ // ERROR - Empty or invalid child node definition name
+ validateQualifiedName(childNodeDefinition.getQualifiedName(), Messages.childDefinitionName, status);
+
+ if (!Utils.isEmpty(existingChildNodeNames) && existingChildNodeNames.contains(childNodeDefinition.getQualifiedName())) {
+ status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicateChildNodeDefinitionName,
+ childNodeDefinition.getName())));
+ }
}
}
@@ -525,12 +532,17 @@
public static void validateName( final PropertyDefinition propertyDefinition,
final Collection<QualifiedName> existingPropertyNames,
final MultiValidationStatus status ) {
- // ERROR - Empty or invalid child node definition name
- validateQualifiedName(propertyDefinition.getQualifiedName(), Messages.propertyDefinitionName, status);
+ Utils.verifyIsNotNull(propertyDefinition, "propertyDefinition"); //$NON-NLS-1$
- if (!Utils.isEmpty(existingPropertyNames) && existingPropertyNames.contains(propertyDefinition.getQualifiedName())) {
- status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicatePropertyDefinitionName,
- propertyDefinition.getName())));
+ // allow residual name
+ if (!ItemDefinition.RESIDUAL_NAME.equals(propertyDefinition.getName())) {
+ // ERROR - Empty or invalid child node definition name
+ validateQualifiedName(propertyDefinition.getQualifiedName(), Messages.propertyDefinitionName, status);
+
+ if (!Utils.isEmpty(existingPropertyNames) && existingPropertyNames.contains(propertyDefinition.getQualifiedName())) {
+ status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicatePropertyDefinitionName,
+ propertyDefinition.getName())));
+ }
}
}
@@ -703,10 +715,12 @@
/**
* @param nodeTypeDefinition the node type definition being validated (cannot be <code>null</code>)
* @param existingNodeTypeNames the existing node type names used to check for a duplicate (can be <code>null</code> or empty)
+ * @param validateEachPropertyAndChildNode indicates if property definition and child node definition validation should be done
* @return the status (never <code>null</code>)
*/
public static MultiValidationStatus validateNodeTypeDefinition( final NodeTypeDefinition nodeTypeDefinition,
- final Collection<QualifiedName> existingNodeTypeNames ) {
+ final Collection<QualifiedName> existingNodeTypeNames,
+ final boolean validateEachPropertyAndChildNode ) {
Utils.verifyIsNotNull(nodeTypeDefinition, "nodeTypeDefinition"); //$NON-NLS-1$
/**
@@ -736,7 +750,7 @@
}
{ // super types
- final String[] superTypeNames = nodeTypeDefinition.getDeclaredSupertypeNames();
+ final Collection<QualifiedName> superTypeNames = nodeTypeDefinition.getSupertypes();
if (Utils.isEmpty(superTypeNames)) {
if (nodeTypeDefinition.getState(NodeTypeDefinition.PropertyName.SUPERTYPES) == Value.IS) {
@@ -749,12 +763,12 @@
}
{ // primary item
- final String primaryItemName = nodeTypeDefinition.getPrimaryItemName();
+ final QualifiedName primaryItemName = nodeTypeDefinition.getPrimaryItem();
if (nodeTypeDefinition.getState(NodeTypeDefinition.PropertyName.PRIMARY_ITEM) == Value.IS) {
// ERROR - Empty or invalid primary item name
- validateLocalName(primaryItemName, Messages.primaryItemName, status);
- } else if (!Utils.isEmpty(primaryItemName)) {
+ validateQualifiedName(primaryItemName, Messages.primaryItemName, status);
+ } else if (!Utils.isEmpty(primaryItemName.get())) {
// ERROR Cannot have a primary item name when the primary item node type attribute is marked as a variant
status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.primaryItemExistsButMarkedAsVariant,
nodeTypeDefinitionName)));
@@ -764,29 +778,35 @@
boolean noPropertyDefinitions = false;
boolean noChildNodeDefinitions = false;
- { // property definitions
- final Collection<PropertyDefinition> propertyDefinitions = nodeTypeDefinition.getPropertyDefinitions();
+ if (validateEachPropertyAndChildNode) {
+ { // property definitions
+ final Collection<PropertyDefinition> propertyDefinitions = nodeTypeDefinition.getPropertyDefinitions();
- if (Utils.isEmpty(propertyDefinitions)) {
- noPropertyDefinitions = true;
- } else {
- validatePropertyDefinitions(nodeTypeDefinitionName, propertyDefinitions, status);
+ if (Utils.isEmpty(propertyDefinitions)) {
+ noPropertyDefinitions = true;
+ } else {
+ validatePropertyDefinitions(nodeTypeDefinitionName, propertyDefinitions, status);
+ }
}
- }
- { // child node definitions
- final Collection<ChildNodeDefinition> childNodeDefinitions = nodeTypeDefinition.getChildNodeDefinitions();
+ { // child node definitions
+ final Collection<ChildNodeDefinition> childNodeDefinitions = nodeTypeDefinition.getChildNodeDefinitions();
- if (Utils.isEmpty(childNodeDefinitions)) {
- noChildNodeDefinitions = true;
- } else {
- validateChildNodeDefinitions(nodeTypeDefinitionName, childNodeDefinitions, status);
+ if (Utils.isEmpty(childNodeDefinitions)) {
+ noChildNodeDefinitions = true;
+ } else {
+ validateChildNodeDefinitions(nodeTypeDefinitionName, childNodeDefinitions, status);
+ }
}
+ } else {
+ noPropertyDefinitions = nodeTypeDefinition.getPropertyDefinitions().isEmpty();
+ noChildNodeDefinitions = nodeTypeDefinition.getChildNodeDefinitions().isEmpty();
}
// WARNING - No property definitions or child node definitions exist
if (noPropertyDefinitions && noChildNodeDefinitions) {
- status.add(ValidationStatus.createWarningMessage(Messages.nodeTypeDefinitionHasNoPropertyDefinitionsOrChildNodeDefinitions));
+ status.add(ValidationStatus.createWarningMessage(NLS.bind(Messages.nodeTypeDefinitionHasNoPropertyDefinitionsOrChildNodeDefinitions,
+ nodeTypeDefinitionName)));
}
return status;
@@ -795,12 +815,15 @@
/**
* @param nodeTypeDefinition the node type definition being validated (cannot be <code>null</code>)
* @param existingNodeTypeNames the existing node type names used to check for a duplicate (can be <code>null</code> or empty)
+ * @param validateEachPropertyAndChildNode indicates if property definition and child node definition validation should be done
* @param status the status to add the new status to (never <code>null</code>)
*/
public static void validateNodeTypeDefinition( final NodeTypeDefinition nodeTypeDefinition,
final Collection<QualifiedName> existingNodeTypeNames,
+ final boolean validateEachPropertyAndChildNode,
final MultiValidationStatus status ) {
- final ValidationStatus newStatus = validateNodeTypeDefinition(nodeTypeDefinition, existingNodeTypeNames);
+ final ValidationStatus newStatus = validateNodeTypeDefinition(nodeTypeDefinition, existingNodeTypeNames,
+ validateEachPropertyAndChildNode);
if (!newStatus.isOk()) {
status.add(newStatus);
@@ -809,9 +832,11 @@
/**
* @param nodeTypeDefinitions the collection of namespace mappings to validate (can be <code>null</code> or empty)
+ * @param validateEachPropertyAndChildNode indicates if property definition and child node definition validation should be done
* @return the status (never <code>null</code>)
*/
- public static MultiValidationStatus validateNodeTypeDefinitions( final Collection<NodeTypeDefinition> nodeTypeDefinitions ) {
+ public static MultiValidationStatus validateNodeTypeDefinitions( final Collection<NodeTypeDefinition> nodeTypeDefinitions,
+ final boolean validateEachPropertyAndChildNode ) {
/**
* <pre>
* ERROR - Duplicate node type definition names
@@ -827,7 +852,7 @@
final Collection<String> names = new ArrayList<String>(nodeTypeDefinitions.size());
for (final NodeTypeDefinition nodeTypeDefinition : nodeTypeDefinitions) {
- validateNodeTypeDefinition(nodeTypeDefinition, null, status);
+ validateNodeTypeDefinition(nodeTypeDefinition, null, validateEachPropertyAndChildNode, status);
{ // ERROR - Duplicate node type definition names
final String name = nodeTypeDefinition.getName();
@@ -847,11 +872,13 @@
/**
* @param nodeTypeDefinitions the collection of namespace mappings to validate (can be <code>null</code> or empty)
+ * @param validateEachPropertyAndChildNode indicates if property definition and child node definition validation should be done
* @param status the status to add the new status to (never <code>null</code>)
*/
public static void validateNodeTypeDefinitions( final Collection<NodeTypeDefinition> nodeTypeDefinitions,
+ final boolean validateEachPropertyAndChildNode,
final MultiValidationStatus status ) {
- final ValidationStatus newStatus = validateNodeTypeDefinitions(nodeTypeDefinitions);
+ final ValidationStatus newStatus = validateNodeTypeDefinitions(nodeTypeDefinitions, validateEachPropertyAndChildNode);
if (!newStatus.isOk()) {
status.add(newStatus);
@@ -987,10 +1014,10 @@
for (final PropertyDefinition propertyDefn : propertyDefinitions) {
validatePropertyDefinition(propertyDefn, null, status);
- { // ERROR - Duplicate property definition names
+ { // ERROR - Duplicate property definition names (allow duplicate residual names)
final String propName = propertyDefn.getName();
- if (!Utils.isEmpty(propName)) {
+ if (!Utils.isEmpty(propName) && !ItemDefinition.RESIDUAL_NAME.equals(propName)) {
if (propNames.contains(propName)) {
status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicatePropertyDefinitionName,
nodeTypeName, propName)));
@@ -1222,12 +1249,13 @@
/**
* @param nodeTypeDefinitionName the node type name whose supertypes are being checked (cannot be <code>null</code> or empty)
* @param superTypesState the supertypes property state (cannot be <code>null</code>)
- * @param superTypeNames the collection of a node type definition's supertypes to validate (can be <code>null</code> or empty)
+ * @param superTypeNames the collection of a node type definition's supertype names to validate (can be <code>null</code> or
+ * empty)
* @return the status (never <code>null</code>)
*/
public static MultiValidationStatus validateSuperTypes( final String nodeTypeDefinitionName,
final Value superTypesState,
- final String[] superTypeNames ) {
+ final Collection<QualifiedName> superTypeNames ) {
Utils.verifyIsNotEmpty(nodeTypeDefinitionName, "nodeTypeDefinitionName"); //$NON-NLS-1$
Utils.verifyIsNotNull(superTypesState, "superTypesState"); //$NON-NLS-1$
@@ -1245,13 +1273,13 @@
}
final MultiValidationStatus status = new MultiValidationStatus();
- final Collection<String> names = new ArrayList<String>(superTypeNames.length);
+ final Collection<QualifiedName> names = new ArrayList<QualifiedName>(superTypeNames.size());
- for (final String superTypeName : superTypeNames) {
+ for (final QualifiedName superTypeName : superTypeNames) {
// ERROR - Invalid super type name
- validateLocalName(superTypeName, Messages.superTypeName, status);
+ validateQualifiedName(superTypeName, Messages.superTypeName, status);
- if (!Utils.isEmpty(superTypeName)) {
+ if (!Utils.isEmpty(superTypeName.get())) {
// ERROR - Duplicate super type name
if (names.contains(superTypeName)) {
status.add(ValidationStatus.createErrorMessage(NLS.bind(Messages.duplicateSuperType, nodeTypeDefinitionName,
@@ -1274,12 +1302,13 @@
/**
* @param nodeTypeDefinitionName the node type name whose supertypes are being checked (cannot be <code>null</code> or empty)
* @param superTypesState the supertypes property state (cannot be <code>null</code>)
- * @param superTypeNames the collection of a node type definition's supertypes to validate (can be <code>null</code> or empty)
+ * @param superTypeNames the collection of a node type definition's supertype names to validate (can be <code>null</code> or
+ * empty)
* @param status the status to add the new status to (never <code>null</code>)
*/
public static void validateSuperTypes( final String nodeTypeDefinitionName,
final Value superTypesState,
- final String[] superTypeNames,
+ final Collection<QualifiedName> superTypeNames,
final MultiValidationStatus status ) {
final MultiValidationStatus newStatus = validateSuperTypes(nodeTypeDefinitionName, superTypesState, superTypeNames);
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ItemDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ItemDefinition.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ItemDefinition.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -0,0 +1,24 @@
+/*
+ * 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.jcr.cnd;
+
+/**
+ * An interface for property definitions and child node definitions.
+ */
+public interface ItemDefinition extends CndElement {
+
+ /**
+ * Defines a residual set of child items.
+ */
+ String RESIDUAL_NAME = "*"; //$NON-NLS-1$
+
+ /**
+ * @return the qualified name (never <code>null</code>)
+ */
+ QualifiedName getQualifiedName();
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/ItemDefinition.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMapping.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMapping.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMapping.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -225,9 +225,11 @@
public String toCndNotation( final NotationType notationType ) {
final StringBuilder builder = new StringBuilder();
builder.append(NOTATION_PREFIX);
- builder.append(this.prefix.toCndNotation(notationType));
+ builder.append(this.prefix.get());
builder.append(NOTATION_DELIMITER);
- builder.append(this.uri.toCndNotation(notationType));
+ builder.append(LocalName.Mode.SINGLE_QUOTED); // the CND parser seems to require URI surrounded by quotes
+ builder.append(this.uri.get());
+ builder.append(LocalName.Mode.SINGLE_QUOTED);
builder.append(NOTATION_SUFFIX);
return builder.toString();
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinition.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinition.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -467,13 +467,20 @@
}
/**
+ * @return the qualified primary item name (never <code>null</code>)
+ */
+ public QualifiedName getPrimaryItem() {
+ return this.attributes.getPrimaryItem().getPrimaryItem();
+ }
+
+ /**
* {@inheritDoc}
*
* @see javax.jcr.nodetype.NodeTypeDefinition#getPrimaryItemName()
*/
@Override
public String getPrimaryItemName() {
- final String primaryItem = this.attributes.getPrimaryItem().getPrimaryItem();
+ final String primaryItem = this.attributes.getPrimaryItem().getPrimaryItem().get();
// API states to return null
if (Utils.isEmpty(primaryItem)) {
@@ -804,7 +811,7 @@
*/
@Override
public void setPrimaryItemName( final String newPrimaryItem ) {
- final String oldName = this.attributes.getPrimaryItem().getPrimaryItem();
+ final String oldName = this.attributes.getPrimaryItem().getPrimaryItem().get();
if (this.attributes.getPrimaryItem().setPrimaryItem(newPrimaryItem)) {
notifyChangeListeners(PropertyName.PRIMARY_ITEM, oldName, newPrimaryItem);
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinition.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/PropertyDefinition.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -33,7 +33,7 @@
/**
* The <code>PropertyDefinition</code> class represents node type property definition.
*/
-public class PropertyDefinition implements CndElement, Comparable, PropertyDefinitionTemplate {
+public class PropertyDefinition implements ItemDefinition, Comparable, PropertyDefinitionTemplate {
/**
* The prefix used in CND notation before the property definition.
@@ -409,7 +409,7 @@
/**
* {@inheritDoc}
- *
+ *
* @see javax.jcr.nodetype.ItemDefinition#getName()
*/
@Override
@@ -437,8 +437,11 @@
}
/**
- * @return the qualified name (never <code>null</code>)
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.jcr.cnd.ItemDefinition#getQualifiedName()
*/
+ @Override
public QualifiedName getQualifiedName() {
return this.name;
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItem.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -9,7 +9,7 @@
import org.jboss.tools.modeshape.jcr.Utils;
import org.jboss.tools.modeshape.jcr.cnd.CndElement;
-import org.jboss.tools.modeshape.jcr.cnd.LocalName;
+import org.jboss.tools.modeshape.jcr.cnd.QualifiedName;
/**
* The primary item attribute used by node type definitions. This primary item may be a child node or a property.
@@ -21,7 +21,7 @@
*/
public static final String[] NOTATION = new String[] { "primaryitem", "!", "!" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private final LocalName primaryItem = new LocalName();
+ private final QualifiedName primaryItem = new QualifiedName();
/**
* {@inheritDoc}
@@ -74,10 +74,10 @@
}
/**
- * @return the primary item (can be <code>null</code> or empty)
+ * @return the primary item (never <code>null</code>)
*/
- public String getPrimaryItem() {
- return this.primaryItem.get();
+ public QualifiedName getPrimaryItem() {
+ return this.primaryItem;
}
/**
@@ -102,7 +102,7 @@
*/
public boolean setPrimaryItem( final String newPrimaryItem ) {
if (this.primaryItem.set(newPrimaryItem)) {
- if (Utils.isEmpty(newPrimaryItem) && !isVariant()) {
+ if (Utils.isEmpty(this.primaryItem.get()) && !isVariant()) {
super.set(Value.IS_NOT);
} else {
super.set(Value.IS);
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties 2012-03-27 20:03:21 UTC (rev 39856)
@@ -76,8 +76,8 @@
# 0 = a name
localNameEqualToSelfOrParent = The "{0}" cannot be equal to self (dot) or parent (dot dot).
# 0 = property or attribute name
-localNameHasInvalidCharacters = The "{0}" contains invalid characters.
-missingName = <missing name>
+localNameHasInvalidCharacters = The {0} of "{1}" contains invalid characters.
+missingName = <empty name>
# 0 = property definition name
multipleDefaultValuesForSingleValuedProperty = The single-valued property definition "{0}" cannot have multiple default values.
# 0 = CND line number, 1 = CND column number
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiConstants.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiConstants.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiConstants.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -40,6 +40,22 @@
}
/**
+ * The file extensions for JCR-related files.
+ */
+ interface FileExtensions {
+
+ /**
+ * File extension for Compact Node Definition (CND) files.
+ */
+ String CND = "cnd"; //$NON-NLS-1$
+
+ /**
+ * File extension for Compact Node Definition (CND) files prefixed with a dot.
+ */
+ String DOT_CND = '.' + CND;
+ }
+
+ /**
* The image paths.
*/
interface Images {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiUtils.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiUtils.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/JcrUiUtils.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -7,8 +7,10 @@
*/
package org.jboss.tools.modeshape.jcr.ui;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.modeshape.jcr.Utils;
import org.jboss.tools.modeshape.jcr.ValidationStatus;
import org.jboss.tools.modeshape.ui.forms.ErrorMessage;
@@ -41,6 +43,33 @@
}
/**
+ * @param status the validation status whose severity is being converted to a form message area message type
+ * @return the message type
+ */
+ public static int getMessageType( final ValidationStatus status ) {
+ Utils.verifyIsNotNull(status, "status"); //$NON-NLS-1$
+
+ if (status.isOk()) {
+ return IMessageProvider.NONE;
+ }
+
+ if (status.isError()) {
+ return IMessageProvider.ERROR;
+ }
+
+ if (status.isWarning()) {
+ return IMessageProvider.WARNING;
+ }
+
+ if (status.isInfo()) {
+ return IMessageProvider.INFORMATION;
+ }
+
+ assert false : "Unexpected severity type"; //$NON-NLS-1$
+ return IMessageProvider.ERROR;
+ }
+
+ /**
* @return the generic new toolbar/menu icon (never <code>null</code>)
*/
public static ImageDescriptor getNewImageDescriptor() {
@@ -52,9 +81,8 @@
* @param status the status being used to set the message (cannot be <code>null</code>)
* @param message the message being set (cannot be <code>null</code>)
*/
- public static void setMessage( ValidationStatus status,
- ErrorMessage message ) {
- // TODO need to figure out how to get all the MultiValidationStatus errors to display
+ public static void setMessage( final ValidationStatus status,
+ final ErrorMessage message ) {
if (status.isError()) {
message.setErrorMessage(status.getMessage());
} else if (status.isWarning()) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditor.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -9,6 +9,8 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@@ -18,14 +20,19 @@
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourceAttributes;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
@@ -37,6 +44,7 @@
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPersistableEditor;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.editors.text.FileDocumentProvider;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.forms.IManagedForm;
@@ -44,6 +52,8 @@
import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType;
import org.jboss.tools.modeshape.jcr.cnd.CndImporter;
import org.jboss.tools.modeshape.jcr.cnd.CompactNodeTypeDefinition;
import org.jboss.tools.modeshape.jcr.ui.Activator;
@@ -58,27 +68,22 @@
public final class CndEditor extends SharedHeaderFormEditor implements IPersistableEditor, IResourceChangeListener,
PropertyChangeListener {
- /**
- * The memento key for the index of the selected editor.
- */
- private static final String SELECTED_PAGE = "SELECTED_PAGE"; //$NON-NLS-1$
+ private CompactNodeTypeDefinition cndBeingEdited;
private boolean dirty = false;
- private boolean readOnly = false;
+ private final FileDocumentProvider documentProvider = new FileDocumentProvider();
+ private final CndEditorPage formsPage;
+
private IMemento memento;
+ private long modificationStamp = 0;
+ private CompactNodeTypeDefinition originalCnd;
- private final FileDocumentProvider documentProvider = new FileDocumentProvider();
- private long modificationStamp = 0;
+ private boolean readOnly = false;
private Listener refreshListener;
- private CompactNodeTypeDefinition originalCnd;
- private CompactNodeTypeDefinition cndBeingEdited;
-
private ScrolledForm scrolledForm;
- private final CndEditorPage formsPage;
-
/**
* Constructs a CND editor.
*/
@@ -105,7 +110,8 @@
try {
addPage(0, this.formsPage); // Page 0: Forms Editor Page
- TextEditor sourceEditor = new TextEditor() {
+ final TextEditor sourceEditor = new TextEditor() {
+
/**
* {@inheritDoc}
*
@@ -142,7 +148,7 @@
int selectedPageNum = 0;
if (this.memento != null) {
- final int value = this.memento.getInteger(SELECTED_PAGE);
+ final int value = this.memento.getInteger(MementoKeys.SELECTED_PAGE);
if (value != -1) {
selectedPageNum = value;
@@ -156,6 +162,33 @@
}
}
+ private void createCnd() throws Exception {
+ final CndImporter importer = new CndImporter();
+ final List<Throwable> errors = new ArrayList<Throwable>();
+ this.originalCnd = importer.importFrom(getFile().getContents(), errors, getFile().getName());
+
+ // check for parse errors
+ if (!errors.isEmpty()) {
+ final Throwable t = errors.iterator().next();
+
+ if (t.getCause() == null) {
+ throw new RuntimeException(t);
+ }
+
+ throw new RuntimeException(t.getCause());
+ }
+
+ // unhook lstening to current CND being edited
+ if (this.cndBeingEdited != null) {
+ this.cndBeingEdited.removeListener(this);
+ }
+
+ // copy over CND
+ this.cndBeingEdited = CompactNodeTypeDefinition.copy(this.originalCnd);
+ this.cndBeingEdited.addListener(this);
+ this.formsPage.handleCndReloaded();
+ }
+
//
// private void contributeToMenu( IMenuManager menuMgr ) {
// menuMgr.add(this.updateRegisteryAction);
@@ -187,24 +220,6 @@
// this.showRegistryViewAction = new ShowModelExtensionRegistryViewAction();
// }
- private void createCnd() throws Exception {
- // TODO implement createCnd
- CndImporter importer = new CndImporter();
- List<Throwable> errors = new ArrayList<Throwable>();
- this.originalCnd = importer.importFrom(getFile().getContents(), errors, getFile().getName());
-
- // TODO process parse errors here
-
- // unhook lstening to current CND being edited
- if (this.cndBeingEdited != null) {
- this.cndBeingEdited.removeListener(this);
- }
-
- // copy over CND
- this.cndBeingEdited = CompactNodeTypeDefinition.copy(this.originalCnd);
- this.cndBeingEdited.addListener(this);
- }
-
/**
* {@inheritDoc}
*
@@ -227,6 +242,17 @@
/**
* {@inheritDoc}
*
+ * @see org.eclipse.ui.forms.editor.SharedHeaderFormEditor#dispose()
+ */
+ @Override
+ public void dispose() {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ super.dispose();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
@@ -241,51 +267,50 @@
*/
@Override
public void doSaveAs() {
- // TODO implement doSaveAs
-// final IProgressMonitor progressMonitor = getProgressMonitor();
- // SaveAsDialog dialog = new SaveAsDialog(getShell());
- // dialog.setOriginalFile(getFile());
- // dialog.create();
- //
- // // dialog was canceled
- // if (dialog.open() == Window.CANCEL) {
- // if (progressMonitor != null) {
- // progressMonitor.setCanceled(true);
- // }
- //
- // return;
- // }
- //
- // // dialog OK'd
- // IPath filePath = dialog.getResult();
- //
- // // make sure that file has the right extension
- // if (!ExtensionConstants.MED_EXTENSION.equals(filePath.getFileExtension())) {
- // filePath = filePath.addFileExtension(ExtensionConstants.MED_EXTENSION);
- // }
- //
- // IWorkspace workspace = ResourcesPlugin.getWorkspace();
- // IFile file = workspace.getRoot().getFile(filePath);
- //
- // try {
- // // create set new editor input file
- // InputStream emptyStream = new ByteArrayInputStream(new byte[0]);
- // file.create(emptyStream, true, progressMonitor);
- // setInput(new FileEditorInput(file));
- //
- // // save MED in new file
- // internalSave(progressMonitor);
- // } catch (Exception e) {
- // IStatus status = null;
- //
- // if (!(e instanceof CoreException)) {
- // status = new Status(IStatus.ERROR, JcrUiConstants.PLUGIN_ID, e.getLocalizedMessage());
- // } else {
- // status = ((CoreException)e).getStatus();
- // }
- //
- // ErrorDialog.openError(getShell(), UiMessages.errorDialogTitle, CndMessages.cndEditorSaveError, status);
- // }
+ final IProgressMonitor progressMonitor = getProgressMonitor();
+ final SaveAsDialog dialog = new SaveAsDialog(getShell());
+ dialog.setOriginalFile(getFile());
+ dialog.create();
+
+ // dialog was canceled
+ if (dialog.open() == Window.CANCEL) {
+ if (progressMonitor != null) {
+ progressMonitor.setCanceled(true);
+ }
+
+ return;
+ }
+
+ // dialog OK'd
+ IPath filePath = dialog.getResult();
+
+ // make sure that file has the right extension
+ if (!JcrUiConstants.FileExtensions.CND.equals(filePath.getFileExtension())) {
+ filePath = filePath.addFileExtension(JcrUiConstants.FileExtensions.CND);
+ }
+
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IFile file = workspace.getRoot().getFile(filePath);
+
+ try {
+ // create set new editor input file
+ final InputStream emptyStream = new ByteArrayInputStream(new byte[0]);
+ file.create(emptyStream, true, progressMonitor);
+ setInput(new FileEditorInput(file));
+
+ // save CND in new file
+ internalSave(progressMonitor);
+ } catch (final Exception e) {
+ IStatus status = null;
+
+ if (!(e instanceof CoreException)) {
+ status = new Status(IStatus.ERROR, JcrUiConstants.PLUGIN_ID, e.getLocalizedMessage());
+ } else {
+ status = ((CoreException)e).getStatus();
+ }
+
+ ErrorDialog.openError(getShell(), UiMessages.errorDialogTitle, CndMessages.cndEditorSaveError, status);
+ }
}
/**
@@ -308,27 +333,18 @@
IMessageManager getMessageManager() {
return this.scrolledForm.getMessageManager();
}
-//
-// private IProgressMonitor getProgressMonitor() {
-// final IStatusLineManager statusLineMgr = getEditorSite().getActionBars().getStatusLineManager();
-// return ((statusLineMgr == null) ? null : statusLineMgr.getProgressMonitor());
-// }
+ private IProgressMonitor getProgressMonitor() {
+ final IStatusLineManager statusLineMgr = getEditorSite().getActionBars().getStatusLineManager();
+ return ((statusLineMgr == null) ? null : statusLineMgr.getProgressMonitor());
+ }
+
/**
* @return the editor's shell (never <code>null</code>)
*/
Shell getShell() {
return getEditorSite().getShell();
}
-//
-// /**
-// * Handler for page change listener.
-// */
-// void handlePageChanged() {
-// final FormPage page = (FormPage)getSelectedPage();
-// this.scrolledForm.setText(page.getTitle());
-// page.setFocus();
-// }
/**
* Registers an editor activation listener.
@@ -337,6 +353,16 @@
getContainer().addListener(SWT.Activate, this.refreshListener);
}
+ //
+ // /**
+ // * Handler for page change listener.
+ // */
+ // void handlePageChanged() {
+ // final FormPage page = (FormPage)getSelectedPage();
+ // this.scrolledForm.setText(page.getTitle());
+ // page.setFocus();
+ // }
+
/**
* {@inheritDoc}
*
@@ -360,16 +386,13 @@
final IEditorInput input = getEditorInput();
try {
- // TODO need a CND writer
- // ModelExtensionDefinitionWriter writer = new ModelExtensionDefinitionWriter();
- // String medAsString = writer.writeAsText(this.cndBeingEdited);
- // IDocument document = this.documentProvider.getDocument(input);
- // document.set(medAsString);
- //
- // this.documentProvider.aboutToChange(input);
- // this.documentProvider.saveDocument(progressMonitor, input, document, true);
- // this.modificationStamp = this.documentProvider.getModificationStamp(input);
+ final IDocument document = this.documentProvider.getDocument(input);
+ document.set(getCnd().toCndNotation(NotationType.LONG)); // TODO hook this to notation type preference
+ this.documentProvider.aboutToChange(input);
+ this.documentProvider.saveDocument(progressMonitor, input, document, true);
+ this.modificationStamp = this.documentProvider.getModificationStamp(input);
+
// create new original CND that that will then be copied over to the CND being edited
createCnd();
} catch (final Exception e) {
@@ -451,7 +474,7 @@
createCnd();
- this.formsPage.handleCndReloaded();
+ // this.formsPage.handleCndReloaded();
} catch (final Exception e) {
// TODO log this
MessageFormDialog.openError(getShell(), CndMessages.cndEditorRefreshErrorTitle,
@@ -572,6 +595,7 @@
@Override
public void restoreState( final IMemento memento ) {
this.memento = memento;
+ this.formsPage.restoreState(this.memento);
}
/**
@@ -582,7 +606,8 @@
@Override
public void saveState( final IMemento memento ) {
final int selectedPageNum = getActivePage();
- memento.putInteger(SELECTED_PAGE, selectedPageNum);
+ memento.putInteger(MementoKeys.SELECTED_PAGE, selectedPageNum);
+ this.formsPage.saveState(memento);
}
/**
@@ -637,4 +662,11 @@
getContainer().removeListener(SWT.Activate, this.refreshListener);
}
}
+
+ /**
+ * The memento keys for saving and restoring editor state.
+ */
+ private interface MementoKeys {
+ String SELECTED_PAGE = "SELECTED_PAGE"; //$NON-NLS-1$
+ }
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditorPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditorPage.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndEditorPage.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -16,6 +16,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableEditor;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.IMessageManager;
import org.eclipse.ui.forms.editor.FormPage;
@@ -24,11 +26,16 @@
import org.jboss.tools.modeshape.ui.forms.ErrorMessage;
/**
- *
+ * The CND editor's form page(s) base class.
*/
-public abstract class CndEditorPage extends FormPage {
+public abstract class CndEditorPage extends FormPage implements IPersistableEditor {
/**
+ * The memento used to restore editor state (can be <code>null</code>).
+ */
+ protected IMemento memento;
+
+ /**
* @param cndEditor the CND editor (cannot be <code>null</code>)
* @param id the unique page identifier (cannot be <code>null</code>)
* @param title the page part title (cannot be <code>null</code>)
@@ -117,6 +124,26 @@
/**
* {@inheritDoc}
*
+ * @see org.eclipse.ui.IPersistableEditor#restoreState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public final void restoreState( IMemento memento ) {
+ this.memento = memento;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState( IMemento memento ) {
+ // nothing to do. subclassses can override.
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.ui.forms.editor.FormPage#setFocus()
*/
@Override
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/CndFormsEditorPage.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -49,6 +49,7 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
@@ -57,6 +58,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.IMemento;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.IMessageManager;
@@ -73,7 +75,6 @@
import org.jboss.tools.modeshape.jcr.cnd.CompactNodeTypeDefinition;
import org.jboss.tools.modeshape.jcr.cnd.NamespaceMapping;
import org.jboss.tools.modeshape.jcr.cnd.NodeTypeDefinition;
-import org.jboss.tools.modeshape.jcr.cnd.NodeTypeDefinition.PropertyName;
import org.jboss.tools.modeshape.jcr.cnd.PropertyDefinition;
import org.jboss.tools.modeshape.jcr.cnd.QualifiedName;
import org.jboss.tools.modeshape.jcr.ui.JcrUiUtils;
@@ -91,6 +92,7 @@
class CndFormsEditorPage extends CndEditorPage implements PropertyChangeListener {
private IAction addChildNode;
+
private IAction addNamespace;
private IAction addNodeType;
private IAction addProperty;
@@ -100,7 +102,6 @@
private Button btnOrderable;
private Button btnQueryable;
private Section childNodeSection;
- private final ErrorMessage childNodesError;
private TableViewer childNodeViewer;
private IAction deleteChildNode;
private IAction deleteNamespace;
@@ -113,18 +114,18 @@
private IAction editProperty;
private IAction editSuperType;
private QualifiedNameEditor nameEditor;
+ private Section namespaceSection;
private final ErrorMessage namespacesError;
private TableViewer namespaceViewer;
- private final ErrorMessage nodeTypeNameError;
private String nodeTypeNameFilterPattern;
+ private Section nodeTypeSection;
private final ErrorMessage nodeTypesError;
private TableViewer nodeTypeViewer;
- private final ErrorMessage propertiesError;
private Section propertiesSection;
private TableViewer propertyViewer;
private NodeTypeDefinition selectedNodeType; // needed for property changes (can be null)
- private final ErrorMessage superTypesError;
private TableViewer superTypesViewer;
+ private Text txtFilter;
/**
* @param cndEditor the CND editor this page belongs to (cannot be <code>null</code>)
@@ -133,12 +134,8 @@
super(cndEditor, CND_FORMS_PAGE, CndMessages.cndEditorFormsPageTitle);
// construct form messages
- this.childNodesError = new ErrorMessage();
this.namespacesError = new ErrorMessage();
this.nodeTypesError = new ErrorMessage();
- this.nodeTypeNameError = new ErrorMessage();
- this.propertiesError = new ErrorMessage();
- this.superTypesError = new ErrorMessage();
}
/**
@@ -158,6 +155,9 @@
// fill GUI with CND
populateUi();
+
+ // clear any initial messages that were created before the control was set
+ getCndEditor().getMessageManager().removeAllMessages();
}
private void createChildNodeActions() {
@@ -213,9 +213,22 @@
private void createChildNodeSection( final IManagedForm managedForm,
final FormToolkit toolkit,
final Composite parent ) {
+ // restore expansion state
+ int sectionStyle = Styles.SECTION_STYLE;
+
+ if (this.memento == null) {
+ // don't expand
+ sectionStyle = sectionStyle & ~ExpandableComposite.EXPANDED;
+ } else {
+ final Boolean expanded = this.memento.getBoolean(MementoKeys.CHILD_NODE_SECTION_EXPANDED);
+
+ if ((expanded != null) && !expanded.booleanValue()) {
+ sectionStyle = sectionStyle & ~ExpandableComposite.EXPANDED;
+ }
+ }
+
this.childNodeSection = FormUtils.createSection(managedForm, toolkit, parent, CndMessages.cndEditorChildNodeSectionTitle,
- CndMessages.cndEditorChildNodeSectionDescription, Styles.SECTION_STYLE
- & ~ExpandableComposite.EXPANDED, true);
+ CndMessages.cndEditorChildNodeSectionDescription, sectionStyle, true);
toolkit.paintBordersFor(this.childNodeSection);
// create actions
@@ -243,7 +256,6 @@
table.setMenu(menuManager.createContextMenu(table));
createChildNodeViewer(table);
- this.childNodesError.setControl(table);
}
private void createChildNodeViewer( final Table childNodeTable ) {
@@ -421,7 +433,7 @@
this.nameEditor = new QualifiedNameEditor(leftContainer,
SWT.NONE,
toolkit,
- Messages.propertyDefinitionName,
+ Messages.nodeTypeDefinitionName,
getNamespacePrefixes(),
null);
((GridData)this.nameEditor.getLayoutData()).horizontalSpan = 2;
@@ -438,7 +450,6 @@
}
});
- this.nodeTypeNameError.setControl(this.nameEditor);
refreshNameControls(); // populate name editor controls
}
@@ -449,7 +460,6 @@
attributesContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
((GridData)attributesContainer.getLayoutData()).horizontalSpan = 2;
toolkit.adapt(attributesContainer);
- // attributesContainer.setBackground(toolkit.getColors().getColor(IFormColors.H_HOVER_LIGHT));
toolkit.paintBordersFor(attributesContainer);
this.btnAbstract = toolkit.createButton(attributesContainer, CndMessages.abstractAttribute, SWT.CHECK);
@@ -536,7 +546,6 @@
table.setLinesVisible(false);
((GridData)table.getLayoutData()).heightHint = table.getItemHeight() * 2;
table.setToolTipText(CndMessages.supertypesToolTip);
- this.superTypesError.setControl(table);
createSuperTypesActions();
@@ -618,24 +627,38 @@
private void createNamespaceSection( final IManagedForm managedForm,
final FormToolkit toolkit,
final Composite parent ) {
+ // restore expansion state
+ int sectionStyle = Styles.SECTION_STYLE;
+
+ if (this.memento == null) {
+ // don't expand
+ sectionStyle = sectionStyle & ~ExpandableComposite.EXPANDED;
+ } else {
+ final Boolean expanded = this.memento.getBoolean(MementoKeys.NAMESPACE_SECTION_EXPANDED);
+
+ if ((expanded != null) && !expanded.booleanValue()) {
+ sectionStyle = sectionStyle & ~ExpandableComposite.EXPANDED;
+ }
+ }
+
// create section
- final Section section = FormUtils.createSection(managedForm, toolkit, parent, CndMessages.cndEditorNamespacesSectionTitle,
- CndMessages.cndEditorNamespacesSectionDescription, Styles.SECTION_STYLE
- & ~ExpandableComposite.EXPANDED, true);
- toolkit.paintBordersFor(section);
+ this.namespaceSection = FormUtils.createSection(managedForm, toolkit, parent, CndMessages.cndEditorNamespacesSectionTitle,
+ CndMessages.cndEditorNamespacesSectionDescription, sectionStyle, true);
+ toolkit.paintBordersFor(this.namespaceSection);
+ this.namespacesError.setControl(this.namespaceSection.getDescriptionControl());
// create actions
createNamespaceActions();
// create toolbar
- FormUtils.createSectionToolBar(section, toolkit, new IAction[] { this.addNamespace, this.editNamespace,
+ FormUtils.createSectionToolBar(this.namespaceSection, toolkit, new IAction[] { this.addNamespace, this.editNamespace,
this.deleteNamespace });
// create viewer
- final Composite container = toolkit.createComposite(section);
+ final Composite container = toolkit.createComposite(this.namespaceSection);
container.setLayout(new GridLayout());
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- section.setClient(container);
+ this.namespaceSection.setClient(container);
toolkit.paintBordersFor(container);
final Table table = FormUtils.createTable(toolkit, container);
@@ -649,7 +672,6 @@
table.setMenu(menuManager.createContextMenu(table));
createNamespaceViewer(table);
- this.namespacesError.setControl(table);
}
private void createNamespaceViewer( final Table namespaceTable ) {
@@ -810,23 +832,24 @@
final FormToolkit toolkit,
final Composite parent ) {
// create section
- final Section section = FormUtils.createSection(managedForm, toolkit, parent, CndMessages.cndEditorNodeTypeSectionTitle,
- CndMessages.cndEditorNodeTypeSectionDescription, Styles.SECTION_STYLE
- & ~ExpandableComposite.TWISTIE, false);
- toolkit.paintBordersFor(section);
+ this.nodeTypeSection = FormUtils.createSection(managedForm, toolkit, parent, CndMessages.cndEditorNodeTypeSectionTitle,
+ CndMessages.cndEditorNodeTypeSectionDescription, Styles.SECTION_STYLE
+ & ~ExpandableComposite.TWISTIE, false);
+ toolkit.paintBordersFor(this.nodeTypeSection);
+ this.nodeTypesError.setControl(this.nodeTypeSection.getDescriptionControl());
// create actions
createNodeTypeActions();
// create toolbar
- FormUtils.createSectionToolBar(section, toolkit, new IAction[] { this.addNodeType, this.deleteNodeType });
+ FormUtils.createSectionToolBar(this.nodeTypeSection, toolkit, new IAction[] { this.addNodeType, this.deleteNodeType });
// splitter has node type table on left and node type detail, properties, and child nodes on right
- final SashForm splitter = new SashForm(section, SWT.HORIZONTAL);
+ final SashForm splitter = new SashForm(this.nodeTypeSection, SWT.HORIZONTAL);
toolkit.adapt(splitter);
splitter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
splitter.setBackground(toolkit.getColors().getColor(IFormColors.SEPARATOR));
- section.setClient(splitter);
+ this.nodeTypeSection.setClient(splitter);
// left side is node type name filter and node type name table
final Composite leftContainer = toolkit.createComposite(splitter);
@@ -835,12 +858,11 @@
toolkit.paintBordersFor(leftContainer);
FILTER: {
- final Text txtFilter = toolkit.createText(leftContainer, Utils.EMPTY_STRING, Styles.TEXT_STYLE | SWT.SEARCH
- | SWT.ICON_CANCEL);
- txtFilter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- txtFilter.setMessage(CndMessages.nodeTypeNamePatternMessage);
- txtFilter.setFont(JFaceResources.getDialogFont());
- txtFilter.addModifyListener(new ModifyListener() {
+ this.txtFilter = toolkit.createText(leftContainer, Utils.EMPTY_STRING, Styles.TEXT_STYLE | SWT.SEARCH | SWT.ICON_CANCEL);
+ this.txtFilter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ this.txtFilter.setMessage(CndMessages.nodeTypeNamePatternMessage);
+ this.txtFilter.setFont(JFaceResources.getDialogFont());
+ this.txtFilter.addModifyListener(new ModifyListener() {
/**
* {@inheritDoc}
@@ -849,12 +871,12 @@
*/
@Override
public void modifyText( final ModifyEvent e ) {
- handleNodeTypeNameFilterModified(txtFilter.getText());
+ handleNodeTypeNameFilterModified(((Text)e.widget).getText());
}
});
}
- VIEWER: {
+ VIEWER: { // left-side
final Composite viewerContainer = toolkit.createComposite(leftContainer);
viewerContainer.setLayout(new GridLayout());
viewerContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
@@ -870,7 +892,6 @@
table.setMenu(menuManager.createContextMenu(table));
createNodeTypeViewer(table);
- this.nodeTypesError.setControl(table);
}
RIGHT_SIDE: {
@@ -879,17 +900,10 @@
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
toolkit.paintBordersFor(container);
- DETAILS: {
- createDetailsSection(managedForm, toolkit, container);
- }
-
- PROPERTIES: {
- createPropertySection(managedForm, toolkit, container);
- }
-
- CHILD_NODES: {
- createChildNodeSection(managedForm, toolkit, container);
- }
+ // create sections
+ createDetailsSection(managedForm, toolkit, container);
+ createPropertySection(managedForm, toolkit, container);
+ createChildNodeSection(managedForm, toolkit, container);
}
splitter.setWeights(new int[] { 20, 80 });
@@ -907,7 +921,13 @@
@Override
public String getText( final Object element ) {
final NodeTypeDefinition nodeTypeDefinition = (NodeTypeDefinition)element;
- return nodeTypeDefinition.getName();
+ String name = nodeTypeDefinition.getName();
+
+ if (Utils.isEmpty(name)) {
+ name = Messages.missingName;
+ }
+
+ return name;
}
}
@@ -1069,10 +1089,22 @@
private void createPropertySection( final IManagedForm managedForm,
final FormToolkit toolkit,
final Composite parent ) {
- // create section
+ // restore expansion state
+ int sectionStyle = Styles.SECTION_STYLE;
+
+ if (this.memento == null) {
+ // don't expand
+ sectionStyle = sectionStyle & ~ExpandableComposite.EXPANDED;
+ } else {
+ final Boolean expanded = this.memento.getBoolean(MementoKeys.PROPERTY_SECTION_EXPANDED);
+
+ if ((expanded != null) && !expanded.booleanValue()) {
+ sectionStyle = sectionStyle & ~ExpandableComposite.EXPANDED;
+ }
+ }
+
this.propertiesSection = FormUtils.createSection(managedForm, toolkit, parent, CndMessages.cndEditorPropertySectionTitle,
- CndMessages.cndEditorPropertySectionDescription, Styles.SECTION_STYLE
- & ~ExpandableComposite.EXPANDED, true);
+ CndMessages.cndEditorPropertySectionDescription, sectionStyle, true);
toolkit.paintBordersFor(this.propertiesSection);
// create actions
@@ -1100,7 +1132,6 @@
table.setMenu(menuManager.createContextMenu(table));
createPropertyViewer(table);
- this.propertiesError.setControl(table);
}
private void createPropertyViewer( final Table propertyTable ) {
@@ -1147,7 +1178,13 @@
}
assert (this.columnIndex == PropertyColumnIndexes.CONSTRAINTS) : "Unexpected property column index"; //$NON-NLS-1$
- return propertyDefinition.getValueConstraintsCndNotation(notationType);
+ final String[] constraints = propertyDefinition.getValueConstraints();
+
+ if (Utils.isEmpty(constraints)) {
+ return Utils.EMPTY_STRING;
+ }
+
+ return UiUtils.join(Arrays.asList(constraints), null);
}
}
@@ -1683,11 +1720,8 @@
public void handleCndReloaded() {
// make sure GUI has been constructed before refreshing
if (this.propertyViewer != null) {
- refreshNameControls();
- refreshAttributeControls();
- refreshSuperTypes();
- refreshPropertyViewer();
- refreshChildNodeViewer();
+ refreshNamespaceControls();
+ refreshNodeTypeControls();
}
}
@@ -1947,8 +1981,6 @@
// update button enablements
final boolean enable = (getSelectedNamespace() != null);
- // this.addNamespace is always enabled
-
if (this.editNamespace.isEnabled() != enable) {
this.editNamespace.setEnabled(enable);
}
@@ -1966,7 +1998,7 @@
void handleNodeTypeNameFilterModified( final String namePattern ) {
this.nodeTypeNameFilterPattern = namePattern;
- this.nodeTypeViewer.refresh();
+ refreshNodeTypeControls();
}
void handleNodeTypeSelected() {
@@ -2043,6 +2075,7 @@
} else if (NodeTypeDefinition.PropertyName.NAME.toString().equals(propName)) {
validateName();
this.nodeTypeViewer.refresh(source);
+ UiUtils.pack(this.nodeTypeViewer);
} else if (NodeTypeDefinition.PropertyName.PROPERTY_DEFINITIONS.toString().equals(propName)) {
validateProperties();
this.propertyViewer.refresh();
@@ -2054,12 +2087,15 @@
// tell editor about node type definition change
getCndEditor().refreshDirtyState();
} else if (source instanceof NamespaceMapping) {
+ validateNamespaces();
this.namespaceViewer.refresh(source);
+ UiUtils.pack(this.namespaceViewer);
} else if (source instanceof CompactNodeTypeDefinition) {
if (CompactNodeTypeDefinition.PropertyName.NAMESPACE_MAPPINGS.toString().equals(propName)) {
- this.namespaceViewer.refresh();
+ validateNamespaces();
+ refreshNamespaceControls();
} else if (CompactNodeTypeDefinition.PropertyName.NODE_TYPE_DEFINITIONS.toString().equals(propName)) {
- this.nodeTypeViewer.refresh();
+ refreshNodeTypeControls();
}
}
}
@@ -2107,11 +2143,33 @@
// size columns to the data
UiUtils.pack(this.namespaceViewer, this.nodeTypeViewer);
- if (this.nodeTypeViewer.getTable().getItemCount() != 0) {
- this.nodeTypeViewer.getTable().select(0);
- final Event e = new Event();
- e.widget = this.nodeTypeViewer.getTable();
- this.nodeTypeViewer.getTable().notifyListeners(SWT.Selection, e);
+ // restore selected node type and node type name pattern
+ if (this.memento == null) {
+ if (this.nodeTypeViewer.getTable().getItemCount() != 0) {
+ this.nodeTypeViewer.getTable().select(0);
+ final Event e = new Event();
+ e.widget = this.nodeTypeViewer.getTable();
+ this.nodeTypeViewer.getTable().notifyListeners(SWT.Selection, e);
+ }
+ } else {
+ final String nodeTypeName = this.memento.getString(MementoKeys.SELECTED_NODE_TYPE);
+
+ if (!Utils.isEmpty(nodeTypeName)) {
+ for (final NodeTypeDefinition nodeTypeDefinition : getCnd().getNodeTypeDefinitions()) {
+ if (nodeTypeName.equals(nodeTypeDefinition.getName())) {
+ this.nodeTypeViewer.setSelection(new StructuredSelection(nodeTypeDefinition));
+ break;
+ }
+ }
+
+ }
+
+ // set last used node type filter pattern
+ final String filter = this.memento.getString(MementoKeys.NODE_TYPE_FILTER);
+
+ if (!Utils.isEmpty(filter)) {
+ this.txtFilter.setText(filter);
+ }
}
}
@@ -2186,6 +2244,29 @@
}
}
+ private void refreshNamespaceControls() {
+ this.namespaceViewer.refresh();
+ }
+
+ private void refreshNodeTypeControls() {
+ final NodeTypeDefinition selectedNodeType = getSelectedNodeType();
+ this.nodeTypeViewer.refresh(); // this will deselect node type
+
+ // reselect node type by name
+ if (selectedNodeType != null) {
+ final String name = selectedNodeType.getName();
+
+ // should always have a name but just make sure
+ if (!Utils.isEmpty(name)) {
+ for (final NodeTypeDefinition nodeType : getCnd().getNodeTypeDefinitions()) {
+ if (name.equals(nodeType.getName())) {
+ this.nodeTypeViewer.setSelection(new StructuredSelection(nodeType));
+ }
+ }
+ }
+ }
+ }
+
private void refreshPropertyViewer() {
if (this.propertyViewer != null) {
this.propertyViewer.setInput(this);
@@ -2205,6 +2286,32 @@
/**
* {@inheritDoc}
*
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState( final IMemento memento ) {
+ memento.putBoolean(MementoKeys.CHILD_NODE_SECTION_EXPANDED, this.childNodeSection.isExpanded());
+ memento.putBoolean(MementoKeys.NAMESPACE_SECTION_EXPANDED, this.namespaceSection.isExpanded());
+ memento.putBoolean(MementoKeys.PROPERTY_SECTION_EXPANDED, this.propertiesSection.isExpanded());
+
+ // selected node type
+ final NodeTypeDefinition nodeTypeDefinition = getSelectedNodeType();
+
+ if (nodeTypeDefinition == null) {
+ memento.putString(MementoKeys.SELECTED_NODE_TYPE, Utils.EMPTY_STRING);
+ } else {
+ memento.putString(MementoKeys.SELECTED_NODE_TYPE, nodeTypeDefinition.getName());
+ }
+
+ // node type filter
+ if (!Utils.isEmpty(this.nodeTypeNameFilterPattern)) {
+ memento.putString(MementoKeys.NODE_TYPE_FILTER, this.nodeTypeNameFilterPattern);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.jboss.tools.modeshape.jcr.ui.cnd.CndEditorPage#setResourceReadOnly(boolean)
*/
@Override
@@ -2352,23 +2459,30 @@
private void updateMessage( final ValidationStatus status,
final ErrorMessage errorMessage ) {
final IMessageManager msgMgr = getCndEditor().getMessageManager();
+ msgMgr.setAutoUpdate(false);
+ final Control control = errorMessage.getControl();
+ msgMgr.removeMessages(control);
+
JcrUiUtils.setMessage(status, errorMessage);
- if (errorMessage.isOk()) {
- if (errorMessage.getControl() == null) {
- msgMgr.removeMessage(errorMessage.getKey());
+ if (!errorMessage.isOk()) {
+ if (status instanceof MultiValidationStatus) {
+ final Object data = errorMessage.getData();
+ final MultiValidationStatus multiStatus = (MultiValidationStatus)status;
+
+ for (final ValidationStatus singleStatus : multiStatus.getAll()) {
+ if (!singleStatus.isOk()) {
+ msgMgr.addMessage(singleStatus.getMessage(), singleStatus.getMessage(), data,
+ JcrUiUtils.getMessageType(singleStatus), control);
+ }
+ }
} else {
- msgMgr.removeMessage(errorMessage.getKey(), errorMessage.getControl());
- }
- } else {
- if (errorMessage.getControl() == null) {
msgMgr.addMessage(errorMessage.getKey(), errorMessage.getMessage(), errorMessage.getData(),
- errorMessage.getMessageType());
- } else {
- msgMgr.addMessage(errorMessage.getKey(), errorMessage.getMessage(), errorMessage.getData(),
errorMessage.getMessageType(), errorMessage.getControl());
}
}
+
+ msgMgr.setAutoUpdate(true);
}
private void validateAttributes() {
@@ -2376,19 +2490,11 @@
}
private void validateChildNodes() {
- final NodeTypeDefinition nodeTypeDefinition = getSelectedNodeType();
-
- if (nodeTypeDefinition == null) {
- this.nodeTypesError.setOkMessage(null);
- } else {
- final MultiValidationStatus status = CndValidator.validateChildNodeDefinitions(nodeTypeDefinition.getName(),
- nodeTypeDefinition.getChildNodeDefinitions());
- updateMessage(status, this.nodeTypesError);
- }
+ validateNodeTypes();
}
private void validateName() {
- updateMessage(this.nameEditor.getStatus(), this.nodeTypeNameError);
+ validateNodeTypes();
}
private void validateNamespaces() {
@@ -2397,39 +2503,16 @@
}
private void validateNodeTypes() {
- final MultiValidationStatus status = CndValidator.validateNodeTypeDefinitions(getCnd().getNodeTypeDefinitions());
+ final MultiValidationStatus status = CndValidator.validateNodeTypeDefinitions(getCnd().getNodeTypeDefinitions(), true);
updateMessage(status, this.nodeTypesError);
}
private void validateProperties() {
- final NodeTypeDefinition nodeTypeDefinition = getSelectedNodeType();
-
- if (nodeTypeDefinition == null) {
- this.propertiesError.setOkMessage(null);
- } else {
- final MultiValidationStatus status = CndValidator.validatePropertyDefinitions(nodeTypeDefinition.getName(),
- nodeTypeDefinition.getPropertyDefinitions());
- updateMessage(status, this.propertiesError);
- }
+ validateNodeTypes();
}
private void validateSuperTypes() {
- final NodeTypeDefinition nodeTypeDefinition = getSelectedNodeType();
-
- if (nodeTypeDefinition == null) {
- this.superTypesError.setOkMessage(null);
- } else {
- String nodeTypeName = nodeTypeDefinition.getName();
-
- if (Utils.isEmpty(nodeTypeName)) {
- nodeTypeName = Messages.missingName;
- }
-
- final MultiValidationStatus status = CndValidator.validateSuperTypes(nodeTypeName,
- nodeTypeDefinition.getState(PropertyName.SUPERTYPES),
- nodeTypeDefinition.getDeclaredSupertypeNames());
- updateMessage(status, this.superTypesError);
- }
+ validateNodeTypes();
}
interface ChildNodeColumnIndexes {
@@ -2439,6 +2522,17 @@
int REQUIRED_TYPES = 1;
}
+ /**
+ * The memento keys for saving and restoring editor state.
+ */
+ private interface MementoKeys {
+ String CHILD_NODE_SECTION_EXPANDED = "CHILD_NODE_SECTION_EXPANDED"; //$NON-NLS-1$
+ String NAMESPACE_SECTION_EXPANDED = "NAMESPACE_SECTION_EXPANDED"; //$NON-NLS-1$
+ String NODE_TYPE_FILTER = "NODE_TYPE_FILTER"; //$NON-NLS-1$
+ String PROPERTY_SECTION_EXPANDED = "PROPERTY_SECTION_EXPANDED"; //$NON-NLS-1$
+ String SELECTED_NODE_TYPE = "SELECTED_NODE_TYPE"; //$NON-NLS-1$
+ }
+
interface NamespaceColumnIndexes {
int PREFIX = 0;
int URI = 1;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -925,7 +925,7 @@
if (dialog.open() == Window.OK) {
final String newDefaultValue = dialog.getValue();
- if (!this.propertyBeingEdited.addValueConstraint(newDefaultValue)) {
+ if (!this.propertyBeingEdited.addDefaultValue(newDefaultValue)) {
MessageFormDialog.openError(getShell(), UiMessages.errorDialogTitle, JcrUiUtils.getCndEditorImage(),
NLS.bind(CndMessages.errorAddingDefaultValue, newDefaultValue));
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/QualifiedNameEditor.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/QualifiedNameEditor.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/QualifiedNameEditor.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -175,7 +175,12 @@
}
void handleQualifierChanged( final String newQualifier ) {
- this.qualifier = newQualifier;
+ if (CndMessages.noNameQualifierChoice.equals(newQualifier)) {
+ this.qualifier = Utils.EMPTY_STRING;
+ } else {
+ this.qualifier = newQualifier;
+ }
+
validate();
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/cndMessages.properties 2012-03-27 20:03:21 UTC (rev 39856)
@@ -153,7 +153,7 @@
errorEditingRequiredType = There was an unexpected error updating required type "{0}" to the CND.\nThe remove command result: {1}. The add command result: {2}.
errorEditingSupertype = There was an unexpected error updating supertype "{0}" to the CND.\nThe remove command result: {1}. The add command result: {2}.
errorEditingValueConstraint = There was an unexpected error updating value constraint "{0}" to the property definition.\nThe remove command result: {1}. The add command result: {2}.
-errorOpeningCndEditor = There was a problem creating the CND editor.
+errorOpeningCndEditor = There were errors parsing the CND so the CND editor could not be created. Fix errors and retry.
mandatoryAttribute = Mandatory
mandatoryAttributeToolTip = Indicates if the child node/property must exist
missingValue = <missing>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/ErrorMessage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/ErrorMessage.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.ui/src/org/jboss/tools/modeshape/ui/forms/ErrorMessage.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -18,6 +18,11 @@
public class ErrorMessage implements IMessage {
/**
+ * Used to hold additional information (can be <code>null</code>).
+ */
+ private Object data;
+
+ /**
* The error message (can be <code>null</code> or empty)
*/
private String message;
@@ -56,7 +61,7 @@
*/
@Override
public Object getData() {
- return null;
+ return this.data;
}
/**
@@ -135,6 +140,13 @@
}
/**
+ * @param data any additional information needed by the error message (can be <code>null</code>)
+ */
+ public void setData( Object data ) {
+ this.data = data;
+ }
+
+ /**
* Also sets the message severity to an error.
*
* @param newMessage the new message (can be <code>null</code> or empty)
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndValidatorTest.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -147,7 +147,7 @@
this.nodeTypeDefinition.addChildNodeDefinition(this.childNodeDefinition);
this.nodeTypeDefinition.addChildNodeDefinition(child2);
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, true).isError());
}
@Test
@@ -162,22 +162,22 @@
this.nodeTypeDefinition.addPropertyDefinition(this.propertyDefinition);
this.nodeTypeDefinition.addPropertyDefinition(prop2);
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, true).isError());
}
@Test
public void nodeTypeDefinitionWithEmptyNameShouldAnError() {
this.nodeTypeDefinition.setName(null);
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, false).isError());
this.nodeTypeDefinition.setName(Utils.EMPTY_STRING);
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, false).isError());
}
@Test
public void nodeTypeDefinitionWithInvalidNameShouldBeAnError() {
this.nodeTypeDefinition.setName("invalid/name"); //$NON-NLS-1$
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, false).isError());
}
@Test
@@ -185,7 +185,7 @@
this.nodeTypeDefinition.setName("nodeTypeName"); //$NON-NLS-1$
this.nodeTypeDefinition.setPrimaryItemName("invalid/name"); //$NON-NLS-1$
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, false).isError());
}
@Test
@@ -193,13 +193,13 @@
this.nodeTypeDefinition.setName("nodeTypeName"); //$NON-NLS-1$
this.nodeTypeDefinition.addSuperType("invalid/name"); //$NON-NLS-1$
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isError());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, false).isError());
}
@Test
public void nodeTypeDefinitionWithoutPropertiesAndChildNodesShouldBeAWarning() {
this.nodeTypeDefinition.setName("name"); //$NON-NLS-1$
- assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null).isWarning());
+ assertTrue(CndValidator.validateNodeTypeDefinition(this.nodeTypeDefinition, null, false).isWarning());
}
@Test
@@ -241,26 +241,86 @@
}
@Test
- public void shouldNotAllDuplicateNamespacePrefixes() {
+ public void shouldAllowChildNodeDefinitionsWithResidualNames() {
+ this.childNodeDefinition.setName(ItemDefinition.RESIDUAL_NAME);
+ assertTrue(CndValidator.validateName(this.childNodeDefinition, null).isOk());
+ }
+
+ @Test
+ public void shouldAllowMultipleChildNodeDefinitionsWithResidualNames() {
+ this.nodeTypeDefinition.setName("nodeName"); //$NON-NLS-1$
+ this.childNodeDefinition.setName(ItemDefinition.RESIDUAL_NAME);
+ final ChildNodeDefinition childNode2 = new ChildNodeDefinition();
+ childNode2.setName(ItemDefinition.RESIDUAL_NAME);
+ this.nodeTypeDefinition.addChildNodeDefinition(this.childNodeDefinition);
+ this.nodeTypeDefinition.addChildNodeDefinition(childNode2);
+ assertTrue(CndValidator.validateChildNodeDefinitions(this.nodeTypeDefinition.getName(),
+ this.nodeTypeDefinition.getChildNodeDefinitions()).isOk());
+ }
+
+ @Test
+ public void shouldAllowMultiplePropertyDefinitionsWithResidualNames() {
+ this.nodeTypeDefinition.setName("nodeName"); //$NON-NLS-1$
+ this.propertyDefinition.setName(ItemDefinition.RESIDUAL_NAME);
+ final PropertyDefinition propDefn2 = new PropertyDefinition();
+ propDefn2.setName(ItemDefinition.RESIDUAL_NAME);
+ this.nodeTypeDefinition.addPropertyDefinition(this.propertyDefinition);
+ this.nodeTypeDefinition.addPropertyDefinition(propDefn2);
+ assertTrue(CndValidator.validatePropertyDefinitions(this.nodeTypeDefinition.getName(),
+ this.nodeTypeDefinition.getPropertyDefinitions()).isOk());
+ }
+
+ @Test
+ public void shouldAllowPropertyDefinitionsWithResidualNames() {
+ this.propertyDefinition.setName(ItemDefinition.RESIDUAL_NAME);
+ assertTrue(CndValidator.validateName(this.propertyDefinition, null).isOk());
+ }
+
+ @Test
+ public void shouldNotAllowChildNodeDefinitionsWithSameName() {
+ this.nodeTypeDefinition.setName("nodeName"); //$NON-NLS-1$
+ this.childNodeDefinition.setName("name"); //$NON-NLS-1$
+ final ChildNodeDefinition childNode2 = new ChildNodeDefinition();
+ childNode2.setName(this.childNodeDefinition.getName());
+ this.nodeTypeDefinition.addChildNodeDefinition(this.childNodeDefinition);
+ this.nodeTypeDefinition.addChildNodeDefinition(childNode2);
+ assertTrue(CndValidator.validateChildNodeDefinitions(this.nodeTypeDefinition.getName(),
+ this.nodeTypeDefinition.getChildNodeDefinitions()).isError());
+ }
+
+ @Test
+ public void shouldNotAllowDuplicateNamespacePrefixes() {
// create a namespace mapping with a prefix that already exists and a URI that doesn't exist in the default namespaces
final NamespaceMapping namespaceMapping = new NamespaceMapping(Constants.NAMESPACE_PREFIX1, "xyz"); //$NON-NLS-1$
assertTrue(CndValidator.validateNamespaceMapping(namespaceMapping, Constants.Helper.getDefaultNamespaces()).isError());
}
@Test
- public void shouldNotAllDuplicateNamespaceUris() {
+ public void shouldNotAllowDuplicateNamespaceUris() {
// create a namespace mapping with a URI that already exists and a prefix that doesn't exist in the default namespaces
final NamespaceMapping namespaceMapping = new NamespaceMapping("xyz", Constants.NAMESPACE_URI1); //$NON-NLS-1$
assertTrue(CndValidator.validateNamespaceMapping(namespaceMapping, Constants.Helper.getDefaultNamespaces()).isError());
}
@Test
- public void shouldNotAllDuplicateQualifiedNames() {
+ public void shouldNotAllowDuplicateQualifiedNames() {
assertTrue(CndValidator.validateQualifiedName(Constants.QUALIFIED_NAME1,
"propertyName", Constants.Helper.getDefaultQualifiers(), Constants.Helper.getDefaultQualifiedNames()).isError()); //$NON-NLS-1$
}
@Test
+ public void shouldNotAllowPropertyDefinitionsWithSameName() {
+ this.nodeTypeDefinition.setName("nodeName"); //$NON-NLS-1$
+ this.propertyDefinition.setName("name"); //$NON-NLS-1$
+ final PropertyDefinition propDefn2 = new PropertyDefinition();
+ propDefn2.setName(this.propertyDefinition.getName());
+ this.nodeTypeDefinition.addPropertyDefinition(this.propertyDefinition);
+ this.nodeTypeDefinition.addPropertyDefinition(propDefn2);
+ assertTrue(CndValidator.validatePropertyDefinitions(this.nodeTypeDefinition.getName(),
+ this.nodeTypeDefinition.getPropertyDefinitions()).isError());
+ }
+
+ @Test
public void shouldValidateAllQueryOperators() {
for (final QueryOperator operator : QueryOperator.values()) {
assertTrue(CndValidator.validateQueryOperator(operator.toString(), "propName").isOk()); //$NON-NLS-1$
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -34,7 +34,7 @@
final String PREFIX = "prefix"; //$NON-NLS-1$
final String URI = "uri"; //$NON-NLS-1$
this.namespaceMapping = new NamespaceMapping(PREFIX, URI);
- assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + URI
+ assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + '\'' + URI + '\''
+ NamespaceMapping.NOTATION_SUFFIX, this.namespaceMapping.toCndNotation(NotationType.COMPACT));
}
@@ -43,7 +43,7 @@
final String PREFIX = "prefix"; //$NON-NLS-1$
final String URI = "uri"; //$NON-NLS-1$
this.namespaceMapping = new NamespaceMapping(PREFIX, URI);
- assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + URI
+ assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + '\'' + URI + '\''
+ NamespaceMapping.NOTATION_SUFFIX, this.namespaceMapping.toCndNotation(NotationType.COMPRESSED));
}
@@ -52,7 +52,7 @@
final String PREFIX = "prefix"; //$NON-NLS-1$
final String URI = "uri"; //$NON-NLS-1$
this.namespaceMapping = new NamespaceMapping(PREFIX, URI);
- assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + URI
+ assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + '\'' + URI + '\''
+ NamespaceMapping.NOTATION_SUFFIX, this.namespaceMapping.toCndNotation(NotationType.LONG));
}
@@ -201,12 +201,12 @@
NamespaceMapping thatNamespaceMapping = NamespaceMapping.copy(this.namespaceMapping);
assertEquals(this.namespaceMapping, thatNamespaceMapping);
assertEquals(this.namespaceMapping.hashCode(), thatNamespaceMapping.hashCode());
-
+
assertTrue(this.namespaceMapping.setPrefix(Constants.NAMESPACE_PREFIX1));
thatNamespaceMapping = NamespaceMapping.copy(this.namespaceMapping);
assertEquals(this.namespaceMapping, thatNamespaceMapping);
assertEquals(this.namespaceMapping.hashCode(), thatNamespaceMapping.hashCode());
-
+
assertTrue(this.namespaceMapping.setUri(Constants.NAMESPACE_URI1));
thatNamespaceMapping = NamespaceMapping.copy(this.namespaceMapping);
assertEquals(this.namespaceMapping, thatNamespaceMapping);
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NodeTypeDefinitionTest.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -481,7 +481,7 @@
assertEquals(1, l.getCount());
assertEquals(PropertyName.PRIMARY_ITEM.toString(), l.getPropertyName());
assertEquals(PRIMARY_ITEM, l.getNewValue());
- assertNull(l.getOldValue());
+ assertTrue(Utils.isEmpty((String)l.getOldValue()));
}
@Test
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItemTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItemTest.java 2012-03-27 19:46:28 UTC (rev 39855)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/attributes/PrimaryItemTest.java 2012-03-27 20:03:21 UTC (rev 39856)
@@ -50,6 +50,9 @@
public void stateShouldBeIsNotWhenSettingEmptyPrimaryItem() {
assertTrue(this.attribute.setPrimaryItem("primaryItem")); //$NON-NLS-1$
assertTrue(this.attribute.setPrimaryItem(Utils.EMPTY_STRING));
+ assertTrue(this.attribute.isNot());
+
+ assertTrue(this.attribute.setPrimaryItem("primaryItem")); //$NON-NLS-1$
assertTrue(this.attribute.setPrimaryItem(null));
assertTrue(this.attribute.isNot());
}
12 years, 2 months
JBoss Tools SVN: r39855 - trunk/build/aggregate.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-27 15:46:28 -0400 (Tue, 27 Mar 2012)
New Revision: 39855
Modified:
trunk/build/aggregate/pom.xml
Log:
add build instructions for coretests site
Modified: trunk/build/aggregate/pom.xml
===================================================================
--- trunk/build/aggregate/pom.xml 2012-03-27 19:45:33 UTC (rev 39854)
+++ trunk/build/aggregate/pom.xml 2012-03-27 19:46:28 UTC (rev 39855)
@@ -22,6 +22,7 @@
mvn clean install -f site/sources/pom.xml
mvn clean install -f webtools-site/pom.xml
mvn clean install -f bottests-site/pom.xml
+ mvn clean install -f coretests-site/pom.xml
...
-->
</project>
12 years, 2 months
JBoss Tools SVN: r39854 - trunk/build/aggregate/coretests-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-27 15:45:33 -0400 (Tue, 27 Mar 2012)
New Revision: 39854
Modified:
trunk/build/aggregate/coretests-site/index.html
trunk/build/aggregate/coretests-site/site.xml
Log:
add sources for tests for all features except vpe.test, runtime.test, and central.test
Modified: trunk/build/aggregate/coretests-site/index.html
===================================================================
--- trunk/build/aggregate/coretests-site/index.html 2012-03-27 16:59:39 UTC (rev 39853)
+++ trunk/build/aggregate/coretests-site/index.html 2012-03-27 19:45:33 UTC (rev 39854)
@@ -82,10 +82,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature_3.2.1.v20120326-1835-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature_3.2.1.v20120327-1000-H781-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.2.1.v20120326-1835-Beta3</span>
+<span style="font-size:x-small">3.2.1.v20120327-1000-H781-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -97,10 +97,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature_2.3.0.v20120326-1835-Beta3.jar">org.jboss.ide.eclipse.as.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.test.feature.source_3.2.1.v20120327-1000-H781-Beta3.jar">org.jboss.ide.eclipse.archives.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">2.3.0.v20120326-1835-Beta3</span>
+<span style="font-size:x-small">3.2.1.v20120327-1000-H781-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -112,10 +112,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature_1.2.0.v20120324-0258-H774-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature_2.3.0.v20120327-1018-H1191-Beta3.jar">org.jboss.ide.eclipse.as.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120324-0258-H774-Beta3</span>
+<span style="font-size:x-small">2.3.0.v20120327-1018-H1191-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -127,10 +127,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature_1.3.0.v20120324-0058-H797-Beta3.jar">org.jboss.tools.birt.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.test.feature.source_2.3.0.v20120327-1018-H1191-Beta3.jar">org.jboss.ide.eclipse.as.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.3.0.v20120324-0058-H797-Beta3</span>
+<span style="font-size:x-small">2.3.0.v20120327-1018-H1191-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -142,10 +142,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature_1.2.0.v20120326-2054-H986-Beta3.jar">org.jboss.tools.cdi.seam.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature_1.2.0.v20120327-1739-H778-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120326-2054-H986-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-1739-H778-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -157,10 +157,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature_1.2.0.v20120326-2054-H986-Beta3.jar">org.jboss.tools.cdi.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.test.feature.source_1.2.0.v20120327-1739-H778-Beta3.jar">org.jboss.ide.eclipse.freemarker.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120326-2054-H986-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-1739-H778-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -172,10 +172,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.central.test.feature_1.0.0.v20120326-1846-Beta3.jar">org.jboss.tools.central.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature_1.3.0.v20120327-1000-H801-Beta3.jar">org.jboss.tools.birt.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.0.0.v20120326-1846-Beta3</span>
+<span style="font-size:x-small">1.3.0.v20120327-1000-H801-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -187,10 +187,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature_3.3.0.v20120326-1835-Beta3.jar">org.jboss.tools.common.all.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.birt.test.feature.source_1.3.0.v20120327-1000-H801-Beta3.jar">org.jboss.tools.birt.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120326-1835-Beta3</span>
+<span style="font-size:x-small">1.3.0.v20120327-1000-H801-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -202,10 +202,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature_1.0.0.v20120326-1639-H610-Beta3.jar">org.jboss.tools.forge.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.seam.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.0.0.v20120326-1639-H610-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -217,10 +217,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature_1.2.0.v20120326-1835-Beta3.jar">org.jboss.tools.jmx.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.test.feature.source_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.seam.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120326-1835-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -232,10 +232,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature_3.3.0.v20120324-0505-H803-Beta3.jar">org.jboss.tools.jsf.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120324-0505-H803-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -247,10 +247,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature_3.3.0.v20120324-0258-H935-Beta3.jar">org.jboss.tools.jst.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.test.feature.source_1.2.0.v20120327-1111-H988-Beta3.jar">org.jboss.tools.cdi.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120324-0258-H935-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-1111-H988-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -262,10 +262,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.maven.test.feature_1.3.0.v20120326-1905-H587-Beta3.jar">org.jboss.tools.maven.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.central.test.feature_1.0.0.v20120327-1610-H443-Beta3.jar">org.jboss.tools.central.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.3.0.v20120326-1905-H587-Beta3</span>
+<span style="font-size:x-small">1.0.0.v20120327-1610-H443-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -277,10 +277,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature_2.3.0.v20120326-1914-H342-Beta3.jar">org.jboss.tools.openshift.express.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature_3.3.0.v20120327-0859-H801-Beta3.jar">org.jboss.tools.common.all.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">2.3.0.v20120326-1914-H342-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120327-0859-H801-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -292,10 +292,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.portlet.test.feature_1.2.0.v20120326-1608-H538-Beta3.jar">org.jboss.tools.portlet.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.common.all.test.feature.source_3.3.0.v20120327-0859-H801-Beta3.jar">org.jboss.tools.common.all.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.0.v20120326-1608-H538-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120327-0859-H801-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -307,10 +307,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.project.examples.test.feature_1.2.1.v20120326-1820-H619-Beta3.jar">org.jboss.tools.project.examples.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature_1.0.0.v20120327-0956-H612-Beta3.jar">org.jboss.tools.forge.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">1.2.1.v20120326-1820-H619-Beta3</span>
+<span style="font-size:x-small">1.0.0.v20120327-0956-H612-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -322,10 +322,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.runtime.test.feature_1.3.0.v20120326-0354-H680-Beta3.jar">org.jboss.tools.runtime.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.forge.test.feature.source_1.0.0.v20120327-0956-H612-Beta3.jar">org.jboss.tools.forge.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.3.0.v20120326-0354-H680-Beta3</span>
+<span style="font-size:x-small">1.0.0.v20120327-0956-H612-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -337,10 +337,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature_3.3.0.v20120326-0201-H893-Beta3.jar">org.jboss.tools.seam.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature_1.2.0.v20120327-0954-H725-Beta3.jar">org.jboss.tools.jmx.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120326-0201-H893-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-0954-H725-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -352,10 +352,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature_3.3.0.v20120324-0440-H699-Beta3.jar">org.jboss.tools.struts.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jmx.test.feature.source_1.2.0.v20120327-0954-H725-Beta3.jar">org.jboss.tools.jmx.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120324-0440-H699-Beta3</span>
+<span style="font-size:x-small">1.2.0.v20120327-0954-H725-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -367,10 +367,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.test.feature_3.2.0.v20120326-1835-Beta3.jar">org.jboss.tools.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature_3.3.0.v20120327-1148-H804-Beta3.jar">org.jboss.tools.jsf.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.2.0.v20120326-1835-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120327-1148-H804-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -382,10 +382,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature_1.1.0.v20120326-1835-Beta3.jar">org.jboss.tools.usage.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jsf.test.feature.source_3.3.0.v20120327-1148-H804-Beta3.jar">org.jboss.tools.jsf.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.1.0.v20120326-1835-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120327-1148-H804-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -397,10 +397,10 @@
#FFFFFF
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.vpe.test.feature_3.3.0.v20120324-0338-H896-Beta3.jar">org.jboss.tools.vpe.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature_3.3.0.v20120327-1023-H938-Beta3.jar">org.jboss.tools.jst.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.3.0.v20120324-0338-H896-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120327-1023-H938-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -412,10 +412,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature_1.2.2.v20120325-1424-H848-Beta3.jar">org.jboss.tools.ws.test.feature</a>
+<a style="font-size:x-small" href="features/org.jboss.tools.jst.test.feature.source_3.3.0.v20120327-1023-H938-Beta3.jar">org.jboss.tools.jst.test.feature.source</a>
</td>
<td>
-<span style="font-size:x-small">1.2.2.v20120325-1424-H848-Beta3</span>
+<span style="font-size:x-small">3.3.0.v20120327-1023-H938-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -423,6 +423,306 @@
JBoss Tools - Core Tests</span>
</td>
</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.test.feature_1.3.0.v20120327-1557-H588-Beta3.jar">org.jboss.tools.maven.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120327-1557-H588-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.test.feature.source_1.3.0.v20120327-1557-H588-Beta3.jar">org.jboss.tools.maven.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120327-1557-H588-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature_2.3.0.v20120327-1112-H344-Beta3.jar">org.jboss.tools.openshift.express.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120327-1112-H344-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.test.feature.source_2.3.0.v20120327-1112-H344-Beta3.jar">org.jboss.tools.openshift.express.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120327-1112-H344-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.portlet.test.feature_1.2.0.v20120327-1618-H540-Beta3.jar">org.jboss.tools.portlet.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120327-1618-H540-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.portlet.test.feature.source_1.2.0.v20120327-1618-H540-Beta3.jar">org.jboss.tools.portlet.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120327-1618-H540-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.project.examples.test.feature_1.2.1.v20120327-1543-H620-Beta3.jar">org.jboss.tools.project.examples.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.1.v20120327-1543-H620-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.project.examples.test.feature.source_1.2.1.v20120327-1543-H620-Beta3.jar">org.jboss.tools.project.examples.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.1.v20120327-1543-H620-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.test.feature_1.3.0.v20120327-1524-H681-Beta3.jar">org.jboss.tools.runtime.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120327-1524-H681-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature_3.3.0.v20120327-1334-H894-Beta3.jar">org.jboss.tools.seam.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120327-1334-H894-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.seam.test.feature.source_3.3.0.v20120327-1334-H894-Beta3.jar">org.jboss.tools.seam.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120327-1334-H894-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature_3.3.0.v20120327-1150-H700-Beta3.jar">org.jboss.tools.struts.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120327-1150-H700-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.struts.test.feature.source_3.3.0.v20120327-1150-H700-Beta3.jar">org.jboss.tools.struts.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120327-1150-H700-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.test.feature_3.2.0.v20120327-0753-H630-Beta3.jar">org.jboss.tools.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.2.0.v20120327-0753-H630-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.test.feature.source_3.2.0.v20120327-0753-H630-Beta3.jar">org.jboss.tools.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.2.0.v20120327-0753-H630-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature_1.1.0.v20120327-0943-H639-Beta3.jar">org.jboss.tools.usage.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.1.0.v20120327-0943-H639-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.usage.test.feature.source_1.1.0.v20120327-0943-H639-Beta3.jar">org.jboss.tools.usage.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.1.0.v20120327-0943-H639-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.test.feature_3.3.0.v20120327-1055-H899-Beta3.jar">org.jboss.tools.vpe.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120327-1055-H899-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature_1.2.2.v20120327-1115-H853-Beta3.jar">org.jboss.tools.ws.test.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120327-1115-H853-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.test.feature.source_1.2.2.v20120327-1115-H853-Beta3.jar">org.jboss.tools.ws.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120327-1115-H853-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
<tr style="background-color:#DDDDDD">
<th style="font-size:small">Feature</th>
<th style="font-size:small">Version</th>
@@ -434,10 +734,10 @@
#EEEEEE
">
<td class="rowLine">
-<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature_3.4.0.v20120324-0445-H837-Beta3.jar">org.hibernate.eclipse.test.feature</a>
+<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature_3.4.0.v20120327-1246-H840-Beta3.jar">org.hibernate.eclipse.test.feature</a>
</td>
<td>
-<span style="font-size:x-small">3.4.0.v20120324-0445-H837-Beta3</span>
+<span style="font-size:x-small">3.4.0.v20120327-1246-H840-Beta3</span>
</td>
<td>
<span style="font-size:x-small">
@@ -445,6 +745,21 @@
JBoss Tools - Core Tests</span>
</td>
</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.hibernate.eclipse.test.feature.source_3.4.0.v20120327-1246-H840-Beta3.jar">org.hibernate.eclipse.test.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.4.0.v20120327-1246-H840-Beta3</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ JBoss Tools - Core Tests</span>
+</td>
+</tr>
<tr style="background-color:#DDDDDD">
<th style="font-size:small" colspan="1">Metadata</th>
<th style="font-size:small" colspan="1"/>
Modified: trunk/build/aggregate/coretests-site/site.xml
===================================================================
--- trunk/build/aggregate/coretests-site/site.xml 2012-03-27 16:59:39 UTC (rev 39853)
+++ trunk/build/aggregate/coretests-site/site.xml 2012-03-27 19:45:33 UTC (rev 39854)
@@ -17,7 +17,6 @@
</description>
</category-def>
-<!-- TODO: includes feature.source features -->
<feature url="features/org.jboss.ide.eclipse.archives.test.feature_0.0.0.jar" id="org.jboss.ide.eclipse.archives.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.ide.eclipse.as.test.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.birt.test.feature_0.0.0.jar" id="org.jboss.tools.birt.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
@@ -43,6 +42,31 @@
<feature url="features/org.jboss.tools.vpe.test.feature_0.0.0.jar" id="org.jboss.tools.vpe.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.ws.test.feature_0.0.0.jar" id="org.jboss.tools.ws.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.ide.eclipse.archives.test.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.archives.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.ide.eclipse.as.test.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.as.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.birt.test.feature.source_0.0.0.jar" id="org.jboss.tools.birt.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.cdi.seam.test.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.seam.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.cdi.test.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<!-- TODO add central sources <feature url="features/org.jboss.tools.central.test.feature.source_0.0.0.jar" id="org.jboss.tools.central.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature> -->
+<feature url="features/org.jboss.tools.common.all.test.feature.source_0.0.0.jar" id="org.jboss.tools.common.all.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.project.examples.test.feature.source_0.0.0.jar" id="org.jboss.tools.project.examples.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.forge.test.feature.source_0.0.0.jar" id="org.jboss.tools.forge.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.ide.eclipse.freemarker.test.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.freemarker.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.hibernate.eclipse.test.feature.source_0.0.0.jar" id="org.hibernate.eclipse.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.jmx.test.feature.source_0.0.0.jar" id="org.jboss.tools.jmx.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.jsf.test.feature.source_0.0.0.jar" id="org.jboss.tools.jsf.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.jst.test.feature.source_0.0.0.jar" id="org.jboss.tools.jst.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.maven.test.feature.source_0.0.0.jar" id="org.jboss.tools.maven.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.openshift.express.test.feature.source_0.0.0.jar" id="org.jboss.tools.openshift.express.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.portlet.test.feature.source_0.0.0.jar" id="org.jboss.tools.portlet.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<!-- TODO: add <feature url="features/org.jboss.tools.runtime.test.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature> -->
+<feature url="features/org.jboss.tools.seam.test.feature.source_0.0.0.jar" id="org.jboss.tools.seam.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.struts.test.feature.source_0.0.0.jar" id="org.jboss.tools.struts.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.test.feature.source_0.0.0.jar" id="org.jboss.tools.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.usage.test.feature.source_0.0.0.jar" id="org.jboss.tools.usage.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<!-- TODO: add <feature url="features/org.jboss.tools.vpe.test.feature.source_0.0.0.jar" id="org.jboss.tools.vpe.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature> -->
+<feature url="features/org.jboss.tools.ws.test.feature.source_0.0.0.jar" id="org.jboss.tools.ws.test.feature.source" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+
<!-- These should be on a SOA Tooling tests site, so they can be used by downstream
<feature url="features/org.jboss.tools.bpel.test.feature_0.0.0.jar" id="org.jboss.tools.bpel.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.bpel.test.source.feature_0.0.0.jar" id="org.jboss.tools.bpel.test.source.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
12 years, 2 months
JBoss Tools SVN: r39853 - trunk/download.jboss.org/jbosstools/updates/requirements/gwt.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-27 12:59:39 -0400 (Tue, 27 Mar 2012)
New Revision: 39853
Modified:
trunk/download.jboss.org/jbosstools/updates/requirements/gwt/build.xml
Log:
JBIDE-11167 new GWT site for 2.5.2 including visual editor and windowbuilder
Modified: trunk/download.jboss.org/jbosstools/updates/requirements/gwt/build.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/requirements/gwt/build.xml 2012-03-27 16:47:05 UTC (rev 39852)
+++ trunk/download.jboss.org/jbosstools/updates/requirements/gwt/build.xml 2012-03-27 16:59:39 UTC (rev 39853)
@@ -21,14 +21,24 @@
<property name="compress" value="true" />
<p2.mirror>
- <repository location="file:${destination}/2.5.0.v201201120043-rel-r37" name="Google Plugin for Eclipse 3.7" />
+ <repository location="file:${destination}/2.5.2.v201202290255-rel-r37" name="Google Plugin for Eclipse 3.7" />
<source>
<repository location="${URL}" />
</source>
+ <!-- JBDS-1737: GPE and GWT SDK -->
<iu id="com.google.gdt.eclipse.suite.e37.feature.feature.group"/>
<iu id="com.google.gwt.eclipse.sdkbundle.e37.feature.feature.group"/>
+
+ <!-- JBIDE-11167: Windowbuilder and GDT Designer -->
+ <iu id="com.google.gdt.eclipse.designer.hosted.feature.feature.group"/>
+ <iu id="com.google.gdt.eclipse.designer.editor.feature.feature.group"/>
+ <iu id="com.google.gdt.eclipse.designer.gpe.feature.feature.group"/>
+ <iu id="org.eclipse.wb.core.feature.feature.group"/>
+ <iu id="org.eclipse.wb.css.feature.feature.group"/>
+ <iu id="org.eclipse.wb.core.xml.feature.feature.group"/>
+
<slicingOptions includeFeatures="true" followStrict="true" />
</p2.mirror>
- <p2.publish.featuresAndBundles metadataRepository="file:${destination}/2.5.0.v201201120043-rel-r37" artifactRepository="file:${destination}/2.5.0.v201201120043-rel-r37" publishartifacts="true" source="${destination}/2.5.0.v201201120043-rel-r37" compress="${compress}" />
+ <p2.publish.featuresAndBundles metadataRepository="file:${destination}/2.5.2.v201202290255-rel-r37" artifactRepository="file:${destination}/2.5.2.v201202290255-rel-r37" publishartifacts="true" source="${destination}/2.5.2.v201202290255-rel-r37" compress="${compress}" />
</target>
</project>
12 years, 2 months
JBoss Tools SVN: r39852 - branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-03-27 12:47:05 -0400 (Tue, 27 Mar 2012)
New Revision: 39852
Modified:
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
Log:
JBIDE-11406 fix default maven profiles
Modified: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java 2012-03-27 14:49:34 UTC (rev 39851)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java 2012-03-27 16:47:05 UTC (rev 39852)
@@ -470,13 +470,6 @@
if (projectExample.getDescription() != null) {
setDescription(ProjectExamplesActivator.getShortDescription(projectExample.getDescription()));
}
- ProjectImportConfiguration configuration = getImportConfiguration();
- if (configuration != null) {
- String profiles = projectExample.getDefaultProfiles();
- if (profiles != null && profiles.trim().length() > 0) {
- configuration.getResolverConfiguration().setActiveProfiles(profiles);
- }
- }
initDefaultValues();
}
}
Modified: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2012-03-27 14:49:34 UTC (rev 39851)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2012-03-27 16:47:05 UTC (rev 39852)
@@ -497,6 +497,13 @@
setDescription(ProjectExamplesActivator
.getShortDescription(projectExample.getDescription()));
}
+ ProjectImportConfiguration configuration = getImportConfiguration();
+ if (configuration != null) {
+ String profiles = projectExample.getDefaultProfiles();
+ if (profiles != null && profiles.trim().length() > 0) {
+ configuration.getResolverConfiguration().setActiveProfiles(profiles);
+ }
+ }
projectDescription = projectExample;
if (getContainer() != null) {
initialize();
12 years, 2 months
JBoss Tools SVN: r39851 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-27 10:49:34 -0400 (Tue, 27 Mar 2012)
New Revision: 39851
Modified:
trunk/build/publish.sh
Log:
if coretests/trunk doesn't exist under tools@filemgmt.jboss.org:/downloads_htdocs/tools/updates/nightly/, create it over sftp or simple mkdir -p
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2012-03-27 14:35:22 UTC (rev 39850)
+++ trunk/build/publish.sh 2012-03-27 14:49:34 UTC (rev 39851)
@@ -308,12 +308,7 @@
date
# create folders if not already there
if [[ ${DESTINATION##*@*:*} == "" ]]; then # user@server, do remote op
- seg="."
- for d in ${PUBLISHPATHSUFFIX/\// }; do
- seg=$seg/$d
- echo -e "mkdir ${seg:2}" | sftp $DESTINATION/builds/nightly/
- done
- seg=""
+ seg="."; for d in ${PUBLISHPATHSUFFIX/\// }; do seg=$seg/$d; echo -e "mkdir ${seg:2}" | sftp $DESTINATION/builds/nightly/; done; seg=""
else
mkdir -p $DESTINATION/builds/nightly/${PUBLISHPATHSUFFIX}
fi
@@ -438,7 +433,13 @@
# extra publish step for aggregate update sites ONLY
if [[ ${JOB_NAME/.aggregate} != ${JOB_NAME} ]]; then
if [[ ${PUBLISHPATHSUFFIX} ]]; then
- date; rsync -arzq --protocol=28 --delete ${STAGINGDIR}/all/repo/* $DESTINATION/updates/nightly/${PUBLISHPATHSUFFIX}/
+ # create folders if not already there
+ if [[ ${DESTINATION##*@*:*} == "" ]]; then # user@server, do remote op
+ seg="."; for d in ${PUBLISHPATHSUFFIX/\// }; do seg=$seg/$d; echo -e "mkdir ${seg:2}" | sftp $DESTINATION/updates/nightly/; done; seg=""
+ else
+ mkdir -p $DESTINATION/updates/nightly/${PUBLISHPATHSUFFIX}
+ fi
+ date; rsync -arzq --protocol=28 --delete ${STAGINGDIR}/all/repo/* $DESTINATION/updates/nightly/${PUBLISHPATHSUFFIX}/
else
date; rsync -arzq --protocol=28 --delete ${STAGINGDIR}/all/repo/* $DESTINATION/updates/nightly/${JOBNAMEREDUX}/
fi
12 years, 2 months
JBoss Tools SVN: r39850 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-03-27 10:35:22 -0400 (Tue, 27 Mar 2012)
New Revision: 39850
Modified:
trunk/build/publish.sh
Log:
if coretests/trunk doesn't exist under tools@filemgmt.jboss.org:/downloads_htdocs/tools/builds/nightly/, create it over sftp or simple mkdir -p
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2012-03-27 14:10:20 UTC (rev 39849)
+++ trunk/build/publish.sh 2012-03-27 14:35:22 UTC (rev 39850)
@@ -305,6 +305,18 @@
if [[ ${JOB_NAME/.aggregate} != ${JOB_NAME} ]]; then
echo "<meta http-equiv=\"refresh\" content=\"0;url=${BUILD_ID}-H${BUILD_NUMBER}/\">" > $tmpdir/latestBuild.html
if [[ ${PUBLISHPATHSUFFIX} ]]; then
+ date
+ # create folders if not already there
+ if [[ ${DESTINATION##*@*:*} == "" ]]; then # user@server, do remote op
+ seg="."
+ for d in ${PUBLISHPATHSUFFIX/\// }; do
+ seg=$seg/$d
+ echo -e "mkdir ${seg:2}" | sftp $DESTINATION/builds/nightly/
+ done
+ seg=""
+ else
+ mkdir -p $DESTINATION/builds/nightly/${PUBLISHPATHSUFFIX}
+ fi
date; rsync -arzq --protocol=28 --delete ${STAGINGDIR}/* $DESTINATION/builds/nightly/${PUBLISHPATHSUFFIX}/${BUILD_ID}-H${BUILD_NUMBER}/
# sftp only works with user@server, not with local $DESTINATIONS, so use rsync to push symlink instead
# echo -e "rm latest\nln ${BUILD_ID}-H${BUILD_NUMBER} latest" | sftp ${DESTINATIONREDUX}/builds/nightly/${PUBLISHPATHSUFFIX}/
12 years, 2 months