PhpGenerator help

2003-03-16 Thread JD Daniels
Has anyone gotten the phpgenerator to work? I have followed this page:

http://wiki.cocoondev.org/Wiki.jsp?page=PHPGenerator

and do not get any error messages.. just a blank html page (The html/body
tags are present, just no content)

My config:

Redhat 7.3
tomcat 4.1.18
Cocoon 2.1-dev (March 16 cvs checkout)

My phpsrvlt.jar is only 10k ... seems kinda small - Is this right?

JD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: pass attributes to phpgenerator

2003-01-26 Thread Marco Rolappe
hi johannes,

I think you should be matching the request parameter(s) via the respective
matcher, i.e. RequestParameterMatcher. the default (WildcardURI) matcher
most probably only matches on the URI.

so (from the top of my head) it would be something like:

!--php try--
map:pipeline
map:match pattern=one2.php
   map:match type=request-parameter pattern=myparam

   map:generate type=php src=daten/one.php
   map:parameter name=myparam value={1}/ !-- param matched by
request-parameter matcher --
   /map:generate
   /map:match

   map:transform src=stylesheets/try1.xsl/
   map:serialize type=xml/
/map:match
/map:pipeline

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag
von Johannes Stein
Gesendet: Sonntag, 26. Januar 2003 04:19
An: [EMAIL PROTECTED]
Betreff: pass attributes to phpgenerator


hello people!

after some hours of configuration, i finally got the c2 phpgenerator
set up correctly. next thing would be to pass http-attributes as
parameters to the php-script. i tried something like this in the sitemap:

!--php try--
map:pipeline
map:match pattern=one2.php?myparam=**
   map:generate type=php src=daten/one.php
  map:parameter name=myparam value={1}/
/map:generate
   map:transform src=stylesheets/try1.xsl/
   map:serialize type=xml/
/map:match
/map:pipeline

then i called the url one2.php?myparam=three, but the variable myparam isn't
available
in the php-script, referring to it seems to result in a php errormessage
(which is no valid xml, therefore i do not see anything of it).

i'd be delighted if anyone had some experience to share on this problem!

Thank you,  johannes


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




pass attributes to phpgenerator

2003-01-25 Thread Johannes Stein



hello people!

after some hours of configuration, i finally got 
the c2 phpgenerator
set up correctly. next thing would be to pass 
http-attributes as
parameters to the php-script. i tried something 
like this in the sitemap:

!--php 
try--map:pipelinemap:match 
pattern="one2.php?myparam=**" map:generate type="php" 
src="" map:parameter 
name="myparam" value="{1}"/ 
/map:generate map:transform 
src=""/ map:serialize 
type="xml"//map:match/map:pipeline

then i called the url one2.php?myparam=three, but 
the variable myparam isn't available
in the php-script, referring to it seems to result 
in a php errormessage
(which is no valid xml, therefore i do not see 
anything of it).

i'd be delighted if anyone had some experience to 
share on this problem!
Thank you, johannes


Re: PHPGenerator

2002-11-20 Thread Alexandru COSTIN
Hello,
To use PHP and XML content publishing, you should also try Krysalis.
http://www.interakt.ro/products/Krysalis

Alexandru
On Mon, 2002-11-18 at 15:37, Leszek Gawron wrote:
 I am not able to make PHPGenerator work but maybe you will see some mistake in
 my actions:
 1. I have downloaded PHP 4.2.3 Win32 binaries from PHP site 
 2. I have enabled php_java extension and setup [Java] section like this:
 [Java]
 java.class.path = c:\DevTools\php-4.2.3-Win32\extensions\php_java.jar
 java.home = c:\DevTools\jdk1.3.1_06 
 java.library = c:\DevTools\jdk1.3.1_06\jre\bin\hotspot\jvm.dll 
 java.library.path = c:\DevTools\php-4.2.3-Win32\extensions\
 
 3. I have downloaded phpsrvlt.jar from somewhere (the original from PHP
 binaries did not contain net.php.servlet class and I was not able to compile
 PHP by myself due to some compilation errors)
 
 4. I have put phpsrvlt.jar int lib/optional dir of cocoon sources (today's
 snapshot) and updated jars.xml
 
 5. I have built cocoon (scratchpad war)
 
 6. Set up some environment variables (do not even remember which ones)
 
 7. started tomcat (4.1.12)
 
 8. opened cocoon to see if it works
 
 9. added the sitemap entry:
 map:match pattern=test.php
  map:generate type=php src=documents/test.php/
  map:serialize type=xml/
   /map:match
 10.  created a simple php file:
 ?php 
 
