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); |