Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactored div delete, moved cascading METS deletes to specialized EM…

…F command

fixed redundant parent creation/capture for multiple sibling selections
removed extraneous log messages
  • Loading branch information...
commit 0635b99cf25cbb2e62e9ad05bbc58630ed8662b3 1 parent 70fb191
@gregjan gregjan authored
View
19 mets.model.edit/src/gov/loc/mets/provider/DivTypeItemProvider.java
@@ -24,10 +24,14 @@
import java.util.Collection;
import java.util.List;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -63,7 +67,20 @@ public DivTypeItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
- /**
+ @Override
+ protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature,
+ Collection<?> collection) {
+ return new RemoveDivTypeCommand(domain, owner, feature, collection);
+ }
+
+ @Override
+ protected Command createRemoveCommand(EditingDomain domain, EObject owner, EReference feature,
+ Collection<?> collection) {
+ // TODO Auto-generated method stub
+ return new RemoveDivTypeCommand(domain, owner, feature, collection);
+ }
+
+ /**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
View
92 mets.model.edit/src/gov/loc/mets/provider/RemoveDivTypeCommand.java
@@ -0,0 +1,92 @@
+package gov.loc.mets.provider;
+
+import gov.loc.mets.DivType;
+import gov.loc.mets.DocumentRoot;
+import gov.loc.mets.MdSecType;
+import gov.loc.mets.SmLinkType;
+import gov.loc.mets.util.METSConstants;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+public class RemoveDivTypeCommand extends RemoveCommand implements Command {
+
+ public RemoveDivTypeCommand(EditingDomain domain, EList<?> list, Collection<?> collection) {
+ super(domain, list, collection);
+ }
+
+ public RemoveDivTypeCommand(EditingDomain domain, EList<?> list, Object value) {
+ super(domain, list, value);
+ }
+
+ public RemoveDivTypeCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection<?> collection) {
+ super(domain, owner, feature, collection);
+ }
+
+ public RemoveDivTypeCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value) {
+ super(domain, owner, feature, value);
+ }
+
+ @Override
+ public void doExecute() {
+ for(Object o : this.getCollection()) {
+ DivType d = (DivType)o;
+ deleteMetadataSections(d);
+ deleteSmLinks(d);
+ TreeIterator<EObject> iter = d.eAllContents();
+ while (iter.hasNext()) {
+ EObject i = iter.next();
+ if (i instanceof DivType) {
+ DivType descendant = (DivType) i;
+ deleteMetadataSections(descendant);
+ deleteSmLinks(descendant);
+ }
+ }
+ }
+ super.doExecute();
+ }
+
+ /**
+ * Finds elements that are linked to in this DivType and adds them to the supplied list
+ *
+ * @param toDelete
+ * the list
+ * @param div
+ * the DivType with potential links
+ */
+ private void deleteMetadataSections(DivType div) {
+ for (MdSecType dmd : div.getDmdSec()) {
+ if (METSConstants.MD_STATUS_CROSSWALK_LINKED.equals(dmd.getSTATUS())) {
+ dmd.setSTATUS(METSConstants.MD_STATUS_CROSSWALK_NOT_LINKED);
+ }
+ if (METSConstants.MD_STATUS_CROSSWALK_USER_LINKED.equals(dmd.getSTATUS())) {
+ dmd.setSTATUS(METSConstants.MD_STATUS_CROSSWALK_NOT_LINKED);
+ } else if (METSConstants.MD_STATUS_USER_EDITED.equals(dmd.getSTATUS())) {
+ EcoreUtil.delete(dmd);
+ }
+ }
+ for (MdSecType md : div.getMdSec()) {
+ EcoreUtil.delete(md);
+ }
+ }
+
+ private void deleteSmLinks(DivType div) {
+ DocumentRoot root = (DocumentRoot)div.eResource().getContents().get(0);
+ for(SmLinkType l : root.getMets().getStructLink().getSmLink()) {
+ if(div.equals(l.getXlinkFrom())) {
+ EcoreUtil.delete(l);
+ }
+ if(div.equals(l.getXlinkTo())) {
+ EcoreUtil.delete(l);
+ }
+ }
+ }
+}
View
1  mets.model/src/gov/loc/mets/util/METSUtils.java
@@ -145,6 +145,7 @@ public static SmLinkType findLink(EObject s, String p, EObject o) {
}
}
MetsType mets = (MetsType)testMets;
+ if(mets.getStructLink() == null) return null;
for(SmLinkType l : mets.getStructLink().getSmLink()) {
if(l.getXlinkFrom().equals(s)) {
if(l.getXlinkTo().equals(o)) {
View
1  workbench_plugin/plugin.xml
@@ -126,7 +126,6 @@
name="Edit Access Control">
</command>
<command
- categoryId="workbench_plugin.categoryLink"
defaultHandler="unc.lib.cdr.workbench.commands.DivLinkHandler"
id="workbench_plugin.commandLink"
name="Link">
View
79 workbench_plugin/src/main/java/unc/lib/cdr/workbench/arrange/RemoveDivHandler.java
@@ -16,7 +16,9 @@
package unc.lib.cdr.workbench.arrange;
import gov.loc.mets.DivType;
+import gov.loc.mets.DocumentRoot;
import gov.loc.mets.MdSecType;
+import gov.loc.mets.SmLinkType;
import gov.loc.mets.util.METSConstants;
import gov.loc.mets.util.METSUtils;
@@ -32,9 +34,8 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.RemoveCommand;
@@ -49,7 +50,7 @@
/**
* @author Gregory Jansen
- *
+ *
*/
public class RemoveDivHandler extends AbstractHandler {
@@ -58,38 +59,32 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands. ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection select = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
for (Object o : select.toList()) {
- // find cascading deletes in this and children
if (o instanceof DivType) {
- Set<EObject> toDelete = new HashSet<EObject>();
DivType d = (DivType) o;
IProject project = MetsProjectNature.getProjectForMetsEObject(d);
- toDelete.add(d);
- addLinkedElements(toDelete, d);
removeCaptureMarker(d, project);
- TreeIterator<EObject> iter = d.eAllContents();
- while (iter.hasNext()) {
- EObject i = iter.next();
- if (i instanceof DivType) {
- DivType desc = (DivType) i;
- removeCaptureMarker(desc, project);
- addLinkedElements(toDelete, desc);
+ for(TreeIterator<EObject> iter = d.eAllContents(); iter.hasNext();) {
+ EObject eobj = iter.next();
+ if(DivType.class.isInstance(eobj)) {
+ removeCaptureMarker((DivType)eobj, project);
}
}
EditingDomain ed = MetsProjectNature.getEditingDomain(d);
+ Command cmd = RemoveCommand.create(ed, o);
try {
- Command cmd = RemoveCommand.create(ed, toDelete);
- ed.getCommandStack().execute(cmd);
+ if(cmd.canExecute()) {
+ ed.getCommandStack().execute(cmd);
+ }
} catch (NullPointerException e) {
- // ignore, item's parent probably removed
e.printStackTrace();
- }
+ }
}
}
return null;
@@ -104,16 +99,15 @@ private void removeCaptureMarker(DivType d, IProject project) {
String originalLoc = d.getCONTENTIDS().get(0);
try {
URI location = new URI(originalLoc);
- System.out.println("Trying to uncapture: " + originalLoc + "\nwith URI:" + location);
IResource r = null;
IResource[] found = null;
- if(METSUtils.isContainer(d)) {
+ if (METSUtils.isContainer(d)) {
found = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(location);
} else {
found = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(location);
}
- for(IResource f : found) {
- if(project.equals(f.getProject())) {
+ for (IResource f : found) {
+ if (project.equals(f.getProject())) {
r = f;
break;
}
@@ -121,51 +115,14 @@ private void removeCaptureMarker(DivType d, IProject project) {
if (r != null) {
r.deleteMarkers(IResourceConstants.MARKER_CAPTURED, true, r.DEPTH_ZERO);
} else {
- LOG.debug("Did not find resource for URI: " +location);
+ LOG.debug("Did not find resource for URI: " + location);
}
} catch (URISyntaxException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (CoreException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
// remove capture and stage markers with infinite depth
}
-
- /**
- * Finds elements that are linked to in this DivType and adds them to the supplied list
- *
- * @param toDelete
- * the list
- * @param div
- * the DivType with potential links
- */
- private void addLinkedElements(Set<EObject> toDelete, DivType div) {
- for (MdSecType dmd : div.getDmdSec()) {
- if (METSConstants.MD_STATUS_CROSSWALK_LINKED.equals(dmd.getSTATUS())) {
- dmd.setSTATUS(METSConstants.MD_STATUS_CROSSWALK_NOT_LINKED);
- }
- if (METSConstants.MD_STATUS_CROSSWALK_USER_LINKED.equals(dmd.getSTATUS())) {
- dmd.setSTATUS(METSConstants.MD_STATUS_CROSSWALK_NOT_LINKED);
- } else if (METSConstants.MD_STATUS_USER_EDITED.equals(dmd.getSTATUS())) {
- toDelete.add(dmd);
- }
- }
- for (MdSecType md : div.getMdSec()) {
- toDelete.add(md);
- }
- // No longer deleting File section on delete of Div
-// if (div.getFptr() != null) {
-// for (FptrType f : div.getFptr()) {
-// EObject ob = div.eResource().getEObject(f.getFILEID());
-// if (ob != null) {
-// toDelete.add(ob);
-// } else {
-// LOG.debug("Cannot find FILEID: " + f.getFILEID());
-// }
-// }
-// }
- }
}
View
1  workbench_plugin/src/main/java/unc/lib/cdr/workbench/arrange/RemoveSmLinkHandler.java
@@ -25,7 +25,6 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
if (sSelection.size() == 1) {
if (sSelection.getFirstElement() instanceof SmLinkType) {
SmLinkType link = (SmLinkType) sSelection.getFirstElement();
- System.out.println("about to execute on: " + link);
MetsProjectNature mpn = MetsProjectNature.getNatureForMetsObject(link);
Command c = RemoveCommand.create(mpn.getEditingDomain(), mpn.getMets().getStructLink(),
MetsPackage.eINSTANCE.getStructLinkType_SmLink(), link);
View
227 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/CaptureJob.java
@@ -23,6 +23,7 @@
import gov.loc.mets.MetsType;
import gov.loc.mets.util.METSConstants;
import gov.loc.mets.util.METSUtils;
+import irods.efs.plugin.Activator;
import java.text.Collator;
import java.util.ArrayList;
@@ -32,6 +33,8 @@
import java.util.List;
import java.util.Map;
+import javax.swing.ProgressMonitor;
+
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileStore;
@@ -48,6 +51,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.edit.command.AddCommand;
import unc.lib.cdr.workbench.IResourceConstants;
@@ -55,7 +59,7 @@
/**
* @author Gregory Jansen
- *
+ *
*/
public class CaptureJob extends Job {
private IProject project = null;
@@ -66,6 +70,8 @@
private MetsType m = null;
private DivType bag = null;
private IProgressMonitor monitor = null;
+ private CompoundCommand command = null;
+ private Map<IResource, DivType> localParentDivs = new HashMap<IResource, DivType>();
private static Comparator<IResource> resourceComparator = new Comparator<IResource>() {
@Override
@@ -110,7 +116,7 @@ public CaptureJob(String jobName, List<IResource> items) {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.resources.IResourceVisitor#visit(org.eclipse.core.resources.IResource)
*/
@Override
@@ -122,7 +128,7 @@ public boolean visit(IResource resource) throws CoreException {
/*
* if parent folders have been arranged, they will stay in their places, reset arrangement is separate! (non-Javadoc)
- *
+ *
* @seeorg.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime. IProgressMonitor)
*/
@Override
@@ -141,29 +147,58 @@ protected IStatus run(IProgressMonitor monitor) {
for (IResource r : items) {
r.accept(v);
}
- monitor.beginTask("Capturing " + v.count + " resources..", v.count);
+ String commandLabel = "Capturing " + v.count + " resources..";
+ monitor.beginTask(commandLabel, v.count);
+ command = new CompoundCommand(commandLabel);
// get METS object
mpn = (MetsProjectNature) project.getNature(MetsProjectNature.NATURE_ID);
m = mpn.getMets();
bag = METSUtils.findBagDiv(m);
- // recursion, yo
- captureSiblingList(items, topDestination, insertBefore);
+ Map<IResource, DivType> map = captureSiblingList(items);
+
+ if (topDestination == null) {
+ // create and add relevant parents (EMF Command for top node)
+ for(IResource r: items) {
+ if(map.containsKey(r)) {
+ makeOrLinkParent(r, map.get(r));
+ }
+ }
+ } else {
+ for(IResource r : items) {
+ if(map.containsKey(r)) {
+ // use EMF command to add item to topDestination
+ emfAdd(topDestination, map.get(r));
+ }
+ }
+ }
+ mpn.getCommandStack().execute(command);
project.getWorkspace().save(true, monitor);
- Map<String, String> params = new HashMap<String, String>();
- // if (auditPreviouslyStaged) {
- // params.put("audit", Boolean.TRUE);
- // }
- // log.debug("calling incremental build");
+
if (mpn.getAutomaticStaging(project)) {
- System.out.println("triggering build b/c auto staging says "+mpn.getAutomaticStaging(project));
- project.build(IncrementalProjectBuilder.FULL_BUILD, MetsProjectNature.STAGING_BUILDER_ID, params,
- new NullProgressMonitor());
+ System.out.println("triggering build b/c auto staging says " + mpn.getAutomaticStaging(project));
+ Job buildJob = new Job("") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ Map<String, String> params = new HashMap<String, String>();
+ try {
+ project.build(IncrementalProjectBuilder.FULL_BUILD, MetsProjectNature.STAGING_BUILDER_ID, params,
+ monitor);
+ } catch (CoreException e) {
+ return new Status(Status.ERROR, Activator.PLUGIN_ID, "There was a problem running the staging process.", e);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ buildJob.setPriority(Job.BUILD);
+ buildJob.schedule(1000);
} else {
- System.out.println("skipping build b/c auto staging says "+mpn.getAutomaticStaging(project));
+ System.out.println("skipping build b/c auto staging says " + mpn.getAutomaticStaging(project));
}
+
monitor.done();
return Status.OK_STATUS;
} catch (CoreException e) {
@@ -172,31 +207,58 @@ protected IStatus run(IProgressMonitor monitor) {
}
}
- private void captureSiblingList(List<IResource> list, DivType dest, DivType insert) throws CoreException {
+ /**
+ * Recursives captures a list of resources, returning a map of the top resource nodes to their DivTypes. Resources
+ * already captured are left in place, but their children are captured under them.
+ *
+ * @param list
+ * the resources to capture
+ * @param dest
+ * the parent to add these DivTypes to
+ * @return a map of captured resources (at this level) to DivTypes
+ * @throws CoreException
+ */
+ private Map<IResource, DivType> captureSiblingList(List<IResource> list) throws CoreException {
if (list.size() == 0)
- return;
- DivType sharedParent = null;
- if (dest == null) {
- sharedParent = findOrCaptureParent(list.get(0));
- } else {
- sharedParent = dest;
- }
+ return Collections.EMPTY_MAP;
+ Map<IResource, DivType> result = new HashMap<IResource, DivType>();
+
Collections.sort(list, resourceComparator);
for (IResource r : list) {
+ // first find or create this Div
DivType d = findDiv(r);
+ boolean newDiv = false;
if (d == null) {
- d = capture(r, sharedParent, insert);
+ newDiv = true;
+ d = makeDiv(r);
+ result.put(r, d);
+ // dest.getDiv().add(d);
} else {
System.out.println("previously captured: " + d);
}
if (r instanceof IContainer) {
+ // get children, and capture them
List<IResource> children = new ArrayList<IResource>();
IContainer c = (IContainer) r;
Collections.addAll(children, c.members());
- captureSiblingList(children, d, null);
+ Map<IResource, DivType> map = captureSiblingList(children);
+ for (IResource childRes : children) {
+ if (map.containsKey(childRes)) { // if we created a new Div
+ if (!newDiv) {
+ emfAdd(d, map.get(childRes));
+ } else {
+ d.getDiv().add(map.get(childRes));
+ }
+ }
+ }
}
}
- // TODO appended in alpha order, now sort the parent folder?
+ return result;
+ }
+
+ private void emfAdd(DivType d, DivType child) {
+ Command add = AddCommand.create(mpn.getEditingDomain(), d, MetsPackage.eINSTANCE.getDivType_Div(), child);
+ command.append(add);
}
private DivType findDiv(IResource r) throws CoreException {
@@ -218,93 +280,70 @@ private FileType findFile(IResource r) throws CoreException {
}
/**
+ * Finds and links to existing parent of resource or builds a parent and recurses.
+ *
* @param iResource
* @return
* @throws CoreException
*/
- private DivType findOrCaptureParent(IResource me) throws CoreException {
- if (mpn.getOriginalsFolder().equals(me.getParent())) {
- return this.bag;
- }
-
- DivType result = findDiv(me.getParent());
- if (result != null) {
- System.out.println("Found closest parent:" + result);
- return result;
- }
-
- // need to create parent, but first we need it's parent
- DivType parent = findOrCaptureParent(me.getParent());
- result = capture(me.getParent(), parent, null);
- // sort the parent folder?
- return result;
- }
-
- DivType capture(IResource me, DivType parent, DivType insertBefore) throws CoreException {
- monitor.subTask("Capturing " + me.getLocationURI());
- DivType result = MetsFactory.eINSTANCE.createDivType();
- // use an EMF command
- Command command = null;
- if (insertBefore != null && parent.getDiv().contains(insertBefore)) {
- int index = parent.getDiv().indexOf(insertBefore);
- command = AddCommand.create(mpn.getEditingDomain(), parent, MetsPackage.eINSTANCE.getDivType_Div(), result,
- index);
+ private void makeOrLinkParent(IResource resource, DivType div) throws CoreException {
+ DivType parent = null;
+ if (mpn.getOriginalsFolder().equals(resource.getParent()) || resource.getParent() == null) {
+ parent = this.bag;
} else {
- command = AddCommand.create(mpn.getEditingDomain(), parent, MetsPackage.eINSTANCE.getDivType_Div(), result);
+ parent = findDiv(resource.getParent());
}
- if (me instanceof IContainer) {
- fillFolderDiv(result, (IContainer) me);
- } else if (me instanceof IFile) {
- fillFileDiv(result, (IFile) me);
+ if (parent != null) {
+ // attach resource div to found parent
+ emfAdd(parent, div);
+ } else { // parent is not in METS doc
+ if(localParentDivs.containsKey(resource.getParent())) {
+ // parents were already made
+ localParentDivs.get(resource.getParent()).getDiv().add(div);
+ } else {
+ // make a parent, attach the child and keep going
+ parent = makeDiv(resource.getParent());
+ localParentDivs.put(resource.getParent(), parent);
+ parent.getDiv().add(div);
+ makeOrLinkParent(resource.getParent(), parent);
+ }
}
- mpn.getCommandStack().execute(command);
- monitor.worked(1);
- return result;
}
/**
* @param folderDiv
* @param c
*/
- private void fillFolderDiv(DivType folderDiv, IContainer c) throws CoreException {
+ private DivType makeDiv(IResource c) throws CoreException {
+ DivType result = MetsFactory.eINSTANCE.createDivType();
List<String> contentIds = new ArrayList<String>();
contentIds.add(c.getLocationURI().toASCIIString());
- folderDiv.setCONTENTIDS(contentIds);
- folderDiv.setID(METSUtils.makeXMLUUID());
- folderDiv.setLABEL1(c.getName());
- folderDiv.setTYPE(METSConstants.Div_Folder);
- IResourceConstants.setDivID(c, folderDiv.getID());
- }
+ result.setCONTENTIDS(contentIds);
+ result.setID(METSUtils.makeXMLUUID());
+ result.setLABEL1(c.getName());
+ if (c instanceof IContainer) {
+ result.setTYPE(METSConstants.Div_Folder);
+ } else if (c instanceof IFile) {
+ result.setTYPE(METSConstants.Div_File);
- /**
- * @param folderDiv
- * @param c
- */
- private void fillFileDiv(DivType div, IFile c) throws CoreException {
- List<String> contentIds = new ArrayList<String>();
- contentIds.add(c.getLocationURI().toASCIIString());
- div.setCONTENTIDS(contentIds);
- div.setID(METSUtils.makeXMLUUID());
- div.setLABEL1(c.getName());
- div.setTYPE(METSConstants.Div_File);
+ // calc size and checksum.
+ IFileStore sourceFileStore = EFS.getStore(c.getLocationURI());
+ IFileInfo sourceFileInfo = sourceFileStore.fetchInfo();
+ long size = sourceFileInfo.getLength();
- // calc size and checksum.
- IFileStore sourceFileStore = EFS.getStore(c.getLocationURI());
- IFileInfo sourceFileInfo = sourceFileStore.fetchInfo();
- long size = sourceFileInfo.getLength();
+ // find File section (for previously captured) or make one
+ FileType ft = findFile(c);
+ if (ft == null) {
+ ft = METSUtils.addFile(m, c.getLocationURI(), size, null);
+ IResourceConstants.setFileID(c, ft.getID());
+ }
- // find File section (for previously captured) or make one
- FileType ft = findFile(c);
- if (ft == null) {
- ft = METSUtils.addFile(m, c.getLocationURI(), size, null);
- IResourceConstants.setFileID(c, ft.getID());
+ FptrType fptr = MetsFactory.eINSTANCE.createFptrType();
+ fptr.setFILEID(ft.getID());
+ result.getFptr().add(fptr);
}
-
- FptrType fptr = MetsFactory.eINSTANCE.createFptrType();
- fptr.setFILEID(ft.getID());
- div.getFptr().add(fptr);
-
- IResourceConstants.setDivID(c, div.getID());
+ IResourceConstants.setDivID(c, result.getID());
+ return result;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.