print ?xml version=\1.0\?\n;
 
print page\n;
print titleHello world from PHP/title\n;
print content\n;
print paraThis is my page being dynamically generated using a 
PhpGenerator/para\n;
print /content\n;
print /page\n;
 ?
 
 11. run http://localhost:8080/cocoon/test.php
 
 And I get the following error: 
 Function registration failed - duplicate name - java_last_exception_get
 Function registration failed - duplicate name - java_last_exception_clear
 java: Unable to register functions, unable to load
 
 I have figured out that if I disable php_java.dll extension ( and [Java]
 section) this error does not occur but still happens what follows:
 
 org.apache.cocoon.ProcessingException: org.xml.sax.SAXParseException: Premature end 
of file.: null:-1:-1:org.xml.sax.SAXParseException: Premature end of file.
   at org.apache.cocoon.generation.PhpGenerator.generate(PhpGenerator.java:198)
   at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:512)
   at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:204)
   at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483)
   at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:149)
   at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
   at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:166)
   at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
   at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
   at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
   at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:143)
   at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
   at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
   at org.apache.cocoon.Cocoon.process(Cocoon.java:596)
 
 What is really funny, when i look into tomcat's console window I see:
 ?xml version=1.0?
 page
 titleHello world from PHP/title
 content
 paraThis is my page being dynamically generated using a PhpGenerator/para
 /content
 /page
 
 Configuration summary:
 Windows 2000
 JDK 1.3.1 06
 xml-cocoon2_20021118112152.tar.gz
 php 4.2.3
 phpsrvlt.jar from somewhere :) (got the link :
 http://www.9753.net/download/server/php/java/ )
 
 Has anyone got this error before?
 
 I thought that PHP Generator would be quite useful when dealing with databases
 that do have ODBC and do not have JDBC (still I'm trying to figure out how to
 access Pervasive 7 from cocoon)
 
 but questions are coming:
 1. What about request parameters? Will they be visible in php code?
 2. How could I access user session data?
 3. What to do if php code generates an error ? I'm almost sure that this would
 lead to non well formed xml document
   ouzo
   
-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 411 2610


-
Please check that your question  has not already

PHPGenerator

2002-11-18 Thread Leszek Gawron
I am not able to make PHPGenerator work but maybe you will see some mistake in
my actions:
1. I have downloaded PHP 4.2.3 Win32 binaries from PHP site 
2. I have enabled php_java extension and setup [Java] section like this:
[Java]
java.class.path = c:\DevTools\php-4.2.3-Win32\extensions\php_java.jar
java.home = c:\DevTools\jdk1.3.1_06 
java.library = c:\DevTools\jdk1.3.1_06\jre\bin\hotspot\jvm.dll 
java.library.path = c:\DevTools\php-4.2.3-Win32\extensions\

3. I have downloaded phpsrvlt.jar from somewhere (the original from PHP
binaries did not contain net.php.servlet class and I was not able to compile
PHP by myself due to some compilation errors)

4. I have put phpsrvlt.jar int lib/optional dir of cocoon sources (today's
snapshot) and updated jars.xml

5. I have built cocoon (scratchpad war)

6. Set up some environment variables (do not even remember which ones)

7. started tomcat (4.1.12)

8. opened cocoon to see if it works

9. added the sitemap entry:
map:match pattern=test.php
   map:generate type=php src=documents/test.php/
   map:serialize type=xml/
/map:match
10.  created a simple php file:
?php 

   print ?xml version=\1.0\?\n;

   print page\n;
   print titleHello world from PHP/title\n;
   print content\n;
   print paraThis is my page being dynamically generated using a 
PhpGenerator/para\n;
   print /content\n;
   print /page\n;
?

11. run http://localhost:8080/cocoon/test.php

And I get the following error: 
Function registration failed - duplicate name - java_last_exception_get
Function registration failed - duplicate name - java_last_exception_clear
java: Unable to register functions, unable to load

I have figured out that if I disable php_java.dll extension ( and [Java]
section) this error does not occur but still happens what follows:

org.apache.cocoon.ProcessingException: org.xml.sax.SAXParseException: Premature end of 
file.: null:-1:-1:org.xml.sax.SAXParseException: Premature end of file.
at org.apache.cocoon.generation.PhpGenerator.generate(PhpGenerator.java:198)
at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:512)
at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:204)
at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483)
at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:149)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:166)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:143)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
at org.apache.cocoon.Cocoon.process(Cocoon.java:596)

