How to change path for my show.dcmes-xml.php files ?

24 views
Skip to first unread message

hms

unread,
Dec 7, 2011, 12:12:42 PM12/7/11
to Omeka Dev
Hello,
In order to build a light unAPI server on my site (in order to have
zotero readable Illustration items), i'd like to have an address
without get parameters for accessing my show.dcmes-xml.php files
(unAPI specs http://unapi.info/specs/ mention the fact that no ?
should be present in the link for unAPI server).

Any idea on how to do that ? maybe by defining a new route ?
Thanks !

John Flatness

unread,
Dec 7, 2011, 12:37:33 PM12/7/11
to omek...@googlegroups.com
While we use the "?output=dcmes-xml" URL form by default, you should be
able to get to a dcmes-xml output by going to:

items/browse/output/dcmes-xml

This should work out of the box.

-John

hms

unread,
Dec 7, 2011, 1:21:51 PM12/7/11
to Omeka Dev
Ok, thanks. But how do you pass an item id, then ?

HM.

On 7 déc, 18:37, John Flatness <j...@zerocrates.org> wrote:
> While we use the "?output=dcmes-xml" URL form by default, you should be
> able to get to a dcmes-xml output by going to:
>
> items/browse/output/dcmes-xml
>
> This should work out of the box.
>
> -John
>
> On 12/07/2011 12:12 PM, hms wrote:
>
>
>
>
>
>
>
> > Hello,
> >   In order to build a light unAPI server on my site (in order to have
> > zotero readable Illustration items), i'd like to have an address
> > without get parameters for accessing my show.dcmes-xml.php files

> > (unAPI specshttp://unapi.info/specs/mention the fact that no ?

Jim Safley

unread,
Dec 7, 2011, 1:39:41 PM12/7/11
to omek...@googlegroups.com
items/show/[itemId]?output=dcmes-xml

> --
> You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
> To post to this group, send email to omek...@googlegroups.com.
> To unsubscribe from this group, send email to omeka-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/omeka-dev?hl=en.
>

Jeremy Boggs

unread,
Dec 7, 2011, 3:00:31 PM12/7/11
to omek...@googlegroups.com
To get the items/show URL without the query string, you can do:

items/show/id/[itemId]/output/dcmes-xml

(items/show/[id]/output/dcmes-xml doesn't work; it returns an Omeka_Controller_Exception_404. The '/id/' is required, so Omeka knows what item ID to retrieve when using this URL formatting.)

Best,
Jeremy

hms

unread,
Dec 7, 2011, 3:33:42 PM12/7/11
to Omeka Dev
Ok, thanks for your replies but I think there is something missing
then, because unAPI specs says that, given URL the unAPI server :
* URL should give the list of available formats and
* URL?id=ID should give the description of item whose ID is given with
a GET parameter

So, the solution would'nt be then to add a route to reach the
show.dcmes-xml.php file, who would behave according to the presence or
not of a GET parameter ?

On 7 déc, 21:00, Jeremy Boggs <jer...@clioweb.org> wrote:
> To get the items/show URL without the query string, you can do:
>
>   items/show/id/[itemId]/output/dcmes-xml
>
> (items/show/[id]/output/dcmes-xml doesn't work; it returns an Omeka_Controller_Exception_404. The '/id/' is required, so Omeka knows what item ID to retrieve when using this URL formatting.)
>
> Best,
> Jeremy
>
> On Dec 7, 2011, at 1:39 PM, Jim Safley wrote:
>
>
>
>
>
>
>
> > items/show/[itemId]?output=dcmes-xml
>

> > On Wed, Dec 7, 2011 at 1:21 PM, hms <hmsuch...@gmail.com> wrote:
> >> Ok, thanks. But how do you pass an item id, then ?
>
> >> HM.
>
> >> On 7 déc, 18:37, John Flatness <j...@zerocrates.org> wrote:
> >>> While we use the "?output=dcmes-xml" URL form by default, you should be
> >>> able to get to a dcmes-xml output by going to:
>
> >>> items/browse/output/dcmes-xml
>
> >>> This should work out of the box.
>
> >>> -John
>
> >>> On 12/07/2011 12:12 PM, hms wrote:
>
> >>>> Hello,
> >>>>   In order to build a light unAPI server on my site (in order to have
> >>>> zotero readable Illustration items), i'd like to have an address
> >>>> without get parameters for accessing my show.dcmes-xml.php files

> >>>> (unAPI specshttp://unapi.info/specs/mentionthe fact that no ?


> >>>> should be present in the link for unAPI server).
>
> >>>> Any idea on how to do that ? maybe by defining a new route ?
> >>>> Thanks !
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
> >> To post to this group, send email to omek...@googlegroups.com.
> >> To unsubscribe from this group, send email to omeka-dev+...@googlegroups.com.

> >> For more options, visit this group athttp://groups.google.com/group/omeka-dev?hl=en.

hms

unread,
Dec 8, 2011, 6:31:32 AM12/8/11
to Omeka Dev
Hello,
Actually both
http://mysite.org/items/show/output/dcmes-xml?id=2133
and
http://mysite.org/items/show/output/dcmes-xml

are reachable. I just get an error when no id is provided. Instead of
this, i'd like to have a specific behaviour, such as displaying a
specific rdf description for example.


Any idea on how to do that ?

Thank you !
HM.

> > >>>> (unAPI specshttp://unapi.info/specs/mentionthefact that no ?

hms

unread,
Dec 8, 2011, 11:29:51 AM12/8/11
to Omeka Dev
Hello,
I actually managed to get quite what i wanted using url
http://mysite.org/items/browse/output/dcmes-xml/ : my modified
browse.dcmes-xml.php file almost behave the way unapi specs tells,
according to the presence or not of required parameters.

Just one last single question to reach what specs says : it seems that
somewhere before executing that script, a header with application/rdf
+xml content type is sent. I'd just like to change it to application/
xml, or better remove that. Is it possible ? how to do that ?

Thanks !
HM.
On 8 déc, 12:31, hms <hmsuch...@gmail.com> wrote:
> Hello,
>  Actually bothhttp://mysite.org/items/show/output/dcmes-xml?id=2133
> andhttp://mysite.org/items/show/output/dcmes-xml

> > > >>>> (unAPI specshttp://unapi.info/specs/mentionthefactthat no ?

Jeremy Boggs

unread,
Dec 8, 2011, 2:47:56 PM12/8/11
to omek...@googlegroups.com
Forgive me if I'm misunderstanding what you're trying to do, but it sounds like you'd be much better off adding a new output and view for your unAPI than hijacking the dcmes-xml output, since I assume you would want to actually list dcmes-xml as one of the formats available in your unAPI.

Creating a plugin with a controller and view for an unAPI page would be a much better approach. You could set the header for that view from within your plugin as well, instead of trying to change the header for the dcmes-xml output.

Jeremy

hms

unread,
Dec 8, 2011, 3:58:03 PM12/8/11
to Omeka Dev
I'd be glad to do an unAPI server this way. I will try to read
documentation to write a plugin for that.

Thanks,
HM.

> >>>>>>>> (unAPI specshttp://unapi.info/specs/mentionthefactthatno ?

Reply all
Reply to author
Forward
0 new messages