Fixes for multiple Issues: 1. WorkspaceHelper -for the issues Chris was seeing. 2. TigerstripeResourceAdapterFactory – for the issue with Right click on Folders 3. ManagedEntityArtifact, Method and OssjEntitySpecifics – for the issue Dan found
diff --git a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/adapt/TigerstripeResourceAdapterFactory.java b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/adapt/TigerstripeResourceAdapterFactory.java index 6f09969..23d1f9e 100644 --- a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/adapt/TigerstripeResourceAdapterFactory.java +++ b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/adapt/TigerstripeResourceAdapterFactory.java
@@ -179,9 +179,9 @@ '.'), false, new NullProgressMonitor()); - if (artifact != null) + if (artifact != null && (adapterType.isInstance(artifact)) ) return artifact; - else { + try { if (folder.exists()) { IResource[] resources = folder.members(); @@ -197,7 +197,6 @@ .extractArtifact( reader, new NullProgressMonitor()); - return artifact; } finally { if (reader != null) { try { @@ -206,6 +205,10 @@ } } } + if (adapterType.isInstance(artifact)) + return artifact; + else + return null; } } } @@ -215,7 +218,7 @@ } return null; } - } + } catch (Exception e) { // This means we couldn't parse it. Must some kind of other // file (not pojo artifact)
diff --git a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/builder/WorkspaceHelper.java b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/builder/WorkspaceHelper.java index d1b2afc..4cd33cf 100644 --- a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/builder/WorkspaceHelper.java +++ b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/builder/WorkspaceHelper.java
@@ -69,13 +69,13 @@ if (resource instanceof IFile && localFilter.select(resource)) { switch (subDelta.getKind()) { case IResourceDelta.REMOVED: - itemsRemoved.add(delta.getResource()); + itemsRemoved.add(resource); break; case IResourceDelta.CHANGED: - itemsChanged.add(delta.getResource()); + itemsChanged.add(resource); break; case IResourceDelta.ADDED: - itemsAdded.add(delta.getResource()); + itemsAdded.add(resource); break; } }
diff --git a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ManagedEntityArtifact.java b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ManagedEntityArtifact.java index 7fad5c9..f65473f 100644 --- a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ManagedEntityArtifact.java +++ b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ManagedEntityArtifact.java
@@ -96,43 +96,43 @@ setIStandardSpecifics(specifics); } - @Override - public void resolveReferences(IProgressMonitor monitor) - throws TigerstripeException { - super.resolveReferences(monitor); - - // see Bug #53: duplicate logic with OssjEntitySpecifics - - // Extract the primary Key - // Tag tag = getFirstTagByName(getMarkingTag()); - // Properties props = tag.getProperties(); - // String fullQual = props.getProperty("primary-key", - // "java.lang.String"); - // this.primaryKey = new PrimaryKey(fullQual); - // - // Populate the derived entities now - // populateDerivedEntities(monitor); - - // Extract CRUD operations Options - try { - OssjEntitySpecifics specifics = (OssjEntitySpecifics) getIStandardSpecifics(); - specifics.setCRUDProperties(IOssjEntitySpecifics.CREATE, - PropertiesConstants.getPropertiesById(getTags(), - IOssjEntitySpecifics.CREATE_PROP_ID)); - specifics.setCRUDProperties(IOssjEntitySpecifics.GET, - PropertiesConstants.getPropertiesById(getTags(), - IOssjEntitySpecifics.GET_PROP_ID)); - specifics.setCRUDProperties(IOssjEntitySpecifics.SET, - PropertiesConstants.getPropertiesById(getTags(), - IOssjEntitySpecifics.SET_PROP_ID)); - specifics.setCRUDProperties(IOssjEntitySpecifics.DELETE, - PropertiesConstants.getPropertiesById(getTags(), - IOssjEntitySpecifics.REMOVE_PROP_ID)); - } catch (TigerstripeException e) { - TigerstripeRuntime.logErrorMessage("TigerstripeException detected", - e); - } - } +// @Override +// public void resolveReferences(IProgressMonitor monitor) +// throws TigerstripeException { +// super.resolveReferences(monitor); +// +// // see Bug #53: duplicate logic with OssjEntitySpecifics +// +// // Extract the primary Key +// // Tag tag = getFirstTagByName(getMarkingTag()); +// // Properties props = tag.getProperties(); +// // String fullQual = props.getProperty("primary-key", +// // "java.lang.String"); +// // this.primaryKey = new PrimaryKey(fullQual); +// // +// // Populate the derived entities now +// // populateDerivedEntities(monitor); +// +// // Extract CRUD operations Options +// try { +// OssjEntitySpecifics specifics = (OssjEntitySpecifics) getIStandardSpecifics(); +// specifics.setCRUDProperties(IOssjEntitySpecifics.CREATE, +// PropertiesConstants.getPropertiesById(getTags(), +// IOssjEntitySpecifics.CREATE_PROP_ID)); +// specifics.setCRUDProperties(IOssjEntitySpecifics.GET, +// PropertiesConstants.getPropertiesById(getTags(), +// IOssjEntitySpecifics.GET_PROP_ID)); +// specifics.setCRUDProperties(IOssjEntitySpecifics.SET, +// PropertiesConstants.getPropertiesById(getTags(), +// IOssjEntitySpecifics.SET_PROP_ID)); +// specifics.setCRUDProperties(IOssjEntitySpecifics.DELETE, +// PropertiesConstants.getPropertiesById(getTags(), +// IOssjEntitySpecifics.REMOVE_PROP_ID)); +// } catch (TigerstripeException e) { +// TigerstripeRuntime.logErrorMessage("TigerstripeException detected", +// e); +// } +// } public Properties getCreateProperties() { OssjEntitySpecifics specifics = (OssjEntitySpecifics) getIStandardSpecifics();
diff --git a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/Method.java b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/Method.java index 643ef00..c9b8e9c 100644 --- a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/Method.java +++ b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/Method.java
@@ -562,20 +562,20 @@ this.exceptions.add(exception); } - // Extract the method properties - try { - this.ossjMethodProperties = PropertiesConstants.getPropertiesById( - getTags(), EXPOSED_PROP_ID); - } catch (TigerstripeException e) { - // ignore exception. - // this means the POJO did not have any of the method options - // embedded in the comment. Anyway, the validateProperties() - // method in the finally clause, makes sure the default - // values are added anyway. - } finally { +// // Extract the method properties +// try { +// this.ossjMethodProperties = PropertiesConstants.getPropertiesById( +// getTags(), EXPOSED_PROP_ID); +// } catch (TigerstripeException e) { +// // ignore exception. +// // this means the POJO did not have any of the method options +// // embedded in the comment. Anyway, the validateProperties() +// // method in the finally clause, makes sure the default +// // values are added anyway. +// } finally { setDefaultFlavors(); setDefaultProperties(); - } +// } // Extract all the stereotypes extractStereotypes();
diff --git a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ossj/specifics/OssjEntitySpecifics.java b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ossj/specifics/OssjEntitySpecifics.java index 5548788..5b77d44 100644 --- a/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ossj/specifics/OssjEntitySpecifics.java +++ b/plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ossj/specifics/OssjEntitySpecifics.java
@@ -189,23 +189,23 @@ interfaceKeyProperties = keyIntfTag.getProperties(); } - // Extract CRUD operations Options - try { - - setCRUDProperties(IOssjEntitySpecifics.CREATE, - PropertiesConstants.getPropertiesById(getArtifact() - .getTags(), CREATE_PROP_ID)); - setCRUDProperties(IOssjEntitySpecifics.GET, PropertiesConstants - .getPropertiesById(getArtifact().getTags(), GET_PROP_ID)); - setCRUDProperties(IOssjEntitySpecifics.SET, PropertiesConstants - .getPropertiesById(getArtifact().getTags(), SET_PROP_ID)); - setCRUDProperties(IOssjEntitySpecifics.DELETE, - PropertiesConstants.getPropertiesById(getArtifact() - .getTags(), REMOVE_PROP_ID)); - } catch (TigerstripeException e) { - TigerstripeRuntime.logErrorMessage("TigerstripeException detected", - e); - } +// // Extract CRUD operations Options +// try { +// +// setCRUDProperties(IOssjEntitySpecifics.CREATE, +// PropertiesConstants.getPropertiesById(getArtifact() +// .getTags(), CREATE_PROP_ID)); +// setCRUDProperties(IOssjEntitySpecifics.GET, PropertiesConstants +// .getPropertiesById(getArtifact().getTags(), GET_PROP_ID)); +// setCRUDProperties(IOssjEntitySpecifics.SET, PropertiesConstants +// .getPropertiesById(getArtifact().getTags(), SET_PROP_ID)); +// setCRUDProperties(IOssjEntitySpecifics.DELETE, +// PropertiesConstants.getPropertiesById(getArtifact() +// .getTags(), REMOVE_PROP_ID)); +// } catch (TigerstripeException e) { +// TigerstripeRuntime.logErrorMessage("TigerstripeException detected", +// e); +// } // Extract the base type // Extract Extensibility flag