Permalink
Browse files

moved to java 7

optimized capture logic (one EMF command execution, instead of N)
added some disk volume monitor code
started modelling dictionary
  • Loading branch information...
1 parent 0635b99 commit 3d7f2ce14d0524d6efc738dbe4ee30265ec9e2eb @gregjan gregjan committed Apr 23, 2012
Showing with 430 additions and 118 deletions.
  1. +1 −1 access-control.edit/META-INF/MANIFEST.MF
  2. +4 −4 crosswalk-gmf.diagram/META-INF/MANIFEST.MF
  3. +2 −2 crosswalk-gmf.edit/META-INF/MANIFEST.MF
  4. +2 −2 crosswalk-gmf.editor/META-INF/MANIFEST.MF
  5. +2 −2 crosswalk-gmf/META-INF/MANIFEST.MF
  6. +33 −7 crosswalk-gmf/model/crosswalk.ecore
  7. +5 −1 eclipse-repository/workbench.product
  8. +2 −2 mets.model.edit/META-INF/MANIFEST.MF
  9. +1 −1 mets.model/META-INF/MANIFEST.MF
  10. +25 −1 mets.model/src/gov/loc/mets/util/METSUtils.java
  11. +2 −2 mods.model.edit/META-INF/MANIFEST.MF
  12. +1 −1 mods.model.editor/META-INF/MANIFEST.MF
  13. +1 −1 mods.model/META-INF/MANIFEST.MF
  14. +9 −7 target-definition/indigo.target
  15. +2 −2 target-definition/pom.xml
  16. +1 −1 workbench_plugin/.classpath
  17. +97 −6 workbench_plugin/META-INF/MANIFEST.MF
  18. +14 −0 workbench_plugin/plugin.xml
  19. +1 −0 workbench_plugin/src/main/java/unc/lib/cdr/workbench/arrange/DivAdapterFactory.java
  20. +7 −4 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/CaptureJob.java
  21. +52 −52 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/OriginalsDecorator.java
  22. +3 −3 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/OriginalsLinkJob.java
  23. +26 −8 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/PickOriginalLocationsPage.java
  24. +1 −1 workbench_plugin/src/main/java/unc/lib/cdr/workbench/readonly/ReadOnlyWrapperStore.java
  25. +129 −0 workbench_plugin/src/main/java/unc/lib/cdr/workbench/readonly/VolumeUtil.java
  26. +1 −1 xlink.model.edit/META-INF/MANIFEST.MF
  27. +1 −1 xlink.model/.classpath
  28. +4 −4 xlink.model/.settings/org.eclipse.jdt.core.prefs
  29. +1 −1 xlink.model/META-INF/MANIFEST.MF