What is really funny, when i look into tomcat's console window I see:
?xml version=1.0?
page
titleHello world from PHP/title
content
paraThis is my page being dynamically generated using a PhpGenerator/para
/content
/page

Configuration summary:
Windows 2000
JDK 1.3.1 06
xml-cocoon2_20021118112152.tar.gz
php 4.2.3
phpsrvlt.jar from somewhere :) (got the link :
http://www.9753.net/download/server/php/java/ )

Has anyone got this error before?

I thought that PHP Generator would be quite useful when dealing with databases
that do have ODBC and do not have JDBC (still I'm trying to figure out how to
access Pervasive 7 from cocoon)

but questions are coming:
1. What about request parameters? Will they be visible in php code?
2. How could I access user session data?
3. What to do if php code generates an error ? I'm almost sure that this would
lead to non well formed xml document
ouzo

-- 
__
 | /  \ |Leszek Gawron//  \\
\_\\  //_/  [EMAIL PROTECTED]  _\\()//_
 .'/()\'. Phone: +48(600)341118 / //  \\ \
  \\  //  recursive: adj; see recursive  | \__/ |


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL

Re: [ PHPGenerator ] Inital draft of PHPGenerator docs on Wiki

2002-11-13 Thread Jose Borges Ferreira
On Tue, 2002-11-12 at 18:12, Tony Collen wrote:
 
 Off, nasty. I'll take a look at it when I have a chance.  I wasn't able to
 get back to working on this last night.   I'll keep you updated.
 
 
 Tony
 
 Tony Collen -- [EMAIL PROTECTED]
 College of Liberal Arts   University of Minnesota, Minneapolis, West Bank
 

Great!

This isn't the right place to post this question , but has anybody
successfully run php as a servlet. I've tried run directly under
tomcat but after some reloads tomcat dies.

Z.

-- 
Linux is not user-friendly. It _is_ user-friendly.
It is not ignorant-friendly and idiot-friendly.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: [ PHPGenerator ] Inital draft of PHPGenerator docs on Wiki

2002-11-12 Thread Jose Borges Ferreira
Hi there !


I made all the steps you sugest on your page and i got the following
error :

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: bailout
at net.php.servlet.send(Native Method)
at net.php.servlet.service(servlet.java:188)
at net.php.servlet.service(servlet.java:212)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

...

Any ideas ?

Z.


On Mon, 2002-11-11 at 22:47, Tony Collen wrote:
 http://outerthought.net/wiki/Wiki.jsp?page=PHPGenerator
 
 I've gone through the process myself up until make, and then I had to 
 leave to work, so I made an educated guess as to what should happen 
 afterwards.  When I get home, I'll go through the rest and make sure the 
 directions work.
 
 Could someone else with experience getting the PHPGenerator working 
 please check my docs to make sure they're accurate?  
 
 On a side note (to -dev), why is it PhpGenerator and not 
 PHPGenerator?  We have HTTPGenerator and SWFGenerator, so perhaps the 
 file should be renamed to PHPGenerator for consistency's sake?
 
 
 Tony
 
 
 
 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html
 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]
