diff --git a/content/projekt/ressource.xml.php b/content/projekt/ressource.xml.php new file mode 100644 index 000000000..61dec159b --- /dev/null +++ b/content/projekt/ressource.xml.php @@ -0,0 +1,246 @@ +, + * Andreas Oesterreicher and + * Rudolf Hangl . + */ +require_once('../../config/vilesci.config.inc.php'); +header("Content-type: application/vnd.mozilla.xul+xml"); + +echo ''; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + try + { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + tree = document.getAnonymousElementByAttribute(this ,'anonid', 'tree-ressource'); + var col = tree.columns.getColumnFor(document.getAnonymousElementByAttribute(this ,'anonid', 'treecol-ressource-ressource_id')); + return tree.view.getCellText(tree.currentIndex, col); + } + catch(e) + { + return false; + } + + + + + + + + + + + + + + + rdf/ressource.rdf.php?ts="+gettimestamp(); + datasource = datasource+"&projekt_kurzbz="+encodeURIComponent(projekt_kurzbz); + }else if(projektphase_id!='') + { + var datasource="rdf/ressource.rdf.php?ts="+gettimestamp(); + datasource = datasource+"&projekt_phase="+encodeURIComponent(projektphase_id); + } + + //debug('Source:'+datasource); + var tree = document.getAnonymousElementByAttribute(this ,'anonid', 'tree-ressource'); + + //Alte DS entfernen + var oldDatasources = tree.database.GetDataSources(); + while(oldDatasources.hasMoreElements()) + { + tree.database.RemoveDataSource(oldDatasources.getNext()); + } + + var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); + this.TreeRessourceDatasource = rdfService.GetDataSource(datasource); + this.TreeRessourceDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); + this.TreeRessourceDatasource.QueryInterface(Components.interfaces.nsIRDFXMLSink); + tree.database.AddDataSource(this.TreeRessourceDatasource); + + this.TreeRessourceDatasource.addXMLSinkObserver({ + notiz: this, + onBeginLoad: function(aSink) + {}, + + onInterrupt: function(aSink) + {}, + + onResume: function(aSink) + {}, + + onEndLoad: function(aSink) + { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + + //aSink.removeXMLSinkObserver(this); + //debug('onEndLoad start Rebuild'); + var tree = document.getAnonymousElementByAttribute(this.notiz ,'anonid', 'tree-ressource'); + tree.builder.rebuild(); + }, + + onError: function(aSink, aStatus, aErrorMsg) + { alert("error! " + aErrorMsg); } + }); + tree.builder.addListener({ + willRebuild : function(builder) + { + }, + didRebuild : function(builder) + { + //debug("didrebuild"); + //builder.removeListener(this); + } + }); + } + catch(e) + { + debug("Notiz load failed with exception: "+e); + } + ]]> + + + + + + var projekt_kurzbz = this.getAttribute('projekt_kurzbz'); + var projektphase_id = this.getAttribute('projektphase_id'); + + if(projekt_kurzbz!='') + { + this.LoadRessourceTree(projekt_kurzbz); + } + + + //debug('Notiz Binding Stop'); + + + + +