Omeka Storage Adapter in plugin

58 views
Skip to first unread message

Oldřich Vykydal

unread,
Feb 20, 2015, 8:24:23 AM2/20/15
to omek...@googlegroups.com
Hello,

I'm thinking about storage adapter for some web service e.g. picasa. I know I can do it similar like ZendS3 adapter and put file with new class to application/libraries/Omeka/Storage/Adapter directory and update configuration application/config/config.ini.

But I want to make it in pure omeka plugin. So I'm looking for clean way to create this plugin. I want to have possibility to turn on/off this functionality instantly when I enable or disable whole plugin and I don't want to configure config.ini or copy my class to Adapter directory in this time.

I'm thinking about make a link  "ln PicasaWeb.php application/libraries/Omeka/Storage/Adapter/PicasaWeb.php" in installation hook and delete this link in uninstallation hook. But I don't know how to configure application/config/config.ini in clean way. I can only do some dirty text processing in plugin hooks :)

Is it possible to do it clean?

Thank you
O1da

John Flatness

unread,
Feb 24, 2015, 1:44:18 PM2/24/15
to omek...@googlegroups.com
You don't need to make any symlinks to ship a new adapter: they don't
need to be located in the Omeka/Storage/Adapter directory. Having it in
your plugin at libraries/PicasaWeb/Storage/Adapter/PicasaWeb.php would
let you use it by specifying the adapter as
"PicasaWeb_Storage_Adapter_PicasaWeb". The class would be autoloaded as
long as it's at the right (PSR-0) path under libraries/ within your plugin.

As for altering the storage adapter automatically, that's not supported.
It's probably possible to do it by using initialize or another hook and
getting the Config resource from the bootstrap and editing the data
there, but I wouldn't recommend it. Because there's no method for
automatically migrating between storage methods, the storage settings
are designed to be more permanent than easily-editable.

-John
> --
> You received this message because you are subscribed to the Google
> Groups "Omeka Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to omeka-dev+...@googlegroups.com
> <mailto:omeka-dev+...@googlegroups.com>.
> To post to this group, send email to omek...@googlegroups.com
> <mailto:omek...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/omeka-dev.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages