This error:
Exists is not a function.
Here is my code in the sitemap:
-----Ursprüngliche Nachricht-----
Von: Upayavira [mailto:uv@upaya.co.uk]
Gesendet: Freitag, 19. September 2003 14:03
An: users@cocoon.apache.org
Betreff: Re: AW: AW: AW: File existence
What error are you getting? Can you show me the code you put into your
sitemap?
Regards, Upayavira
Mustafa Ali, Halgurt wrote:
>Hello,
>
>I've got it as exists, her ist he content of my exists.js:
>
>function exists() {
> var file = new java.io.File(cocoon.parameters["test-uri"]);
> if (file.exists()) {
> cocoon.sendPage(cocoon.parameters["exists-uri"];
> } else {
> cocoon.sendPage(cocoon.parameters["non-exist-uri"];
> }
>}
>
>Have I forgotten anything?
>
>regards
>
>
>-----Ursprüngliche Nachricht-----
>Von: Upayavira [mailto:uv@upaya.co.uk]
>Gesendet: Freitag, 19. September 2003 13:08
>An: users@cocoon.apache.org
>Betreff: Re: AW: AW: File existence
>
>Mustafa Ali, Halgurt wrote:
>
>
>
>>Hello,
>>
>>I did it as you said, but I got this error message:
>>
>>(Exists is not a function)
>>
>>
>>
>>
>Note that Javascript is case sensitive. Have you got it as Exists or as
>exists?
>
>
>
>>Another question, when I call the Pipeline handling, I don't have just ID as parameter, even more, how can I pass these parameters to the non-exists pipeline?
>>
>>
>>
>You should be able to get at the request parameter inside the non-exists
>pipeline just as in any other, e.g. with value="{request-param:id}.xml"/>
>
>Regards, Upayavira
>
>
>
>>Here is my pipelines:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>-----Ursprüngliche Nachricht-----
>>Von: Upayavira [mailto:uv@upaya.co.uk]
>>Gesendet: Freitag, 19. September 2003 11:08
>>An: users@cocoon.apache.org
>>Betreff: Re: AW: File existence
>>
>>You seem to be having a lot of trouble with this. Have you considered
>>using flow? With the below, if the file exists, the pattern="exists"
>>pipeline will be shown, otherwise the pattern="non-existent" pipeline
>>will be shown.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> whatever
>>
>>
>>
>> whatever
>>
>>
>>In your sitemap, just before the element:
>>
>>
>>
>>
>>Create a file called flow/exists.js:
>>
>>function exists() {
>> var file = new java.io.File(cocoon.parameters["test-uri"]);
>> if (file.exists()) {
>> cocoon.sendPage(cocoon.parameters["exists-uri"];
>> } else {
>> cocoon.sendPage(cocoon.parameters["non-exist-uri"];
>> }
>>}
>>
>>HTH. Regards, Upayavira
>>
>>Mustafa Ali, Halgurt wrote:
>>
>>
>>
>>
>>
>>>Oh, you are right, I changed it, but the pipeline still choose the second part, no matter whether the file exists or not, it ignores the ... part, do you have an Idea what is perhaps wrong?
>>>
>>>Thanks,
>>>Halgurt
>>>PS: I am a Kurd and my first name is Halgurt, we don't have surnames, Mustafa is my father and Ali my Grandfather.
>>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: Olivier Billard [mailto:obillard@rennes.jouve.fr]
>>>Gesendet: Freitag, 19. September 2003 10:02
>>>An: users@cocoon.apache.org
>>>Betreff: Re: File existence
>>>
>>>Hi Halgurt (I'm french and didn't manage to see what is your name and first name, so sorry
>>>if i'm wrong),
>>>
>>>Please check if you *really* didn't wrote {request-parameter:ID} instead of
>>>{request-param:ID}, because the error seem to point a mistake of this type...
>>>see :
>>>cause: org.apache.avalon.framework.component.ComponentException: *input-modules*:
>>>ComponentSelector could not find the component for hint [*request-parameter*] (key
>>>[*request-parameter*])
>>>
>>>-> this should be request-param...
>>>
>>>--
>>>Olivier
>>>
>>>
>>>On 19/09/2003 10:30, Mustafa Ali, Halgurt wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Sure, here is it:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>cause: org.apache.avalon.framework.component.ComponentException: input-modules: ComponentSelector could not find the component for hint [request-parameter] (key [request-parameter])
>>>>
>>>>
>>>>
>>>>-----Ursprüngliche Nachricht-----
>>>>Von: Olivier Billard [mailto:obillard@rennes.jouve.fr]
>>>>Gesendet: Freitag, 19. September 2003 09:19
>>>>An: users@cocoon.apache.org
>>>>Betreff: Re: AW: AW: AW: AW: File existence
>>>>
>>>>Can you send the exact error and the stack trace you got ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>>
>>
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org