net.ontopia.topicmaps.entry
Class URLTopicMapSource

java.lang.Object
  extended by net.ontopia.topicmaps.entry.URLTopicMapSource
All Implemented Interfaces:
TopicMapSourceIF

public class URLTopicMapSource
extends java.lang.Object
implements TopicMapSourceIF

INTERNAL: TopicMapSourceIF that can reference individual topic map documents by their URL address. The properties id, title, url, and syntax are the most commonly used. The syntaxes XTM, HyTM, and LTM are currently supported.

Since:
2.0

Field Summary
protected  LocatorIF base_address
           
protected  boolean duplicate_suppression
           
protected  boolean hidden
           
protected  java.lang.String id
           
protected  ExternalReferenceHandlerIF ref_handler
           
protected  java.lang.String refid
           
protected  java.util.Collection<TopicMapReferenceIF> reflist
           
protected  java.lang.String syntax
           
protected  java.lang.String title
           
protected  java.lang.String url
           
protected  boolean validate
           
 
Constructor Summary
URLTopicMapSource()
           
URLTopicMapSource(java.lang.String url)
           
 
Method Summary
 TopicMapReferenceIF createTopicMap(java.lang.String name, java.lang.String baseAddress)
          PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.
 LocatorIF getBase()
          INTERNAL: Gets the base locator of the topic maps retrieved from the source.
 java.lang.String getBaseAddress()
          INTERNAL: Gets the base address of the topic maps retrieved from the source.
 boolean getDuplicateSuppression()
          INTERNAL: Gets the duplicate suppression flag.
 ExternalReferenceHandlerIF getExternalReferenceHandler()
          INTERNAL: Gets the external reference handler.
 boolean getHidden()
           
 java.lang.String getId()
          PUBLIC: Gets the id of the source.
 java.lang.String getReferenceId()
          INTERNAL: Gets the id of the topic map reference for this topic map source.
 java.util.Collection<TopicMapReferenceIF> getReferences()
          PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.
 java.lang.String getSyntax()
          INTERNAL: Returns the syntax of the document.
 java.lang.String getTitle()
          PUBLIC: Gets the title of the source.
 java.lang.String getUrl()
          INTERNAL: Gets the URL of the source topic map.
 boolean getValidation()
          INTERNAL: Returns true if validation is on, false otherwise.
 void refresh()
          PUBLIC: Refreshes the collection of references.
 void setBase(LocatorIF base_address)
          INTERNAL: Sets the base locator of the topic maps retrieved from the source.
 void setBaseAddress(java.lang.String base_address)
          INTERNAL: Sets the base address of the topic maps retrieved from the source.
 void setDuplicateSuppression(boolean duplicate_suppression)
          INTERNAL: Sets the duplicate suppression flag.
 void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
          INTERNAL: Sets the external reference handler.
 void setHidden(boolean hidden)
           
 void setId(java.lang.String id)
          PUBLIC: Sets the id of the source.
 void setReferenceId(java.lang.String refid)
          INTERNAL: Sets the id of the topic map reference for this topic map source.
 void setSyntax(java.lang.String syntax)
          INTERNAL: Specifies the syntax of the document.
 void setTitle(java.lang.String title)
          PUBLIC: Sets the title of the source.
 void setUrl(java.lang.String url)
          INTERNAL: Sets the URL of the source topic map.
 void setValidation(boolean validate)
          INTERNAL: Turn validation of XTM documents according to DTD on or off.
 boolean supportsCreate()
          PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.
 boolean supportsDelete()
          PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

refid

protected java.lang.String refid

title

protected java.lang.String title

url

protected java.lang.String url

syntax

protected java.lang.String syntax

hidden

protected boolean hidden

base_address

protected LocatorIF base_address

duplicate_suppression

protected boolean duplicate_suppression

validate

protected boolean validate

ref_handler

protected ExternalReferenceHandlerIF ref_handler

reflist

protected java.util.Collection<TopicMapReferenceIF> reflist
Constructor Detail

URLTopicMapSource

public URLTopicMapSource()

URLTopicMapSource

public URLTopicMapSource(java.lang.String url)
Method Detail

