[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AtomPub Media Repository




On Feb 10, 2010, at 9:05 AM, Asbjørn Ulsberg wrote:

> 2010/2/8 Jan Algermissen <algermissen1971@xxxxxxx>
>  
> GET /the-service/images/at-the-beach/original/at-the-beach.jpg
> Accept: image/jpeg
> 
> 200 Ok
> Content-Type: image/jpeg
> Link-Template: </the-service/images/at-the-beach/conversions/{template}>;rel="http://your.org/specs/rels/conversions";
> 
> [image data]
>  
> About this; I've now defined that an URI Template for a photo can look like so:
> 
> Link-Template: </acme/photos/{template}/at-the-beach/>;
>                rel="http://example.com/acme/templates/";
> 
> And that an URI Template for a template can look like so:
> 
> Link-Template: </acme/photos/thumbnail/{photo}/>;
>                rel="http://example.com/acme/photos/";
> 
> All fine and dandy. However, I would like to expand this so the client can insert even more pre-known values into the URI. I would like to make as much of this parameterized, as the clients of this AtomPub server will be pretty smart and built with a lot of knowledge.

As long as you specify all these parameters (can also be query string params) in the specof the link rel you are fine. Any client that implements that link rel inherently knows about the params (==understands the tempate's meaning)

> 
> For instance, I would like to have a URI Template for each customer, to allow the client to interpolate both template and photo at runtime. The template itself can look like so:
> 
> Link-Template: </acme/photos/{template}/{photo}/>;

Just think this way:

Link-Template: </acme/photo-converter?t={template}&p={photo}&quality={quality}&overlay-text={overlay-text}

or conceptually similar:

<form action="/acme/photo-converter" method="GET">
  <input name="template"/>
  <input name="photo"/>
  <!-- ... -->
</form>

> 
> I can't figure out what to do with the "rel" parameter, though. On top of this, I'd like the client to be able to interpolate the category into the URI, because photos may be named in a way that is only unique within a given category,

Use the photo's URI as a value for the photo parameter. Same with template. Or use unique IDs instead of photo name.

jan



> but not globally across a customer. I'm not entirely sure of this requirement yet, but let's say it's absolute. Is it solvable? How?
> 
> -- 
> Asbjørn Ulsberg           -=|=-        asbjorn@xxxxxxxxxx
> «He's a loathsome offensive brute, yet I can't look away»

-----------------------------------
 Jan Algermissen, Consultant
 NORD Software Consulting

 Mail: algermissen@xxxxxxx
 Blog: http://www.nordsc.com/blog/
 Work: http://www.nordsc.com/
-----------------------------------