Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 62901 Details for
Bug 173433
WSDM Tooling: Ability to add service groups in MRT is missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to apply metadata for Content Rules
ServiceGroup_Metadata.patch (text/plain), 33.42 KB, created by
Saurabh Dravid
on 2007-04-04 05:53:25 EDT
(
hide
)
Description:
Patch to apply metadata for Content Rules
Filename:
MIME Type:
Creator:
Saurabh Dravid
Created:
2007-04-04 05:53:25 EDT
Size:
33.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.wsdm.editor >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/ServiceGroupInspector.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/ServiceGroupInspector.java,v >retrieving revision 1.7 >diff -u -r1.7 ServiceGroupInspector.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/ServiceGroupInspector.java 30 Mar 2007 14:30:13 -0000 1.7 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/ServiceGroupInspector.java 4 Apr 2007 09:51:39 -0000 >@@ -13,15 +13,16 @@ > package org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional; > > import java.io.ByteArrayInputStream; >-import java.io.IOException; > import java.io.InputStream; >-import java.net.URL; > import java.util.ArrayList; > import java.util.HashMap; >-import java.util.Iterator; > import java.util.List; > >-import org.apache.muse.tools.Activator; >+import javax.xml.namespace.QName; >+ >+import org.apache.muse.util.xml.XmlUtils; >+import org.apache.muse.ws.addressing.soap.SoapFault; >+import org.apache.muse.ws.resource.sg.WssgConstants; > import org.apache.ws.muse.descriptor.CapabilityType; > import org.apache.ws.muse.descriptor.DescriptorFactory; > import org.apache.ws.muse.descriptor.DocumentRoot; >@@ -31,36 +32,23 @@ > import org.apache.ws.muse.descriptor.ResourceTypeType; > import org.apache.ws.muse.descriptor.WsdlType; > import org.eclipse.core.resources.IFile; >-import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.emf.common.util.URI; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; >-import org.eclipse.emf.ecore.util.BasicExtendedMetaData; >-import org.eclipse.emf.ecore.util.ExtendedMetaData; >-import org.eclipse.emf.ecore.util.FeatureMap; >-import org.eclipse.emf.ecore.xml.type.AnyType; >-import org.eclipse.emf.ecore.xml.type.XMLTypeFactory; >-import org.eclipse.tptp.wsdm.model.MetadataDescriptor; >-import org.eclipse.tptp.wsdm.tooling.editor.capability.util.internal.MetaDataUtils; >-import org.eclipse.tptp.wsdm.tooling.editor.mrt.servicegroup.utils.internal.ServiceGroupUtils; > import org.eclipse.tptp.wsdm.tooling.editor.ui.internal.NewNameGenerator; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability; > import org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.ManageableResourceType; > import org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.ManageableResourceTypeFactory; > import org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.MembershipContentRuleType; >-import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.InitialValuesType; >-import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.MetadataDescriptorFactory; >-import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.PropertyType; >-import org.eclipse.tptp.wsdm.tooling.model.metadataDescriptor.impl.MetadataDescriptorFactoryImpl; >+import org.eclipse.tptp.wsdm.tooling.util.internal.CustomMrtResourceFactoryImpl; > import org.eclipse.tptp.wsdm.tooling.util.internal.EclipseUtils; >-import org.eclipse.tptp.wsdm.tooling.util.internal.IFile2Capability; > import org.eclipse.tptp.wsdm.tooling.util.internal.MrtUtils; >-import org.eclipse.tptp.wsdm.tooling.util.internal.RmdUtils; > import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmConstants; >-import org.eclipse.tptp.wsdm.tooling.util.internal.CustomMrtResourceFactoryImpl; >+import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog; >+import org.w3c.dom.Document; >+import org.w3c.dom.Element; > /** > * This class analyzes the given manageable resource type and provide an extra > * resource type for muse descriptor (ServiceGroupEntry), if manageable >@@ -76,14 +64,8 @@ > > private ResourceTypeType _serviceGroupEntryResorceType; > >- private ManageableResourceType _mrt; >- >- private ExtendedMetaData _extendedMetaData; >- > private ManageableResourceType _serviceGroupEntrymrt; > >- private List _fileLocation ; >- > private HashMap _prefixNamespaceMap; > > /** >@@ -95,8 +77,6 @@ > public ServiceGroupInspector(ManageableResourceType mrt,DocumentRoot root) > { > _root = root; >- _mrt = mrt; >- _extendedMetaData = createExtendedMetaData(); > } > > /** >@@ -107,46 +87,11 @@ > public ResourceTypeType inspect(Capability[] mrtCapabilities) > { > >- for(int i =0;i<mrtCapabilities.length;i++) >- { >- if(hasServiceGroupCapabilities(mrtCapabilities)) >- { >- addMandatoryFiles(); >- return createServiceGroupEntryResourceType(); >- } >- } >- >+ if(hasServiceGroupCapabilities(mrtCapabilities)) >+ return createServiceGroupEntryResourceType(); > return null; > } > >- private void addMandatoryFiles() >- { >- _fileLocation = new ArrayList(); >- boolean hasSGCapability = workspaceHasServiceGroupCapability(); >- boolean hasSGRmd = workspaceHasServiceGroupRMD(); >- try >- { >- if(hasSGCapability && hasSGRmd) >- { >- copyMemberRulesToRMD(); >- >- }else if(hasSGCapability && !hasSGRmd) >- { >- createRMDFile(); >- copyMemberRulesToRMD(); >- } >- else >- { >- createServiceGroupCapability(); >- createRMDFile(); >- copyMemberRulesToRMD(); >- } >- }catch (Exception ex) >- { >- ex.printStackTrace(); >- } >- >- } > private boolean hasServiceGroupCapabilities(Capability[] mrtCapabilities) > { > boolean hasServiceGroupCapability = false; >@@ -163,55 +108,6 @@ > return hasServiceGroupCapability && hasServiceGroupRegistration; > } > >- private void createRMDFile() >- { >- URL serviceGroupRMDURL = Activator.getDefault().getBundle().getEntry("artifacts/resourceTypes/ServiceGroupCapability.rmd"); >- try { >- InputStream is = serviceGroupRMDURL.openStream(); >- IFile serviceGroupRMDIFile = EclipseUtils.getIFile(_mrtParentDirName+"/ServiceGroupCapability.rmd"); >- >- if(!serviceGroupRMDIFile.exists()) >- { >- serviceGroupRMDIFile.create(is, true, new NullProgressMonitor()); >- } >- else >- { >- serviceGroupRMDIFile.setContents(is, IFile.FORCE, new NullProgressMonitor()); >- } >- >- _fileLocation.add(serviceGroupRMDIFile); >- } catch (Exception e) { >- // TODO Auto-generated catch block >- e.printStackTrace(); >- } >- >- } >- >- private IFile createServiceGroupCapability() >- { >- try { >- URL sgCapabilityURL = Activator.getDefault().getBundle().getEntry("artifacts/resourceTypes/ServiceGroupCapability.wsdl"); >- InputStream is = sgCapabilityURL.openStream(); >- IFile sgCapabilityIFile = EclipseUtils.getIFile(_mrtParentDirName+"/ServiceGroupCapability.mcap"); >- if(!sgCapabilityIFile.exists()) >- { >- sgCapabilityIFile.create(is, true, new NullProgressMonitor()); >- } >- else >- { >- sgCapabilityIFile.setContents(is, IFile.FORCE, new NullProgressMonitor()); >- } >- >- _fileLocation.add(sgCapabilityIFile); >- >- return sgCapabilityIFile; >- } catch (Exception e) { >- // TODO Auto-generated catch block >- e.printStackTrace(); >- } >- return null; >- } >- > /** > * Returns the initial instances > * @return InitialInstancesType[] >@@ -242,15 +138,11 @@ > { > createServiceGroupEntryMrt(); > _serviceGroupEntryResorceType = createServiceGroupEntryMuseResourceType(); >- _mrt.getImplements().remove(WsdmConstants.SERVICE_GROUP_CAPABILITY_LOCATION); >- _mrt.getImplements().add("platform:/resource"+_mrtParentDirName+"/ServiceGroupCapability.mcap"); >- saveMRTFile(_mrt); > return _serviceGroupEntryResorceType; > } > > private void createServiceGroupEntryMrt() > { >- //_serviceGroupEntrymrt = ManageableResourceTypeFactory.eINSTANCE.createManageableResourceType(); > org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.DocumentRoot documentRoot = ManageableResourceTypeFactory.eINSTANCE.createDocumentRoot(); > _serviceGroupEntrymrt = ManageableResourceTypeFactory.eINSTANCE.createManageableResourceType(); > documentRoot.setManageableResource(_serviceGroupEntrymrt); >@@ -322,113 +214,11 @@ > return resourceType; > } > >- private boolean workspaceHasServiceGroupCapability() >- { >- List fileList = ServiceGroupUtils.getFilesFromDirectory(_mrtParentDirName); >- for(Iterator iter = fileList.iterator();iter.hasNext();) >- { >- IFile file = (IFile) iter.next(); >- if(file.getFileExtension() == "mcap") >- { >- try >- { >- IFile2Capability file2Capability = new IFile2Capability(file); >- Capability capability = file2Capability.getCapability(); >- if(capability.getNamespace().equals(WsdmConstants.SERVICE_GROUP_NS)) >- { >- return true; >- } >- }catch(Exception e) >- { >- continue; >- } >- } >- } >- return false; >- } >- >- private boolean workspaceHasServiceGroupRMD() >- { >- List fileList = ServiceGroupUtils.getFilesFromDirectory(_mrtParentDirName); >- for(Iterator iter = fileList.iterator();iter.hasNext();) >- { >- IFile file = (IFile) iter.next(); >- if(file.getFileExtension() == "rmd") >- { >- try >- { >- if(RmdUtils.getDocumentRoot(file).getDefinitions().getTargetNamespace().equals(WsdmConstants.SERVICE_GROUP_NS)) >- return true; >- }catch(Exception e) >- { >- continue; >- } >- } >- } >- return false; >- } >- >- private void copyMemberRulesToRMD() throws CoreException >- { >- >- try { >- >- IFile file = EclipseUtils.getIFile(_mrtParentDirName+"/ServiceGroupCapability.mcap"); >- IFile2Capability file2Capability = new IFile2Capability(file); >- Capability sgCapability = file2Capability.getCapability(); >- MetadataDescriptor descriptor = sgCapability.getMetadata(); >- MetadataDescriptorFactory _rmdFactory = new MetadataDescriptorFactoryImpl(); >- >- >- List memberShipContentRuleList = _mrt.getMembershipContentRule(); >- InitialValuesType initialValuesType = _rmdFactory.createInitialValuesType(); >- >- for(int i = 0; i<memberShipContentRuleList.size();i++) >- { >- FeatureMap fm = initialValuesType.getAny(); >- String namespace = WsdmConstants.SERVICE_GROUP_NS; >- String name = "MembershipContentRule"; >- _prefixNamespaceMap = new HashMap(); >- AnyType anyType = XMLTypeFactory.eINSTANCE.createAnyType(); >- String xmlAttribute=""; >- String xmlNamespace = ""; >- String tns=""; >- MembershipContentRuleType rule = (MembershipContentRuleType) memberShipContentRuleList.get(i); >- for(Iterator iter = rule.getContentElements().iterator();iter.hasNext();) >- { >- String contentElements = (String)iter.next(); >- tns = getNamespace(contentElements); >- String localName = getLocalName(contentElements); >- preparePrfixNamespaceMap(tns); >- if(xmlAttribute.length() !=0) >- xmlAttribute = xmlAttribute + " " + (String)_prefixNamespaceMap.get(tns)+":"+ localName; >- else >- xmlAttribute =(String)_prefixNamespaceMap.get(tns)+":"+ localName; >- String xmlns = "xmlns:" + _prefixNamespaceMap.get(tns); >- EStructuralFeature pfx1Attribute = _extendedMetaData.demandFeature(null, xmlns, false); >- anyType.eSet(pfx1Attribute, tns); >- } >- EStructuralFeature memberShipContentRule = _extendedMetaData.demandFeature(namespace,name, true); >- fm.add(memberShipContentRule, anyType); >- EStructuralFeature contentElementsAttribute = _extendedMetaData.demandFeature(null, "ContentElements", false); >- anyType.eSet(contentElementsAttribute, xmlAttribute); >- } >- >- >- PropertyType propertyType = descriptor.getPropertyMetadata("MembershipContentRule", WsdmConstants.SERVICE_GROUP_NS); >- propertyType.setInitialValues(initialValuesType); >- MetaDataUtils.save(descriptor, new NullProgressMonitor()); >- >- } catch (Exception e){ >- e.printStackTrace(); >- } >- >- } >- > private String getNamespace(String contentElement) > { > return contentElement.substring(1,contentElement.lastIndexOf('}')); > } >+ > private void preparePrfixNamespaceMap(String contentElement) > { > if(!_prefixNamespaceMap.containsKey(contentElement)) >@@ -455,13 +245,7 @@ > { > return namespace.substring(namespace.lastIndexOf('}')+1); > } >- private ExtendedMetaData createExtendedMetaData() >- { >- ResourceSet resourceSet = new ResourceSetImpl(); >- ExtendedMetaData extendedMetaData = new BasicExtendedMetaData( >- resourceSet.getPackageRegistry()); >- return extendedMetaData; >- } >+ > /** > * This method will returns the extra generated ManageableResourceType object equivalent to ServiceGroupEntry. > */ >@@ -482,91 +266,33 @@ > */ > public void persistArtifacts() > { >- ResourceSet rs = new ResourceSetImpl(); >- byte[] rawNewMRT = MrtUtils.serializeMRT(_serviceGroupEntrymrt, rs, URI >- .createURI("dummy.xml"), true); >- InputStream stream = new ByteArrayInputStream(rawNewMRT); >- >- try >- { >- String serviceGroupMrt = _mrtParentDirName + "/" >- + "ServiceGroupEntry.mrt"; >- IFile serviceGroupMrtFile = EclipseUtils.getIFile(serviceGroupMrt); >- if (serviceGroupMrtFile.exists()) >+ try{ >+ ResourceSet rs = new ResourceSetImpl(); >+ rs.getResourceFactoryRegistry().getExtensionToFactoryMap() >+ .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new CustomMrtResourceFactoryImpl()); >+ String serviceGroupMrt = _mrtParentDirName + "/"+ "ServiceGroupEntry.mrt"; >+ URI uri = URI.createPlatformResourceURI(serviceGroupMrt); >+ byte[] rawNewMRT = MrtUtils.serializeMRT(_serviceGroupEntrymrt, rs, uri, true); >+ InputStream stream = new ByteArrayInputStream(rawNewMRT); >+ IFile subManagerMrtFile = EclipseUtils.getIFile(serviceGroupMrt); >+ if (subManagerMrtFile.exists()) > { >- serviceGroupMrtFile.setContents(stream, true, true, >- new NullProgressMonitor()); >+ subManagerMrtFile.setContents(stream, true, true, >+ new NullProgressMonitor()); > } > else > { >- serviceGroupMrtFile.create(stream, true, >- new NullProgressMonitor()); >- } >- try >- { >- stream.close(); >- } >- catch (IOException e) >- { >- // TODO Log >- e.printStackTrace(); >+ subManagerMrtFile.create(stream, true, >+ new NullProgressMonitor()); > } >+ stream.close(); > } >- catch (CoreException e) >+ catch(Exception e) > { >- // TODO Log > e.printStackTrace(); > } >- >- >- } >-/** >- * This method will remove the artifacts which are generated during the code generation time and should not be persisted >- * in the workspace even though user checks the Persisit Artifatcs Button. >- */ >- public void removeArtifacts() >- { >- if(_mrt.getImplements().contains("platform:/resource"+_mrtParentDirName+"/ServiceGroupCapability.mcap")) >- { >- _mrt.getImplements().remove("platform:/resource"+_mrtParentDirName+"/ServiceGroupCapability.mcap"); >- _mrt.getImplements().add(WsdmConstants.SERVICE_GROUP_CAPABILITY_LOCATION); >- saveMRTFile(_mrt); >- removeFiles(_fileLocation); >- } >- } >- >- private void saveMRTFile(ManageableResourceType mrt) >- { >- ResourceSet rs = new ResourceSetImpl(); >- rs.getResourceFactoryRegistry().getExtensionToFactoryMap() >- .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new CustomMrtResourceFactoryImpl()); >- URI uri = _mrt.eResource().getURI(); >- byte[] bytes = MrtUtils.serializeMRT(_mrt, rs, uri, false); >- try { >- IFile mrtFile = EclipseUtils.getIFile(uri.toString()); >- mrtFile.setContents(new ByteArrayInputStream(bytes), IFile.FORCE, null); >- } catch (Exception e) { >- e.printStackTrace(); >- } > } > >- private void removeFiles(List fileLocations) >- { >- if(fileLocations != null) >- { >- for(int i =0;i<fileLocations.size();i++) >- { >- IFile file = (IFile)fileLocations.get(i); >- try { >- file.delete(IFile.FORCE, new NullProgressMonitor()); >- } catch (CoreException e) >- { >- e.printStackTrace(); >- } >- } >- } >- } >- > /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given > * merged RMD document for it by having the rules/relationships in it. >@@ -574,5 +300,67 @@ > public void inspectMetadata(ManageableResourceType mrt, > org.apache.muse.ws.resource.metadata.MetadataDescriptor rmd) > { >+ >+ _prefixNamespaceMap = new HashMap(); >+ Capability[] mrtCapabilities = new Capability[0]; >+ try >+ { >+ mrtCapabilities = MrtUtils.getCapabilities(mrt); >+ } >+ catch (Exception e) >+ { >+ WsdmToolingLog.logError(e.getMessage(), e); >+ } >+ >+ if(hasServiceGroupCapabilities(mrtCapabilities)) >+ { >+ List membershipContentRule = mrt.getMembershipContentRule(); >+ List initialValues = new ArrayList(); >+ for(int i=0;i<membershipContentRule.size();i++) >+ { >+ MembershipContentRuleType rule = (MembershipContentRuleType) membershipContentRule.get(i); >+ Element value = createMembershipContentRuleElement(rule); >+ >+ initialValues.add(value); >+ } >+ if(!initialValues.isEmpty()); >+ try >+ { >+ rmd.setInitialValues(new QName(WssgConstants.NAMESPACE_URI,"MembershipContentRule"), initialValues); >+ } >+ catch (SoapFault e) >+ { >+ WsdmToolingLog.logError(e.getMessage(), e); >+ } >+ } >+ } >+ >+ private Element createMembershipContentRuleElement(MembershipContentRuleType rule) >+ { >+ Document document = XmlUtils.createDocument(); >+ Element membershipContentRuleElement = XmlUtils.createElement(document, new QName(WssgConstants.NAMESPACE_URI,"MembershipContentRule")); >+ List contentElements = rule.getContentElements(); >+ String contentElementAttribute=""; >+ >+ for(int i =0 ;i<contentElements.size();i++) >+ { >+ String contentElement = (String)contentElements.get(i); >+ String tns = getNamespace(contentElement); >+ String localName = getLocalName(contentElement); >+ preparePrfixNamespaceMap(tns); >+ >+ if(contentElementAttribute.length() !=0) >+ contentElementAttribute = contentElementAttribute + " " + (String)_prefixNamespaceMap.get(tns)+":"+ localName; >+ else >+ contentElementAttribute =(String)_prefixNamespaceMap.get(tns)+":"+ localName; >+ String xmlns = "xmlns:" + _prefixNamespaceMap.get(tns); >+ membershipContentRuleElement.setAttribute(xmlns,tns ); >+ >+ } >+ membershipContentRuleElement.setAttribute("ContentElements",contentElementAttribute ); >+ >+ return membershipContentRuleElement; >+ >+ > } > } >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtPreProcessor.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtPreProcessor.java,v >retrieving revision 1.6 >diff -u -r1.6 MrtPreProcessor.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtPreProcessor.java 30 Mar 2007 14:30:13 -0000 1.6 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtPreProcessor.java 4 Apr 2007 09:51:39 -0000 >@@ -236,18 +236,6 @@ > } > > /** >- * @see MrtInspector#removeArtifacts() >- */ >- public void removeArtifacts() >- { >- for(Iterator iter = _allInspectors.iterator();iter.hasNext();) >- { >- MrtInspector inspector = (MrtInspector) iter.next(); >- inspector.removeArtifacts(); >- } >- } >- >- /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given > * merged RMD document for it by having the rules/relationships in it. > */ >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MRTCodeGenerationDelegate.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MRTCodeGenerationDelegate.java,v >retrieving revision 1.7 >diff -u -r1.7 MRTCodeGenerationDelegate.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MRTCodeGenerationDelegate.java 3 Apr 2007 18:09:39 -0000 1.7 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MRTCodeGenerationDelegate.java 4 Apr 2007 09:51:38 -0000 >@@ -30,13 +30,10 @@ > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; >-import org.eclipse.emf.ecore.xmi.XMLResource; > import org.eclipse.tptp.wsdm.tooling.editor.dde.util.internal.DdeUtil; > import org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.ManageableResourceType; >-import org.eclipse.tptp.wsdm.tooling.nls.messages.dde.internal.Messages; > import org.eclipse.tptp.wsdm.tooling.util.internal.MrtUtils; > import org.eclipse.tptp.wsdm.tooling.util.internal.MyDescriptorResourceFactoryImpl; >-import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog; > > /** > * This class acts as a way during the Code Generation of MRT to capture doing WSDL >@@ -148,14 +145,6 @@ > } > > /** >- * @see CodeGenerationDelegate#removeArtifacts() >- */ >- public void removeArtifacts() >- { >- _mrtPreProcessor.removeArtifacts(); >- } >- >- /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given > * merged RMD document for it by having the rules/relationships in it. > */ >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/SubscriptionManagerInspector.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/SubscriptionManagerInspector.java,v >retrieving revision 1.5 >diff -u -r1.5 SubscriptionManagerInspector.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/SubscriptionManagerInspector.java 30 Mar 2007 14:30:13 -0000 1.5 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/SubscriptionManagerInspector.java 4 Apr 2007 09:51:39 -0000 >@@ -42,6 +42,7 @@ > import org.eclipse.tptp.wsdm.tooling.util.internal.MrtUtils; > import org.eclipse.tptp.wsdm.tooling.util.internal.WsdlUtils; > import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmConstants; >+import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog; > > /** > * This class analyzes the given manageable resource type and provide an extra >@@ -295,14 +296,12 @@ > } > catch (IOException e) > { >- // TODO Log >- e.printStackTrace(); >+ WsdmToolingLog.logError(e.getMessage(), e); > } > } > catch (CoreException e) > { >- // TODO Log >- e.printStackTrace(); >+ WsdmToolingLog.logError(e.getMessage(), e); > } > } > >@@ -322,10 +321,6 @@ > return _mrtParentDirName+"/SubscriptionManager.mrt"; > } > >- public void removeArtifacts() >- { >- } >- > /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given > * merged RMD document for it by having the rules/relationships in it. >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/NewProjectWizard.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/NewProjectWizard.java,v >retrieving revision 1.11 >diff -u -r1.11 NewProjectWizard.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/NewProjectWizard.java 27 Mar 2007 19:07:17 -0000 1.11 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/NewProjectWizard.java 4 Apr 2007 09:51:39 -0000 >@@ -205,7 +205,6 @@ > monitor.subTask(Messages.CODE_GEN_STEP4); > if(_shouldPersistArtifacts) > _codeGenerationDelegate.persistArtifacts(); >- _codeGenerationDelegate.removeArtifacts(); > monitor.worked(1); > } > finally >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtInspector.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtInspector.java,v >retrieving revision 1.4 >diff -u -r1.4 MrtInspector.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtInspector.java 30 Mar 2007 14:30:13 -0000 1.4 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/MrtInspector.java 4 Apr 2007 09:51:38 -0000 >@@ -60,10 +60,6 @@ > * This method should return the persistance location for extra generated ManageableResourceType object. > */ > String getExtraGeneratedMrtPersistanceLocation(); >- /** >- * This method will remove the file which are created during the code generation such as ServiceGrouypCapability.mcap. >- */ >- void removeArtifacts(); > > /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/CodeGenerationDelegate.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/CodeGenerationDelegate.java,v >retrieving revision 1.4 >diff -u -r1.4 CodeGenerationDelegate.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/CodeGenerationDelegate.java 30 Mar 2007 14:30:13 -0000 1.4 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/CodeGenerationDelegate.java 4 Apr 2007 09:51:38 -0000 >@@ -44,11 +44,6 @@ > void persistArtifacts(); > > /** >- * Removes the unwanted artifacts from the workspace which are created during code generation like ServiceGroupCapability.mcap and ServiceGroupCapability.rmd >- */ >- void removeArtifacts(); >- >- /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given > * merged RMD document for it by having the rules/relationships in it. > */ >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/BasicMrtInspector.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/BasicMrtInspector.java,v >retrieving revision 1.8 >diff -u -r1.8 BasicMrtInspector.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/BasicMrtInspector.java 2 Apr 2007 09:41:56 -0000 1.8 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/BasicMrtInspector.java 4 Apr 2007 09:51:38 -0000 >@@ -116,10 +116,6 @@ > return null; > } > >- public void removeArtifacts() >- { >- } >- > public void inspectMetadata(ManageableResourceType mrt, > MetadataDescriptor rmd) > { >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/RelationshipInspector.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/RelationshipInspector.java,v >retrieving revision 1.1 >diff -u -r1.1 RelationshipInspector.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/RelationshipInspector.java 30 Mar 2007 14:30:13 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/mrt/provisional/RelationshipInspector.java 4 Apr 2007 09:51:39 -0000 >@@ -240,21 +240,15 @@ > } > catch (IOException e) > { >- // TODO Log >- e.printStackTrace(); >+ WsdmToolingLog.logError(e.getMessage(), e); > } > } > catch (CoreException e) > { >- // TODO Log >- e.printStackTrace(); >+ WsdmToolingLog.logError(e.getMessage(), e); > } > } > >- public void removeArtifacts() >- { >- } >- > public void setMrtParentDirectory(String mrtParentDir) > { > _mrtParentDirName = mrtParentDir; >Index: src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/contentprovider/internal/MembershipContentProvider.java >=================================================================== >RCS file: src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/contentprovider/internal/MembershipContentProvider.java >diff -N src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/contentprovider/internal/MembershipContentProvider.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/contentprovider/internal/MembershipContentProvider.java 8 Mar 2007 14:59:17 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,75 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Balan Subramanian (bsubram@us.ibm.com) >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.tptp.wsdm.tooling.editor.mrt.servicegroup.contentprovider.internal; >- >-import java.util.List; >- >-import org.eclipse.jface.viewers.IStructuredContentProvider; >-import org.eclipse.jface.viewers.LabelProvider; >-import org.eclipse.jface.viewers.Viewer; >-import org.eclipse.swt.graphics.Image; >-/** >- * This class is the content provider for the TableViewer int the MemebershipRuleDialog class. >- * This will give the list of user selected QNames. >- * >- */ >-public class MembershipContentProvider implements IStructuredContentProvider >-{ >- >- /** >- * This method will retun the elements of type String to the table viewer. >- */ >- public Object[] getElements(Object inputElement) >- { >- List _qNames = (List) inputElement; >- return _qNames.toArray(); >- } >- >- public void dispose() >- { >- >- } >- >- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) >- { >- } >- public QNameContentLabelProvider getQNameContentLabelProvider () >- { >- return new QNameContentLabelProvider(); >- } >-} >-/** >- *This class is the LabelProvider for the TableViewer in MemebershipRuleDialog class. >- *This will return the text to be displayed in the TableViewer. >- */ >-class QNameContentLabelProvider extends LabelProvider >-{ >- >- >- public Image getImage(Object element) >- { >- >- return super.getImage(element); >- } >- >- /** >- * This method will return the QNames of the elements. >- */ >- public String getText(Object element) >- { >- String str = element.toString(); >- return str.substring(str.lastIndexOf('}')+1, str.length()); >- } >- >- >-} >Index: src/org/eclipse/tptp/wsdm/tooling/codegen/dd/internal/DDCodeGenerationDelegate.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/codegen/dd/internal/DDCodeGenerationDelegate.java,v >retrieving revision 1.7 >diff -u -r1.7 DDCodeGenerationDelegate.java >--- src/org/eclipse/tptp/wsdm/tooling/codegen/dd/internal/DDCodeGenerationDelegate.java 30 Mar 2007 14:30:13 -0000 1.7 >+++ src/org/eclipse/tptp/wsdm/tooling/codegen/dd/internal/DDCodeGenerationDelegate.java 4 Apr 2007 09:51:38 -0000 >@@ -31,15 +31,12 @@ > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; >-import org.eclipse.emf.ecore.xmi.XMLResource; > import org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.CodeGenerationDelegate; > import org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.DescriptorHelper; > import org.eclipse.tptp.wsdm.tooling.codegen.mrt.provisional.MrtPreProcessor; > import org.eclipse.tptp.wsdm.tooling.editor.dde.util.internal.DdeUtil; > import org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.ManageableResourceType; >-import org.eclipse.tptp.wsdm.tooling.nls.messages.dde.internal.Messages; > import org.eclipse.tptp.wsdm.tooling.util.internal.MyDescriptorResourceFactoryImpl; >-import org.eclipse.tptp.wsdm.tooling.util.internal.WsdmToolingLog; > > /** > * A Deployment Descriptor-specifc resolver. This will go through the Deployment >@@ -147,15 +144,6 @@ > DdeUtil.serializeDescriptorRoot(_ddRoot, fileURI); > } > >- public void removeArtifacts() >- { >- for(int i=0;i<_mrtPreProcessors.size();i++) >- { >- MrtPreProcessor mrtPreProcessor = (MrtPreProcessor) _mrtPreProcessors.get(i); >- mrtPreProcessor.removeArtifacts(); >- } >- } >- > /** > * Inspects the given manageable resource type for servicegroup/relationship kind of resource type and update the given > * merged RMD document for it by having the rules/relationships in it. >Index: src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/dialog/internal/ServiceGroupPropertyDialog.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/dialog/internal/ServiceGroupPropertyDialog.java,v >retrieving revision 1.5 >diff -u -r1.5 ServiceGroupPropertyDialog.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/dialog/internal/ServiceGroupPropertyDialog.java 30 Mar 2007 13:11:39 -0000 1.5 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/mrt/servicegroup/dialog/internal/ServiceGroupPropertyDialog.java 4 Apr 2007 09:51:40 -0000 >@@ -208,9 +208,11 @@ > for(int i =0;i<categoryArray.length;i++) > { > Category category = (Category) categoryArray[i]; >+ category.removeUnExposedCapabilities(); > CapabilityInfo[] capabilityInfoArray = category.getCapabilitiesInfo(); > for(int j =0;j<capabilityInfoArray.length;j++) > { >+ > Capability cap = (Capability) capabilityInfoArray[j].getCapability(); > if(_isEdit && cap.getProperties().size() >0) > editCapabilityList.add(cap);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 173433
:
60169
| 62901