org.activemath.webapp.clip
Class OMSDisambiguator
java.lang.Object
org.activemath.webapp.clip.OMSDisambiguator
public class OMSDisambiguator
- extends Object
Simple utility to inject the xref attribute to OMS
elements using either the cdbase attribute (of itself or a parent)
or searching through the knowledge-base.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OMSDisambiguator
public OMSDisambiguator(AuthorExtendedMBaseRef mbaseRef)
fixOMnamespaces
public OJElement fixOMnamespaces(OJElement e)
injectXrefInAll
public OJElement injectXrefInAll(OJElement any)
throws OMSDisambiguator.DisambiguationException
- Throws:
OMSDisambiguator.DisambiguationException
injectXref
public void injectXref(OJElement oms)
throws OMSDisambiguator.DisambiguationException
- Throws:
OMSDisambiguator.DisambiguationException
trySearchingMBaseForOMSTarget
public String trySearchingMBaseForOMSTarget(OJElement elt)
- Searches MBase using
AuthorExtendedMBaseRef.searchIDs(java.lang.String)
to find the ID matching cd and name.
- Parameters:
elt - the OMS element out of which the attributes cd and name are used
- Returns:
- an ID whose theory and name match
- Throws:
OMSDisambiguator.DisambiguationException - if such an ID appears twice or more
trySearchingMBaseForId
public String trySearchingMBaseForId(String cd,
String name)
- Searches MBase using
AuthorExtendedMBaseRef.searchIDs(java.lang.String)
to find the ID matching cd and name.
- Parameters:
cd - the theory id-namename - the id-name
- Returns:
- an ID whose theory and name match
- Throws:
OMSDisambiguator.DisambiguationException - if such an ID appears twice or more