getId

public java.lang.String getId()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the id of the source.

Specified by:
getId in interface TopicMapSourceIF

setId

public void setId(java.lang.String id)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the id of the source. Note that this method is intended for use when the source is used in a TopicMapRepositoryIF. The source should throw an UnsupportedOperationException if it does not support setting the id.

Specified by:
setId in interface TopicMapSourceIF

getReferenceId

public java.lang.String getReferenceId()
INTERNAL: Gets the id of the topic map reference for this topic map source.


setReferenceId

public void setReferenceId(java.lang.String refid)
INTERNAL: Sets the id of the topic map reference for this topic map source.


getTitle

public java.lang.String getTitle()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the title of the source.

Specified by:
getTitle in interface TopicMapSourceIF

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the title of the source.

Specified by:
setTitle in interface TopicMapSourceIF

getSyntax

public java.lang.String getSyntax()
INTERNAL: Returns the syntax of the document.


setSyntax

public void setSyntax(java.lang.String syntax)
INTERNAL: Specifies the syntax of the document. This property will be used to ensure that the topic map syntax is correctly recognized. The supported syntaxes are 'XTM', 'HyTM', and 'LTM'. If the syntax is not specified the class will attempt to guess it by looking at the address suffix.


getUrl

public java.lang.String getUrl()
INTERNAL: Gets the URL of the source topic map.


setUrl

public void setUrl(java.lang.String url)
INTERNAL: Sets the URL of the source topic map.


getBase

public LocatorIF getBase()
INTERNAL: Gets the base locator of the topic maps retrieved from the source.


setBase

public void setBase(LocatorIF base_address)
INTERNAL: Sets the base locator of the topic maps retrieved from the source.


getBaseAddress

public java.lang.String getBaseAddress()
INTERNAL: Gets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.


setBaseAddress

public void setBaseAddress(java.lang.String base_address)
INTERNAL: Sets the base address of the topic maps retrieved from the source. The notation is assumed to be 'URI'.


getDuplicateSuppression

public boolean getDuplicateSuppression()
INTERNAL: Gets the duplicate suppression flag. If the flag is true duplicate suppression is to be performed when loading the topic maps.


setDuplicateSuppression

public void setDuplicateSuppression(boolean duplicate_suppression)
INTERNAL: Sets the duplicate suppression flag. If the flag is true duplicate suppression is to be performed when loading the topic maps.


setValidation

public void setValidation(boolean validate)
INTERNAL: Turn validation of XTM documents according to DTD on or off. The validation checks if the documents read follow the DTD, and will abort import if they do not.

Parameters:
validate - Will validate if true, will not if false.

getValidation

public boolean getValidation()
INTERNAL: Returns true if validation is on, false otherwise.


setExternalReferenceHandler

public void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
INTERNAL: Sets the external reference handler.


getExternalReferenceHandler

public ExternalReferenceHandlerIF getExternalReferenceHandler()
INTERNAL: Gets the external reference handler. The reference handler will receive notifications on references to external topics and topic maps.


getReferences

public java.util.Collection<TopicMapReferenceIF> getReferences()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.

Specified by:
getReferences in interface TopicMapSourceIF

refresh

public void refresh()
Description copied from interface: TopicMapSourceIF
PUBLIC: Refreshes the collection of references. This lets the source look at its underlying data source to reflect any changes made since the last refresh.

Specified by:
refresh in interface TopicMapSourceIF

supportsCreate

public boolean supportsCreate()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.

Specified by:
supportsCreate in interface TopicMapSourceIF

supportsDelete

public boolean supportsDelete()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.

Specified by:
supportsDelete in interface TopicMapSourceIF

createTopicMap

public TopicMapReferenceIF createTopicMap(java.lang.String name,
                                          java.lang.String baseAddress)
Description copied from interface: TopicMapSourceIF
PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map. The method takes a name and the base address for the topic map to create.

Specified by:
createTopicMap in interface TopicMapSourceIF

getHidden

public boolean getHidden()

setHidden

public void setHidden(boolean hidden)


Copyright © 2000-2012 Ontopia.