-- 
Linux is not user-friendly. It _is_ user-friendly.
It is not ignorant-friendly and idiot-friendly.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: [ PHPGenerator ] Inital draft of PHPGenerator docs on Wiki

2002-11-12 Thread Tony Collen
On 12 Nov 2002, Jose Borges Ferreira wrote:

 Hi there !


 I made all the steps you sugest on your page and i got the following
 error :

 HTTP Status 500 -

 type Exception report

 message

 description The server encountered an internal error () that prevented
 it from fulfilling this request.

 exception

 javax.servlet.ServletException: bailout
   at net.php.servlet.send(Native Method)
   at net.php.servlet.service(servlet.java:188)
   at net.php.servlet.service(servlet.java:212)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
   at
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)


Off, nasty. I'll take a look at it when I have a chance.  I wasn't able to
get back to working on this last night.   I'll keep you updated.


Tony

Tony Collen -- [EMAIL PROTECTED]
College of Liberal Arts   University of Minnesota, Minneapolis, West Bank


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




[ PHPGenerator ] Inital draft of PHPGenerator docs on Wiki

2002-11-11 Thread Tony Collen
http://outerthought.net/wiki/Wiki.jsp?page=PHPGenerator

I've gone through the process myself up until make, and then I had to 
leave to work, so I made an educated guess as to what should happen 
afterwards.  When I get home, I'll go through the rest and make sure the 
directions work.

Could someone else with experience getting the PHPGenerator working 
please check my docs to make sure they're accurate?  

On a side note (to -dev), why is it PhpGenerator and not 
PHPGenerator?  We have HTTPGenerator and SWFGenerator, so perhaps the 
file should be renamed to PHPGenerator for consistency's sake?


Tony



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]



C2 - PhpGenerator

2001-08-13 Thread Jan



Hi,

I am experiencing problems with setting up PHP as 
generator for c2.
Having recompiled c2 with phpsrvlt.jar and 
php_java.jar in the lib directory without problems now I get the attached error 
message on sites that use the PhpGenerator.
The two jar files I got from a friend of mine two 
days ago but I cannot reach him, so I have no clue where they are from and 
whether or not they are the most recent version - c2 is the latest CVS checkout 
(from yesterday at least). So if somebody knows what to do or where I can get 
these jar files - maybe including some documentation - please 
answer.

Thxia,
Jan.


Internal Servlet Error:java.lang.UnsatisfiedLinkError: no phpsrvlt in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)
	at java.lang.Runtime.loadLibrary0(Runtime.java:749)
	at java.lang.System.loadLibrary(System.java:820)
	at net.php.reflect.loadLibrary(reflect.java:34)
	at net.php.reflect.(reflect.java:29)
	at net.php.servlet.init(servlet.java:131)
	at org.apache.cocoon.generation.PhpGenerator.generate(PhpGenerator.java:146)
	at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:219)
	at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:363)
	at org.apache.cocoon.www.sitemap_xmap.wildcardMatchN24B(sitemap_xmap.java:2917)
	at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2155)
	at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2067)
	at org.apache.cocoon.sitemap.Handler.process(Handler.java:160)
	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:103)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:423)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:535)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java)
	at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:500)
	at org.apache.tomcat.core.Handler.service(Handler.java:223)
	at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:448)
	at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:788)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:701)
	at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:143)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:424)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:497)
	at java.lang.Thread.run(Thread.java:484)