MINDMAKERS Forum
Welcome, Guest. Please login or register.
September 09, 2010, 08:48:48 AM

Login with username, password and session length
Search:     Advanced search
NB: Spam bots are becoming smarter every day - we had to turn off regular registration. To become member, please send email to Kris Thorisson ([kris'_lastname] att ru dott is).
337 Posts in 99 Topics by 99 Members
Latest Member: peterwit
* Home Help Search Login Register
+  MINDMAKERS Forum
|-+  Projects
| |-+  Psyclone (Moderator: cmlabs)
| | |-+  Testing Catalog examples: not working...
« previous next »
Pages: [1] Print
Author Topic: Testing Catalog examples: not working...  (Read 2296 times)
matija
Newbie
*
Posts: 11


View Profile Email
« on: October 17, 2007, 05:27:10 PM »

Testing Catalog examples: not working...

Hello,

I tried to go through the "Using catalogs" section of the manual (Part 3):
I started psyclone with spec:

<psySpec name=" test catalogs" version="1.2">
   <whiteboard name="WB1" maxcount="10000">
      <description>...</description>
      <catalog name="MyFileCatalog" queryhandler="FileCatalog">
          <parameter name="location" type="String" value="."/>
          <parameter name="readonly" type="String" value="no"/>
         </catalog>
   </whiteboard>
</psySpec>

Then I tried to use this code for external module in Java (I used the JavaTester example code
keeping the:
   String xml = "<module name=\"JavaTester\" ...
data for the module registration)
and added the following:
         Message msg = new Message();
         msg.type = "Write";
         msg.set("Filename", "MyFileName"); // what connection with the MyFileCatalog?
         msg.content = "My File Contents, bla bla ";
         //msg.set("<param2>", "Param2");
         InfoItem answer = plug.queryCatalog("MyFileCatalog", msg);
            // Note: method NOT visible: correct it to "public" in  Communicator
         if (answer == null)
            error = "No Catalog by that name";
         else if (!answer.getEntry("Status").equalsIgnoreCase("Success"))
            error = "Catalog reported an error, look at answer to see why";
         else
            error = "Success, look at answer for results";
         System.out.println("\nJavaTester test for Catalog: error=" + error);
         /*
          I get the printout:
           JavaTester test for Catalog: error=No Catalog by that name
          */
The psyclone terminal trace:
   18:51:56
    796 Whiteboard AIRCentral started
    859 Whiteboard WB1 started
    859 Psyclone.System.Report.Spawn.InProgress
    859 Psyclone.System.Report.Status.Whiteboards.Spawn.Complete
    859 Psyclone.System.Report.Stream.Spawn.InProgress
    859 Number of Streams specified: 0
    859 Psyclone.System.Report.Catalog.Spawn.InProgress
    859 Number of Catalogs specified: 0                    ---> my comment: Huh?
    859 Psyclone.System.Report.Modules.Spawn.InProgress
    859 Number of Modules specified: 0
    859 Psyclone.System.Report.Services.Spawn.InProgress
    859 Number of Services specified: 0
    859 Psyclone.System.Report.Spawn.Complete
    859 Psyclone.System.Report.Status.Ready
    859 Psyclone.Context:Psyclone.System.Ready
    859 Psyclone running...
    ...
   18:52:19
    093 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
   18:52:25
    453 Module 'JavaTester' configured by itself with context(s):Psyclone.System.Ready
   18:52:27
    234 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
    234 Temporarily removed Module JavaTester from system database
   
Psyprobe shows MyFileCatalog in the list of External modules ?!
All tests done on windows, no cygwin.

Other questions:
-- can you give some hints on catalogs: do they appear as files somewhere?
-- any more info about the <catalog> XML element structure?
-- FileCatalog, StorageCatalog: are these class names?
-- what are the records for StorageCatalogs?
This topic seems rather under-documented...

Regards,
Matija
Logged
thorlist
Jr. Member
**
Posts: 51


thorlist
View Profile WWW Email
« Reply #1 on: October 18, 2007, 07:31:15 AM »

Hi Matija,

Just a quick note about your last bug report - we now have fixed the issues and expect to make a new release shortly.

In the example above you have embedded the Catalog definition inside the Whiteboard definition - you need to split out the catalog on its own:

<psySpec name=" test catalogs" version="1.2">
   <whiteboard name="WB1" maxcount="10000">
      <description>...</description>
   </whiteboard>
   <catalog name="MyFileCatalog" queryhandler="FileCatalog">
       <parameter name="location" type="String" value="."/>
       <parameter name="readonly" type="String" value="no"/>
   </catalog>
</psySpec>

Now you have defined your catalog, which uses one of the standard built-in catalogs of Psyclone, namely the catalog that allows you to request (i.e. read) files from the file systems. If you do the above your new catalog called MyFileCatalog appears correctly under the catalogs section in psyProbe.

-- can you give some hints on catalogs: do they appear as files somewhere?

No, a catalog is meant to be used as a Data Storage entity. This example stores and reads files from the file system. Other catalogs that you build yourself could contain a database of facial expressions, etc. that you can query using your own query language. If you think of them as a way of accessing 'third party information' you are not far off.

-- FileCatalog, StorageCatalog: are these class names?

No, they are built-in catalog names - that is, you can create an instance of one of these for storing and accessing information, either in memory or as files.

-- what are the records for StorageCatalogs?

This section in the manual has a number of mistakes in it - sorry about that. The Storage Catalog is for storing information in and retrieving from memory where the FileCatalog is for storing and reading files. So, with the Storage Catalog you can say "Save this data (Object) and call it 'Fred'". Anyone else can then request this data by name ('Fred') from the same catalog.

-- any more info about the <catalog> XML element structure?
This topic seems rather under-documented...

Catalogs are very new and not well documented yet. We will update this section in the next release.

If you find that you in your work needs to use either the File or the Storage Catalog, or that you wish to build your own catalog, please do say and we will help as much as we can.

Best,

Thor

Logged
matija
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: October 19, 2007, 10:34:02 AM »

hello,

retesting with corrected psyspec:
-- the catalog MyFileCatalog is now correctly appearing under Catalogs on psyProbe,
bat I still get the psyclone errors:

1) running psyclone on windows:
       171 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
        ...
       000 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***

2)and a rerun on linux (with external Java modules still run from windows):
   12:03:44
   167 Whiteboard AIRCentral started
   172 Whiteboard WB1 started
   173 Psyclone.System.Report.Spawn.InProgress
   173 Psyclone.System.Report.Status.Whiteboards.Spawn.Complete
   173 Psyclone.System.Report.Stream.Spawn.InProgress
   173 Number of Streams specified: 0
   173 Psyclone.System.Report.Catalog.Spawn.InProgress
   174 Number of Catalogs specified: 1
   180 Catalog MyFileCatalog created, initialized and started
   180 Psyclone.System.Report.Status.Catalogs.Spawn.Complete
   181 Psyclone.System.Report.Modules.Spawn.InProgress
   181 Number of Modules specified: 0
   181 Psyclone.System.Report.Services.Spawn.InProgress
   181 Number of Services specified: 0
   182 Psyclone.System.Report.Spawn.Complete
   182 Psyclone.System.Report.Status.Ready
   182 Psyclone.Context:Psyclone.System.Ready
   182 Psyclone running...
   185 *** New context Psyclone set to 'Psyclone.System.Ready' ***
   12:04:10
   783 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
   12:05:03
   491 Module 'JavaTester' configured by itself with context(s):Psyclone.System.Ready
   12:05:05
   174 *** ERROR: Could not locate Catalog query 'FileCatalog' in preloaded libraries ***
   178 Temporarily removed Module JavaTester from system database

