[kepler-dev] Dynamically created actor not shown in library but can be seen with Search button ....
Shawn Bowers
sbowers at ucdavis.edu
Mon Aug 7 17:08:41 PDT 2006
As a first approximation on how to do this (at least, you can see an
example of how I am doing this currently from within Kepler), you should
look at the org/kepler/ksw/gui/SaveInLibraryDialog.java class.
Hope that helps. Also, Chad Berkley might be able to more specifically
help you, as he is the one who wrote the ActorMetadata code, etc.
-shawn
On Tue, 8 Aug 2006, jagan wrote:
> Hi Shawn,
>
> I am able to create a "gridlet actor" dynamically using
> JGridletCreator" actor which is located under "General Purpose/Grid
> Function/Griddles" folder.
> I am building kswFile using KSWBuilder (org.kepler.ksw.KSWBuilder new
> KSWBuilder(gridlet , false , false, kswFile);) in a directory
> $KEPLER/kar/griddles
>
> The created file is processed by using the following procedure and
> at the end I have refreshed the library
>
> ----------------------------------------------------------------------------------------------------------------
> public void processKSW(File kswFile)
> {
> try
> {
> KeplerLSID[] actorLSIDs;
> CacheManager cache = CacheManager.getInstance();
> KARCacheObject kco = new KARCacheObject(kswFile);
> LibraryIndex lindex;
> actorLSIDs = kco.getActors();
> if(actorLSIDs != null)
> {
> System.out.println("processing kar file: " +
> kswFile.getAbsolutePath());
> lindex = LibraryIndex.getInstance();
> for(int j=0; j<actorLSIDs.length; j++)
> {
> ActorCacheObject aco =
> (ActorCacheObject)cache.getObject(actorLSIDs[j]);
> ActorMetadata am = aco.getMetadata();
> //build an entity for each actor in the ksw and add it to the
> actorLibrary
> LibraryIndexItem subtree = lindex.findItem(new
> KeplerLSID("urn:lsid:localhost:onto:2:1#PreConfiguredGridletActor"));
> LibraryIndexItem oldlsid =
> lindex.findItem(am.getName());
> if(oldlsid != null)
> lindex.removeComponent(oldlsid.getLSID(), subtree);
> lindex.add(new LibraryIndexComponentItem(am.getName(),
> am.getLSID()), subtree);
> //System.out.println("actor " + " loaded into the library in
> category " + subtree.getName() + " with id " +am.getId());
> }
> lindex.refresh();
> }
> }
> catch(CacheException ce)
> {
> System.out.println("Error with the cache: " + ce.getMessage());
> return;
> }
> catch(Exception e)
> {
> e.printStackTrace();
> System.out.println("Error creating ComponentEntity from actor " +
> "metadata: " + e.getMessage());
> return;
> }
> }
> ----------------------------------------------------------------------------------------------------
>
> I see the library is updating on the screen but I cann't see newly
> created actor in the library.
>
> Whereas when search for the newly created actor, I could see in the
> folder where it is supposed to be (General Purpose/Grid
> Function/Griddles/gridlet). If I exit and restart Kepler, I can see the
> same thing in the library list.
>
> I have also noticed one more problem, if I change previosly created
> dynamic actor and refresh the library. This time I am not able to
> restart kepler and I am getting a duplication error message.
>
> I have updated all my chenges into kepler cvs repository, If possible
> could you mind look into the problem.
>
> Could you mind to indicate me which is the best time to chat "irc Kepler
> chaneel" with any of you?
>
> with regards,
>
> Jagan Kommineni
>
>
>
> jagan kommineni wrote:
>
> >Hi Chad and Shawn,
> >
> > I am able to create a "gridlet actor" dynamically using
> >JGridletCreator" actor which is located under "General Purpose/Grid
> >Function/Griddles" folder.
> >I am building kswFile using KSWBuilder (org.kepler.ksw.KSWBuilder new
> >KSWBuilder(gridlet , false , false, kswFile);) in a directory
> >$KEPLER/kar/griddles
> >
> > The created file is processed by using the following procedure and
> >at the end I have refreshed the library
> >
> >----------------------------------------------------------------------------------------------------------------
> > public void processKSW(File kswFile)
> > {
> > try
> > {
> > KeplerLSID[] actorLSIDs;
> > CacheManager cache = CacheManager.getInstance();
> > KARCacheObject kco = new KARCacheObject(kswFile);
> > LibraryIndex lindex;
> > actorLSIDs = kco.getActors();
> > if(actorLSIDs != null)
> > {
> > System.out.println("processing kar file: " +
> >kswFile.getAbsolutePath());
> > lindex = LibraryIndex.getInstance();
> > for(int j=0; j<actorLSIDs.length; j++)
> > {
> > ActorCacheObject aco =
> >(ActorCacheObject)cache.getObject(actorLSIDs[j]);
> > ActorMetadata am = aco.getMetadata();
> > //build an entity for each actor in the ksw and add it to the
> >actorLibrary
> > LibraryIndexItem subtree = lindex.findItem(new
> >KeplerLSID("urn:lsid:localhost:onto:2:1#PreConfiguredGridletActor"));
> > LibraryIndexItem oldlsid =
> >lindex.findItem(am.getName());
> > if(oldlsid != null)
> > lindex.removeComponent(oldlsid.getLSID(), subtree);
> > lindex.add(new LibraryIndexComponentItem(am.getName(),
> >am.getLSID()), subtree);
> > //System.out.println("actor " + " loaded into the library in
> >category " + subtree.getName() + " with id " +am.getId());
> > }
> > lindex.refresh();
> > }
> > }
> > catch(CacheException ce)
> > {
> > System.out.println("Error with the cache: " + ce.getMessage());
> > return;
> > }
> > catch(Exception e)
> > {
> > e.printStackTrace();
> > System.out.println("Error creating ComponentEntity from actor " +
> >"metadata: " + e.getMessage());
> > return;
> > }
> > }
> >----------------------------------------------------------------------------------------------------
> >
> >I see the library is updating on the screen but I cann't see newly
> >created actor in the library.
> >
> >Whereas when search for the newly created actor, I could see in the
> >folder where it is supposed to be (General Purpose/Grid
> >Function/Griddles/gridlet). If I exit and restart Kepler, I can see the
> >same thing in the library list.
> >
> >I have also noticed one more problem, if I change previosly created
> >dynamic actor and refresh the library. This time I am not able to
> >restart kepler and I am getting a duplication error message.
> >
> >I have updated all my chenges into kepler cvs repository, If possible
> >could you mind look into the problem.
> >
> >Could you mind to indicate me which is the best time to chat "irc Kepler
> >chaneel" with any of you?
> >
> >with regards,
> >
> >Jagan Kommineni
> >
> >_______________________________________________
> >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