How to make a simple news/updates list

2004-05-06 Thread Anders Forsgren
Hi
Im trying to add a simple list of text/xml chunks  to my cocoon site. 
(which could be used for example as a list of news/site 
updates/guestbook posts etc.).
Doing this with esql seems relatively easy, but it also seems overkill 
to run a database process just to keep a single list of xml chunks. 
Also, I'd like the site to be movable to another cocoon server without 
configuring any database servers and so on at the new location, that is: 
the data has to be stored inside the webapp directory.

So far I have considered these methods:

- raw xml data files. Edit file in text editor to add data, or use the 
SourceWritingTransformer if I need a web form.
- embedded sql database (can hsqldb be completely internal to the webapp 
like xindice-embed is?)
- embedded xindice. Haven't had any success with this, but it feels like 
the best solution. Has anyone seen any simple example apps (like for 
example a guestbook) using embedded xindice in cocoon?

Any recommendations or links are appreciated...

rgds
Anders


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


Re: Deployment/Migration to linux (update)

2004-02-15 Thread Anders Forsgren
Anders Forsgren wrote:


Anders Forsgren wrote:

- The WEB-INF/work and logs directories are not created when the 
webapp loads, probably a problem with file access. What directories 
and permissions do I need to give to the user running the tomcat 
process?

The only traces of errors I can find are in the 
/etc/jakarta-tomcat/logs/catalina.out  , where cocoon complains about 
not being able to create the log files.


Now the file permission problems have been resolved (by making myself 
and the tomcat user belong to the same group). The log directory and 
logkit files are created ok when I deploy the webapp in the manager, 
but now I get an OutOfMemoryError at servlet.init() when I first try 
to visit the webapp through a browser. Is this a cryptic way of saying 
something else is wrong, or is the server actually out of memory? Has 
anyone else seen this? 

Cocoon 2.1 on Tomcat 4.1.27 on linux

Thanks
Anders


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


Re: Deployment/Migration to linux

2004-02-15 Thread Anders Forsgren


- The WEB-INF/work and logs directories are not created when the 
webapp loads, probably a problem with file access. What directories 
and permissions do I need to give to the user running the tomcat 
process?


Well, Tomcat will be started as a specific user; I usually install a 
tomcat user, but this must not be the case, and is probably not even 
the recommended way. however: the user under which tomcat is startes 
should have write rights to these directories.
Tomcat runs as the user tomcat. The webapp resides in a folder 'webapp' 
under my own home directory, so per default, the tomcat process does not 
have write access.

As a test, I have given +rwx to all users to webapp, webapp/WEB-INF, 
webapp/work directories. Still, the logikit complains that it cannot 
create files. under webapp/WEB-INF/logs

I'm not sure wether the tomcat process was started with a security 
policy, and I don't have access to the jakarta-tomcat/conf directory. 
I'd like to bother the administrator as little as possible, so I figure 
perhaps I should be doing my testing first on my own linux setup?

How difficult is it to set up a minimal linux development environment 
with tomcat and cocoon? Can it be done with a knoppix or mandrake 
livecd? Or better yet, are there any "testbed" linux distros that 
installs on windows as an application?

Thanks
Anders




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


Deployment/Migration to linux

2004-02-15 Thread Anders Forsgren
Hi,

I hope someone could help me sort out some of the problems I'm 
experiencing when deploying my cocoon webapp to a linux server.

I'm developing and testing my cocoon 2.1  webapp under windows XP/Tomcat 
4.1.29, and it works great.

Now that it's done, Im going to deploy the whole thing to a server where 
I have my homepage account. It's a linux server, running Tomcat 4.1.27 
through Apache. I have stumbled across a couple of problems, most of 
which I blame on not being all that linux-literate.

- The WEB-INF/work and logs directories are not created when the webapp 
loads, probably a problem with file access. What directories and 
permissions do I need to give to the user running the tomcat process?