View
2 access-control.edit/META-INF/MANIFEST.MF
@@ -10,6 +10,6 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: edu.unc.lib.schemas.acl.provider
Require-Bundle: org.eclipse.core.runtime,
- access-control;visibility:=reexport,
+ access-control;bundle-version="4.0.0";visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport
Bundle-ActivationPolicy: lazy
View
8 crosswalk-gmf.diagram/META-INF/MANIFEST.MF
@@ -44,11 +44,11 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
org.eclipse.draw2d;visibility:=reexport,
org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
- crosswalk-gmf;visibility:=reexport,
+ crosswalk-gmf;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.ocl.ecore;visibility:=reexport,
org.eclipse.gef;visibility:=reexport,
- mods.model;visibility:=reexport,
- mods.model.edit;visibility:=reexport,
- crosswalk-gmf.edit
+ mods.model;bundle-version="0.0.0";visibility:=reexport,
+ mods.model.edit;bundle-version="0.0.0";visibility:=reexport,
+ crosswalk-gmf.edit;bundle-version="0.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
View
4 crosswalk-gmf.edit/META-INF/MANIFEST.MF
@@ -10,8 +10,8 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: crosswalk.provider
Require-Bundle: org.eclipse.core.runtime,
- crosswalk-gmf;visibility:=reexport,
+ crosswalk-gmf;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport,
org.eclipse.core.resources,
- mods.model.edit
+ mods.model.edit;bundle-version="0.0.0"
Bundle-ActivationPolicy: lazy
View
4 crosswalk-gmf.editor/META-INF/MANIFEST.MF
@@ -11,9 +11,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: crosswalk.presentation
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;visibility:=reexport,
- crosswalk-gmf.edit;visibility:=reexport,
+ crosswalk-gmf.edit;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
- mods.model.edit
+ mods.model.edit;bundle-version="0.0.0"
Bundle-ActivationPolicy: lazy
View
4 crosswalk-gmf/META-INF/MANIFEST.MF
@@ -14,5 +14,5 @@ Export-Package: crosswalk,
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.core.resources,
- mods.model,
- mets.model
+ mods.model;bundle-version="0.0.0",
+ mets.model;bundle-version="0.0.0"
View
40 crosswalk-gmf/model/crosswalk.ecore
@@ -121,6 +121,8 @@
unsettable="true" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="required" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ConversionStrategy" abstract="true"
interface="true">
@@ -131,15 +133,39 @@
<eOperations name="getOutputDataType" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EDataType"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DateToISO8601StringConversion" eSuperTypes="#//ConversionStrategy"/>
- <eClassifiers xsi:type="ecore:EClass" name="ElementBox" eSuperTypes="#//OutputElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- defaultValueLiteral="New Element Box"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="ports" upperBound="-1"
- eType="#//IOPort" containment="true"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Dictionary">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="blocks" upperBound="-1"
+ eType="#//MetadataBlock" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="vocabularies" upperBound="-1"
+ eType="#//Vocabulary" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="MetadataBlock" eSuperTypes="#//OutputElement">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="elements" upperBound="-1"
eType="#//MappedElement" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ports" upperBound="-1"
+ eType="#//InputField" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Vocabulary">
+ <eOperations name="getTerms" lowerBound="1">
+ <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap">
+ <eTypeArguments/>
+ <eTypeArguments/>
+ </eGenericType>
+ <eParameters name="broaderTerm" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getCompletions">
+ <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap">
+ <eTypeArguments/>
+ <eTypeArguments/>
+ </eGenericType>
+ <eParameters name="prefix" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="IOPort" eSuperTypes="#//Input #//Output">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="Label" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eClassifiers xsi:type="ecore:EClass" name="InputField" eSuperTypes="#//Output #//Input">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="label" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="usage" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
View
6 eclipse-repository/workbench.product
@@ -37,7 +37,7 @@ Biff Hollingsworth
<launcherArgs>
<programArgs>-consoleLog -data @user.home/curators-workspace</programArgs>
- <vmArgs>-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=128m -Xms128m -Xmx1024m -Djargon.debug=0</vmArgs>
+ <vmArgs>-Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=128m -Xms128m -Xmx1024m -Djargon.debug=0</vmArgs>
</launcherArgs>
<windowImages/>
@@ -55,6 +55,10 @@ Biff Hollingsworth
<intro introId="org.eclipse.ui.intro.universal"/>
<vm>
+ <linux include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</linux>
+ <macos include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</macos>
+ <solaris include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</solaris>
+ <windows include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</windows>
</vm>
<license>
View
4 mets.model.edit/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: gov.loc.mets.provider
Require-Bundle: org.eclipse.core.runtime,
- mets.model;visibility:=reexport,
+ mets.model;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport,
- xlink.model.edit;visibility:=reexport
+ xlink.model.edit;bundle-version="0.0.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
View
2 mets.model/META-INF/MANIFEST.MF
@@ -13,5 +13,5 @@ Export-Package: gov.loc.mets,
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
- xlink.model;visibility:=reexport
+ xlink.model;bundle-version="0.0.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
View
26 mets.model/src/gov/loc/mets/util/METSUtils.java
@@ -38,7 +38,10 @@
import java.net.FileNameMap;
import java.net.URI;
import java.net.URLConnection;
+import java.util.Collection;
import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
import java.util.UUID;
import javax.activation.MimetypesFileTypeMap;
@@ -56,6 +59,10 @@
MetsPackageImpl.init();
}
+ public static String makeXMLUUID(UUID rawuuid) {
+ return new StringBuilder().append("uuid_").append(rawuuid.toString()).toString();
+ }
+
public static String makeXMLUUID() {
return new StringBuilder().append("uuid_").append(UUID.randomUUID().toString()).toString();
}
@@ -64,7 +71,9 @@ public static DocumentRoot createInitialMetsDocument(String label) {
DocumentRoot result = MetsFactory.eINSTANCE.createDocumentRoot();
result.setMets(MetsFactory.eINSTANCE.createMetsType1());
MetsType m = result.getMets();
- m.setID(makeXMLUUID());
+ UUID uuid = UUID.randomUUID();
+ m.setID(makeXMLUUID(uuid));
+ m.setOBJID("info:fedora/uuid:"+uuid.toString());
m.setLABEL(label);
m.setPROFILE(METSConstants.MetsProfile_UNC_LIBRARIES);
m.setTYPE(METSConstants.MetsType_WORKBENCH);
@@ -287,4 +296,19 @@ public static boolean isContainer(DivType d) {
return false;
}
}
+
+ public static Collection<SmLinkType> getObjectLinks(DivType d) {
+ Set<SmLinkType> result = new HashSet<SmLinkType>();
+ try {
+ DocumentRoot r = (DocumentRoot)d.eResource().getContents().get(0);
+ for(SmLinkType sml : r.getMets().getStructLink().getSmLink()) {
+ if(d.equals(sml.getXlinkTo())) {
+ result.add(sml);
+ }
+ }
+ } catch(NullPointerException ignored) {
+ //ignored.printStackTrace();
+ }
+ return result;
+ }
}
View
4 mods.model.edit/META-INF/MANIFEST.MF
@@ -12,6 +12,6 @@ Export-Package: gov.loc.mods.mods.provider
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.edit;visibility:=reexport,
org.eclipse.emf.ecore;visibility:=reexport,
- mods.model;visibility:=reexport,
- xlink.model.edit;visibility:=reexport
+ mods.model;bundle-version="0.0.0";visibility:=reexport,
+ xlink.model.edit;bundle-version="0.0.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
View
2 mods.model.editor/META-INF/MANIFEST.MF
@@ -14,5 +14,5 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
- mods.model.edit
+ mods.model.edit;bundle-version="0.0.0"
Bundle-ActivationPolicy: lazy
View
2 mods.model/META-INF/MANIFEST.MF
@@ -13,4 +13,4 @@ Export-Package: gov.loc.mods.mods,
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
- xlink.model;visibility:=reexport
+ xlink.model;bundle-version="0.0.0";visibility:=reexport
View
16 target-definition/indigo.target
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>
+
<target name="eclipse 3.7.1 (indigo)" sequenceNumber="16">
- <locations>
- <location includeAllPlatforms="false" includeMode="planner" includeSource="false" type="InstallableUnit">
- <unit id="org.eclipse.rcp.source.feature.group" version="3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A"/>
- <unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.1.R37x_v20110907-7M7W8h8eNV4Vrz-hz01A7SL_MhZP"/>
- <unit id="org.eclipse.pde.feature.group" version="3.7.1.r37x_v20110810-0800-7b7qFVtFEx2XnmZ4jlM5mjM"/>
- <repository location="http://download.eclipse.org/releases/indigo"/>
- </location>
+<locations>
+<location includeAllPlatforms="false" includeMode="planner" includeSource="false" type="InstallableUnit">
+<unit id="org.eclipse.rcp.source.feature.group" version="3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A"/>
+<unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.1.R37x_v20110907-7M7W8h8eNV4Vrz-hz01A7SL_MhZP"/>
+<unit id="org.eclipse.pde.feature.group" version="3.7.1.r37x_v20110810-0800-7b7qFVtFEx2XnmZ4jlM5mjM"/>
+<repository location="http://download.eclipse.org/releases/indigo"/>
+</location>
</locations>
+<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
</target>
View
4 target-definition/pom.xml
@@ -30,9 +30,9 @@
<configuration>
<artifacts>
<artifact>
- <file>helios.target</file>
+ <file>indigo.target</file>
<type>target</type>
- <classifier>helios</classifier>
+ <classifier>indigo</classifier>
</artifact>
</artifacts>
</configuration>
View
2 workbench_plugin/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="src" path="src/main/resources/"/>
View
103 workbench_plugin/META-INF/MANIFEST.MF
@@ -8,16 +8,16 @@ Bundle-Vendor: UNC Libraries
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.300",
org.eclipse.core.filesystem;bundle-version="1.3.100",
org.eclipse.ui.navigator;bundle-version="3.5.100",
- crosswalk-gmf.diagram,
- mets.model.edit,
- mods.model.editor,
- irods-efs.plugin,
+ crosswalk-gmf.diagram;bundle-version="0.0.0",
+ mets.model.edit;bundle-version="0.0.0",
+ mods.model.editor;bundle-version="0.0.0",
+ irods-efs.plugin;bundle-version="0.0.0",
org.apache.commons.codec;bundle-version="1.3.0",
org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
- access-control.edit,
+ access-control.edit;bundle-version="0.0.0",
org.eclipse.ui.intro
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
lib/jargon-core-0.0.2.jar,
@@ -27,3 +27,94 @@ Bundle-ClassPath: .,
lib/xml-apis-1.3.04.jar,
lib/slf4j-api-1.6.0.jar
Import-Package: org.slf4j;version="0.0.0"
+Export-Package: .,
+ edu.sdsc.grid.io,
+ edu.sdsc.grid.io.irods,
+ edu.sdsc.grid.io.local,
+ javax.xml,
+ javax.xml.datatype,
+ javax.xml.namespace,
+ javax.xml.parsers,
+ javax.xml.transform,
+ javax.xml.transform.dom,
+ javax.xml.transform.sax,
+ javax.xml.transform.stream,
+ javax.xml.validation,
+ javax.xml.xpath,
+ license,
+ net.sf.saxon,
+ net.sf.saxon.charcode,
+ net.sf.saxon.codenorm,
+ net.sf.saxon.dom,
+ net.sf.saxon.event,
+ net.sf.saxon.expr,
+ net.sf.saxon.exslt,
+ net.sf.saxon.functions,
+ net.sf.saxon.instruct,
+ net.sf.saxon.number,
+ net.sf.saxon.om,
+ net.sf.saxon.pattern,
+ net.sf.saxon.pull,
+ net.sf.saxon.query,
+ net.sf.saxon.regex,
+ net.sf.saxon.sort,
+ net.sf.saxon.style,
+ net.sf.saxon.sxpath,
+ net.sf.saxon.tinytree,
+ net.sf.saxon.trace,
+ net.sf.saxon.trans,
+ net.sf.saxon.tree,
+ net.sf.saxon.type,
+ net.sf.saxon.value,
+ org.apache.xmlcommons,
+ org.irods.jargon.core.connection,
+ org.irods.jargon.core.exception,
+ org.irods.jargon.core.packinstr,
+ org.irods.jargon.core.protovalues,
+ org.irods.jargon.core.pub,
+ org.irods.jargon.core.pub.aohelper,
+ org.irods.jargon.core.pub.domain,
+ org.irods.jargon.core.pub.io,
+ org.irods.jargon.core.query,
+ org.irods.jargon.core.remoteexecute,
+ org.irods.jargon.core.rule,
+ org.irods.jargon.core.security,
+ org.irods.jargon.core.transfer,
+ org.irods.jargon.core.utils,
+ org.jdom,
+ org.jdom.adapters,
+ org.jdom.filter,
+ org.jdom.input,
+ org.jdom.output,
+ org.jdom.transform,
+ org.jdom.xpath,
+ org.slf4j,
+ org.slf4j.helpers,
+ org.slf4j.spi,
+ org.w3c.dom,
+ org.w3c.dom.bootstrap,
+ org.w3c.dom.css,
+ org.w3c.dom.events,
+ org.w3c.dom.html,
+ org.w3c.dom.ls,
+ org.w3c.dom.ranges,
+ org.w3c.dom.stylesheets,
+ org.w3c.dom.traversal,
+ org.w3c.dom.views,
+ org.w3c.dom.xpath,
+ org.xml.sax,
+ org.xml.sax.ext,
+ org.xml.sax.helpers,
+ unc.lib.cdr.workbench,
+ unc.lib.cdr.workbench.acl,
+ unc.lib.cdr.workbench.arrange,
+ unc.lib.cdr.workbench.capture,
+ unc.lib.cdr.workbench.commands,
+ unc.lib.cdr.workbench.describe,
+ unc.lib.cdr.workbench.preferences,
+ unc.lib.cdr.workbench.project,
+ unc.lib.cdr.workbench.rcp,
+ unc.lib.cdr.workbench.readonly,
+ unc.lib.cdr.workbench.stage,
+ unc.lib.cdr.workbench.views,
+ unc.lib.cdr.workbench.xwalk
View
14 workbench_plugin/plugin.xml
@@ -1102,6 +1102,9 @@
<contentExtension
pattern="workbench_plugin.stagedFileContent">
</contentExtension>
+ <contentExtension
+ pattern="workbench_plugin.commonFilterMetsLinks">
+ </contentExtension>
</includes>
</viewerContentBinding>
<viewerActionBinding
@@ -1256,6 +1259,17 @@
</or>
</triggerPoints>
</navigatorContent>
+ <commonFilter
+ activeByDefault="false"
+ description="This filter allows you to hide the link items, which are otherwise shown immediately under the divs where the links originate."
+ id="workbench_plugin.commonFilterMetsLinks"
+ name="Hide Links on Divs (METS smLink)">
+ <filterExpression>
+ <instanceof
+ value="gov.loc.mets.SmLinkType">
+ </instanceof>
+ </filterExpression>
+ </commonFilter>
</extension>
<extension
id="unc.lib.cdr.workbench.markers.Captured"
View
1 workbench_plugin/src/main/java/unc/lib/cdr/workbench/arrange/DivAdapterFactory.java
@@ -43,6 +43,7 @@ public Object getAdapter(Object adaptableObject, Class adapterType) {
// make a DivType into a IResource.
DivType d = (DivType) adaptableObject;
IProject project = MetsProjectNature.getProjectForMetsEObject(d);
+ if(project == null) return result;
if (d.getCONTENTIDS() != null && d.getCONTENTIDS().size() > 0) {
URI loc;
try {
View
11 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/CaptureJob.java
@@ -32,6 +32,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import javax.swing.ProgressMonitor;
@@ -179,7 +180,7 @@ protected IStatus run(IProgressMonitor monitor) {
if (mpn.getAutomaticStaging(project)) {
System.out.println("triggering build b/c auto staging says " + mpn.getAutomaticStaging(project));
- Job buildJob = new Job("") {
+ Job buildJob = new Job("Staging") {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -191,8 +192,9 @@ protected IStatus run(IProgressMonitor monitor) {
return new Status(Status.ERROR, Activator.PLUGIN_ID, "There was a problem running the staging process.", e);
}
return Status.OK_STATUS;
- }
+ }
};
+ buildJob.setUser(true);
buildJob.setPriority(Job.BUILD);
buildJob.schedule(1000);
} else {
@@ -316,16 +318,17 @@ private void makeOrLinkParent(IResource resource, DivType div) throws CoreExcept
*/
private DivType makeDiv(IResource c) throws CoreException {
DivType result = MetsFactory.eINSTANCE.createDivType();
+ UUID uuid = UUID.randomUUID();
List<String> contentIds = new ArrayList<String>();
contentIds.add(c.getLocationURI().toASCIIString());
+ contentIds.add("info:fedora/uuid:"+uuid.toString());
result.setCONTENTIDS(contentIds);
- result.setID(METSUtils.makeXMLUUID());
+ result.setID(METSUtils.makeXMLUUID(uuid));
result.setLABEL1(c.getName());
if (c instanceof IContainer) {
result.setTYPE(METSConstants.Div_Folder);
} else if (c instanceof IFile) {
result.setTYPE(METSConstants.Div_File);
-
// calc size and checksum.
IFileStore sourceFileStore = EFS.getStore(c.getLocationURI());
IFileInfo sourceFileInfo = sourceFileStore.fetchInfo();
View
104 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/OriginalsDecorator.java
@@ -18,9 +18,12 @@
import gov.loc.mets.DivType;
import gov.loc.mets.MdSecType;
import gov.loc.mets.MetsPackage;
+import gov.loc.mets.SmLinkType;
import gov.loc.mets.util.METSConstants;
+import gov.loc.mets.util.METSUtils;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -80,66 +83,63 @@ public void removeListener(ILabelProviderListener listener) {
public void decorate(Object element, IDecoration decoration) {
IResource r = null;
boolean isDiv = false;
- if (element instanceof IResource) {
- r = (IResource) element;
- } else if (element instanceof DivType) {
- isDiv = true;
- DivType d = (DivType) element;
- Object adapted = Platform.getAdapterManager().getAdapter(d, IResource.class);
- if (adapted != null && adapted instanceof IResource) {
- r = (IResource) adapted;
- }
- // described, crosswalked
- MetsProjectNature n = MetsProjectNature.getNatureForMetsObject(d);
- boolean userEdited = false;
- boolean crosswalked = false;
- for (MdSecType md : d.getDmdSec()) {
- if (md != null) {
- String st = md.getSTATUS();
- if (METSConstants.MD_STATUS_CROSSWALK_LINKED.equals(st)) {
- decoration.addOverlay(
- Icon.CrosswalkedDecor.getImageDescriptor(),
- IDecoration.BOTTOM_LEFT);
- } else if (METSConstants.MD_STATUS_USER_EDITED.equals(st)) {
- decoration.addOverlay(
- Icon.UserEditedDecor.getImageDescriptor(),
- IDecoration.TOP_RIGHT);
- } else if (METSConstants.MD_STATUS_CROSSWALK_USER_LINKED.equals(st)) {
- decoration.addOverlay(
- Icon.CrosswalkedDecor.getImageDescriptor(),
- IDecoration.BOTTOM_LEFT);
+ // added/captured, queued/staged BR
+ try {
+ List<String> labels = new ArrayList<String>();
+ if (element instanceof IResource) {
+ r = (IResource) element;
+ } else if (element instanceof DivType) {
+ isDiv = true;
+ DivType d = (DivType) element;
+ Object adapted = Platform.getAdapterManager().getAdapter(d, IResource.class);
+ if (adapted != null && adapted instanceof IResource) {
+ r = (IResource) adapted;
+ }
+ // described, crosswalked
+ // MetsProjectNature n = MetsProjectNature.getNatureForMetsObject(d);
+ boolean userEdited = false;
+ boolean crosswalked = false;
+ for (MdSecType md : d.getDmdSec()) {
+ if (md != null) {
+ String st = md.getSTATUS();
+ if (METSConstants.MD_STATUS_CROSSWALK_LINKED.equals(st)) {
+ decoration.addOverlay(Icon.CrosswalkedDecor.getImageDescriptor(), IDecoration.BOTTOM_LEFT);
+ } else if (METSConstants.MD_STATUS_USER_EDITED.equals(st)) {
+ decoration.addOverlay(Icon.UserEditedDecor.getImageDescriptor(), IDecoration.TOP_RIGHT);
+ } else if (METSConstants.MD_STATUS_CROSSWALK_USER_LINKED.equals(st)) {
+ decoration.addOverlay(Icon.CrosswalkedDecor.getImageDescriptor(), IDecoration.BOTTOM_LEFT);
+ }
}
}
- }
- for (MdSecType md : d.getMdSec()) { // process admin metadata overlays
- if (md != null) {
- if (MetsPackage.eINSTANCE.getAmdSecType_RightsMD().equals(md.eContainingFeature())) {
- decoration.addOverlay(Icon.ACLDecor.getImageDescriptor(),
- IDecoration.TOP_LEFT);
+ for (MdSecType md : d.getMdSec()) { // process admin metadata overlays
+ if (md != null) {
+ if (MetsPackage.eINSTANCE.getAmdSecType_RightsMD().equals(md.eContainingFeature())) {
+ decoration.addOverlay(Icon.ACLDecor.getImageDescriptor(), IDecoration.TOP_LEFT);
+ }
}
}
+ // add labels for links of which this div is the object
+ for(SmLinkType sml : METSUtils.getObjectLinks(d)) {
+ labels.add(METSConstants.getLinkForArcRole(sml.getArcrole()).label);
+ }
+
}
- }
-
- // added/captured, queued/staged BR
- try {
- List<String> labels = new ArrayList<String>();
ImageDescriptor overlay = null;
if (r != null && r.getProject() != null && r.getProject().isOpen()) {
boolean captured = false;
if (r.findMarkers(IResourceConstants.MARKER_CAPTURED, false, IResource.DEPTH_ZERO).length > 0) {
captured = true;
- if(!isDiv) {
+ if (!isDiv) {
labels.add("captured");
}
}
- if(!isDiv && r.getParent().equals(r.getProject().getFolder(MetsProjectNature.ORIGINALS_FOLDER_NAME))) {
+ if (!isDiv && r.getParent().equals(r.getProject().getFolder(MetsProjectNature.ORIGINALS_FOLDER_NAME))) {
IMarker[] m = r.findMarkers(IResourceConstants.MARKER_ORIGINALFILESET, false, IResource.DEPTH_ZERO);
- if(m.length > 0) {
+ if (m.length > 0) {
Object base = m[0].getAttribute("prestagedBase");
- if(base != null) {
- labels.add("prestaged => "+base);
+ if (base != null) {
+ labels.add("prestaged => " + base);
}
}
}
@@ -148,10 +148,10 @@ public void decorate(Object element, IDecoration decoration) {
overlay = Icon.StagedDecor.getImageDescriptor();
labels.add("staged");
} else {
- if(captured && r instanceof IFile) {
- overlay = Icon.CaptureDecor.getImageDescriptor();
- labels.add("queued");
- }
+ if (captured && r instanceof IFile) {
+ overlay = Icon.CaptureDecor.getImageDescriptor();
+ labels.add("queued");
+ }
}
} else {
if (isDiv) {
@@ -161,12 +161,12 @@ public void decorate(Object element, IDecoration decoration) {
if (overlay != null) {
decoration.addOverlay(overlay, IDecoration.BOTTOM_RIGHT);
}
- if(labels.size() > 0) {
- //decoration.setForegroundColor(org.eclipse.swt.graphics.);
+ if (labels.size() > 0) {
+ // decoration.setForegroundColor(org.eclipse.swt.graphics.);
StringBuilder sb = new StringBuilder();
sb.append(" [");
sb.append(labels.remove(0));
- for(String label : labels) {
+ for (String label : labels) {
sb.append(" ").append(label);
}
sb.append("]");
@@ -179,7 +179,7 @@ public void decorate(Object element, IDecoration decoration) {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org
* .eclipse.core.resources.IResourceChangeEvent)
*/
View
6 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/OriginalsLinkJob.java
@@ -16,11 +16,9 @@
package unc.lib.cdr.workbench.capture;
import java.net.URI;
-import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -41,6 +39,7 @@
import unc.lib.cdr.workbench.IResourceConstants;
import unc.lib.cdr.workbench.project.MetsProjectNature;
import unc.lib.cdr.workbench.readonly.ReadOnlyWrapperFileSystem;
+import unc.lib.cdr.workbench.readonly.VolumeUtil;
/**
* @author Gregory Jansen
@@ -82,7 +81,6 @@ protected IStatus run(IProgressMonitor monitor) {
System.out.println("starting link");
monitor.beginTask("Linking to originals ...", this.locations.size());
IFolder originalsFolder = this.project.getFolder(MetsProjectNature.ORIGINALS_FOLDER_NAME);
-
try {
for (URI location : locations) {
IFileStore fs = ReadOnlyWrapperFileSystem.wrapStore(location);
@@ -126,6 +124,8 @@ protected IStatus run(IProgressMonitor monitor) {
}
IMarker marker = link.createMarker(IResourceConstants.MARKER_ORIGINALFILESET);
marker.setAttribute("type", location.getScheme());
+ VolumeUtil.isVolumeRemovable(link);
+ VolumeUtil.recordVolumeFingerprint(link);
if (this.prestaged && this.prestagedBase != null && this.baselocation != null) {
// calculate staging base for each original location
IPath basePath = new Path(this.baselocation.getPath()); // base path for all locations
View
34 workbench_plugin/src/main/java/unc/lib/cdr/workbench/capture/PickOriginalLocationsPage.java
@@ -29,6 +29,7 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.provider.FileStore;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -69,7 +70,7 @@
/**
* @author Gregory Jansen
- *
+ *
*/
public class PickOriginalLocationsPage extends WizardPage implements Listener {
@@ -84,7 +85,7 @@
// A boolean to indicate if the user has typed anything
private boolean locationChanged = false;
- //private boolean prestagedChanged = false;
+ // private boolean prestagedChanged = false;
// widgets
private Combo locationField;
@@ -176,7 +177,7 @@ private String checkValidLocation() {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets .Composite)
*/
@Override
@@ -269,7 +270,7 @@ public void checkStateChanged(CheckStateChangedEvent event) {
/**
* Creates the import destination specification controls.
- *
+ *
* @param parent
* the parent control
*/
@@ -508,28 +509,45 @@ protected void handleDrivesBrowseButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SHEET);
dialog.setMessage("Select the location");
String locationstr = dialog.open();
- if(locationstr != null && locationstr.trim().length() > 0) {
+ if (locationstr != null && locationstr.trim().length() > 0) {
File f = new File(locationstr);
this.location = f.toURI();
}
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
@Override
public void handleEvent(Event event) {
Widget source = event.widget;
if (source == this.drivesBrowseButton) {
handleDrivesBrowseButtonPressed();
+ updateWidgets();
+ selectFirstCheckbox();
+ setMessage(null);
+ setPageComplete(true);
} else if (source == this.irodsBrowseButton) {
handleIrodsBrowseButtonPressed();
+ updateWidgets();
+ selectFirstCheckbox();
+ setMessage(null);
+ setPageComplete(true);
} else if (source == this.preStagedButton) {
handlePreStagedButtonPressed();
+ updateWidgets();
+ }
+ }
+
+ private void selectFirstCheckbox() {
+ if (this.fileTreeViewer.getInput() != null) {
+ FileStoreProvider.Root root = (FileStoreProvider.Root) this.fileTreeViewer.getInput();
+ if (root.roots != null && root.roots.length > 0) {
+ this.fileTreeViewer.setChecked(root.roots[0], true);
+ }
}
- updateWidgets();
}
/**
@@ -678,7 +696,7 @@ public boolean finish() {
/**
* @return
- *
+ *
*/
private List<URI> getSelectedLocations() {
List<URI> result = new ArrayList<URI>();
View
2 workbench_plugin/src/main/java/unc/lib/cdr/workbench/readonly/ReadOnlyWrapperStore.java
@@ -19,7 +19,7 @@
public class ReadOnlyWrapperStore implements IFileStore {
private static final String protectedMessage = "Operation cancelled. This file under read only protection within the workbench.";
- private static final String SCHEME_PREFIX = "ro+";
+ public static final String SCHEME_PREFIX = "ro+";
protected URI uri = null;
protected IFileStore wrapped = null;
View
129 workbench_plugin/src/main/java/unc/lib/cdr/workbench/readonly/VolumeUtil.java
@@ -0,0 +1,129 @@
+package unc.lib.cdr.workbench.readonly;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.FileStore;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.attribute.BasicFileAttributeView;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+
+import unc.lib.cdr.workbench.rcp.Activator;
+
+public class VolumeUtil {
+ public static final QualifiedName VOLUME_FINGERPRINT = new QualifiedName(Activator.PLUGIN_ID, "volume-fingerprint");
+ public static Set<String> removableFileStoreTypes = new HashSet<String>();
+
+ static {
+ //removableFileStoreTypes.add("");
+ }
+
+ public static boolean isVolumeRemovable(IResource r) throws CoreException {
+ FileStore fs = getFileStore(r);
+ String type = fs.type();
+ System.err.println("Is this a removable? type="+type);
+ return removableFileStoreTypes.contains(type);
+ }
+
+ public static void recordVolumeFingerprint(IResource resource) throws CoreException {
+ long fp = makeVolumeFingerprint(resource);
+ System.err.println("recording fingerprint: "+fp);
+ resource.setPersistentProperty(VOLUME_FINGERPRINT, String.valueOf(fp));
+ }
+
+ public static boolean isSameVolume(IResource resource) throws CoreException {
+ long fp = makeVolumeFingerprint(resource);
+ String prop = resource.getPersistentProperty(VOLUME_FINGERPRINT);
+ return (String.valueOf(fp).equals(prop));
+ }
+
+ /**
+ * Computes a fingerprint for the volume (FileStore) containing this resource based on the names and dates in the root directory.
+ * The fingerprint will include:
+ * volume root creation time (if available)
+ * volume root name
+ * volume root file key (if available)
+ * volume root's oldest constituent file's timestamp
+ *
+ * @param resource
+ * a resource
+ */
+ public static long makeVolumeFingerprint(IResource resource) throws CoreException {
+ FileStore fstore = getFileStore(resource);
+ try {
+ Path path = getPath(resource);
+ Path volumeRoot = findTopResourceInVolume(fstore, path);
+ System.err.println("Found volume root: " + volumeRoot);
+ long oldestFileCreation = -1;
+ File[] files = volumeRoot.toFile().listFiles();
+ if(files != null) {
+ for(File f : files) {
+ BasicFileAttributeView v = FileSystems.getDefault().provider().getFileAttributeView(f.toPath(), BasicFileAttributeView.class, LinkOption.NOFOLLOW_LINKS);
+ BasicFileAttributes basic = v.readAttributes();
+ long test = basic.creationTime().toMillis();
+ if(test > oldestFileCreation) {
+ oldestFileCreation = test;
+ }
+ }
+ }
+ String name = volumeRoot.toString();
+ System.err.println("Found volume root name: "+name);
+ if(fstore.supportsFileAttributeView("basic")) {
+ BasicFileAttributeView v = FileSystems.getDefault().provider().getFileAttributeView(volumeRoot, BasicFileAttributeView.class, LinkOption.NOFOLLOW_LINKS);
+ BasicFileAttributes basic = v.readAttributes();
+ System.err.println("Found volume root file key: "+basic.fileKey());
+ System.err.println("Found volume root create time: "+basic.creationTime());
+ long result = name.hashCode() ^ basic.fileKey().hashCode() ^ basic.creationTime().toMillis() ^ oldestFileCreation;
+ return result;
+ } else {
+ return name.hashCode() ^ oldestFileCreation;
+ }
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IO Exception while making unique volume key", e));
+ }
+ }
+
+ private static Path getPath(IResource dirty) {
+ Path result = null;
+ result = Paths.get(dirty.getLocation().toOSString());
+ return result;
+ }
+
+ private static Path findTopResourceInVolume(FileStore fstore, Path path) throws IOException {
+ Path parent = path.getParent();
+ if (parent == null) {
+ return path; // root will do for default file system
+ } else {
+ FileStore parentStore = FileSystems.getDefault().provider().getFileStore(parent);
+ if (fstore.equals(parentStore)) {
+ return findTopResourceInVolume(fstore, parent);
+ } else {
+ return path;
+ }
+ }
+ }
+
+ public static FileStore getFileStore(IResource resource) throws CoreException {
+ Path path = getPath(resource);
+ System.err.println(path.toUri());
+ try {
+ FileSystem fs = FileSystems.getDefault();
+ FileStore fstore = fs.provider().getFileStore(path);
+ return fstore;
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Unexpected I/O error", e));
+ }
+ }
+
+}
View
2 xlink.model.edit/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.w3._1999.xlink.provider
-Require-Bundle: xlink.model;visibility:=reexport,
+Require-Bundle: xlink.model;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
View
2 xlink.model/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
View
8 xlink.model/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
-#Tue Feb 21 13:53:59 EST 2012
+#Fri Mar 23 15:30:23 EDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
View
2 xlink.model/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 4.0.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.w3._1999.xlink,
org.w3._1999.xlink.impl,
org.w3._1999.xlink.util

0 comments on commit 3d7f2ce

Please sign in to comment.