You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(30) |
Jul
(74) |
Aug
(2) |
Sep
(91) |
Oct
(27) |
Nov
(77) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(175) |
Feb
(133) |
Mar
(94) |
Apr
(65) |
May
(108) |
Jun
(100) |
Jul
(46) |
Aug
(19) |
Sep
(145) |
Oct
(289) |
Nov
(134) |
Dec
(211) |
2003 |
Jan
(106) |
Feb
(269) |
Mar
(106) |
Apr
(202) |
May
(300) |
Jun
(83) |
Jul
(70) |
Aug
(217) |
Sep
(183) |
Oct
(292) |
Nov
(324) |
Dec
(117) |
2004 |
Jan
(318) |
Feb
(151) |
Mar
(64) |
Apr
(195) |
May
(279) |
Jun
(263) |
Jul
(280) |
Aug
(167) |
Sep
(91) |
Oct
(175) |
Nov
(34) |
Dec
(38) |
2005 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2006 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
2007 |
Jan
(2) |
Feb
(11) |
Mar
(1) |
Apr
(33) |
May
(13) |
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
(191) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(33) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(14) |
2009 |
Jan
(39) |
Feb
(6) |
Mar
(22) |
Apr
(31) |
May
(78) |
Jun
(74) |
Jul
(39) |
Aug
(22) |
Sep
(16) |
Oct
(32) |
Nov
(4) |
Dec
(5) |
2010 |
Jan
(1) |
Feb
|
Mar
(33) |
Apr
(45) |
May
(66) |
Jun
(63) |
Jul
(32) |
Aug
(56) |
Sep
(19) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
From: Xuan B. <med...@us...> - 2008-01-23 22:39:08
|
Update of /cvsroot/tm4j/tm4j In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23936 Modified Files: build.xml Log Message: Support for easier analysis of test failures. Index: build.xml =================================================================== RCS file: /cvsroot/tm4j/tm4j/build.xml,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** build.xml 22 Jan 2008 19:40:01 -0000 1.144 --- build.xml 23 Jan 2008 22:39:09 -0000 1.145 *************** *** 885,888 **** --- 885,891 ---- <sysproperty key="backends" value="${backends}"/> <test name="org.tm4j.topicmap.test.AllTests" outfile="testresult"/> + <!-- + <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> + --> <assertions> <enable/> *************** *** 1661,1665 **** <formatter type="plain"/> <!-- ! <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> --> <jvmarg value="-Dtestdir=resource/tests/"/> --- 1664,1668 ---- <formatter type="plain"/> <!-- ! <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> --> <jvmarg value="-Dtestdir=resource/tests/"/> |
From: Xuan B. <med...@us...> - 2008-01-23 22:38:22
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/merged In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23515/src/org/tm4j/topicmap/tmdm/merged Modified Files: MergedTopicMapView.java Log Message: Support for MergedOccurrence. Index: MergedTopicMapView.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/merged/MergedTopicMapView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MergedTopicMapView.java 22 Jan 2008 20:22:03 -0000 1.8 --- MergedTopicMapView.java 23 Jan 2008 22:38:26 -0000 1.9 *************** *** 86,91 **** protected Map<MergedAssociationKey,MergedAssociation> mergedAssociationByKey; ! protected Map<MergedAssociationKey,MergedAssociation> mergedAssociationRoleByKey; protected Map<MergedTopicNameKey,MergedTopicName> mergedTopicNameByKey; --- 86,92 ---- protected Map<MergedAssociationKey,MergedAssociation> mergedAssociationByKey; ! protected Map<MergedAssociationRoleKey,MergedAssociationRole> mergedAssociationRoleByKey; protected Map<MergedTopicNameKey,MergedTopicName> mergedTopicNameByKey; + protected Map<MergedOccurrenceKey,MergedOccurrence> mergedOccurrenceByKey; *************** *** 106,113 **** topicNameToMergedTopicName = createMap(); variantToMergedVariant = createMap(); ! occurrenceToMergedOccurrence = createMap(); mergedAssociationByKey = createMap(); mergedTopicNameByKey = createMap(); mergedTopicMap = new MergedTopicMap(this); --- 107,115 ---- topicNameToMergedTopicName = createMap(); variantToMergedVariant = createMap(); ! occurrenceToMergedOccurrence = createMap(); mergedAssociationByKey = createMap(); mergedTopicNameByKey = createMap(); + mergedOccurrenceByKey = createMap(); mergedTopicMap = new MergedTopicMap(this); *************** *** 915,918 **** --- 917,925 ---- } + protected void internalNotifyMergedOccurrenceCreated(MergedOccurrence occurrence) { + + getEventListener().notifyOccurrenceCreated(getMergedTopicMap(),occurrence.getParent(),occurrence); + } + protected void unindexKeys(Set<MergedAssociation> dependentAssociations,Set<MergedAssociationKey> dependentAssociationKeys) { *************** *** 1001,1004 **** --- 1008,1040 ---- } + protected void indexOccurrence(ReadableOccurrence occurrence,boolean notifyListener) { + MergedOccurrenceKey key = createOccurrenceKey(occurrence); + + MergedOccurrence mergedOccurrence = mergedOccurrenceByKey.get(key); + + if (mergedOccurrence==null) { + mergedOccurrence = new MergedOccurrence(/*getMergedTopicMap()*/this,/*mergedOccurrence.getParent(),*/key,occurrence); + mergedOccurrenceByKey.put(key,mergedOccurrence); + + if (notifyListener) { + internalNotifyMergedOccurrenceCreated(mergedOccurrence); + } + } else { + mergedOccurrence.addComponent(occurrence); + } + + MergedOccurrence oldValue = occurrenceToMergedOccurrence.put(occurrence,mergedOccurrence); + + assert oldValue==null; + + /* + FIXME: What if the components of the key change over time? + They do not change, but they may become invalid. + If a topic merges, for example, all its dependent keys should be reevaluated, as some dependent + keys may now be equal as well. + + */ + } + protected MergedAssociation getMergedAssociation(MergedAssociationKey key) { return mergedAssociationByKey.get(key); *************** *** 1132,1135 **** --- 1168,1175 ---- } + protected MergedOccurrenceKey createOccurrenceKey(ReadableOccurrence source) { + return new MergedOccurrenceKey(getMergedTopic(source.getParent()),getMergedTopic(source.getType()),source.getDatatype(),source.getValue(),createScopeKey(source.getScope())); + } + protected MergedScopeKey createScopeKey(ReadableScope scope) { return new MergedScopeKey(null); // FIXME *************** *** 1142,1145 **** --- 1182,1191 ---- } + public void notifyOccurrenceCreated(ReadableTopicMap topicMap,ReadableTopic topic,ReadableOccurrence occurrence) { + assert isRepresentedTopicMap(topicMap); + + indexOccurrence(occurrence,true); + } + public void notifyAssociationRoleCreated(ReadableTopicMap topicMap,ReadableAssociation association,ReadableAssociationRole associationRole) { assert isRepresentedTopicMap(topicMap); |
From: Xuan B. <med...@us...> - 2008-01-23 22:38:05
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/merged In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23113/src/org/tm4j/topicmap/tmdm/merged Modified Files: MergedOccurrenceKey.java MergedOccurrence.java Log Message: Support for MergedOccurrence.src/org/tm4j/topicmap/tmdm/merged/MergedTopicMapView.java Index: MergedOccurrenceKey.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/merged/MergedOccurrenceKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MergedOccurrenceKey.java 21 Jan 2008 20:00:27 -0000 1.2 --- MergedOccurrenceKey.java 23 Jan 2008 22:37:59 -0000 1.3 *************** *** 24,37 **** protected MergedTopic type; protected String value; // FIXME: variants missing - // FIXME: scope missing ! protected MergedOccurrenceKey(MergedTopic parent,MergedTopic type,String value,MergedScopeKey scope) { super(scope); ! this.parent = parent; ! this.type = type; ! this.value = value; // FIXME: register at MergedTopics --- 24,39 ---- protected MergedTopic type; + protected Locator datatype; + protected String value; // FIXME: variants missing ! protected MergedOccurrenceKey(MergedTopic parent,MergedTopic type,Locator datatype,String value,MergedScopeKey scope) { super(scope); ! this.parent = parent; ! this.type = type; ! this.datatype = datatype; ! this.value = value; // FIXME: register at MergedTopics *************** *** 52,60 **** public boolean equals(MergedOccurrenceKey o) { ! return parent.equals(o.parent)&&type.equals(o.type)&&value.equals(o.value)&&super.equals(o); } public int hashCode() { ! return parent.hashCode()^type.hashCode()^value.hashCode()^super.hashCode(); } --- 54,62 ---- public boolean equals(MergedOccurrenceKey o) { ! return parent.equals(o.parent)&&type.equals(o.type)&&datatype.equals(o.datatype)&&value.equals(o.value)&&super.equals(o); } public int hashCode() { ! return parent.hashCode()^type.hashCode()^datatype.hashCode()^value.hashCode()^super.hashCode(); } *************** *** 70,74 **** public String toString() { ! return "MergedOccurrenceKey("+parent+","+type+",\""+value+"\")"; } } --- 72,76 ---- public String toString() { ! return "MergedOccurrenceKey("+parent+","+type+","+datatype+",\""+value+"\")"; } } Index: MergedOccurrence.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/merged/MergedOccurrence.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MergedOccurrence.java 23 Jan 2008 00:07:53 -0000 1.3 --- MergedOccurrence.java 23 Jan 2008 22:37:59 -0000 1.4 *************** *** 18,26 **** public class MergedOccurrence extends MergedScopeable<ReadableOccurrence,MergedOccurrenceKey> implements ReadableOccurrence { ! protected MergedTopic parent; ! protected MergedOccurrence(MergedTopic parent,MergedOccurrenceKey key,Occurrence firstComponent) { ! super(parent.getContainer(),key,firstComponent); ! this.parent = parent; } --- 18,26 ---- public class MergedOccurrence extends MergedScopeable<ReadableOccurrence,MergedOccurrenceKey> implements ReadableOccurrence { ! //protected MergedTopic parent; ! protected MergedOccurrence(MergedTopicMapView container,MergedOccurrenceKey key,ReadableOccurrence firstComponent) { ! super(container,key,firstComponent); ! // this.parent = parent; } *************** *** 44,48 **** @TMDM public MergedTopic getParent() { ! return parent; } } --- 44,48 ---- @TMDM public MergedTopic getParent() { ! return getContainer().getMergedTopic(getRandomComponent().getParent()); } } |
From: Xuan B. <med...@us...> - 2008-01-23 21:32:52
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27805/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: ScopedObjectImpl.java Log Message: Implement ScopedObjectImpl.addTheme(). Index: ScopedObjectImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/ScopedObjectImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScopedObjectImpl.java 23 Jan 2008 21:27:07 -0000 1.2 --- ScopedObjectImpl.java 23 Jan 2008 21:32:44 -0000 1.3 *************** *** 66,70 **** */ public void addTheme(Topic theme) throws PropertyVetoException { ! throw new UnsupportedOperationException(); } --- 66,78 ---- */ public void addTheme(Topic theme) throws PropertyVetoException { ! try { ! getRepresentedObject().addScopingTopic(getContainer().externalToUnmerged(theme)); ! } catch (NullPointerException e) { ! if (theme==null) { ! throw new IllegalArgumentException("Null themes are not allowed, but some callers expect an IllegalArgumentException instead of a NullPointerException",e); ! } else { ! throw e; ! } ! } } |
From: Xuan B. <med...@us...> - 2008-01-23 21:27:03
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25579/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: ScopedObjectImpl.java Log Message: Implement ScopedObjectImpl.setScope(). Index: ScopedObjectImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/ScopedObjectImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScopedObjectImpl.java 21 Jan 2008 11:13:45 -0000 1.1 --- ScopedObjectImpl.java 23 Jan 2008 21:27:07 -0000 1.2 *************** *** 57,61 **** */ public void setScope(Topic[] scopingTopics) throws PropertyVetoException { ! throw new UnsupportedOperationException(); } --- 57,61 ---- */ public void setScope(Topic[] scopingTopics) throws PropertyVetoException { ! getRepresentedObject().replaceScope(getContainer().convertToInternalScope(scopingTopics)); } |
From: Xuan B. <med...@us...> - 2008-01-23 21:25:03
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24420/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicScopeable.java Log Message: Introduce Scopeable.replaceScope(). Index: BasicScopeable.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicScopeable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicScopeable.java 21 Jan 2008 11:13:44 -0000 1.1 --- BasicScopeable.java 23 Jan 2008 21:25:02 -0000 1.2 *************** *** 87,90 **** --- 87,101 ---- } + public void replaceScope(Scope newScope) { + replaceScope((BasicScope) newScope); + } + + public void replaceScope(BasicScope newScope) { + BasicScope oldScope = this.scope; + + this.scope = newScope; + + getEventListener().notifyScopeReplaced(getContainingTopicMap(),this,oldScope,newScope); + } /* |
From: Xuan B. <med...@us...> - 2008-01-23 21:25:03
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24420/src/org/tm4j/topicmap/tmdm Modified Files: TopicMapEventListener.java TopicMapEventAdapter.java Scopeable.java Log Message: Introduce Scopeable.replaceScope(). Index: TopicMapEventAdapter.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/TopicMapEventAdapter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TopicMapEventAdapter.java 23 Jan 2008 19:33:05 -0000 1.3 --- TopicMapEventAdapter.java 23 Jan 2008 21:25:02 -0000 1.4 *************** *** 47,50 **** --- 47,53 ---- } + public void notifyScopeReplaced(TM topicMap,Scopeable scopeable,Scope oldScope,Scope newScope) { + } + /** Notifies this listener after an occurrence has been created. Index: Scopeable.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/Scopeable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Scopeable.java 21 Jan 2008 11:13:44 -0000 1.1 --- Scopeable.java 23 Jan 2008 21:25:02 -0000 1.2 *************** *** 14,17 **** --- 14,19 ---- public boolean removeScopingTopic(Topic scopingTopic); + + public void replaceScope(Scope newScope); } Index: TopicMapEventListener.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/TopicMapEventListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TopicMapEventListener.java 23 Jan 2008 19:33:05 -0000 1.3 --- TopicMapEventListener.java 23 Jan 2008 21:25:02 -0000 1.4 *************** *** 37,40 **** --- 37,42 ---- public void notifyScopingTopicRemoved(TM topicMap,Scopeable scopeable,T scopingTopic); + public void notifyScopeReplaced(TM topicMap,Scopeable scopeable,Scope oldScope,Scope newScope); + /** Notifies this listener after an occurrence has been created. |
From: Xuan B. <med...@us...> - 2008-01-23 20:55:23
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12186/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: AssociationImpl.java Log Message: More support for unspecified association types. Index: AssociationImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/AssociationImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AssociationImpl.java 23 Jan 2008 20:40:25 -0000 1.4 --- AssociationImpl.java 23 Jan 2008 20:55:24 -0000 1.5 *************** *** 158,162 **** */ public void setType(Topic type) throws PropertyVetoException { ! getRepresentedObject().setType(getContainer().externalToUnmerged(type)); } --- 158,162 ---- */ public void setType(Topic type) throws PropertyVetoException { ! getRepresentedObject().setType((type!=null)?getContainer().externalToUnmerged(type):getContainer().getInternalUnspecifiedTopic()); } |
From: Xuan B. <med...@us...> - 2008-01-23 20:54:11
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11760/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicImpl.java TopicMapImpl.java Log Message: Support for default occurence type topic. Index: TopicImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TopicImpl.java 23 Jan 2008 20:30:40 -0000 1.9 --- TopicImpl.java 23 Jan 2008 20:54:15 -0000 1.10 *************** *** 455,459 **** public Occurrence createOccurrence(String id) throws DuplicateObjectIDException, PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().getInternalUnspecifiedTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),"",null))); // dummy, not allowed in TMDM } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 455,459 ---- public Occurrence createOccurrence(String id) throws DuplicateObjectIDException, PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().getInternalDefaultOccurenceTypeTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),"",null))); // dummy, not allowed in TMDM } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); *************** *** 463,467 **** public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 463,467 ---- public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createOccurrence((type!=null)?getContainer().externalToUnmerged(type):getContainer().getInternalDefaultOccurenceTypeTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); *************** *** 471,475 **** public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 471,475 ---- public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createOccurrence((type!=null)?getContainer().externalToUnmerged(type):getContainer().getInternalDefaultOccurenceTypeTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); Index: TopicMapImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapImpl.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TopicMapImpl.java 23 Jan 2008 20:30:40 -0000 1.17 --- TopicMapImpl.java 23 Jan 2008 20:54:15 -0000 1.18 *************** *** 66,69 **** --- 66,71 ---- protected org.tm4j.topicmap.tmdm.Topic unspecifiedTopic; + protected org.tm4j.topicmap.tmdm.Topic defaultOccurenceTypeTopic; + protected static HashMap<String,Boolean> defaultProperties = new HashMap<String,Boolean>(); *************** *** 149,152 **** --- 151,170 ---- } + protected org.tm4j.topicmap.tmdm.Topic getInternalDefaultOccurenceTypeTopic() { + if (defaultOccurenceTypeTopic==null) { + /* + this topic does not have properties, but this should be fine for now. + However, when having multiple merged topic maps, maybe the instances of the internal unspecified topic should merge, too? + */ + try { + defaultOccurenceTypeTopic = createInternalTopic(XTMPSI.OCCURRENCE); + } catch (LocatorFactoryException e) { + throw new RuntimeException("This should not happen.",e); + } + } + + return defaultOccurenceTypeTopic; + } + /** Having this method is good, as this method may evaluate faster than getInternalUnspecifiedTopic()==t, because: |
From: Xuan B. <med...@us...> - 2008-01-23 20:40:21
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5616/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: AssociationImpl.java Log Message: Use infrastructure for adding item identifiers by resource locators easily if these resource locators are supplied. Index: AssociationImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/AssociationImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssociationImpl.java 22 Jan 2008 21:47:20 -0000 1.3 --- AssociationImpl.java 23 Jan 2008 20:40:25 -0000 1.4 *************** *** 108,113 **** @SuppressWarnings("unchecked") public Member createMember(String id, Locator resourceLoc, Topic roleSpec,Collection players) throws DuplicateObjectIDException,PropertyVetoException,DuplicateResourceLocatorException { - assert resourceLoc==null; // not implemented - org.tm4j.topicmap.tmdm.Topic roleType; --- 108,111 ---- *************** *** 128,132 **** } ! return getContainer().unmergedToExternal(result); } --- 126,130 ---- } ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLoc,result)); } |
From: Xuan B. <med...@us...> - 2008-01-23 20:35:19
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3394/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicTopic.java Log Message: Do not assume that BasicTopic.occurrences!=null. We allow BasicTopic.occurrences==null (meaning an empty set) for (memory and CPU) performance reasons: Do it properly. Index: BasicTopic.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicTopic.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BasicTopic.java 23 Jan 2008 20:34:15 -0000 1.5 --- BasicTopic.java 23 Jan 2008 20:35:23 -0000 1.6 *************** *** 187,192 **** BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value,scope); ! if (topicNames==null) { ! topicNames = createSet(); } --- 187,192 ---- BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value,scope); ! if (occurrences==null) { ! occurrences = createSet(); } |
From: Xuan B. <med...@us...> - 2008-01-23 20:34:11
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2936/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicTopic.java Log Message: Do not assume that BasicTopic.occurrences!=null. We allow BasicTopic.occurrences==null (meaning an empty set) for (memory and CPU) performance reasons. Index: BasicTopic.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicTopic.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicTopic.java 23 Jan 2008 19:40:44 -0000 1.4 --- BasicTopic.java 23 Jan 2008 20:34:15 -0000 1.5 *************** *** 42,46 **** Set<Locator> subjectLocators; Set<Locator> subjectIdentifiers; ! Set<BasicOccurrence> occurrences; /** While rolesPlayed is specified in TMDM, it is redundant from a data completeness point of view. --- 42,46 ---- Set<Locator> subjectLocators; Set<Locator> subjectIdentifiers; ! Set<BasicOccurrence> occurrences; /** While rolesPlayed is specified in TMDM, it is redundant from a data completeness point of view. *************** *** 187,190 **** --- 187,194 ---- BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value,scope); + if (topicNames==null) { + topicNames = createSet(); + } + occurrences.add(occurrence); *************** *** 195,198 **** --- 199,204 ---- protected void internalRemove(BasicOccurrence occurrence) { + assert occurrences!=null; + boolean success = occurrences.remove(occurrence); |
From: Xuan B. <med...@us...> - 2008-01-23 20:30:37
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1186/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicImpl.java TopicMapImpl.java TopicMapObjectImpl.java Log Message: Infrastructure for adding item identifiers by resource locators easily if these resource locators are supplied. Index: TopicImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TopicImpl.java 23 Jan 2008 20:21:45 -0000 1.8 --- TopicImpl.java 23 Jan 2008 20:30:40 -0000 1.9 *************** *** 462,469 **** public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { - assert resourceLocator==null; // not supported - try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 462,467 ---- public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); *************** *** 472,479 **** public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { - assert resourceLocator==null; // not supported - try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 470,475 ---- public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); Index: TopicMapObjectImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapObjectImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TopicMapObjectImpl.java 23 Jan 2008 20:17:43 -0000 1.4 --- TopicMapObjectImpl.java 23 Jan 2008 20:30:41 -0000 1.5 *************** *** 378,381 **** --- 378,395 ---- } + protected <T extends TopicMapConstruct> T maybeAddID(String id,Locator resourceLocator,T tmo) throws DuplicateObjectIDException,DuplicateResourceLocatorException { + maybeAddID(id,tmo); + + if (resourceLocator!=null) { + try { + tmo.addItemIdentifier(resourceLocator); + } catch (org.tm4j.topicmap.tmdm.DuplicateItemIdentifierException e) { + throw new DuplicateResourceLocatorException(e); + } + } + + return tmo; + } + public String toString() { return "TopicMapObjectImpl[sourceLocators="+getSourceLocators()+"]"; Index: TopicMapImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapImpl.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TopicMapImpl.java 23 Jan 2008 20:17:43 -0000 1.16 --- TopicMapImpl.java 23 Jan 2008 20:30:40 -0000 1.17 *************** *** 422,428 **** */ public Association createAssociation(String id, org.tm4j.net.Locator resourceLocator,Topic type, Topic[] themes) throws DuplicateObjectIDException, DuplicateResourceLocatorException,PropertyVetoException { ! assert resourceLocator==null; // not implemented ! ! return unmergedToExternal(maybeAddID(id,getRepresentedObject().createAssociation(type!=null?(((TopicImpl) type).getRepresentedObject()):getInternalUnspecifiedTopic(),convertToInternalScope(themes)))); } --- 422,426 ---- */ public Association createAssociation(String id, org.tm4j.net.Locator resourceLocator,Topic type, Topic[] themes) throws DuplicateObjectIDException, DuplicateResourceLocatorException,PropertyVetoException { ! return unmergedToExternal(maybeAddID(id,resourceLocator,getRepresentedObject().createAssociation(type!=null?(((TopicImpl) type).getRepresentedObject()):getInternalUnspecifiedTopic(),convertToInternalScope(themes)))); } |
From: Xuan B. <med...@us...> - 2008-01-23 20:21:42
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29956/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicImpl.java Log Message: Use infrastructure for adding item identifiers by supplying id Strings. Index: TopicImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TopicImpl.java 23 Jan 2008 19:49:28 -0000 1.7 --- TopicImpl.java 23 Jan 2008 20:21:45 -0000 1.8 *************** *** 339,345 **** */ public BaseName createName(String id, String nameString) throws DuplicateObjectIDException, PropertyVetoException { ! assert id==null; // currently not implemented ! ! return getContainer().unmergedToExternal(getRepresentedObject().createTopicName(nameString,null)); } --- 339,343 ---- */ public BaseName createName(String id, String nameString) throws DuplicateObjectIDException, PropertyVetoException { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createTopicName(nameString,null))); } *************** *** 359,363 **** */ public BaseName createName(String id, String nameString, Topic[] scope) throws DuplicateObjectIDException, PropertyVetoException { ! return getContainer().unmergedToExternal(getRepresentedObject().createTopicName(nameString,getContainer().convertToInternalScope(scope))); // return createName(id,nameString,(TopicImpl[]) scope); } --- 357,361 ---- */ public BaseName createName(String id, String nameString, Topic[] scope) throws DuplicateObjectIDException, PropertyVetoException { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createTopicName(nameString,getContainer().convertToInternalScope(scope)))); // return createName(id,nameString,(TopicImpl[]) scope); } *************** *** 456,463 **** */ public Occurrence createOccurrence(String id) throws DuplicateObjectIDException, PropertyVetoException { - assert id==null; // not supported - try { ! return getContainer().unmergedToExternal(getRepresentedObject().createOccurrence(getContainer().getInternalUnspecifiedTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),"",null)); // dummy, not allowed in TMDM } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 454,459 ---- */ public Occurrence createOccurrence(String id) throws DuplicateObjectIDException, PropertyVetoException { try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().getInternalUnspecifiedTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),"",null))); // dummy, not allowed in TMDM } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); *************** *** 466,474 **** public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { - assert id==null; // not supported assert resourceLocator==null; // not supported try { ! return getContainer().unmergedToExternal(getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 462,469 ---- public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { assert resourceLocator==null; // not supported try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); *************** *** 477,485 **** public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { - assert id==null; // not supported assert resourceLocator==null; // not supported try { ! return getContainer().unmergedToExternal(getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 472,479 ---- public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { assert resourceLocator==null; // not supported try { ! return getContainer().unmergedToExternal(maybeAddID(id,getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes)))); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); |
From: Xuan B. <med...@us...> - 2008-01-23 20:17:41
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28261/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicMapImpl.java TopicMapObjectImpl.java Log Message: Infrastructure for adding item identifiers by id Strings easily if these id Strings are supplied. Index: TopicMapObjectImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapObjectImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TopicMapObjectImpl.java 22 Jan 2008 20:12:15 -0000 1.3 --- TopicMapObjectImpl.java 23 Jan 2008 20:17:43 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- import org.tm4j.topicmap.tmdm.DuplicateItemIdentifierException; + import org.tm4j.topicmap.tmdm.TopicMapConstruct; *************** *** 369,372 **** --- 370,381 ---- } + protected <T extends TopicMapConstruct> T maybeAddID(String id,T tmo) throws DuplicateObjectIDException { + if (id!=null) { + getContainer().addIdTo(tmo,id); + } + + return tmo; + } + public String toString() { return "TopicMapObjectImpl[sourceLocators="+getSourceLocators()+"]"; Index: TopicMapImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapImpl.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TopicMapImpl.java 23 Jan 2008 19:35:38 -0000 1.15 --- TopicMapImpl.java 23 Jan 2008 20:17:43 -0000 1.16 *************** *** 422,429 **** */ public Association createAssociation(String id, org.tm4j.net.Locator resourceLocator,Topic type, Topic[] themes) throws DuplicateObjectIDException, DuplicateResourceLocatorException,PropertyVetoException { - assert id==null; // not implemented assert resourceLocator==null; // not implemented ! return unmergedToExternal(getRepresentedObject().createAssociation(type!=null?(((TopicImpl) type).getRepresentedObject()):getInternalUnspecifiedTopic(),convertToInternalScope(themes))); } --- 422,428 ---- */ public Association createAssociation(String id, org.tm4j.net.Locator resourceLocator,Topic type, Topic[] themes) throws DuplicateObjectIDException, DuplicateResourceLocatorException,PropertyVetoException { assert resourceLocator==null; // not implemented ! return unmergedToExternal(maybeAddID(id,getRepresentedObject().createAssociation(type!=null?(((TopicImpl) type).getRepresentedObject()):getInternalUnspecifiedTopic(),convertToInternalScope(themes)))); } *************** *** 439,446 **** */ public Topic createTopic(String id) throws DuplicateObjectIDException, PropertyVetoException { ! org.tm4j.topicmap.tmdm.Topic topic = getRepresentedObject().createTopic(); - addIdTo(topic,id); - return unmergedToExternal(topic); } --- 438,443 ---- */ public Topic createTopic(String id) throws DuplicateObjectIDException, PropertyVetoException { ! org.tm4j.topicmap.tmdm.Topic topic = maybeAddID(id,getRepresentedObject().createTopic()); return unmergedToExternal(topic); } |
From: Xuan B. <med...@us...> - 2008-01-23 20:09:22
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24878/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicMapProviderImpl.java Log Message: Reject two different topicmaps with the same baseLocator. Index: TopicMapProviderImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapProviderImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TopicMapProviderImpl.java 21 Jan 2008 11:13:45 -0000 1.1 --- TopicMapProviderImpl.java 23 Jan 2008 20:09:24 -0000 1.2 *************** *** 80,84 **** } ! public org.tm4j.topicmap.TopicMap createTopicMap(Locator baseLocator) { // Syslog.log(this,Syslog.DEBUG4,"createTopicMap("+baseLocator+")."); --- 80,84 ---- } ! public org.tm4j.topicmap.TopicMap createTopicMap(Locator baseLocator) throws TopicMapProviderException { // Syslog.log(this,Syslog.DEBUG4,"createTopicMap("+baseLocator+")."); *************** *** 96,99 **** --- 96,104 ---- TopicMapImpl oldTopicMap = storedTopicMaps.put(baseLocator,topicMap); + if (oldTopicMap!=null) { + storedTopicMaps.put(baseLocator,oldTopicMap); + throw new TopicMapProviderException("Base locator "+baseLocator+" already in use for a different topic map."); + } + storedTopicMaps = storedTopicMaps; |
From: Xuan B. <med...@us...> - 2008-01-23 19:49:24
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16009/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicImpl.java Log Message: Allow Occurences to be created in the TM4J1 compatibility layer. Index: TopicImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TopicImpl.java 22 Jan 2008 21:49:10 -0000 1.6 --- TopicImpl.java 23 Jan 2008 19:49:28 -0000 1.7 *************** *** 10,17 **** --- 10,19 ---- import java.beans.PropertyVetoException; + import org.tm4j.net.LocatorFactoryException; import org.tm4j.net.LocatorFactory; import org.tm4j.net.Locator; import org.tm4j.topicmap.*; + import org.tm4j.topicmap.tmdm.PSI; import org.tm4j.topicmap.tmdm.ReadableTopic; import org.tm4j.topicmap.tmdm.ReadableTopicName; *************** *** 453,473 **** * this TopicMap. */ ! public Occurrence createOccurrence(String id) ! throws DuplicateObjectIDException, PropertyVetoException { ! throw new UnsupportedOperationException(); } ! public Occurrence createOccurrence(String id, Locator resourceLocator, ! Topic type, Locator ref, Topic[] themes) ! throws DuplicateObjectIDException, DuplicateResourceLocatorException, ! PropertyVetoException { ! throw new UnsupportedOperationException(); } ! public Occurrence createOccurrence(String id, Locator resourceLocator, ! Topic type, String data, Topic[] themes) ! throws DuplicateObjectIDException, DuplicateResourceLocatorException, ! PropertyVetoException { ! throw new UnsupportedOperationException(); } --- 455,488 ---- * this TopicMap. */ ! public Occurrence createOccurrence(String id) throws DuplicateObjectIDException, PropertyVetoException { ! assert id==null; // not supported ! ! try { ! return getContainer().unmergedToExternal(getRepresentedObject().createOccurrence(getContainer().getInternalUnspecifiedTopic(),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),"",null)); // dummy, not allowed in TMDM ! } catch (LocatorFactoryException e) { ! throw new RuntimeException("This should never happen.",e); ! } } ! public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,Locator ref, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { ! assert id==null; // not supported ! assert resourceLocator==null; // not supported ! ! try { ! return getContainer().unmergedToExternal(getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(ref),getContainer().convertToInternalScope(themes))); ! } catch (LocatorFactoryException e) { ! throw new RuntimeException("This should never happen.",e); ! } } ! public Occurrence createOccurrence(String id, Locator resourceLocator,Topic type,String data, Topic[] themes) throws DuplicateObjectIDException,DuplicateResourceLocatorException,PropertyVetoException { ! assert id==null; // not supported ! assert resourceLocator==null; // not supported ! ! try { ! return getContainer().unmergedToExternal(getRepresentedObject().createOccurrence(getContainer().externalToUnmerged(type),OccurrenceImpl.createLocator(PSI.XMLSchema.String,this),data,getContainer().convertToInternalScope(themes))); ! } catch (LocatorFactoryException e) { ! throw new RuntimeException("This should never happen.",e); ! } } |
From: Xuan B. <med...@us...> - 2008-01-23 19:45:01
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14343/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: OccurrenceImpl.java Log Message: Use shortcut OccurenceImpl.createLocator() Index: OccurrenceImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/OccurrenceImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OccurrenceImpl.java 23 Jan 2008 19:37:14 -0000 1.2 --- OccurrenceImpl.java 23 Jan 2008 19:45:06 -0000 1.3 *************** *** 95,99 **** public void setDataLocator(Locator loc) throws PropertyVetoException { try { ! getRepresentedObject().setDatatypeAndValue(getContainer().getLocatorFactory().createLocator("URI",PSI.XMLSchema.IRI),TM4J1Utils.locatorToIRI(loc)); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 95,99 ---- public void setDataLocator(Locator loc) throws PropertyVetoException { try { ! getRepresentedObject().setDatatypeAndValue(createLocator(PSI.XMLSchema.IRI,this),TM4J1Utils.locatorToIRI(loc)); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); *************** *** 111,115 **** public void setData(String data) throws PropertyVetoException { try { ! getRepresentedObject().setDatatypeAndValue(getContainer().getLocatorFactory().createLocator("URI",PSI.XMLSchema.String),data); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); --- 111,115 ---- public void setData(String data) throws PropertyVetoException { try { ! getRepresentedObject().setDatatypeAndValue(createLocator(PSI.XMLSchema.String,this),data); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); |
From: Xuan B. <med...@us...> - 2008-01-23 19:40:40
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12248/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicTopic.java Log Message: Allow for scope when creating occurrences. Index: BasicTopic.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicTopic.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicTopic.java 21 Jan 2008 20:00:26 -0000 1.3 --- BasicTopic.java 23 Jan 2008 19:40:44 -0000 1.4 *************** *** 178,189 **** } ! public BasicOccurrence createOccurrence(Topic type,Locator datatype,String value) { ! return createOccurrence((BasicTopic) type,datatype,value); } ! public BasicOccurrence createOccurrence(BasicTopic type,Locator datatype,String value) { assert type.getContainingTopicMap()==getContainingTopicMap(); ! BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value); occurrences.add(occurrence); --- 178,189 ---- } ! public BasicOccurrence createOccurrence(Topic type,Locator datatype,String value,Scope scope) { ! return createOccurrence((BasicTopic) type,datatype,value,(BasicScope) scope); } ! public BasicOccurrence createOccurrence(BasicTopic type,Locator datatype,String value,BasicScope scope) { assert type.getContainingTopicMap()==getContainingTopicMap(); ! BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value,scope); occurrences.add(occurrence); |
From: Xuan B. <med...@us...> - 2008-01-23 19:40:40
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12248/src/org/tm4j/topicmap/tmdm Modified Files: Topic.java Log Message: Allow for scope when creating occurrences. Index: Topic.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/Topic.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Topic.java 21 Jan 2008 20:00:25 -0000 1.2 --- Topic.java 23 Jan 2008 19:40:44 -0000 1.3 *************** *** 43,48 **** --- 43,53 ---- public TopicName createTopicName(String value,Topic type,Scope scope); + /* @TMDM public Occurrence createOccurrence(Topic type,Locator datatype,String value); + */ + + @TMDM + public Occurrence createOccurrence(Topic type,Locator datatype,String value,Scope scope); @TMDM |
From: Xuan B. <med...@us...> - 2008-01-23 19:37:11
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10892/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: OccurrenceImpl.java Log Message: More work on OccurenceImpl.java Index: OccurrenceImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/OccurrenceImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OccurrenceImpl.java 23 Jan 2008 19:01:22 -0000 1.1 --- OccurrenceImpl.java 23 Jan 2008 19:37:14 -0000 1.2 *************** *** 75,79 **** public Locator getDataLocator() { if (!isDataInline()) { ! return TM4J1Utils.iriToLocator(getRepresentedObject().getValue(),getContainer().getLocatorFactory()); } else { return null; --- 75,83 ---- public Locator getDataLocator() { if (!isDataInline()) { ! try { ! return TM4J1Utils.iriToLocator(getRepresentedObject().getValue(),getContainer().getLocatorFactory()); ! } catch (LocatorFactoryException e) { ! throw new RuntimeException("This should never happen.",e); ! } } else { return null; *************** *** 113,116 **** --- 117,124 ---- } + protected static Locator createLocator(String iri,TopicMapObjectImpl tmo) throws LocatorFactoryException { + return tmo.getContainer().getLocatorFactory().createLocator("URI",iri); + } + /** * Gets the resource data string associated with this occurrence. This function returns |
From: Xuan B. <med...@us...> - 2008-01-23 19:35:36
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10078/src/org/tm4j/topicmap/tmdm/tm4j1 Modified Files: TopicMapImpl.java Log Message: Provide support for Occurrence proxying. Index: TopicMapImpl.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapImpl.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TopicMapImpl.java 23 Jan 2008 16:08:48 -0000 1.14 --- TopicMapImpl.java 23 Jan 2008 19:35:38 -0000 1.15 *************** *** 280,283 **** --- 280,289 ---- } else if (unmerged instanceof org.tm4j.topicmap.tmdm.Association) { return unmergedToExternal((org.tm4j.topicmap.tmdm.Association) unmerged); + } else if (unmerged instanceof org.tm4j.topicmap.tmdm.AssociationRole) { + return unmergedToExternal((org.tm4j.topicmap.tmdm.AssociationRole) unmerged); + } else if (unmerged instanceof org.tm4j.topicmap.tmdm.TopicName) { + return unmergedToExternal((org.tm4j.topicmap.tmdm.TopicName) unmerged); + } else if (unmerged instanceof org.tm4j.topicmap.tmdm.Occurrence) { + return unmergedToExternal((org.tm4j.topicmap.tmdm.Occurrence) unmerged); } else if (unmerged instanceof org.tm4j.topicmap.tmdm.TopicMap) { return unmergedToExternal((org.tm4j.topicmap.tmdm.TopicMap) unmerged); *************** *** 321,324 **** --- 327,338 ---- } + protected OccurrenceImpl unmergedToExternal(org.tm4j.topicmap.tmdm.Occurrence unmerged) { + if (unmerged!=null) { + return new OccurrenceImpl(unmerged,getContainer()); + } else { + return null; + } + } + protected TopicMapImpl unmergedToExternal(org.tm4j.topicmap.tmdm.TopicMap unmerged) { assert unmerged!=null; |
From: Xuan B. <med...@us...> - 2008-01-23 19:33:04
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9142/src/org/tm4j/topicmap/tmdm Modified Files: TopicMapEventAdapter.java TopicMapEventListener.java Occurrence.java Log Message: Clarify Occurence.setDatatypeAndValue() and friends Index: TopicMapEventAdapter.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/TopicMapEventAdapter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TopicMapEventAdapter.java 21 Jan 2008 20:00:25 -0000 1.2 --- TopicMapEventAdapter.java 23 Jan 2008 19:33:05 -0000 1.3 *************** *** 95,98 **** --- 95,101 ---- } + public void notifyOccurrenceDatatypeAndValueChanged(TM topicMap,T topic,O occurrence,Locator oldDatatype,String oldValue,Locator newDatatype,String newValue) { + } + public void notifyVariantCreated(TM topicMap,T topic,TN topicName,V variant) { } Index: Occurrence.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/Occurrence.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Occurrence.java 23 Jan 2008 18:59:18 -0000 1.4 --- Occurrence.java 23 Jan 2008 19:33:05 -0000 1.5 *************** *** 42,46 **** for a very brief time. */ ! public String setDatatypeAndValue(Locator datatype,String value); /** --- 42,46 ---- for a very brief time. */ ! public void setDatatypeAndValue(Locator datatype,String value); /** Index: TopicMapEventListener.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/TopicMapEventListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TopicMapEventListener.java 21 Jan 2008 20:00:25 -0000 1.2 --- TopicMapEventListener.java 23 Jan 2008 19:33:05 -0000 1.3 *************** *** 80,83 **** --- 80,85 ---- public void notifyOccurrenceValueChanged(TM topicMap,T topic,O occurrence,String oldValue,String newValue); + public void notifyOccurrenceDatatypeAndValueChanged(TM topicMap,T topic,O occurrence,Locator oldDatatype,String oldValue,Locator newDatatype,String newValue); + public void notifyVariantCreated(TM topicMap,T topic,TN topicName,V variant); |
From: Xuan B. <med...@us...> - 2008-01-23 19:33:04
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9142/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicOccurrence.java Log Message: Clarify Occurence.setDatatypeAndValue() and friends Index: BasicOccurrence.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicOccurrence.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicOccurrence.java 21 Jan 2008 20:00:26 -0000 1.2 --- BasicOccurrence.java 23 Jan 2008 19:33:05 -0000 1.3 *************** *** 18,22 **** String value; ! protected BasicOccurrence(BasicTopic parent,BasicTopic type,Locator datatype,String value) { this.parent = parent; this.type = type; --- 18,23 ---- String value; ! protected BasicOccurrence(BasicTopic parent,BasicTopic type,Locator datatype,String value,BasicScope scope) { ! super(scope); this.parent = parent; this.type = type; *************** *** 76,79 **** --- 77,95 ---- } + /** + Provide a shortcut to change the datatype and the value in one transaction. + This is to avoid cases where value unintentionally does not match the datatype + for a very brief time. + */ + public void setDatatypeAndValue(Locator datatype,String value) { + Locator oldDatatype = this.datatype; + String oldValue = this.value; + this.datatype = datatype; + this.value = value; + + // We do not treat cases where the old value equals the new value specially. + getEventListener().notifyOccurrenceDatatypeAndValueChanged(getContainingTopicMap(),getParent(),this,oldDatatype,oldValue,datatype,value); + } + @TMAPI public String getValue() { |
From: Xuan B. <med...@us...> - 2008-01-23 19:01:18
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1 In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28197/src/org/tm4j/topicmap/tmdm/tm4j1 Added Files: OccurrenceImpl.java TM4J1Utils.java Log Message: Provide OccurenceImpl.java --- NEW FILE: TM4J1Utils.java --- package org.tm4j.topicmap.tmdm.tm4j1; import org.tm4j.net.LocatorFactoryException; import org.tm4j.net.LocatorFactory; import org.tm4j.net.Locator; /** @author <a href="mailto:xua...@pu...">Xuân Baldauf</a> */ public class TM4J1Utils { protected static String encodedIRIprefix = "tm4j1compatibilitylocator:"; public static String locatorToIRI(Locator locator) { String notation = locator.getNotation(); if (notation.equals("URI")) { return locator.getAddress(); } else { // We may return something like "tm4j1compatibilitylocator:${escape(locator.getNotation())}:${escape(locator.getAddress())}", however, it is quite probable that nobody needs it, because we only use URI locators anyways. throw new UnsupportedOperationException(); } } public static Locator iriToLocator(String iri,LocatorFactory locatorFactory) throws LocatorFactoryException { return locatorFactory.createLocator("URI",iri); } } /* Copyright (c) 2007-2008 Xuân Baldauf. This software is licensed, under the terms of * Apache 2 License * GPL v2 License * GPL v3 License * LGPL v2.1 License * MPL v1.1 License as well as each later version of these licenses. This means: (1) If you are using this software, you can choose any subset of the licenses mentioned, and you can choose any version of each of these licenses (starting with the respective version indicated). (Note that, however, choosing the empty set of licenses means that you do not have any right granted by any license at all.) (2) If you are committing contributions to this software (i.e. this software as part of the official TM4J sourcecode), then you agree to each of these licenses for your contribution (such that each user of this software has still at least the same set of rights and licenses when using this software together with you contribution compared to when using this software without your contribution). */ // :tabSize=2:indentSize=2: --- NEW FILE: OccurrenceImpl.java --- package org.tm4j.topicmap.tmdm.tm4j1; import java.util.Set; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.beans.PropertyVetoException; import org.tm4j.net.LocatorFactoryException; import org.tm4j.net.LocatorFactory; import org.tm4j.net.Locator; import org.tm4j.topicmap.*; import org.tm4j.topicmap.tmdm.PSI; import org.tm4j.topicmap.tmdm.TMDMUtil; import org.tm4j.topicmap.tmdm.ReadableOccurrence; /** @author <a href="mailto:xua...@pu...">Xuân Baldauf</a> */ public class OccurrenceImpl extends ScopedObjectImpl<org.tm4j.topicmap.tmdm.Occurrence,org.tm4j.topicmap.tmdm.ReadableOccurrence> implements org.tm4j.topicmap.Occurrence { protected OccurrenceImpl(org.tm4j.topicmap.tmdm.Occurrence representedObject,TopicMapImpl container) { super(representedObject,container); } protected ReadableOccurrence getMergedObject() { return getContainer().getMergedTopicMapView().getMergedOccurrence(getRepresentedObject()); } // Get/Set type /** * Gets the Topic definition the type of this occurrence. * * @return The Topic defining the type of this Occurrence, or * <code>null</code> if no such Topic has been specified. */ public Topic getType() { return getContainer().unmergedToExternal(getRepresentedObject().getType()); } /** * Sets the Topic defining the type of this Occurrence. * * @param type The {@link Topic} defining the type of this occurrence. */ public void setType(Topic type) throws PropertyVetoException { getRepresentedObject().setType(getContainer().externalToUnmerged(type)); } /** * Determines whether the type of the occurrence is described by <code>type</code>. * * @return <code>true</code> if the type of this Occurrence is defined by the topic * <code>type</code>, <code>false</code> otherwise. */ public boolean isOfType(Topic type) { assert type!=null; assert getRepresentedObject().getType()!=null; return getContainer().externalToUnmerged(type).equals(getRepresentedObject().getType()); } /** * Returns the Locator of the resource referenced by this data object. * If the data object provides inline data, this method will return null. * * @return The resource locator, or <code>null</code> if this data object provides * inline character data. */ public Locator getDataLocator() { if (!isDataInline()) { return TM4J1Utils.iriToLocator(getRepresentedObject().getValue(),getContainer().getLocatorFactory()); } else { return null; } } /** * Sets the Locator of the resource referenced by this data object. * The new value overwrites any previous resource locator or data string. * * @param loc the resource locator. * @throws PropertyVetoException if the change to the data object is * vetoed by a listener. */ public void setDataLocator(Locator loc) throws PropertyVetoException { try { getRepresentedObject().setDatatypeAndValue(getContainer().getLocatorFactory().createLocator("URI",PSI.XMLSchema.IRI),TM4J1Utils.locatorToIRI(loc)); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); } } /** * Sets the resource data string associated with this data object. The new value overwrites * any previous data strings or resource locators. * * @param data the character data to be provided by this data object. * @throws PropertyVetoException if the change to the data object is * vetoed by a listener. */ public void setData(String data) throws PropertyVetoException { try { getRepresentedObject().setDatatypeAndValue(getContainer().getLocatorFactory().createLocator("URI",PSI.XMLSchema.String),data); } catch (LocatorFactoryException e) { throw new RuntimeException("This should never happen.",e); } } /** * Gets the resource data string associated with this occurrence. This function returns * null if there is no resource data string associated with this occurrence. * * @return The resource data string, or <code>null</code> if this data object provides * a resource reference. */ public String getData() { if (isDataInline()) { return getRepresentedObject().getValue(); } else { return null; } } /** * Determines the type of resource data provided by this data object. * * @return <code>true</code> if this data object provides inline character data, * <code>false</code> if it refers to a remote resource. */ public boolean isDataInline() { return !TMDMUtil.locatorRepresentsURI(getRepresentedObject().getDatatype(),PSI.XMLSchema.IRI); } /** * Gets the topic which contains this occurrence. * * @return The Topic object which contains this occurrence, or * <code>null</code> if the * occurrence is not currently part of any topic. */ public Topic getParent() { return getContainer().unmergedToExternal(getRepresentedObject().getParent()); } } /* Copyright (c) 2007-2008 Xuân Baldauf. This software is licensed, under the terms of * Apache 2 License * GPL v2 License * GPL v3 License * LGPL v2.1 License * MPL v1.1 License as well as each later version of these licenses. This means: (1) If you are using this software, you can choose any subset of the licenses mentioned, and you can choose any version of each of these licenses (starting with the respective version indicated). (Note that, however, choosing the empty set of licenses means that you do not have any right granted by any license at all.) (2) If you are committing contributions to this software (i.e. this software as part of the official TM4J sourcecode), then you agree to each of these licenses for your contribution (such that each user of this software has still at least the same set of rights and licenses when using this software together with you contribution compared to when using this software without your contribution). */ // :tabSize=2:indentSize=2: |