Community
Participate
Working Groups
There is currently no way, short of using StructureEdit to get at the actual links (wb-resource elements) that define a virtual component. This is necessary in order to instruct a server where to find various resources without copying.
What does your code look like now using structure edit?
Thank John, Here is the code snipplet from my PublishTask assembler. The fact that we create a link instead of making copy doesn't change the requirement. We need the ability to obtain the actual wb-resource elements so that we can do the assembling in a PublishTask. IProject proj = mod.getProject(); StructureEdit earStruct = StructureEdit.getStructureEditForRead(proj); try { StringBuffer buffer = new StringBuffer(); WorkbenchComponent earComp = earStruct.findComponentByName(mod.getName()); // ear entries generateApplicationEntries(earComp, buffer, monitor); // dependents entries EList children = earComp.getReferencedComponents(); for (Iterator itor=children.iterator(); itor.hasNext();) { ReferencedComponent childRef = (ReferencedComponent) itor.next(); WorkbenchComponent childCom = earStruct.findComponentByURI(childRef.getHandle()); generateDependentEntries(childCom, buffer, monitor); } } finally { earStruct.dispose(); } private void generateDependentEntries(WorkbenchComponent child, StringBuffer buffer, IProgressMonitor monitor) throws CoreException { // find dependent component of the ear IProject childProject = StructureEdit.getContainingProject(child); String name = child.getName(); // assume it is the same as URI // go thru all entries EList res = child.getResources(); for (Iterator itorRes = res.iterator(); itorRes.hasNext();) { ComponentResource childComp = (ComponentResource) itorRes.next(); IPath srcPath = childComp.getSourcePath(); IPath rtPath = childComp.getRuntimePath(); link(srcPath, rtPath); // we create softlinks instead of copying the entries. } }
*** Bug 284060 has been marked as a duplicate of this bug. ***