- I have some small dynamic images made with svg and svg2jpeg, which 
will not render. I have read some things about problems with batik on 
headless setups, but also that It should not be a problem since jdk 1.4. 
Where do I start looking for the problem?

The only traces of errors I can find are in the 
/etc/jakarta-tomcat/logs/catalina.out  , where cocoon complains about 
not being able to create the log files.

I also have some problems with xsp-actions, but I figure these errors 
are just following from the write-access problems (i.e. the /work 
directory needs to be created before an xsp will work)? Am I correct?

I was hoping to be able to merely upload the whole directory structure 
from the windows machine to the linux machine, but unfortunately this 
was not the case (how naive).  :)
The server administrator is a busy person, and there are loads of other 
webapps running in the same tomcat process, so I'd rather not be 
experimenting to much with it either.

Thanks for any pointers to 
'how-to-deploy-your-cocoon-app-on-linux-without-headaches' docs.

Regards

Anders













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


map:parameter and xsl defaults

2003-12-16 Thread Anders Forsgren
Hi all

I want to use a request param passed on as an argument to a transform.
The sitemap snippet looks like this:


 
  
  




In the log2page.xsl file, I have defaults for the parameters, for example
  

The default values are never assigned, which means the transform only 
works when both parameters are specified in the request params. What 
will the {request-param:foo} be replaced with when a param is not 
specified in the request? I don't know about empty versus "undefined" 
parameters, I wonder if the sitemap somehow passes an "empty but still 
valid/defined" (like a "" String versus the null String) -parameter to 
the xsl that prevents the defaults from being used?

If  I don't use any map:params with my transform, the defaults are used 
correctly inthe xsl.

Do I have to use a sitemap swicth to do the transform without 
map:parameter when the request parameters are missing, and with 
map:parameter when they exist? Seems like a lot of work, and also makes 
the xsl defaults unusable...
Am I missing the simple solution here?

rgds
Anders


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


Re: xindice & xml:db samples

2003-11-30 Thread Anders Forsgren

Hi all,
How do I get the xmldb block samples working?
They don't exist at the moment ...

Ah I get it, I'm at the edge of the devel process :) I thought I was 
just too stupid to get it running

Am I correct when I think that cocoon together with xindice embedded 
will be a brilliant sort of "self-contained" app? (i.e. the App will be 
truly portable, the data can reside in WEB-INF)? If so, then this should 
be the main benefit of the proposed cocoon-nuke: the fact that most 
people who want a cms or community portal can't install and prepare a 
dbms, a web server, and php/perl/whatever - site. Dumping a .war into 
the webapps dir of a servlet container would certainly be a lot easier.

rgds
Anders


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


xindice & xml:db samples

2003-11-29 Thread Anders Forsgren
Hi all,
How do I get the xmldb block samples working?
I found this page, which is as confusing as it is new
http://wiki.cocoondev.org/Wiki.jsp?page=XMLIndiceCocoon2.1
I have the cocoon 2.1.4-dev up and running, with the xmldb block 
included. Do I need to create the 'db' database or any special 
collections in the xindice db before the xmldb samples work? If so, how 
do I create data? Do I still need to build & run xindice from the 
command line to do that?

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


Re: XSP/ESQL escaping

