Where can I find a use case or concrete example of setting up a service?

Peace Jerome peace_the_dreamer at yahoo.com
Fri Sep 15 05:16:22 UTC 2006


Hi Edgar,

This starts to help. I need an example that goes just
a little slower than this. I need it to start with the
user story.

Something like... 

What I would like to do is:

have a menu item that when I select it does...

it must appear in the ... menu and no others 

it should say...

So to get this to happen using services you do 
this here and 
that there and 
test it by doing x. 

My difficulty is that the service stuff is introducing
new language to allow me to do what I used to do by
modifing menu methods. I am having trouble thinking in
the service language. And I want some way to link what
I know to what I need to understand.

If you can add the story part to your example I think
that would help.

Thanks amigo, -- Jer






--- "Lic. Edgar J. De Cleene"
<edgardec2001 at yahoo.com.ar> wrote:

> Peace Jerome puso en su mail :
> 
> > Hi all,
> > 
> > I just tried to figure out how to use the service
> > browser and got pretty throughly stumped.
> > 

> > I need something that lets me start of dumb and
> get
> > smarter.
> > 
> > For me a couple of use cases and examples of
> running
> > thru the dialogs will probably set me on the right
> > path. Does anyone know where I can find some?
> > 
> > Can anyone direct me to useful sources of help?
> > 
> > Yours in curiosity, -- Jerome Peace


> Jerome;
> This was for SqueakLight, but should be similar in
> 3.9
> 
> Adding Services 
> The example is for class MiStack
> 
> 
> initialize
> " MiStack initialize"
> FileList registerFileReader: self.
> 
> 
> This method should be adecuated to service
> 
> 
> registeredServices
>     ^ { 
>     Service new
>         label: 'Open saved SqueakBook';
>         shortLabel: 'SqueakBook';
>         description: 'load back saved notes ';
>         action: [:stream | self reloadMeFromDisk:
> ((RWBinaryOrTextStream
> with: stream contents asString)reset)];
>         shortcut: nil;
>         categories: Service worldServiceCat.}
> 
> 
> This is for in FileList you could select and load
> 
> fileReaderServicesForFile: fullName suffix: suffix
>     | services |
>     services _ OrderedCollection new.
>     
>     (fullName asLowercase endsWith: '.shc')
>         ifTrue: [ services add: self
> serviceLoadSqueakBook ].
>     ^services
> 
> 
> 
> serviceLoadSqueakBook
> "Answer a service for opening a saved SqueakBook"
> 
>     ^ (SimpleServiceEntry
>         provider: self
>         label: 'saved SqueakBook'
>         selector: #reloadMeFromDisk:
>         description: 'open a SqueakBook'
>         buttonLabel: 'SqueakBook')
>         argumentGetter: [:fileList | fileList
> readOnlyStream]
> 
> 
> Hope this helps.
> 
> Edgar
> 
> 
> 
> 	
> 	
> 		
> __________________________________________________
> Preguntá. Respondé. Descubrí.
> Todo lo que querías saber, y lo que ni imaginabas,
> está en Yahoo! Respuestas (Beta).
> ¡Probalo ya! 
> http://www.yahoo.com.ar/respuestas
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Squeak-dev mailing list