[Etoys] Journal access problem

Bert Freudenberg bert at freudenbergs.de
Tue Feb 12 09:11:10 EST 2008


On Feb 12, 2008, at 14:11 , Karl wrote:

> I've been looking into accessing the Journal from Squeak but I  
> can't get
> it to work.
> In SugarLauncher>>startUp I changed
>
> ServerDirectory
>             addServer: (SugarDatastoreDirectory mimetype:
> 'application/x-squeak-project' extension: '.pr')
>             named: SugarLauncher defaultDatastoreDirName.
>
> to read
>
> ServerDirectory
>             addServer: (SugarDatastoreDirectory mimetype: 'image/jpeg'
> extension: '.jpg')
>             named: SugarLauncher defaultDatastoreDirName.
>
> When I select [Projects in Journal] I see jpegs and their content get
> loaded in the bottom pane in FileList but when I select the file I  
> get a
> message that the file could not be found, and to select a new name.
>
> Anybody have any clue to this ?

You can press Alt-. when the message is shown and select "full stack"  
to see the problem. It is a bug in the "open" service entry, which  
does not preserve the original directory instance (which would have  
been our SugarDatastoreDirectory) but simply uses "FileStream  
readOnlyFileNamed: ...". So it tries to open the file from disk  
instead of the datastore. It does work with projects because their  
handler preserves the directory instance, and asks that instance to  
open the file.

Btw, you can simply evaluate this in a workspace:

ServerDirectory
	addServer: (SugarDatastoreDirectory mimetype: 'image/jpeg'  
extension: '.jpg')
	named: '[JPEGs in Journal]'.

All of this is a hack, obviously, we need something better than  
emulating the Journal as file directory.

What we should do (as mentioned previously) is to use the Journal's  
object chooser. Open a Transcript, and then try this in a workspace:

(SugarLauncher current instVarNamed: 'dbus')
	addMatch: #(type 'signal' path '/org/laptop/Journal').
SugarLauncher current sendDBusMessage: ((DBusMessageMethodCall
	destination: 'org.laptop.Journal'
	path: '/org/laptop/Journal'
	interface: 'org.laptop.Journal'
	selector: 'ChooseObject')
		addArgument: 0 signature: 'i').

In the Transcript you can see what is happening ...

- Bert -




More information about the Etoys mailing list