Anyway I do appreciate your quick answers...

Best regards,
Matija
Logged
thorlist
Jr. Member
**
Posts: 51


thorlist
View Profile WWW Email
« Reply #3 on: October 19, 2007, 11:18:09 AM »

Hi Matija,

We have been testing this ourselves and there is one change you need to make (is now included in the manual), namely adding the text "Internal::" in front of the catalog query:

<psySpec name=" test catalogs" version="1.2">
   <whiteboard name="WB1" maxcount="10000">
      <description>...</description>
   </whiteboard>
   <catalog name="MyFileCatalog" queryhandler="Internal::FileCatalog">
       <parameter name="location" type="String" value="."/>
       <parameter name="readonly" type="String" value="no"/>
   </catalog>
</psySpec>

This has been updated in the manual now, and you can see the new version of it online at

   http://cmlabs.com/psyclone/manual

The manual now has much more and better (and correct :-) information about the two catalogs.

Also, do consider using the shorter and fully equivalent entry in the psySpec file:

 <catalog name="MyFileCatalog" query="Internal::FileCatalog" location="../myloc" readonly="no" />

The other one is just so unhandy... :-)

We expect to release a new version of everything (version 1.1.7) over the weekend, which addresses all the issues you have mentioned so far and has the updated manual included too.

