You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Gaurav Kalia <ga...@techblue.co.uk> on 2011/04/04 11:12:08 UTC

Using Read src with Select type

Hi All

I need to read a PDF file using read src.

The below match patter works fine.

<map:match pattern="**/showpdf-*.pdf">
<map:read src="{2}.pdf" mime-type="application/pdf" />
</map:match>

Now i need to validate some session param before displaying the PDF and 
according to the result i need to display PDF. Below is the modified 
pipeline

<map:match pattern="**/showpdf-*.pdf">
<map:act type="validate">
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{check}"/>
<map:when test="success">
<map:read src="{2}.pdf" mime-type="application/pdf" />
</map:when>
<map:otherwise>
<map:generate src="test.xml"/>
<map:transform src="test.xsl"/>
<map:serialize type="xml"/>
</map:otherwise>
</map:select>
</map:act>
</map:match>

But in the above example i am not getting the {2} param which is the 
name of the PDF.

Please suggest if this is not the right way to do this.

TIA

Regards
Gaurav

-- 
Gaurav
Web Development
Techblue Softwares&  Technology Blueprint Ltd

T : 08450047142 Extn: 5102
E : gaurav.kalia@techblue.co.uk
W : www.techblue.co.in
     www.technologyblueprint.co.uk

Confidentiality Notice

The contents of this email are confidential and may be privileged, and
are intended only for the use of the person or company named herein. Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Techblue software or Technology Blueprint
Limited.

If you are not the intended recipient of this email or a person
responsible for delivering it to the intended recipient, you are hereby
notified that any distribution, copying or dissemination of the
information herein is strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Using Read src with Select type

Posted by Bhavya Sharma <bh...@gmail.com>.
ok, well m not sure and i just found that this is not correct way
as the sitemap file should be more declarative ,
however can replace <map:paramer.. with xslt variable declaration

HTH



On Mon, Apr 4, 2011 at 3:02 PM, Gaurav Kalia <ga...@techblue.co.uk>wrote:

> HI Bhavya
>
>
>  <map:parameter name="filename" value="{2}"/>
>>
>
> I have tried the above and getting an exception:
>
> <!--Error while evaluating '{2}' : not so many
> levelsorg.apache.cocoon.ProcessingException: Sitemap: error when calling
> sub-sitemap
>
>
> Regards
> Gaurav
>
>
>
>
>
> --
> Gaurav
> Web Development
> Techblue Softwares&  Technology Blueprint Ltd
>
> T : 08450047142 Extn: 5102
> E : gaurav.kalia@techblue.co.uk
> W : www.techblue.co.in
>    www.technologyblueprint.co.uk
>
> Confidentiality Notice
>
> The contents of this email are confidential and may be privileged, and
> are intended only for the use of the person or company named herein. Any
> views or opinions presented are solely those of the author and do not
> necessarily represent those of Techblue software or Technology Blueprint
> Limited.
>
> If you are not the intended recipient of this email or a person
> responsible for delivering it to the intended recipient, you are hereby
> notified that any distribution, copying or dissemination of the
> information herein is strictly prohibited.
>
>
>


-- 
*Thanks with regards
*+919582723100
*Bhavya Sharma*
        निष्काम

Re: Using Read src with Select type

Posted by Gaurav Kalia <ga...@techblue.co.uk>.
HI Bhavya

> <map:parameter name="filename" value="{2}"/>

I have tried the above and getting an exception:

<!--Error while evaluating '{2}' : not so many levelsorg.apache.cocoon.ProcessingException: Sitemap: error when calling sub-sitemap

Regards
Gaurav





-- 
Gaurav
Web Development
Techblue Softwares&  Technology Blueprint Ltd

T : 08450047142 Extn: 5102
E : gaurav.kalia@techblue.co.uk
W : www.techblue.co.in
     www.technologyblueprint.co.uk

Confidentiality Notice

The contents of this email are confidential and may be privileged, and
are intended only for the use of the person or company named herein. Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Techblue software or Technology Blueprint
Limited.

If you are not the intended recipient of this email or a person
responsible for delivering it to the intended recipient, you are hereby
notified that any distribution, copying or dissemination of the
information herein is strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Using Read src with Select type

Posted by Bhavya Sharma <bh...@gmail.com>.
not sure abt the syntax but u can follow following approach,
try to store 2nd param in a parameter and then use it wherevr u need

<map:match pattern="**/showpdf-*.pdf">
<map:parameter name="filename" value="{2}"/>

<map:act type="validate">
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{check}"/>
<map:when test="success">

<map:read src="{[filename parameter]}.pdf" mime-type="application/pdf" />


</map:when>
<map:otherwise>
<map:generate src="test.xml"/>
<map:transform src="test.xsl"/>
<map:serialize type="xml"/>
</map:otherwise>
</map:select>
</map:act>
</map:match>

On Mon, Apr 4, 2011 at 2:42 PM, Gaurav Kalia <ga...@techblue.co.uk>wrote:

> Hi All
>
> I need to read a PDF file using read src.
>
> The below match patter works fine.
>
> <map:match pattern="**/showpdf-*.pdf">
> <map:read src="{2}.pdf" mime-type="application/pdf" />
> </map:match>
>
> Now i need to validate some session param before displaying the PDF and
> according to the result i need to display PDF. Below is the modified
> pipeline
>
> <map:match pattern="**/showpdf-*.pdf">
> <map:act type="validate">
> <map:select type="parameter">
> <map:parameter name="parameter-selector-test" value="{check}"/>
> <map:when test="success">
> <map:read src="{2}.pdf" mime-type="application/pdf" />
> </map:when>
> <map:otherwise>
> <map:generate src="test.xml"/>
> <map:transform src="test.xsl"/>
> <map:serialize type="xml"/>
> </map:otherwise>
> </map:select>
> </map:act>
> </map:match>
>
> But in the above example i am not getting the {2} param which is the name
> of the PDF.
>
> Please suggest if this is not the right way to do this.
>
> TIA
>
> Regards
> Gaurav
>
> --
> Gaurav
> Web Development
> Techblue Softwares&  Technology Blueprint Ltd
>
> T : 08450047142 Extn: 5102
> E : gaurav.kalia@techblue.co.uk
> W : www.techblue.co.in
>    www.technologyblueprint.co.uk
>
> Confidentiality Notice
>
> The contents of this email are confidential and may be privileged, and
> are intended only for the use of the person or company named herein. Any
> views or opinions presented are solely those of the author and do not
> necessarily represent those of Techblue software or Technology Blueprint
> Limited.
>
> If you are not the intended recipient of this email or a person
> responsible for delivering it to the intended recipient, you are hereby
> notified that any distribution, copying or dissemination of the
> information herein is strictly prohibited.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>


-- 
*Thanks with regards
*+919582723100
*Bhavya Sharma*
        निष्काम