09.01.2015 Views

Prof. Guido Russo - Scope - Università degli Studi di Napoli Federico II

Prof. Guido Russo - Scope - Università degli Studi di Napoli Federico II

Prof. Guido Russo - Scope - Università degli Studi di Napoli Federico II

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

XPath("dependencies/arc[@target=\"" + deviceName + "\"]",<br />

this.dependency) :<br />

XPath("dependencies/arc[@source=\"" + deviceName + "\"]",<br />

this.dependency);<br />

for (int i = 0; i < nodes.getLength(); ++i) {<br />

Node node = nodes.item(i);<br />

Node parent = node.getParentNode();<br />

parent.removeChild(node);<br />

}<br />

Document tmp = saveDocument(this.dependency, this.dependencyFile,<br />

this.dependencyDtdFileName);<br />

if (tmp != null)<br />

this.dependency = tmp;<br />

else {<br />

return false;<br />

}<br />

return true;<br />

}<br />

/**<br />

* Restituisce una lista <strong>di</strong> plugin del <strong>di</strong>spositivo deviceName<br />

* @param String deviceName<br />

* @return String[]<br />

*/<br />

public String[] getActionsOfDevice(String deviceName) {<br />

try {<br />

Hashtable plugin = getTagOf(deviceName, "devices/device[@name=\"" + deviceName<br />

+ "\"]/action", this.device);<br />

return ((String[])plugin.keySet().toArray(new String[0]));<br />

}<br />

catch (Exception e) {<br />

}<br />

return new String[0];<br />

}<br />

/**<br />

* Restituisce i link delle pagine <strong>di</strong> monitoraggio del <strong>di</strong>spositivo deviceName<br />

* @param String deviceName<br />

* @return String[]<br />

*/<br />

public String[] getLinksOfDevice(String deviceName)<br />

{<br />

try {<br />

Hashtable plugin = getTagOf(deviceName, "links/link[@name=\"" + deviceName +<br />

"\"]", this.link);<br />

return ((String[])plugin.keySet().toArray(new String[0]));<br />

}<br />

catch (Exception e) {<br />

}<br />

return new String[0];<br />

}<br />

/**<br />

* Restituisce gli attributi del plugin passato come argomento del <strong>di</strong>spositivo deviceName<br />

* @param String deviceName<br />

* @param String action<br />

* @return Hashtable<br />

*/<br />

public Hashtable getActionAttributesOfDevice(String deviceName, String action)<br />

{<br />

try {<br />

Hashtable plugin = getTagOf(deviceName, "devices/device[@name=\"" + deviceName<br />

+ "\"]/action", this.device);<br />

return ((Hashtable)plugin.get(action));<br />

}<br />

catch (Exception e) {<br />

this.error = e.toString(); }<br />

Pietro Neroni 566/2833 Pagina 92 <strong>di</strong> 117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!