[dev] [cvs] commit: ansel/lib api.php

Michael Rubinsky mike at theupstairsroom.com
Sun Jul 2 11:33:44 PDT 2006


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael Rubinsky <mike at theupstairsroom.com>:
>
>> AFAIK, ansel doesn't allow you to create galleries with the same
>> name... perhaps I should clarify that by gallery name I am referring
>> to the unique share name.
>
> Okay. As far as I'm concerned that should be going away everywhere we
> can make it go away - it's long, not meaningful, and not useful.
> Outside apps should never end up with just a share name...

Perhaps an example will help clarify:

I have a web site external to horde that I want to use ansel to manage  
some image content.  I'm using the functionality made available via  
the api to use an Ansel_Gallery seperate from the 'default' one that  
is used within horde (I don't want these images/galleries visable from  
within the ansel gui).

I then have a config setting in my app, something like:  
$recent_images_gallery = 'myApp_recent_images'.  To make a long story  
short, images are uploaded from the app and stored in the  
$recent_images_gallery gallery.  Since I'm setting the $app parameter  
in the api calls, the Ansel_Gallery share is created as  
"horde.shares.myApp" and the gallery is created as a share under  
horde.shares.myApp as myApp_recent_images.  So in this case, the  
*only* way for this app to reference the gallery is  by the share  
name, which in this case is not a long md5 string.  The app checks for  
duplicates before creating the share and name collisions with  
galleries from ansel's own default share is avoided since we are in a  
different namespace so to speak.

Yes, I could go into horde's datatree and manually find out the  
datatree_id for the gallery after it is created then go back into my  
app and use it, but it's not very convienient to have to check horde  
after each gallery is created.

Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org



More information about the dev mailing list