Thank you so much for your patience on this - we are releasing a lot of new functionalities and we will become better at describing these - especially with people like you helping us!

Thor
Logged
matija
Newbie
*
Posts: 11


View Profile Email
« Reply #4 on: October 19, 2007, 02:21:14 PM »

hello,

I rechecked on windows with:
<catalog name="MyFileCatalog" query="Internal::FileCatalog" location="myloc" readonly="no" />

and the result it is now ok (the file is written).

however, the program:
         if (answer == null)
            error = "No Catalog by that name";
         else if (!answer.getEntry("Status").equalsIgnoreCase("Success"))
            error = "Catalog reported an error, look at answer to see why";
         else
            error = "Success, look at answer for results";
         System.out.println("\nJavaTester test for Catalog: error=" + error);

still produces an incorrect answer:
  JavaTester test for Catalog: error=Catalog reported an error, look at answer to see why

  the code: System.out.println("answer.getEntry('Status')=" + answer.getEntry("Status") + "END");
  produces:answer.getEntry('Status')=END

The http://localhost:10000/MyFileCatalog shows:

File Catalog Status
Parameters:
location = Parameter name="location" type="String" value="myloc" default="myloc" step="1.000000"
readonly = Parameter name="readonly" type="String" value="no" default="no" step="1.000000"


Best regards,
Matija


Logged
thorlist
Jr. Member
**
Posts: 51


thorlist
View Profile WWW Email
« Reply #5 on: October 22, 2007, 07:44:00 PM »

Hi Majita,

Today we have released the new version 1.1.7 of Psyclone. Please go to

   http://www.mindmakers.org/mindmakers/projects/Psyclone

and download the new versions, including the new Java version.

Version 1.1.7 addresses all the comments you have made so far. Thank you for all your help - do let us know if you have any more questions or problems!

Best,

Thor
Logged
matija
Newbie
*
Posts: 11


View Profile Email
« Reply #6 on: October 24, 2007, 03:02:17 PM »

ok,

but there remains 2 problems:
1) the new JavaOpenAIR1.1.7.bsd.zip loaded from http://www.mindmakers.org/projects/Psyclone/pages/Linux_gcc4.html is new
    but the one loaded from http://www.mindmakers.org/projects/Psyclone/pages/Win_32_vs2005.html
   is the old one (JavaOpenAIR1.1.6.bsd.zip) even if the text says otherwise...
2) One thing that was not corrected  for the catalog example in Java to work is the accessibility of the method queryCatalog
   in the Communicator: you need to make it public to use the line:
        InfoItem answer = plug.queryCatalog("MyFileCatalog", msg);

yours,
Matija         
Logged
thorlist
Jr. Member
**
Posts: 51


thorlist
View Profile WWW Email
« Reply #7 on: October 25, 2007, 11:22:51 AM »

Hi Majita,

Both issues have been resolves.

All downloads are now 1.1.7 (except Mac OSX). If you see any 1.1.6 links, please refresh the page.

Please download the Java 1.1.7 file again, as this now has the fix for the public queryCatalog function.

Again, thanks for your input!

Best,

Thor
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!