2003-11-04 Thread Anders Forsgren
Sigh :(

Feels like a lot of work to make a linebreak a  tag...If I rephrase 
the question: What would be the simplest way
of  displaying the database strings with correct linebreaks in html 
(except using  in the xsl)?

thanks

Anders




Yes, you cannot use tags inside java strings in this fashion.  When XSP
sees this tag, it tries to insert a whole block of code to output the tag
into the SAX output, which should give you a compilation error.
I'm actually not certain how it is you are able to pass the results of
esql:get-xml into a function call without getting compilation errors.  The
get-xml tag also turns into a whole block of code, not an expression which
can be passed to a function.  What version of Cocoon are you using?  In
C2.0.3, which I am using, you would be unable to do this, and you would be
unable to do substitutions inside the returned XML.  Instead, you'd have to
get the results using get-string, do your substitutions (using < in
place of <), then run the resulting String through an XML parser to get it
into the SAX stream.   (A good example of this is the code that implements
get-xml in the ESQL logicsheet, which is in your cocoon jar file.)
HTH.

-Christopher



|-+>
|     |   Anders Forsgren  |
| |   <[EMAIL PROTECTED]|
| |   rmers.com>   |
| ||
| |   11/04/2003 04:31 |
| |   PM   |
| |   Please respond to|
| |   users|
| ||
|-+>
 
>--|
 | 
 |
 |   To:   [EMAIL PROTECTED]   
   |
 |   cc:   
 |
 |   Subject:  Re: XSP/ESQL escaping   
 |
 
>--|




 >Where and how is formatMessage() implemented? That is the code we
really
>need to see, I think.

Thanks for your time

The formatMessage is implemented above the problem in the xsp logic
section, and it (currently) only does this  :

public string formatMessage(String message)
{
return instring.replaceAll("\n", ")
}

the problem area in the xsp, like I said looks like this

formatMessage()
The problem occurs when the xsp:expr contains tags (i.e. if I do the
replace "\n" ---> "foo" , then all is well, but "\n" ---> "" will
not work. )
rgds

Anders

 



   



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




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



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


Re: XSP/ESQL escaping

2003-11-04 Thread Anders Forsgren
 >Where and how is formatMessage() implemented? That is the code we 
really

>need to see, I think.

Thanks for your time

The formatMessage is implemented above the problem in the xsp logic 
section, and it (currently) only does this  :


public string formatMessage(String message)
{
return instring.replaceAll("\n", ")
}

the problem area in the xsp, like I said looks like this

formatMessage()

The problem occurs when the xsp:expr contains tags (i.e. if I do the 
replace "\n" ---> "foo" , then all is well, but "\n" ---> "" will 
not work. )

rgds

Anders







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


XSP/ESQL escaping

2003-11-04 Thread Anders Forsgren
Hi

I have a problem with escaping when retrieving database data in an xsp 
page. For each row in the resultset, the following xml is generated:


  
  
  formatDate()
  formatMessage()


The formatMessage method will replace all line breaks (\n) with the tag 
, however in this context that will give a  an error for some 
reason. If I replace the \n's with >br/< etc, then it works, so 
it's a document structure error obviously, but I don't see why it should 
be?.

Also, which is the best way to develop xsp efficiently? I'm using 
eclipse/tomcat4/cocoon2.0 on windows, and with this configuration the 
requests time out when there is an error in either the code or structure 
of the xsp, not easily debugged. Even the not-so-helpful generated code 
error pages would be more helpful, but they only show up on rare occasions.

Thanks for any help

Anders

  




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


Re: nuke like engine based on cocoon

2003-10-24 Thread Anders Forsgren
I could help out

I once tried using phpNuke but started hating the ugly mixing of looks 
and content, and the quick hack look of it all. I wanted something 
skinnable so I started writing a simple nuke like community portal that 
used Xalan and an xsl skin to show 
news/forums/polls/downloads/members/etc from a mysql database with 
"modules" producing pages and blocks from the xml content. modules can 
be added/removed and restricted to access levels etc.

3 months into this project i realized that half the work was actually 
implemented already in something called cocoon :(
I am also very interested in using cocoon to make a solid replacement 
for phpNuke.

A look of what it looked like before I ditched the project and started 
looking into cocoon is on this game-clan's website (unfortunately swedish)
http://sheriff.mine.nu

Without knowing too much about cocoon blocks, they seem like they could 
help a lot in the creation of such a framework...

rgds
/Anders



 

this is just an idea or/and a proposition
to begin a "CocoonNuke" maybe project 
something just like nukes (postnuke phpnuke) but using cocoon
   

 



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