You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Anish <an...@techblue.co.uk> on 2009/02/23 12:28:04 UTC
Image Reader in Lenya 2 (inside a module)
Hi All
Can anybody suggest how to use image reader in Lenya 2 (inside a module)
e.g. in lenya 1.2.4, I wrote my pipeline in publication-sitemap.xmap for
reading an image as:
<map:match pattern="**/img-*.jpg">
<map:read src="/home/anish/*.jpg" type="image"/>
</map:match>
I put name of the image in <img src="img-1.jpg"/> tag and It worked
where 1.jpg is the name of the image.
But now I want to achieve that inside a module (lenya 2.0.2). e.g. I've
a module named mymodule (..../lenya/src/modules/mymodule) I've written
the same pipeline in ..../lenya/src/modules/mymodule/sitemap.xmap like:
<map:match pattern="**/img-*.jpg">
<map:read src="/home/anish/*.jpg" type="image"/>
</map:match>
and created a module type page (say page1.html), on the same page I want
to access images using <img...../> tag.
It's not working as such.
Please help.
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
Re: Image Reader in Lenya 2 (inside a module)
Posted by Anish <an...@techblue.co.uk>.
Hi All
I've made my pipeline working at publication sitemap. I've used that
pipeline at publication level and it worked.
Please suggestions w.r.t. module.
Anish wrote:
> Hi All
>
> Can anybody suggest how to use image reader in Lenya 2 (inside a module)
>
> e.g. in lenya 1.2.4, I wrote my pipeline in publication-sitemap.xmap
> for reading an image as:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish/*.jpg" type="image"/>
> </map:match>
>
> I put name of the image in <img src="img-1.jpg"/> tag and It worked
> where 1.jpg is the name of the image.
>
> But now I want to achieve that inside a module (lenya 2.0.2). e.g.
> I've a module named mymodule (..../lenya/src/modules/mymodule) I've
> written the same pipeline in
> ..../lenya/src/modules/mymodule/sitemap.xmap like:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish/*.jpg" type="image"/>
> </map:match>
>
> and created a module type page (say page1.html), on the same page I
> want to access images using <img...../> tag.
>
> It's not working as such.
>
> Please help.
>
> --
> Anish Sneh
> Software Engineer
> Techblue Softwares Pvt. Ltd.
> www.technologyblueprint.co.uk
>
>
>
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
Re: Image Reader in Lenya 2 (inside a module)
Posted by Anish <an...@techblue.co.uk>.
Hi All
I've made my pipeline working at publication sitemap. I've used that
pipeline at publication level and it worked.
Please suggestions w.r.t. module.
Anish wrote:
> Hi All
>
> Can anybody suggest how to use image reader in Lenya 2 (inside a module)
>
> e.g. in lenya 1.2.4, I wrote my pipeline in publication-sitemap.xmap
> for reading an image as:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish/*.jpg" type="image"/>
> </map:match>
>
> I put name of the image in <img src="img-1.jpg"/> tag and It worked
> where 1.jpg is the name of the image.
>
> But now I want to achieve that inside a module (lenya 2.0.2). e.g.
> I've a module named mymodule (..../lenya/src/modules/mymodule) I've
> written the same pipeline in
> ..../lenya/src/modules/mymodule/sitemap.xmap like:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish/*.jpg" type="image"/>
> </map:match>
>
> and created a module type page (say page1.html), on the same page I
> want to access images using <img...../> tag.
>
> It's not working as such.
>
> Please help.
>
> --
> Anish Sneh
> Software Engineer
> Techblue Softwares Pvt. Ltd.
> www.technologyblueprint.co.uk
>
>
>
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
Re: Image Reader in Lenya 2 (inside a module)
Posted by Anish <an...@techblue.co.uk>.
Hi Andreas
Thanks for the help.
I've used the first option for referring the link (for the module's
pipeline) as you suggested:
<img src="/modules/mymodule/img-1.jpg"/>
Now my link contains the module information and it's working now.
Thanks to all again.
Andreas Hartmann wrote:
> Hi Anish,
>
> please take the time to read one or two articles on mailing list
> quoting style. There are some links on the "Mailing Lists" page on the
> Lenya website.
>
> Anish schrieb:
>> I'm sorry actually I used placeholders like:
>>
>> <map:match pattern="**/img-*.jpg"> <map:read
>> src="/home/anish//{2}/.jpg" type="image"/>
>> </map:match>
>>
>> I used the same. This was a typing mistake in the mail.
>
> I see, but that was only a side note anyway. Was there something
> useful in the rest of my mail?
>
> -- Andreas
>
>
>
>> Andreas Hartmann wrote:
>>> Hi Anish,
>>>
>>> please refrain from cross-posting to the dev list. This is a usage
>>> question.
>>>
>>> Anish schrieb:
>>>> Can anybody suggest how to use image reader in Lenya 2 (inside a
>>>> module)
>>>>
>>>> e.g. in lenya 1.2.4, I wrote my pipeline in
>>>> publication-sitemap.xmap for reading an image as:
>>>>
>>>> <map:match pattern="**/img-*.jpg"> <map:read
>>>> src="/home/anish/*.jpg" type="image"/>
>>>> </map:match>
>>>>
>>>> I put name of the image in <img src="img-1.jpg"/> tag and It
>>>> worked where 1.jpg is the name of the image.
>>>> But now I want to achieve that inside a module (lenya 2.0.2). e.g.
>>>> I've a module named mymodule (..../lenya/src/modules/mymodule) I've
>>>> written the same pipeline in
>>>> ..../lenya/src/modules/mymodule/sitemap.xmap like:
>>>>
>>>> <map:match pattern="**/img-*.jpg"> <map:read
>>>> src="/home/anish/*.jpg" type="image"/>
>>>> </map:match>
>>>
>>> Maybe that's a copy&paste error, but you can't use an asterisk in
>>> the source URI, but rather the placeholder (I guess that would be
>>> {2} in your case).
>>>
>>>> and created a module type page (say page1.html), on the same page I
>>>> want to access images using <img...../> tag.
>>>
>>> If you want to deliver the image from a module, your link must
>>> contain the module information. There are two options:
>>>
>>> 1) <img src="/modules/mymodule/img-1.jpg"/>
>>> 2) <img src="img-1.jpg?lenya.module=mymodule"/>
>>>
>>> In option 1), the link has to be transformed using the proxy
>>> transformer so that the URL will be compatible with arbitrary proxy
>>> setups.
>>>
>>> I guess in your case option 1) will be more suitable. The matcher in
>>> the module sitemap doesn't need a prefix:
>>>
>>> <map:match pattern="img-*.jpg">
>>> <map:read src="/home/anish/{1}.jpg"/>
>>> </map:match>
>>>
>>> HTH,
>>>
>>> -- Andreas
>>>
>>>
>>>
>>
>>
>> --
>> Anish Sneh
>> Software Engineer
>> Techblue Softwares Pvt. Ltd.
>> www.technologyblueprint.co.uk
>>
>>
>
>
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Image Reader in Lenya 2 (inside a module)
Posted by Andreas Hartmann <an...@apache.org>.
Hi Anish,
please take the time to read one or two articles on mailing list quoting
style. There are some links on the "Mailing Lists" page on the Lenya
website.
Anish schrieb:
> I'm sorry actually I used placeholders like:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish//{2}/.jpg" type="image"/>
> </map:match>
>
> I used the same. This was a typing mistake in the mail.
I see, but that was only a side note anyway. Was there something useful
in the rest of my mail?
-- Andreas
> Andreas Hartmann wrote:
>> Hi Anish,
>>
>> please refrain from cross-posting to the dev list. This is a usage
>> question.
>>
>> Anish schrieb:
>>> Can anybody suggest how to use image reader in Lenya 2 (inside a module)
>>>
>>> e.g. in lenya 1.2.4, I wrote my pipeline in publication-sitemap.xmap
>>> for reading an image as:
>>>
>>> <map:match pattern="**/img-*.jpg"> <map:read
>>> src="/home/anish/*.jpg" type="image"/>
>>> </map:match>
>>>
>>> I put name of the image in <img src="img-1.jpg"/> tag and It worked
>>> where 1.jpg is the name of the image.
>>> But now I want to achieve that inside a module (lenya 2.0.2). e.g.
>>> I've a module named mymodule (..../lenya/src/modules/mymodule) I've
>>> written the same pipeline in
>>> ..../lenya/src/modules/mymodule/sitemap.xmap like:
>>>
>>> <map:match pattern="**/img-*.jpg"> <map:read
>>> src="/home/anish/*.jpg" type="image"/>
>>> </map:match>
>>
>> Maybe that's a copy&paste error, but you can't use an asterisk in the
>> source URI, but rather the placeholder (I guess that would be {2} in
>> your case).
>>
>>> and created a module type page (say page1.html), on the same page I
>>> want to access images using <img...../> tag.
>>
>> If you want to deliver the image from a module, your link must contain
>> the module information. There are two options:
>>
>> 1) <img src="/modules/mymodule/img-1.jpg"/>
>> 2) <img src="img-1.jpg?lenya.module=mymodule"/>
>>
>> In option 1), the link has to be transformed using the proxy
>> transformer so that the URL will be compatible with arbitrary proxy
>> setups.
>>
>> I guess in your case option 1) will be more suitable. The matcher in
>> the module sitemap doesn't need a prefix:
>>
>> <map:match pattern="img-*.jpg">
>> <map:read src="/home/anish/{1}.jpg"/>
>> </map:match>
>>
>> HTH,
>>
>> -- Andreas
>>
>>
>>
>
>
> --
> Anish Sneh
> Software Engineer
> Techblue Softwares Pvt. Ltd.
> www.technologyblueprint.co.uk
>
>
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Image Reader in Lenya 2 (inside a module)
Posted by Anish <an...@techblue.co.uk>.
Hi Andreas
I'm sorry actually I used placeholders like:
<map:match pattern="**/img-*.jpg">
<map:read src="/home/anish//{2}/.jpg" type="image"/>
</map:match>
I used the same. This was a typing mistake in the mail.
It didn't work.
Andreas Hartmann wrote:
> Hi Anish,
>
> please refrain from cross-posting to the dev list. This is a usage
> question.
>
> Anish schrieb:
>> Can anybody suggest how to use image reader in Lenya 2 (inside a module)
>>
>> e.g. in lenya 1.2.4, I wrote my pipeline in publication-sitemap.xmap
>> for reading an image as:
>>
>> <map:match pattern="**/img-*.jpg"> <map:read
>> src="/home/anish/*.jpg" type="image"/>
>> </map:match>
>>
>> I put name of the image in <img src="img-1.jpg"/> tag and It worked
>> where 1.jpg is the name of the image.
>> But now I want to achieve that inside a module (lenya 2.0.2). e.g.
>> I've a module named mymodule (..../lenya/src/modules/mymodule) I've
>> written the same pipeline in
>> ..../lenya/src/modules/mymodule/sitemap.xmap like:
>>
>> <map:match pattern="**/img-*.jpg"> <map:read
>> src="/home/anish/*.jpg" type="image"/>
>> </map:match>
>
> Maybe that's a copy&paste error, but you can't use an asterisk in the
> source URI, but rather the placeholder (I guess that would be {2} in
> your case).
>
>> and created a module type page (say page1.html), on the same page I
>> want to access images using <img...../> tag.
>
> If you want to deliver the image from a module, your link must contain
> the module information. There are two options:
>
> 1) <img src="/modules/mymodule/img-1.jpg"/>
> 2) <img src="img-1.jpg?lenya.module=mymodule"/>
>
> In option 1), the link has to be transformed using the proxy
> transformer so that the URL will be compatible with arbitrary proxy
> setups.
>
> I guess in your case option 1) will be more suitable. The matcher in
> the module sitemap doesn't need a prefix:
>
> <map:match pattern="img-*.jpg">
> <map:read src="/home/anish/{1}.jpg"/>
> </map:match>
>
> HTH,
>
> -- Andreas
>
>
>
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
Re: Image Reader in Lenya 2 (inside a module)
Posted by Andreas Hartmann <an...@apache.org>.
Hi Anish,
please refrain from cross-posting to the dev list. This is a usage question.
Anish schrieb:
> Can anybody suggest how to use image reader in Lenya 2 (inside a module)
>
> e.g. in lenya 1.2.4, I wrote my pipeline in publication-sitemap.xmap for
> reading an image as:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish/*.jpg" type="image"/>
> </map:match>
>
> I put name of the image in <img src="img-1.jpg"/> tag and It worked
> where 1.jpg is the name of the image.
>
> But now I want to achieve that inside a module (lenya 2.0.2). e.g. I've
> a module named mymodule (..../lenya/src/modules/mymodule) I've written
> the same pipeline in ..../lenya/src/modules/mymodule/sitemap.xmap like:
>
> <map:match pattern="**/img-*.jpg">
> <map:read src="/home/anish/*.jpg" type="image"/>
> </map:match>
Maybe that's a copy&paste error, but you can't use an asterisk in the
source URI, but rather the placeholder (I guess that would be {2} in
your case).
> and created a module type page (say page1.html), on the same page I want
> to access images using <img...../> tag.
If you want to deliver the image from a module, your link must contain
the module information. There are two options:
1) <img src="/modules/mymodule/img-1.jpg"/>
2) <img src="img-1.jpg?lenya.module=mymodule"/>
In option 1), the link has to be transformed using the proxy transformer
so that the URL will be compatible with arbitrary proxy setups.
I guess in your case option 1) will be more suitable. The matcher in the
module sitemap doesn't need a prefix:
<map:match pattern="img-*.jpg">
<map:read src="/home/anish/{1}.jpg"/>
</map:match>
HTH,
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org