BEEP URL handler concept for all URIs starting with "beep://".
This concept is able to execute specified SEP command on specified BEEP server.
URL format is :
beep://<userName>:<passwd>@<hostName>:<port>/<DBName>?sep=<sepCommand>
Possible options :
-
user
- use this option to specify userName for DB connection.
-
pwd
- use this option to specify passwd for DB connection.
If these options are specified then the userName
and the passwd
will be overwrited in the URL.
Execute a fetch SEP command on BEEP server and shows the results.
$resp from "beep://guest:guest@localhost/XMLDB?sep=<request reqno='1'><fetch><union><intersect>
<compare subtree='xmlrpctest/1><path/><value></value></compare>
<intersect></union></fetch></request>"
if $resp.hasAdditional then [
if $resp.hasInfo then [
print $resp/additional/info.toXML
] else [
if $resp.hasWarning then [
print $resp/additional/warning.toXML
]
]
]
if $resp.hasError then [
print $resp/error.toXML
]
if $resp.hasBlock then [
print $resp/block.toXML
]
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
Methods inherited from: URIHandler
|
Creates the URL handler concept
Determines whether this implementation can handle the URI.
print BEEPHandler.acceptsURI("beep://guest:guest@host:port/DB")
-- the result is --
true
Flag to close the connection
$sep = "<request reqno='1'><fetch><union><intersect><compare subtree='xmlrpctest/1><path/><value></value>
</compare><intersect></union></fetch></request>"
$url = "beep://localhost/XMLDB?sep=" + $sep
$beep = BEEPHandler.create($url)
if $beep.acceptsURI($url) then [
$m typeof Map
$m.add("user", "guest")
$m.add("pwd", "guest")
if ($beep.initialize($m)) then [
if ($beep.openConnection) then [
print $beep.getContent
$beep.closeConnection
]
]
]
-- the result is --
The content of xmlrpctest/1 document will be returned:
<testxml>
<homedir path="/home/user"/>
</testxml>
Exceptions: |
executeSEPException :
(Error) | If unable to execute SEP command on BEEP server. |
Get all informations from the URL.
$sep = "<request reqno='1'><fetch><union><intersect><compare subtree='xmlrpctest/1><path/><value></value>
</compare><intersect></union></fetch></request>"
$url = "beep://localhost/XMLDB?sep=" + $sep
$beep = BEEPHandler.create($url)
if $beep.acceptsURI($url) then [
$m typeof Map
$m.add("user", "guest")
$m.add("pwd", "guest")
if ($beep.initialize($m)) then [
if ($beep.openConnection) then [
print $beep.getContent
$beep.closeConnection
]
]
]
-- the result is --
The content of xmlrpctest/1 document will be returned:
<testxml>
<homedir path="/home/user"/>
</testxml>
Parameters: |
$options : | Map concept with user and password informations |
|
Exceptions: |
badURLException :
(Error) | If the URL to the BEEP server isn't valid. |
Initializes the URL useing the user informations
$sep = "<request reqno='1'><fetch><union><intersect><compare subtree='xmlrpctest/1><path/><value></value>
</compare><intersect></union></fetch></request>"
$url = "beep://localhost/XMLDB?sep=" + $sep
$beep = BEEPHandler.create($url)
if $beep.acceptsURI($url) then [
$m typeof Map
$m.add("user", "guest")
$m.add("pwd", "guest")
if ($beep.initialize($m)) then [
if ($beep.openConnection) then [
print $beep.getContent
$beep.closeConnection
]
]
]
-- the result is --
The content of xmlrpctest/1 document will be returned:
<testxml>
<homedir path="/home/user"/>
</testxml>
Exceptions: |
connectionException :
(Error) | If unable to connect to specified XML database. |
Opens the BEEPClient connection
$sep = "<request reqno='1'><fetch><union><intersect><compare subtree='xmlrpctest/1><path/><value></value>
</compare><intersect></union></fetch></request>"
$url = "beep://localhost/XMLDB?sep=" + $sep
$beep = BEEPHandler.create($url)
if $beep.acceptsURI($url) then [
$m typeof Map
$m.add("user", "guest")
$m.add("pwd", "guest")
if ($beep.initialize($m)) then [
if ($beep.openConnection) then [
print $beep.getContent
$beep.closeConnection
]
]
]
-- the result is --
The content of xmlrpctest/1 document will be returned:
<testxml>
<homedir path="/home/user"/>
</testxml>
Parameters: |
$value : | The content of the specified document. |
|
Exceptions: |
storeException :
(Error) | If unable to set the content specified document. |
Flag which shows if the content was sets