[kepler-dev] Loading actors into EntityLibrary

Chad Berkley berkley at nceas.ucsb.edu
Thu Feb 21 10:08:24 PST 2008


Hello Russel,

Kepler uses a very different mechanism that ptII.  The classes it uses 
are in org.kepler.objectmanager.library, specifically LibraryIndex.java. 
  Kepler reads an ontology file, then looks at the semanticType 
attribute of each component and adds the component to the tree based on 
the categorization in the ontology.

Check out the LibraryIndex code and you'll probably get a good idea of 
how it works.  The ontologies are all located in 
/kepler/configs/ptolemy/configs/kepler/ontologies and the file 
ontology_catalog.xml determines which of the ontologies are used in the 
library.  LibraryIndex.getLibrary() is called from 
org.kepler.moml.KSWLibraryBuilder which is the class that actually 
builds the library.  Kepler sets the library builder in 
/kepler/configs/ptolemy/configs/kepler/basicKeplerLibrary.xml in the 
"_alternateLibraryBuilder" parameter.  If you want to set your own 
library builder, you just need to sub-class LibraryBuilder and change 
that property to point to your new class.

Let me know if you have any questions after looking at LibraryIndex.

chad

R.P.Mciver at cs.cardiff.ac.uk wrote:
> Hey there,
> 
> I've been trying to create a simple PTree to list all of the actors  
> etc. that are available in kepler but I've not been having much luck.
> 
> I've managed to get a tree to show the actors just from ptolemy by  
> creating an EntityLibrary, configuring it to use the xml file  
> "$ptII\ptolemy\configs\basicLibrary" and then creating a PTree from  
> this - but I can't get the same to work for kepler. I tried using the  
> xml file "$kepler\configs\ptolemy\configs\kepler\basicKeplerLibrary"  
> to configure my EntityLibrary and then make a PTree from that but that  
> just gave me an empty tree. Do I need to try and do this in a  
> different way when trying to load the kepler actors instead of the  
> ptolemy ones? Or have I just got the wrong xml file?
> 
> Out of interest can anyone tell me how Kepler itself actually creates  
> the tree of components, projects, disciplines etc. that it dispays in  
> the side panel?
> 
> Any info would be greatly appreciated!
> 
> Cheers,
> 
> Russell
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> 
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev


More information about the Kepler-dev mailing list