Re: cocoon-2.1.12 - lucene indexer - cinclude

2015-03-17 Thread Peter Sparkes

Hi Jos,

The files to include come from in the sitemap

map:parameter name=content-directory 
value=/usr/share/tomcat7/instances/wolseylodges/webapps/ROOT/Bamp;B/xml/

map:parameter name=include-pattern value=.xml$/

 !-- create the index from the contents of a collection --
 map:match pattern=create.html
  map:call function=indexCollection
  map:parameter name= value=screen/indexer/
  map:parameter name=lucene-directory 
value={global:lucene-directory}/
 map:parameter name=lucene-analyzer 
value={global:lucene-analyzer}/
 map:parameter name=lucene-merge-factor value=10/
 map:parameter name=lucene-create-index value=false/
 map:parameter name=lucene-content 
value=cocoon:/prepare4indexing//
 map:parameter name=content-directory 
value=/usr/share/tomcat7/instances/wolseylodges/webapps/ROOT/Bamp;B/xml/

 map:parameter name=include-pattern value=.xml$/
 map:parameter name=result-directory value=/
 map:parameter name=result-suffix value=/
 /map:call
/map:match


If I make a change to a file that is correctly included and then search for it in a Lucene search 
the correct file is found, so all appears to be working correctly except for the Cinclude of new files


Cheers

Peter





On 17/03/2015 08:04, Jos Snellings wrote:

Hi Peter,

What file do you want to include? (I see no src attribute?)

Cheers,
Jos

On Mon, Mar 16, 2015 at 8:37 PM, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi,

I have a lucene application base on samples/blocks/querybean

All worked fine for a long time, but now the cinclude in

 !-- the lucene indexer --
map:match pattern=screen/indexer
   map:generate type=jx src=screens/lucene-indexer.xml/
   map:transform type=cinclude/

for new file result in for example:
lucene:document url=2947 /lucene:document

instead of for the older files

lucene:document url=4696
   lodge lodge=west farm web=true
etc
/lodge
/lucene:document

Please,Any ideas why the   cinclude is not properly including the new 
file

Peter





--
Confucius said way too much ...





cocoon-2.1.12 - lucene indexer - cinclude

2015-03-16 Thread Peter Sparkes

Hi,

I have a lucene application base on samples/blocks/querybean

All worked fine for a long time, but now the cinclude in

 !-- the lucene indexer --
map:match pattern=screen/indexer
   map:generate type=jx src=screens/lucene-indexer.xml/
   map:transform type=cinclude/

for new file result in for example:
lucene:document url=2947 /lucene:document

instead of for the older files

lucene:document url=4696
   lodge lodge=west farm  web=true
etc
/lodge
/lucene:document

Please,Any ideas why the   cinclude is not  properly including the new 
file

Peter




Re: Sending Email from a form

2015-03-12 Thread Peter Sparkes

Thank you all for your help. It is a smarthost problem with one particular 
email address

Peter

On 05/03/2015 17:50, Kunisch, Arne wrote:


Dear Peter,

you should check your notice from your email provider:

https://www.bytemark.co.uk/support/document_library/smarthost/

You use smtp.bytemark.co.uk as your smtp-relay.

They describe in the document link above, why you should **not** do this 
anymore.

Hope that helps,

Arne

*From:*Peter Sparkes [mailto:pe...@didm.co.uk]
*Sent:* Thursday, March 05, 2015 6:26 PM
*To:* users@cocoon.apache.org
*Subject:* Sending Email from a form

Hi

I have an application that used a form to send emails.

This has worked successfully for many years. However, recently  users have reported getting error 
messages, as per the attached.


My testing has shown that:

  * Sometime the send email works as it should.
  * Sometimes it does not and the user gets the attached error message.


My email javascript is:

 try {
  mms = 
cocoon.getComponent(Packages.org.apache.cocoon.mail.MailSender.ROLE);

  if (cocoon.parameters.host !=  || cocoon.parameters.user != ) {
  mms.setSmtpHost(smtp.bytemark.co.uk,
 cocoon.parameters.user,
 cocoon.parameters.password);
 }

 mms.setFrom(fromemail);
 mms.setTo(lodgeemail);
 mms.setSubject(subject);
 mms.setCc(i...@wolseylodges.com mailto:i...@wolseylodges.com);

 mms.setBody(body1, text/plain; charset=utf-8);

//mms.addAttachment(cocoon.request.get(attachment));
//mms.addAttachmentURL(cocoon:///);
   // mms.addAttachmentURL(context://welcome.xml);

 mms.send();

  } finally {
  cocoon.releaseComponent(mms);
  }

Has anybody any ideas, please.

Peter Sparkes





Re: Sending Email from a form

2015-03-05 Thread Peter Sparkes
**com.sun.mail.smtp.SMTPAddressFailedException: 451-Unable to verify recipient -- see 
http://www.bytemark.co.uk/smarthost for 451 help.


On 05/03/2015 17:47, Jos Snellings wrote:

Hi Peter,

Cannot read the message. Can you send it as quoted text please?

Kind regards,
Jos

On Thu, Mar 5, 2015 at 6:25 PM, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi

I have an application that used a form to send emails.

This has worked successfully for many years. However, recently  users have 
reported getting
error messages, as per the attached.

My testing has shown that:

  * Sometime the send email works as it should.
  * Sometimes it does not and the user gets the attached error message.


My email javascript is:

 try {
  mms = 
cocoon.getComponent(Packages.org.apache.cocoon.mail.MailSender.ROLE);

  if (cocoon.parameters.host !=  || cocoon.parameters.user != ) {
  mms.setSmtpHost(smtp.bytemark.co.uk 
http://smtp.bytemark.co.uk,
 cocoon.parameters.user,
 cocoon.parameters.password);
 }

 mms.setFrom(fromemail);
 mms.setTo(lodgeemail);
 mms.setSubject(subject);
 mms.setCc(i...@wolseylodges.com mailto:i...@wolseylodges.com);

 mms.setBody(body1, text/plain; charset=utf-8);

//mms.addAttachment(cocoon.request.get(attachment));
//mms.addAttachmentURL(cocoon:///);
   // mms.addAttachmentURL(context://welcome.xml);

 mms.send();

  } finally {
  cocoon.releaseComponent(mms);
  }

Has anybody any ideas, please.

Peter Sparkes




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org




--
Confucius said way too much ...





Re: javascript -Java

2014-09-27 Thread Peter Sparkes

Hi Jos

Thanks for the suggestion,  unfortunately it made  no difference

Peter

On 27/09/2014 07:23, Jos Snellings wrote:

Hi Peter,

Try in your javascript/flowscript:
var imagescaled = Scalr.resize(imagein, size);

without the new keyword. reason: You try to call a so-called static method.

Hope that helps.
Jos

On Fri, Sep 26, 2014 at 10:30 PM, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi,

Cocoon 2.1.12

Ref http://cocoon.apache.org/2.1/userdocs/flow/java.html

Please how do I associate

importClass(Packages.org.imgscalr.Scalr);

with its jar file imgscalr-lib-4.2.jar

which I put in

WEB-INF/lib

Regards

Peter




--
Confucius said way too much ...





javascript -Java

2014-09-26 Thread Peter Sparkes

Hi,

Cocoon 2.1.12

Ref http://cocoon.apache.org/2.1/userdocs/flow/java.html

Please how do I associate

importClass(Packages.org.imgscalr.Scalr);

with its jar file imgscalr-lib-4.2.jar

which I put in

WEB-INF/lib

Regards

Peter


Re: Resizing images using imgscalr

2014-09-25 Thread Peter Sparkes

Hi

The importClass(Packages.problem has been fixed.

I now get the following error

org.mozilla.javascript.EvaluatorException: 
file:///usr/share/tomcat7/instances/chinese-dev/webapps/ROOT/office/flow/upload_example.js, line 
103: Can't find method org.imgscalr.Scalr.resize(java.awt.image.BufferedImage,java.lang.Integer).


The problem I have is that I am not a java programmer

Regards

Petere


On 24/09/2014 14:31, Thorsten Scherler wrote:

On 18/09/14 15:43, Peter Sparkes wrote:

Hi,

Cocoon 2.1.12

 I use the following javascript ( Text in Black )with the Cocoon Upload widget uploading images 
to the upload-dir and then move them to the lodgeimage300px directory. This works


I now want to scale the images using imgscalr , 
http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/#source


I, therefore, added the code in red

The BufferedImage   in BufferedImage scaledImage =Scalr.resize(file, 200); gave 
me a syntax error.

On removing BufferedImage   I get the following error Scalr is not defined

Can anyone help me Please

Peter

importClass(Packages.java.io.File);
importClass(Packages.java.io.FileOutputStream);
importClass(Packages.java.io.FileNotFoundException);

importClass(org.imgscalr.Scalr);


This does not have the importClass(Packages. prefix that explains why later this class is not 
defiened. However I personally would solve that with java.


salu2
--
Thorsten Scherler thorsten.at.apache.org
codeBusters S.L. - web based systems
consulting, training and solutions
http://www.codebusters.es/




Advanced Control Flow - Java

2014-09-24 Thread Peter Sparkes

Hi,

http://cocoon.apache.org/2.1/userdocs/flow/java.html; has an example of dynamically compiling Java 
source files and loading and executing the resulting classes at runtime


Please where would the jar file go?

is it WEB-INF/lib, as I can't get it to work?

Thanks

Peter



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: IMAGEOP Block

2014-09-18 Thread Peter Sparkes

Hi David,

Thanks for investigating it.

I am using java 6 on a linux box.

Unfortunately my java is not up to debugging it.

Would it work if I replaced the 2.1 jar with the 2.2 one

Regards

Peter


On 18/09/2014 02:08, David Crossley wrote:

On Wed, Sep 17, 2014 at 11:31:20AM +0100, Peter Sparkes wrote:

Hi

Cocoon 2.1.12

I can't get scale and resize function in the imageop block to work on
cocoon 2.1.12.

I have the following working

  * Display image with original size and colour
  * Tint image various colour


Miguel has been kindly helping me, but he uses cocoon 2.2. Miguel has it
working on 2.2, see below.

Is there a difference between your versions of Java?


Please, has anyone got imageop scale and resize working on 2.1.12?

No. I looked yesterday at Cocoon running locally using the SVN branch
2.1.13-dev
The block samples show the same as what you described above.
The cocoon log file does show the errors, but doesn't mean much to me.
This was with Java 8.

The only thing that i can suggest is to look at the changes that
have been made to the code in 2.2 and compare with 2.1 branch.

http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/imageop/
http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-imageop/

Perhaps when the last changes were made, then there was a slight
difference, and perhaps no-one tested after that.

Those last changes seem to be
https://issues.apache.org/jira/browse/COCOON-2169
https://issues.apache.org/jira/browse/COCOON-2177

-David


Thanks

Peter



On 17/09/2014 07:11, Miguel wrote:

I've done some test and modulo in cocoon 2.2 project works fine. I
describe step by step:

a) Include dependency into pom file of my project:

dependency
  groupIdorg.apache.cocoon/groupId
  artifactIdcocoon-imageop-impl/artifactId
  version1.0.0-SNAPSHOT/version
/dependency

b) Include test map:match into sitemap.xmap:

map:match pattern=prueba/*/scale-*-*
map:read type=image-op-scale
src=themer/themes/common/images/{1}
  map:parameter name=scale-scale value={2} /
  map:parameter name=output-format value={3} /
/map:read
  /map:match

  map:match pattern=prueba/*/resize-*-*
map:read type=image-op-resize
src=themer/themes/common/images/{1}
  map:parameter name=size-width value={2} /
  map:parameter name=size-height value={3} /
/map:read
  /map:match

themer/themes/common/images/ is the route to my images's folder

c) start my project and I test:

* http://localhost:8080/prueba/audio.gif/scale-2.5-jpg
* http://localhost:8080/prueba/audio.gif/resize-100-50

All works fine.


El 16/09/2014 22:27, Peter Sparkes escribió:

Hi Miguel,

My java is not good enough debug the block imageop to see what
parameters's value arrive to class

However as

  * Display image with original size and colour
  * Tint image various colour

are working I assume there is access to image.

http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ also gives
errors on resize (scalling)

Peter



On 16/09/2014 13:52, Miguel wrote:

Hi Peter

  It seems that there isn't access to image or similar error to read it.
I advise you debug the block imageop to see what parameters's value
arrive to class.


This block has only three bugs, and all are fixed, so I think module
must works.
https://issues.apache.org/jira/browse/COCOON/component/12311751/?selectedTab=com.atlassian.jira.jira-projects-plugin:component-summary-panel



El 16/09/2014 14:03, Peter Sparkes escribió:

I am using the Samples block on cocoon 2.1.12

...//samples/blocks/imageop/logo2.png/resize-50-50 gives the following
error:

java.awt.image.ImagingOpException: Unable to transform src image

Cocoon stacktrace[hide]

*Failed to process reader*
context://samples/blocks/imageop/sitemap.xmap - 46:53   /map:read
type=image-op-resize/
context://samples/blocks/sitemap.xmap - 67:68   /map:mount/
context://samples/sitemap.xmap - 198:66 /map:mount/
context://sitemap.xmap - 1086:92/map:mount/


Java stacktrace[hide]

java.awt.image.ImagingOpException: Unable to transform src image
at
java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:357)
at

org.apache.cocoon.reading.imageop.ResizeOperation.apply(ResizeOperation.java:96)
at

org.apache.cocoon.reading.imageop.ImageOpReader.applyEffectsStack(ImageOpReader.java:193)
at

org.apache.cocoon.reading.imageop.ImageOpReader.processStream(ImageOpReader.java:123)
at

org.apache.cocoon.reading.ResourceReader.generate(ResourceReader.java:332)



On 16/09/2014 12:36, Miguel wrote:

Have you checked dependencies?
Have you tried to use block: cocoon-imageop-sample?
Can you show error message when you use transformer?


El 16/09/2014 13:14, Peter Sparkes escribió:

Hi Miguel,

I have implemented imageop, however, the only samples that work are:

  * Display image with original size and colour
  * Tint

Resizing images using imgscalr

2014-09-18 Thread Peter Sparkes

Hi,

Cocoon 2.1.12

 I use the following javascript ( Text in Black )with the Cocoon Upload widget uploading images 
to the upload-dir and then move them to the lodgeimage300px directory. This works


I now want to scale the images using imgscalr , 
http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/#source


I, therefore, added the code in red

The BufferedImage   in BufferedImage scaledImage =Scalr.resize(file, 200); gave 
me a syntax error.

On removing BufferedImage   I get the following error Scalr is not defined

Can anyone help me Please

Peter

importClass(Packages.java.io.File);
importClass(Packages.java.io.FileOutputStream);
importClass(Packages.java.io.FileNotFoundException);

importClass(org.imgscalr.Scalr);
importClass(Packages.java.awt.image.BufferedImage);
importClass(Packages.javax.imageio.ImageIO);

function uploadprogress() {

var form = new Form(forms/uploadprogress_model.xml);
form.setAttribute(counter, new java.lang.Integer(0));
var k = form.showForm(uploadprogress-display-pipeline.jx);

//var fileSource = D:/cocoon-2.1.11-wl/build/webapp/upload-dir/; //for 
testing
var fileSource = 
/usr/share/tomcat7/instances/chinese-dev/webapps/ROOT/upload-dir/;

//var fileTarget = 
D:/cocoon-2.1.11-wl/build/webapp/resources/imagesSmall/; //for testing
var fileTarget = 
/usr/share/tomcat7/instances/chinese-dev/webapps/ROOT/resources/lodgeimages300px/;



var fileSourcePath = ;
var fileTargetPath = ;
var file = ;

var resizedTargetPath = 
/usr/local/tomcat/instances/chinese-dev/webapps/ROOT/resources/lodgeimagesSmall/;

var resizedfileTargetPath = resizedTargetPath+test.jpg;
var scaledImage = ;

k.invalidate(); // do not allow return to the form

var files = [];
var repeater = form.getChild(uploads);
for (var i = 0; i  repeater.getSize(); i++) {
var upload = repeater.getRow(i).getChild(upload);
files[i] = {
filename: upload.value.fileName,
bytes: upload.value.size
};
   fileSourcePath = fileSource + upload.value.fileName;
   fileTargetPath = fileTarget + upload.value.fileName;
   file = new File(fileSourcePath);
   file.renameTo(new File(fileTargetPath));

  BufferedImage scaledImage =Scalr.resize(file, 200);



}
cocoon.sendPage(upload-images-success.jx,
{
files: files
}
);
}



I now want to extend uploadprogress() to scale the images before moving them to their target 
directory using


  imgscalr, 
http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/#source




IMAGEOP Block

2014-09-17 Thread Peter Sparkes

Hi

Cocoon 2.1.12

I can't get scale and resize function in the imageop block to work on cocoon 
2.1.12.

I have the following working

 * Display image with original size and colour
 * Tint image various colour


Miguel has been kindly helping me, but he uses cocoon 2.2. Miguel has it 
working on 2.2, see below.

Please, has anyone got imageop scale and resize working on 2.1.12?

Thanks

Peter



On 17/09/2014 07:11, Miguel wrote:

I've done some test and modulo in cocoon 2.2 project works fine. I describe 
step by step:

a) Include dependency into pom file of my project:

dependency
  groupIdorg.apache.cocoon/groupId
  artifactIdcocoon-imageop-impl/artifactId
  version1.0.0-SNAPSHOT/version
/dependency

b) Include test map:match into sitemap.xmap:

map:match pattern=prueba/*/scale-*-*
map:read type=image-op-scale src=themer/themes/common/images/{1}
  map:parameter name=scale-scale value={2} /
  map:parameter name=output-format value={3} /
/map:read
  /map:match

  map:match pattern=prueba/*/resize-*-*
map:read type=image-op-resize src=themer/themes/common/images/{1}
  map:parameter name=size-width value={2} /
  map:parameter name=size-height value={3} /
/map:read
  /map:match

themer/themes/common/images/ is the route to my images's folder

c) start my project and I test:

* http://localhost:8080/prueba/audio.gif/scale-2.5-jpg
* http://localhost:8080/prueba/audio.gif/resize-100-50

All works fine.


El 16/09/2014 22:27, Peter Sparkes escribió:

Hi Miguel,

My java is not good enough debug the block imageop to see what parameters's 
value arrive to class

However as

  * Display image with original size and colour
  * Tint image various colour

are working I assume there is access to image.

http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ also gives 
errors on resize (scalling)

Peter



On 16/09/2014 13:52, Miguel wrote:

Hi Peter

  It seems that there isn't access to image or similar error to read it.
I advise you debug the block imageop to see what parameters's value arrive to 
class.


This block has only three bugs, and all are fixed, so I think module must works.
https://issues.apache.org/jira/browse/COCOON/component/12311751/?selectedTab=com.atlassian.jira.jira-projects-plugin:component-summary-panel



El 16/09/2014 14:03, Peter Sparkes escribió:

I am using the Samples block on cocoon 2.1.12

...//samples/blocks/imageop/logo2.png/resize-50-50 gives the following error:

java.awt.image.ImagingOpException: Unable to transform src image

Cocoon stacktrace[hide]

*Failed to process reader*
context://samples/blocks/imageop/sitemap.xmap - 46:53   /map:read 
type=image-op-resize/
context://samples/blocks/sitemap.xmap - 67:68   /map:mount/
context://samples/sitemap.xmap - 198:66 /map:mount/
context://sitemap.xmap - 1086:92/map:mount/


Java stacktrace[hide]

java.awt.image.ImagingOpException: Unable to transform src image
at java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:357)
at 
org.apache.cocoon.reading.imageop.ResizeOperation.apply(ResizeOperation.java:96)
at 
org.apache.cocoon.reading.imageop.ImageOpReader.applyEffectsStack(ImageOpReader.java:193)
at 
org.apache.cocoon.reading.imageop.ImageOpReader.processStream(ImageOpReader.java:123)
at 
org.apache.cocoon.reading.ResourceReader.generate(ResourceReader.java:332)



On 16/09/2014 12:36, Miguel wrote:

Have you checked dependencies?
Have you tried to use block: cocoon-imageop-sample?
Can you show error message when you use transformer?


El 16/09/2014 13:14, Peter Sparkes escribió:

Hi Miguel,

I have implemented imageop, however, the only samples that work are:

  * Display image with original size and colour
  * Tint image various colour

I get Unable to transform src image for

  * Image scaling
  * Image resize

Any ideas how to get scaling and resizing working

Best wishes

Peter


On 16/09/2014 07:34, Peter Sparkes wrote:

Thank you Miguel

Peter

On 16/09/2014 07:08, Miguel wrote:

Hi Peter

block imageop-samples exist for cocoon 2.1, and you can download in: 
http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.1/RELEASE_2_1_12/src/blocks/imageop




El 15/09/2014 15:57, Peter Sparkes escribió:

Hi,

Thank you all for your replies.

As I believe it will be the easiest to implement, I am going to try imgscalr.

However, As I am using cocoon 2.1, Is there a way of using 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ in cocoon 2.1


Best wishes

Peter

On 12/09/2014 06:59, Miguel wrote:

Hi Peter r

You can find examples to manage images in Cocoon: 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/


Best regards


On 11/09/2014 16:07, Sandor Szatmari wrote:
I use JAI to dynamically resize images for my site.  There are lot of examples if you 
google 'JAI image resize'.  I store higher res images and downscale them on the fly

Re: Resize images

2014-09-16 Thread Peter Sparkes

Thank you Miguel

Peter

On 16/09/2014 07:08, Miguel wrote:

Hi Peter

block imageop-samples exist for cocoon 2.1, and you can download in: 
http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.1/RELEASE_2_1_12/src/blocks/imageop




El 15/09/2014 15:57, Peter Sparkes escribió:

Hi,

Thank you all for your replies.

As I believe it will be the easiest to implement, I am going to try imgscalr.

However, As I am using cocoon 2.1, Is there a way of using 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ in cocoon 2.1


Best wishes

Peter

On 12/09/2014 06:59, Miguel wrote:

Hi Peter r

You can find examples to manage images in Cocoon: 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/


Best regards


On 11/09/2014 16:07, Sandor Szatmari wrote:
I use JAI to dynamically resize images for my site.  There are lot of examples if you google 
'JAI image resize'.  I store higher res images and downscale them on the fly to the right size 
for the context they will be used in.  I wrote a plain old servlet to do it, but I'm sure it 
could be done in cocoon too.


Sandor

On Sep 11, 2014, at 10:38, Javier Puerto jpue...@gmail.com 
mailto:jpue...@gmail.com wrote:


Hi Peter,

If you can use ImageMagick, you can try with: http://im4java.sourceforge.net/

2014-09-11 16:27 GMT+02:00 Edward David eda...@ucalgary.ca 
mailto:eda...@ucalgary.ca:

Peter,
There are numerous image resizer programs out there.
Check out this Free Picture Resizer at
http://download.cnet.com/Free-Picture-Resizer/3000-12511_4-10297789.html


Thanks,
___
Edward David
Information Technologies Services,
Libraries and Cultural Resources,
The University of Calgary
Phone: (403) 220-3383 tel:%28403%29%20220-3383
Fax: (403) 282-1218 tel:%28403%29%20282-1218

-Original Message-
From: Peter Sparkes [mailto:pe...@didm.co.uk mailto:pe...@didm.co.uk]
Sent: September-11-14 8:23 AM
To: users@cocoon.apache.org mailto:users@cocoon.apache.org  Cocoon users
Subject: Resize images

Hi,

I currently have a cocoon application which enables the site owner to 
upload images and
then  within the upload javascript uses java to move the images to the 
required directory.

Most of the uploaded images are  large and therefore they are  slow in 
displaying in a web
page.

I, therefore, wish to resize them before saving them.

I am not sure how to do it.

Please, can anyone help

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org








-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org




Re: Resize images

2014-09-16 Thread Peter Sparkes

Hi Miguel,

I have implemented imageop, however, the only samples that work are:

 * Display image with original size and colour
 * Tint image various colour

I get Unable to transform src image for

 * Image scaling
 * Image resize

Any ideas how to get scaling and resizing working

Best wishes

Peter


On 16/09/2014 07:34, Peter Sparkes wrote:

Thank you Miguel

Peter

On 16/09/2014 07:08, Miguel wrote:

Hi Peter

block imageop-samples exist for cocoon 2.1, and you can download in: 
http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.1/RELEASE_2_1_12/src/blocks/imageop




El 15/09/2014 15:57, Peter Sparkes escribió:

Hi,

Thank you all for your replies.

As I believe it will be the easiest to implement, I am going to try imgscalr.

However, As I am using cocoon 2.1, Is there a way of using 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ in cocoon 2.1


Best wishes

Peter

On 12/09/2014 06:59, Miguel wrote:

Hi Peter r

You can find examples to manage images in Cocoon: 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/


Best regards


On 11/09/2014 16:07, Sandor Szatmari wrote:
I use JAI to dynamically resize images for my site.  There are lot of examples if you google 
'JAI image resize'.  I store higher res images and downscale them on the fly to the right size 
for the context they will be used in.  I wrote a plain old servlet to do it, but I'm sure it 
could be done in cocoon too.


Sandor

On Sep 11, 2014, at 10:38, Javier Puerto jpue...@gmail.com 
mailto:jpue...@gmail.com wrote:


Hi Peter,

If you can use ImageMagick, you can try with: http://im4java.sourceforge.net/

2014-09-11 16:27 GMT+02:00 Edward David eda...@ucalgary.ca 
mailto:eda...@ucalgary.ca:

Peter,
There are numerous image resizer programs out there.
Check out this Free Picture Resizer at
http://download.cnet.com/Free-Picture-Resizer/3000-12511_4-10297789.html


Thanks,
___
Edward David
Information Technologies Services,
Libraries and Cultural Resources,
The University of Calgary
Phone: (403) 220-3383 tel:%28403%29%20220-3383
Fax: (403) 282-1218 tel:%28403%29%20282-1218

-Original Message-
From: Peter Sparkes [mailto:pe...@didm.co.uk mailto:pe...@didm.co.uk]
Sent: September-11-14 8:23 AM
To: users@cocoon.apache.org mailto:users@cocoon.apache.org  Cocoon users
Subject: Resize images

Hi,

I currently have a cocoon application which enables the site owner to 
upload images and
then  within the upload javascript uses java to move the images to the 
required directory.

Most of the uploaded images are  large and therefore they are  slow in 
displaying in a web
page.

I, therefore, wish to resize them before saving them.

I am not sure how to do it.

Please, can anyone help

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org








-
To unsubscribe, e-mail:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail:users-h...@cocoon.apache.org






Re: Resize images

2014-09-16 Thread Peter Sparkes

I am using the Samples block on cocoon 2.1.12

...//samples/blocks/imageop/logo2.png/resize-50-50 gives the following error:

java.awt.image.ImagingOpException: Unable to transform src image

Cocoon stacktrace[hide]

*Failed to process reader*
context://samples/blocks/imageop/sitemap.xmap - 46:53   /map:read 
type=image-op-resize/
context://samples/blocks/sitemap.xmap - 67:68   /map:mount/
context://samples/sitemap.xmap - 198:66 /map:mount/
context://sitemap.xmap - 1086:92/map:mount/


Java stacktrace[hide]

java.awt.image.ImagingOpException: Unable to transform src image
at java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:357)
at 
org.apache.cocoon.reading.imageop.ResizeOperation.apply(ResizeOperation.java:96)
at 
org.apache.cocoon.reading.imageop.ImageOpReader.applyEffectsStack(ImageOpReader.java:193)
at 
org.apache.cocoon.reading.imageop.ImageOpReader.processStream(ImageOpReader.java:123)
at 
org.apache.cocoon.reading.ResourceReader.generate(ResourceReader.java:332)




On 16/09/2014 12:36, Miguel wrote:

Have you checked dependencies?
Have you tried to use block: cocoon-imageop-sample?
Can you show error message when you use transformer?


El 16/09/2014 13:14, Peter Sparkes escribió:

Hi Miguel,

I have implemented imageop, however, the only samples that work are:

  * Display image with original size and colour
  * Tint image various colour

I get Unable to transform src image for

  * Image scaling
  * Image resize

Any ideas how to get scaling and resizing working

Best wishes

Peter


On 16/09/2014 07:34, Peter Sparkes wrote:

Thank you Miguel

Peter

On 16/09/2014 07:08, Miguel wrote:

Hi Peter

block imageop-samples exist for cocoon 2.1, and you can download in: 
http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.1/RELEASE_2_1_12/src/blocks/imageop




El 15/09/2014 15:57, Peter Sparkes escribió:

Hi,

Thank you all for your replies.

As I believe it will be the easiest to implement, I am going to try imgscalr.

However, As I am using cocoon 2.1, Is there a way of using 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ in cocoon 2.1


Best wishes

Peter

On 12/09/2014 06:59, Miguel wrote:

Hi Peter r

You can find examples to manage images in Cocoon: 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/


Best regards


On 11/09/2014 16:07, Sandor Szatmari wrote:
I use JAI to dynamically resize images for my site.  There are lot of examples if you google 
'JAI image resize'.  I store higher res images and downscale them on the fly to the right 
size for the context they will be used in.  I wrote a plain old servlet to do it, but I'm 
sure it could be done in cocoon too.


Sandor

On Sep 11, 2014, at 10:38, Javier Puerto jpue...@gmail.com 
mailto:jpue...@gmail.com wrote:


Hi Peter,

If you can use ImageMagick, you can try with: http://im4java.sourceforge.net/

2014-09-11 16:27 GMT+02:00 Edward David eda...@ucalgary.ca 
mailto:eda...@ucalgary.ca:

Peter,
There are numerous image resizer programs out there.
Check out this Free Picture Resizer at
http://download.cnet.com/Free-Picture-Resizer/3000-12511_4-10297789.html


Thanks,
___
Edward David
Information Technologies Services,
Libraries and Cultural Resources,
The University of Calgary
Phone: (403) 220-3383 tel:%28403%29%20220-3383
Fax: (403) 282-1218 tel:%28403%29%20282-1218

-Original Message-
From: Peter Sparkes [mailto:pe...@didm.co.uk mailto:pe...@didm.co.uk]
Sent: September-11-14 8:23 AM
To: users@cocoon.apache.org mailto:users@cocoon.apache.org  Cocoon users
Subject: Resize images

Hi,

I currently have a cocoon application which enables the site owner to 
upload images and
then  within the upload javascript uses java to move the images to the 
required directory.

Most of the uploaded images are  large and therefore they are  slow in 
displaying in a
web page.

I, therefore, wish to resize them before saving them.

I am not sure how to do it.

Please, can anyone help

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org








-
To unsubscribe, e-mail:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail:users-h...@cocoon.apache.org








-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org




Re: Resize images

2014-09-16 Thread Peter Sparkes

Hi Miguel,

My java is not good enough debug the block imageop to see what parameters's 
value arrive to class

However as

 * Display image with original size and colour
 * Tint image various colour

are working I assume there is access to image.

http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ also gives 
errors on resize (scalling)

Peter



On 16/09/2014 13:52, Miguel wrote:

Hi Peter

  It seems that there isn't access to image or similar error to read it.
I advise you debug the block imageop to see what parameters's value arrive to 
class.


This block has only three bugs, and all are fixed, so I think module must works.
https://issues.apache.org/jira/browse/COCOON/component/12311751/?selectedTab=com.atlassian.jira.jira-projects-plugin:component-summary-panel



El 16/09/2014 14:03, Peter Sparkes escribió:

I am using the Samples block on cocoon 2.1.12

...//samples/blocks/imageop/logo2.png/resize-50-50 gives the following error:

java.awt.image.ImagingOpException: Unable to transform src image

Cocoon stacktrace[hide]

*Failed to process reader*
context://samples/blocks/imageop/sitemap.xmap - 46:53   /map:read 
type=image-op-resize/
context://samples/blocks/sitemap.xmap - 67:68   /map:mount/
context://samples/sitemap.xmap - 198:66 /map:mount/
context://sitemap.xmap - 1086:92/map:mount/


Java stacktrace[hide]

java.awt.image.ImagingOpException: Unable to transform src image
at java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:357)
at 
org.apache.cocoon.reading.imageop.ResizeOperation.apply(ResizeOperation.java:96)
at 
org.apache.cocoon.reading.imageop.ImageOpReader.applyEffectsStack(ImageOpReader.java:193)
at 
org.apache.cocoon.reading.imageop.ImageOpReader.processStream(ImageOpReader.java:123)
at 
org.apache.cocoon.reading.ResourceReader.generate(ResourceReader.java:332)



On 16/09/2014 12:36, Miguel wrote:

Have you checked dependencies?
Have you tried to use block: cocoon-imageop-sample?
Can you show error message when you use transformer?


El 16/09/2014 13:14, Peter Sparkes escribió:

Hi Miguel,

I have implemented imageop, however, the only samples that work are:

  * Display image with original size and colour
  * Tint image various colour

I get Unable to transform src image for

  * Image scaling
  * Image resize

Any ideas how to get scaling and resizing working

Best wishes

Peter


On 16/09/2014 07:34, Peter Sparkes wrote:

Thank you Miguel

Peter

On 16/09/2014 07:08, Miguel wrote:

Hi Peter

block imageop-samples exist for cocoon 2.1, and you can download in: 
http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.1/RELEASE_2_1_12/src/blocks/imageop




El 15/09/2014 15:57, Peter Sparkes escribió:

Hi,

Thank you all for your replies.

As I believe it will be the easiest to implement, I am going to try imgscalr.

However, As I am using cocoon 2.1, Is there a way of using 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ in cocoon 2.1


Best wishes

Peter

On 12/09/2014 06:59, Miguel wrote:

Hi Peter r

You can find examples to manage images in Cocoon: 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/


Best regards


On 11/09/2014 16:07, Sandor Szatmari wrote:
I use JAI to dynamically resize images for my site.  There are lot of examples if you 
google 'JAI image resize'.  I store higher res images and downscale them on the fly to the 
right size for the context they will be used in.  I wrote a plain old servlet to do it, but 
I'm sure it could be done in cocoon too.


Sandor

On Sep 11, 2014, at 10:38, Javier Puerto jpue...@gmail.com 
mailto:jpue...@gmail.com wrote:


Hi Peter,

If you can use ImageMagick, you can try with: http://im4java.sourceforge.net/

2014-09-11 16:27 GMT+02:00 Edward David eda...@ucalgary.ca 
mailto:eda...@ucalgary.ca:

Peter,
There are numerous image resizer programs out there.
Check out this Free Picture Resizer at
http://download.cnet.com/Free-Picture-Resizer/3000-12511_4-10297789.html


Thanks,
___
Edward David
Information Technologies Services,
Libraries and Cultural Resources,
The University of Calgary
Phone: (403) 220-3383 tel:%28403%29%20220-3383
Fax: (403) 282-1218 tel:%28403%29%20282-1218

-Original Message-
From: Peter Sparkes [mailto:pe...@didm.co.uk mailto:pe...@didm.co.uk]
Sent: September-11-14 8:23 AM
To: users@cocoon.apache.org mailto:users@cocoon.apache.org  Cocoon users
Subject: Resize images

Hi,

I currently have a cocoon application which enables the site owner to 
upload images
and then  within the upload javascript uses java to move the images to the 
required
directory.

Most of the uploaded images are  large and therefore they are  slow in 
displaying in a
web page.

I, therefore, wish to resize them before saving them.

I am not sure how to do it.

Please, can anyone help

Thanks

Re: Resize images

2014-09-15 Thread Peter Sparkes

Hi,

Thank you all for your replies.

As I believe it will be the easiest to implement, I am going to try imgscalr.

However, As I am using cocoon 2.1, Is there a way of using 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/ in cocoon 2.1


Best wishes

Peter

On 12/09/2014 06:59, Miguel wrote:

Hi Peter r

You can find examples to manage images in Cocoon: 
http://cocoon.zones.apache.org/cocoon22/cocoon-imageop-sample/


Best regards


On 11/09/2014 16:07, Sandor Szatmari wrote:
I use JAI to dynamically resize images for my site.  There are lot of examples if you google 'JAI 
image resize'.  I store higher res images and downscale them on the fly to the right size for the 
context they will be used in.  I wrote a plain old servlet to do it, but I'm sure it could be done 
in cocoon too.


Sandor

On Sep 11, 2014, at 10:38, Javier Puerto jpue...@gmail.com 
mailto:jpue...@gmail.com wrote:


Hi Peter,

If you can use ImageMagick, you can try with: http://im4java.sourceforge.net/

2014-09-11 16:27 GMT+02:00 Edward David eda...@ucalgary.ca 
mailto:eda...@ucalgary.ca:

Peter,
There are numerous image resizer programs out there.
Check out this Free Picture Resizer at
http://download.cnet.com/Free-Picture-Resizer/3000-12511_4-10297789.html


Thanks,
___
Edward David
Information Technologies Services,
Libraries and Cultural Resources,
The University of Calgary
Phone: (403) 220-3383 tel:%28403%29%20220-3383
Fax: (403) 282-1218 tel:%28403%29%20282-1218

-Original Message-
From: Peter Sparkes [mailto:pe...@didm.co.uk mailto:pe...@didm.co.uk]
Sent: September-11-14 8:23 AM
To: users@cocoon.apache.org mailto:users@cocoon.apache.org  Cocoon users
Subject: Resize images

Hi,

I currently have a cocoon application which enables the site owner to upload images and then 
within the upload javascript uses java to move the images to the required directory.


Most of the uploaded images are  large and therefore they are  slow in 
displaying in a web page.

I, therefore, wish to resize them before saving them.

I am not sure how to do it.

Please, can anyone help

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org






Resize images

2014-09-11 Thread Peter Sparkes

Hi,

I currently have a cocoon application which enables the site owner to upload images and then  within 
the upload javascript uses java to move the images to the required directory.


Most of the uploaded images are  large and therefore they are  slow in 
displaying in a web page.

I, therefore, wish to resize them before saving them.

I am not sure how to do it.

Please, can anyone help

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Adaptive Images and Cocoon

2014-09-10 Thread Peter Sparkes

Hi,

Has anyone any tips on implementing Adaptive Images, 
http://adaptive-images.com/details.htm, with Cocoon

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Problems building cocoon-2.1.12

2014-06-16 Thread Peter Sparkes

Thank David,

Building on your suggestion I ran build several times and eventually  it was 
successful

Warrell - I tried 1.7 first and it was plainly incompatible

Thanks All

Peter

On 16/06/2014 08:10, David Crossley wrote:

Peter Sparkes wrote:

Hi

I am having problems building  cocoon-2.1.12 on my 64 bit windows 7 system,
with j2sdk1.4.2_19
I had no problems on my old 32 bit windows XP system

I am getting

cocoon-block-html-patch:
Processing: D:\cocoon-2.1.12-wl -
Copy\src\blocks\html\conf\html-transformer.xmap
Processing: D:\cocoon-2.1.12-wl - Copy\src\blocks\html\conf\html.xmap
Writing: D:\cocoon-2.1.12-wl - Copy\build\webapp\sitemap.xmap

BUILD FAILED
D:\cocoon-2.1.12-wl - Copy\tools\targets\webapp-build.xml:120: The
following error occurred while executing this line:
D:\cocoon-2.1.12-wl - Copy\build\cocoon\temp\blocks-build.xml:2088: The
following error occurred while executing this line:
D:\cocoon-2.1.12-wl - Copy\build\cocoon\temp\blocks-build.xml:171:
FileNotFoundException: java.io.FileNotFoundException: D:\cocoon-2.1.12-wl -
Copy\build\webapp\sitemap.xmap (The requested operation cannot be performed
on a file with a user-mapped section open)

Help please

I do not know anything about it, but i popped part of that
error message into Google and followed the leads to find this:
http://stackoverflow.com/questions/1302698/system-io-exception-error-the-requested-operation-cannot-be-performed-on-a-fil
( ... file with a user-mapped section open)

That suggests that another process has the file open, and shows how to find out.

-David


Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Problems building cocoon-2.1.12

2014-06-15 Thread Peter Sparkes

Hi

I am having problems building  cocoon-2.1.12 on my 64 bit windows 7 system, 
with j2sdk1.4.2_19
I had no problems on my old 32 bit windows XP system

I am getting

cocoon-block-html-patch:
Processing: D:\cocoon-2.1.12-wl - 
Copy\src\blocks\html\conf\html-transformer.xmap
Processing: D:\cocoon-2.1.12-wl - Copy\src\blocks\html\conf\html.xmap
Writing: D:\cocoon-2.1.12-wl - Copy\build\webapp\sitemap.xmap

BUILD FAILED
D:\cocoon-2.1.12-wl - Copy\tools\targets\webapp-build.xml:120: The following error occurred while 
executing this line:
D:\cocoon-2.1.12-wl - Copy\build\cocoon\temp\blocks-build.xml:2088: The following error occurred 
while executing this line:
D:\cocoon-2.1.12-wl - Copy\build\cocoon\temp\blocks-build.xml:171: FileNotFoundException: 
java.io.FileNotFoundException: D:\cocoon-2.1.12-wl - Copy\build\webapp\sitemap.xmap (The requested 
operation cannot be performed on a file with a user-mapped section open)


Help please

Peter


Re: authentication framework

2014-06-14 Thread Peter Sparkes

Hi Warrell

Apologies for not replying before, have only just got back to this problem.

The authentication block was enabled but one of the dependencies was not.

However now having problems with building Cocoon; for which I will start a new 
thread

Cheers

Peter

On 27/05/2014 14:39, warrell harries wrote:

Hi Peter,

This is an action that should be declared in the root sitemap. Have you built the war file with 
the authentication block enabled?


Cheers,

Warrell


On 27 May 2014 14:28, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi
  I have not
I can't get the /authentication framework sample to to work in /Cocoon 
2.1.12


I get the following error

org.apache.avalon.framework.configuration.ConfigurationException: Type 
'auth-loggedIn' is not defined for 'act' 
atfile:///D:/cocoon-2.1.12-wl/build/webies for 
notapp/samples/blocks/authentication-fw/sitemap.xmap:72:39


Help please

Peter






Re: svg text in fop on cocoon-2.1.12 Linex

2014-05-27 Thread Peter Sparkes
I have taken the easy way out and converted those svg images with text to jpg and then put them into 
the fop pdf


Regards

Peter

On 25/05/2014 17:28, Andreas Kuehne wrote:

Hi Peter,

as far as I remember the usual suspects were:

- expected font (family) not installed on your machine : make a 14pt
Times available ...

- headless server irritate the calculation of font sizes : some
solutions discussed here
http://fortylines.com/blog/fopHeadlessServer.blog.html

Greetings and good luck,

Andreas



Hi,

Sorry previous email send before fully written

I am having problems with svg text in fop on  cocoon-2.1.12 Linux
The problem does not occur on cocoon-2.1.12 Windows

I get the following error whenever the svg contains text eg with

fo:instream-foreign-object content-width=15px
content-height=100px padding-right=0.2cm
svg xmlns=http://www.w3.org/2000/svg; width=15.5
height=15.5 viewBox=0 0 15.5 15.5
g
  text x=6.0 y=11 style=text-anchor:middle ;
fill:#ff ; font-size:10; font-weight:normal ;
letter-spacing:-1.5EUR/text
 /g
  /svg
  /fo:instream-foreign-object

I get

*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError: Could not initialize class
org.apache.batik.gvt.font.FontFamilyResolver
 org.apache.batik.bridge.SVGTextElementBridge.getFontList(Unknown
Source)
 org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown
Source)
 
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown
Source)
 org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown
Source)
 org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown
Source)
 org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown
Source)
 org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
 org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
 org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
ETC



I assume that the linux server is missing the fop text package

Help please

Peter







-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



authentication framework

2014-05-27 Thread Peter Sparkes

Hi

I can't get the /authentication framework sample to to work in /Cocoon 2.1.12


I get the following error

org.apache.avalon.framework.configuration.ConfigurationException: Type 
'auth-loggedIn' is not defined for 'act' at 
file:///D:/cocoon-2.1.12-wl/build/webapp/samples/blocks/authentication-fw/sitemap.xmap:72:39


Help please

Peter


svg text in fop on cocoon-2.1.12 Linex

2014-05-25 Thread Peter Sparkes

Hi,

I am having problems with svg text in fop on  cocoon-2.1.12 Linux
The problem does not occur on cocoon-2.1.12 Windows

I get the following error whenever the svg contains text eg with

fo:instream-foreign-object content-width=15px content-height=100px 
padding-right=0.2cm
   svg xmlns=http://www.w3.org/2000/svg; width=15.5 height=15.5 viewBox=0 0 
15.5 15.5
   g
 text x=6.0 y=11 style=text-anchor:middle ; fill:#ff ; font-size:10; 
font-weight:normal ; letter-spacing:-1.5EUR/text

/g
 /svg
 /fo:instream-foreign-object

I get *exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.batik.gvt.font.FontFamilyResolver
org.apache.batik.bridge.SVGTextElementBridge.getFontList(Unknown Source)
org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown 
Source)

org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 
Source)

org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 
Source)
org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown 
Source)
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
Source)
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
org.apache.batik.bridge.GVTBuilder.build(Unknown Source)









svg text in fop on cocoon-2.1.12 Linex

2014-05-25 Thread Peter Sparkes

Hi,

Sorry previous email send before fully written

I am having problems with svg text in fop on  cocoon-2.1.12 Linux
The problem does not occur on cocoon-2.1.12 Windows

I get the following error whenever the svg contains text eg with

fo:instream-foreign-object content-width=15px content-height=100px 
padding-right=0.2cm
   svg xmlns=http://www.w3.org/2000/svg; width=15.5 height=15.5 viewBox=0 0 
15.5 15.5
   g
 text x=6.0 y=11 style=text-anchor:middle ; fill:#ff ; font-size:10; 
font-weight:normal ; letter-spacing:-1.5EUR/text

/g
 /svg
 /fo:instream-foreign-object

I get

*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.batik.gvt.font.FontFamilyResolver
org.apache.batik.bridge.SVGTextElementBridge.getFontList(Unknown Source)
org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown 
Source)

org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 
Source)

org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 
Source)
org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown 
Source)
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
Source)
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
ETC



I assume that the linux server is missing the fop text package

Help please

Peter



Using replace in Flowscript

2014-02-16 Thread Peter Sparkes

Hi,

I am having difficulties using:

 * document=document.replace('hhh','ggg')

in my flowscript

Help please, how do I import the correct package/class

Thanks

Peter



Cocoon and Blogging

2014-01-15 Thread Peter Sparkes

Hi,

I want to set up a Blog for a Cocoon 2.1 website.

Help please on what software to use

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



PDF in Cocoon 2.1.12 Tomcat

2013-08-02 Thread Peter Sparkes

Hi,

I have an 2.1.12 application which produces some PDF pages.

It works well on my windows machine, however, on my debian tomcat server the pdf pages produce the 
following error



*type*Exception report

*message*_Servlet execution threw an exception_

*description*_The server encountered an internal error (Servlet execution threw an exception) that 
prevented it from fulfilling this request._


*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.Error: Probable fatal error:No fonts found.
sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1087)
sun.font.FontManager.initialiseDeferredFont(FontManager.java:966)
sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:254)
sun.font.CompositeFont.getSlotFont(CompositeFont.java:334)
sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
sun.font.CompositeGlyphMapper.init(CompositeGlyphMapper.java:62)
sun.font.CompositeFont.getMapper(CompositeFont.java:390)
sun.font.CompositeFont.canDisplay(CompositeFont.java:416)


Any Ideas Please


Peter




Re: Selecting values from a html5 form

2013-07-04 Thread Peter Sparkes

Hi Jos  Thorsten,

I am sorry that I have not thanked you before for your help.

Thank you again

Regards

Peter

On 27/06/2013 13:39, Thorsten Scherler wrote:

On 06/27/2013 02:32 PM, Jos Snellings wrote:

Hi Jos,

nice post! Small enhancement see above.


Hi Peter,

In the sitemap you have access to request parameters via Jexl:


map:match pattern=enquiry
  map:generate type=someGeneration
 map:parameter name=from 
value={jexl:cocoon.request.parameter.fromname}/

  ...


However, it may be far more convenient to use the HttpRequest, as it is exposed 
in different ways:

1. if you want to send your user's inputs to a controller to handle them as in:


 map:match pattern=enquiry
controller:call controller=rest-controller 
select=some.package.EnquiryController

/controller:call
/map:match

The http request is accessible by just declaring it with the annotation @Inject:

   @Inject
private HttpServletRequest request;



Here you can do directly

@RequestParameter
private String fromname;

salu2



In your doPost method (or even doGet) you can use the request:

String fromName = request.getParameter(fromname);



Instead of sending the input to a controller, it may happen that there is little to control, and 
you just want to do a model generation as a response.

In that case:

if you are declaring:
public class SomeViewGenerator extends AbstractSAXGenerator {

You may override the setup member :


public void setup(MapString, Object parameters) {
try {

request = HttpContextHelper.getRequest(parameters);


The setup member is just called at pipeline setup, and when this happens in a web application 
context, the http request is just one of the parameters.



I hope this little expose helps,
Jos













































On Thu, Jun 27, 2013 at 10:32 AM, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi,

I want to use a html5 form to pass values into my sitemap eg

form action=enquiry method=? 
input type=text name=fromname  placeholder=Your Name   
required=''/

How do I pass fromname into enquiry

Regards

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org




--
We should be careful to get out of an experience only the wisdom that is
in it - and stay there, lest we be like the cat that sits down on a hot
stove-lid.  She will never sit down on a hot stove-lid again - and that
is well; but also she will never sit down on a cold one any more.
-- Mark Twain



--
Thorsten Scherler scherler.at.gmail.com
codeBusters S.L. - web based systems
consulting, training and solutions

http://www.codebusters.es/




Selecting values from a html5 form

2013-06-27 Thread Peter Sparkes

Hi,

I want to use a html5 form to pass values into my sitemap eg

form action=enquiry method=? 
input type=text name=fromnameplaceholder=Your Name   
required=''/

How do I pass fromname into enquiry

Regards

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: 2.1.12 and html5

2013-06-05 Thread Peter Sparkes

Thank you Cédric and Thorsten

However, I still can't get it working. Could you, please explain what I have to 
put in my sitemap etc.

Thank you

Peter

On 05/06/2013 10:18, Cédric Damioli wrote:

Hi,

The XHTMLSerializer Francesco was referring to is not the 
org.apache.cocoon.serialization.XMLSerializer of your sample, but the 
org.apache.cocoon.components.serializers.XHTMLSerializer from the serializers block, which is 
another implementation of XHTML serialization.


Regards,
Cédric


On 05/06/2013 10:03, Thorsten Scherler wrote:
http://mail-archives.apache.org/mod_mbox/cocoon-cvs/201211.mbox/%3c20121122234557.250da2388...@eris.apache.org%3E

...

+} else if (xhtml5.equalsIgnoreCase(doctype)) {
+this.doctype_default = XHTML5_DOCTYPE;
...


serializer class=org.apache.cocoon.components.serializers... ... 
   doctype-defaultxhtml5/doctype-default
 /serializer


HTH

salu2


Le 05/06/2013 07:15, Peter Sparkes a écrit :

Hi Francesco ,

I can't get the XHTML serializer to produce html5, the sitemap.xmap has:

map:serializer logger=sitemap.serializer.xhtml mime-type=text/html 
name=xhtml
pool-max=${xhtml-serializer.pool-max} 
src=org.apache.cocoon.serialization.XMLSerializer
   !--+
  | You can choose from Strict, Transitional, or Frameset XHTML.
  | For Strict XHTML set doctype to:
  |   doctype-public-//W3C//DTD XHTML 1.0 
Strict//EN/doctype-public
  |   
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system
  | For Transitional XHTML set doctype to:
  |   doctype-public-//W3C//DTD XHTML 1.0 
Transitional//EN/doctype-public
  |  
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd/doctype-system

  | For Frameset XHTML set doctype to:
  |   doctype-public-//W3C//DTD XHTML 1.0 
Frameset//EN/doctype-public
  |  
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd/doctype-system

  |
  | Default XHTML doctype in Cocoon is XHTML Strict. If you want to 
use more than one
  | XHTML DTD simultaneously, you can define several XHTML 
serializers.
  +--
doctype-public-//W3C//DTD XHTML 1.0 
Strict//EN/doctype-public
   
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system

encodingUTF-8/encoding
 /map:serializer

I have tried experimenting with various values in doctype-public and 
doctype-system but can't get

!DOCTYPE html
html
head

Regards

Peter

On 04/06/2013 08:18, Francesco Chicchiriccò wrote:

On 03/06/2013 19:19, Peter Sparkes wrote:

Hi

Does 2.1.12 have a html5 serializer


Yes: XHTML serializer can handle HTML5 doctype - 
https://issues.apache.org/jira/browse/COCOON-2310

Regards.
--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/



--
Cédric Damioli
Ametys CMS
http://www.ametys.org
http://www.anyware-services.com




Forms Field Widget, Date Converter and IE10

2013-06-04 Thread Peter Sparkes
I have a 2.1.10  application which has successfully used the Forms Field Widget, Date Converter for 
some years. How it appears to be broken in IE10.


Any Ideas

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.1.12 on Windows

2013-06-04 Thread Peter Sparkes

Thank you Chicchiriccò

That fixed the problem

Peter


On 04/06/2013 08:16, Francesco Chicchiriccò wrote:

On 03/06/2013 18:54, Peter Sparkes wrote:

Hi

I have downloaded 2.1.12 onto my windows machine and built it. However, then I 
try to run it using

cocoon or cocoon servlet

the process finishes with

EVENT Stutdown hook executed


Hi,
this means Cocoon could not start...


and when I load it into my browser I get

Firefox can't establish a connection to the server at localhost:.


...hence this, of course ;-)

Have you taken a look at [1]? It seems there is some issue with startup scripts on Windows that 
were easily solved but haven't reached JIRA and weren't fixed.


Regards.

[1] http://markmail.org/message/6skrrwc7oiir5hxd




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.1.12 on Windows

2013-06-04 Thread Peter Sparkes

Sorry I should have said

Thank you Francesco

Peter

On 04/06/2013 08:42, Peter Sparkes wrote:

Thank you Chicchiriccò

That fixed the problem

Peter


On 04/06/2013 08:16, Francesco Chicchiriccò wrote:

On 03/06/2013 18:54, Peter Sparkes wrote:

Hi

I have downloaded 2.1.12 onto my windows machine and built it. However, then I 
try to run it using

cocoon or cocoon servlet

the process finishes with

EVENT Stutdown hook executed


Hi,
this means Cocoon could not start...


and when I load it into my browser I get

Firefox can't establish a connection to the server at localhost:.


...hence this, of course ;-)

Have you taken a look at [1]? It seems there is some issue with startup scripts on Windows that 
were easily solved but haven't reached JIRA and weren't fixed.


Regards.

[1] http://markmail.org/message/6skrrwc7oiir5hxd




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: 2.1.12 and html5

2013-06-04 Thread Peter Sparkes

Hi Francesco ,

I can't get the XHTML serializer to produce html5, the sitemap.xmap has:

   map:serializer logger=sitemap.serializer.xhtml mime-type=text/html 
name=xhtml
   pool-max=${xhtml-serializer.pool-max} 
src=org.apache.cocoon.serialization.XMLSerializer
   !--+
  | You can choose from Strict, Transitional, or Frameset XHTML.
  | For Strict XHTML set doctype to:
  |   doctype-public-//W3C//DTD XHTML 1.0 
Strict//EN/doctype-public
  | 
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system
  | For Transitional XHTML set doctype to:
  |   doctype-public-//W3C//DTD XHTML 1.0 
Transitional//EN/doctype-public
  |
   
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd/doctype-system
  | For Frameset XHTML set doctype to:
  |   doctype-public-//W3C//DTD XHTML 1.0 
Frameset//EN/doctype-public
  | 
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd/doctype-system
  |
  | Default XHTML doctype in Cocoon is XHTML Strict. If you want to 
use more than one
  | XHTML DTD simultaneously, you can define several XHTML 
serializers.
  +--
doctype-public-//W3C//DTD XHTML 1.0 
Strict//EN/doctype-public
   
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system
encodingUTF-8/encoding
 /map:serializer

I have tried experimenting with various values in doctype-public and 
doctype-system but can't get

   !DOCTYPE html
   html
   head

Regards

Peter

On 04/06/2013 08:18, Francesco Chicchiriccò wrote:

On 03/06/2013 19:19, Peter Sparkes wrote:

Hi

Does 2.1.12 have a html5 serializer


Yes: XHTML serializer can handle HTML5 doctype - 
https://issues.apache.org/jira/browse/COCOON-2310

Regards.
--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/




Cocoon 2.1.12 on Windows

2013-06-03 Thread Peter Sparkes

Hi

I have downloaded 2.1.12 onto my windows machine and built it. However, then I 
try to run it using

cocoon or cocoon servlet

the process finishes with

EVENT Stutdown hook executed

and when I load it into my browser I get

Firefox can't establish a connection to the server at localhost:.

Hep Please

Peter







-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



2.1.12 and html5

2013-06-03 Thread Peter Sparkes

Hi

Does 2.1.12 have a html5 serializer

Thanks

peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Mobile Website

2013-05-31 Thread Peter Sparkes
Thank you very much Andre. The initializr site and the Firefox tip have made the learning curve much 
easier. I have also got Ethan Marcotte's book Responsive Web Design which ties it all together


With many thanks

Peter

On 28/05/2013 13:39, Andre Juffer wrote:

On 05/28/2013 02:50 PM, Peter Sparkes wrote:

After investigating the
various options I have gone for responsive web design. In future I will design all my websites 
this way from scratch.


Note sure whether I have send you this:

http://www.initializr.com/

It provides you with a template for a basic HTML5-based site. It use jQuery for communicating with 
(a preferable cocoon-based) server, but one could use any framework (like the Dojo toolkit, my 
favourite). If you display the index.html generated by initializr.com, try Firefox-Tools-Web 
Developer-Responsive Design View.


Best,
André




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Inter Server Communications

2013-05-20 Thread Peter Sparkes

Now working. Thanks to all.

I used xslt to generate the cinclude, to insert the variables

Regards

Peter

On 17/05/2013 23:53, Thorsten Scherler wrote:

On 05/17/2013 05:20 PM, Peter Sparkes wrote:

Hi

I have an application in which I require to send a POST request from
the server to another non Cocoon website ( to set parameters for a
newsletter which uses phplist newsletter software) and the response
would be in JSON

Highly depends on your underlying usecase what to do with the response
and further the cocoon version you are using. I lately use the REST-way
in c3 but you can post anything with cinclude in 2.1.x like:

cinclude:includexml
   cinclude:srchttp://10.231.27.63/sql_templates//cinclude:src
   cinclude:configuration
cinclude:parameter
 cinclude:namemethod/cinclude:name
 cinclude:valuePOST/cinclude:value
/cinclude:parameter
   /cinclude:configuration
   cinclude:parameters
cinclude:parameter
 cinclude:nametext/cinclude:name
 cinclude:value
  ROOT xmlns:sql=urn:schemas-microsoft-com:xml-sql
sql:xpath-query xmlns:lsa=blah
mapping-schema=schema/address.xsd(/lsa:Address)/sql:xpath-query
  /ROOT
 /cinclude:value
/cinclude:parameter
   /cinclude:parameters
/cinclude:includexml

as described in 
http://mail-archives.apache.org/mod_mbox/cocoon-users/200512.mbox/%3c06b403677c41d51194550002a55107d2057b8...@s5-stf1-r1.nrn.nrcan.gc.ca%3E



This would be server to server without any client browser being involved

Actually if I understand your usecase that is not 100% needed. The user
has the newsletter form generated by cocoon and the result has to go to
the php server. IF the php is reachable form the outside then a simple
javascript would do to treat the response. If not I recommend a httpd in
front and there just proxy/rewrite the request to the different server.

salu2


How do I do this?

Help please

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Inter Server Communications

2013-05-17 Thread Peter Sparkes

Hi

I have an application in which I require to send a POST request from the server to another non 
Cocoon website ( to set parameters for a newsletter which uses phplist newsletter software) and the 
response would be in JSON


This would be server to server without any client browser being involved

How do I do this?

Help please

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Mobile Website

2013-05-14 Thread Peter Sparkes

Hi,

I have a requirement to use different sitemap.xmap for mobiles depending on the 
screen size.

I am using 2.1.11

Please, how do I do this?

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Mobile Website

2013-05-14 Thread Peter Sparkes


Or stylesheets

On 14/05/2013 07:36, Peter Sparkes wrote:

Hi,

I have a requirement to use different sitemap.xmap for mobiles depending on the 
screen size.

I am using 2.1.11

Please, how do I do this?

Peter



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: cocoon 2.1.12 - memory

2013-04-15 Thread Peter Sparkes

Hi Francesco,

I have a fairly large 2.1.11 website which has 700+ visits a day. Every few days the site goes down 
unless I stop and start it every day ( using Crontab). I have also increased the available memory


 export CATALINA_OPTS=-Xms1024m -Xmx1024m

When the site goes down the pid is still there and has to be deleted before the 
site will start

I assume that the problem is a memory leak as there is a lot on the web on it

Regards

Peter

On 12/04/2013 07:24, Francesco Chicchiriccò wrote:

On 12/04/2013 07:50, Peter Sparkes wrote:

Hi,

Has  2.1.12 fixed the 2.1.11 memory leak


Hi,
could you be a little less generic? Are you referrring to any specific issue? Any link to e-mail 
or JIRA?


Regards.




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: cocoon 2.1.12 - memory

2013-04-15 Thread Peter Sparkes

On 15/04/2013 10:09, Thorsten Scherler wrote:

On 04/15/2013 10:31 AM, Peter Sparkes wrote:

Hi Francesco,

I have a fairly large 2.1.11 website which has 700+ visits a day.
Every few days the site goes down unless I stop and start it every day
( using Crontab). I have also increased the available memory

  export CATALINA_OPTS=-Xms1024m -Xmx1024m

When the site goes down the pid is still there and has to be deleted
before the site will start

I assume that the problem is a memory leak as there is a lot on the
web on it

I remember that there where a problem with a xalan version, you can
check whether the version is different from 11 to 12 of the xalan lib
and if so then yes it fixes a memory leak whether it is the one that is
bothering you I am not 100% sure but I would give it a try.

salu2


Thanks Salu2

I am using the latest version of saxon, not xalan, so that should not be the 
problem

Peter



Regards

Peter

On 12/04/2013 07:24, Francesco Chicchiriccò wrote:

On 12/04/2013 07:50, Peter Sparkes wrote:

Hi,

Has  2.1.12 fixed the 2.1.11 memory leak

Hi,
could you be a little less generic? Are you referrring to any
specific issue? Any link to e-mail or JIRA?

Regards.



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: cocoon 2.1.12 - memory

2013-04-15 Thread Peter Sparkes
I am not sure, but I don't think so. All data in held and manipulated as xml files. Its fast and 
easy to program etc


Peter

On 15/04/2013 10:44, Jos Snellings wrote:

Does the site happen to use Avalon Datasource objects?

Jos


On Mon, Apr 15, 2013 at 11:38 AM, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

On 15/04/2013 10:09, Thorsten Scherler wrote:

On 04/15/2013 10:31 AM, Peter Sparkes wrote:

Hi Francesco,

I have a fairly large 2.1.11 website which has 700+ visits a day.
Every few days the site goes down unless I stop and start it every 
day
( using Crontab). I have also increased the available memory

  export CATALINA_OPTS=-Xms1024m -Xmx1024m

When the site goes down the pid is still there and has to be deleted
before the site will start

I assume that the problem is a memory leak as there is a lot on the
web on it

I remember that there where a problem with a xalan version, you can
check whether the version is different from 11 to 12 of the xalan lib
and if so then yes it fixes a memory leak whether it is the one that is
bothering you I am not 100% sure but I would give it a try.

salu2


Thanks Salu2

I am using the latest version of saxon, not xalan, so that should not be 
the problem

Peter


Regards

Peter

On 12/04/2013 07:24, Francesco Chicchiriccň wrote:

On 12/04/2013 07:50, Peter Sparkes wrote:

Hi,

Has  2.1.12 fixed the 2.1.11 memory leak

Hi,
could you be a little less generic? Are you referrring to any
specific issue? Any link to e-mail or JIRA?

Regards.



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org




--
We should be careful to get out of an experience only the wisdom that is
in it - and stay there, lest we be like the cat that sits down on a hot
stove-lid.  She will never sit down on a hot stove-lid again - and that
is well; but also she will never sit down on a cold one any more.
-- Mark Twain




cocoon 2.1.12 - memory

2013-04-11 Thread Peter Sparkes

Hi,

Has  2.1.12 fixed the 2.1.11 memory leak

Regards

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Upload widget

2013-04-04 Thread Peter Sparkes

Hi ,

When uploading a file with the same name as one previously uploaded a  new file is created with an  
incremented file name eg.


image.jpg
0_ image.jpg
1_ image.jpg
etc.

Please, how can I get the widget to replace the old file with the new file 
keeping the same file name

Regards

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Cocoon 2.1.12

2013-03-20 Thread Peter Sparkes

A big thank you to everybody involved in developing the newly released Cocoon 
2.1.12


Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Using FOP 1.1 with Cocoon 2.1.11

2013-02-13 Thread Peter Sparkes

Hi Francesco,

Thank you. I shall wait for Cocoon 2.1.12

Regards

Peter


On 13/02/2013 10:07, Francesco Chicchiriccò wrote:

On 12/02/2013 18:42, Peter Sparkes wrote:

I have been unable to use FOP 1.1 with Cocoon 2.1.11.

Please, how do I do it


Hi Peter,
COCOON-2295 [1] is introducing support for FOP 1.0 / 1.1 in Cocoon 2.1.12, expected to be released 
soon.


The modifications to be manually performed on 2.1.11 to run FOP 1.0 (reported in issue 
description) are not straightforward and break the SVGSerializer from the Batik block, so I'd 
suggest to wait for 2.1.12 or at least to use 2.1.12-dev once [1] is closed.


Regards.

[1] https://issues.apache.org/jira/browse/COCOON-2295


On 09/02/2013 10:35, warrell harries wrote:


I believe it is. Certainly, I have used 1.0...iirc

On 9 Feb 2013 08:17, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi,

Is it possible to use FOP 1.1 with Cocoon 2.1.11

Thanks

Peter


--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/




Re: Using FOP 1.1 with Cocoon 2.1.11

2013-02-12 Thread Peter Sparkes

I have been unable to use FOP 1.1 with Cocoon 2.1.11.

Please, how do I do it

Peter

On 09/02/2013 10:35, warrell harries wrote:


I believe it is. Certainly, I have used 1.0...iirc

On 9 Feb 2013 08:17, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi,

Is it possible to use FOP 1.1 with Cocoon 2.1.11

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org





Using FOP 1.1 with Cocoon 2.1.11

2013-02-09 Thread Peter Sparkes

Hi,

Is it possible to use FOP 1.1 with Cocoon 2.1.11

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread Peter Sparkes

Hi

Cocoon 2.11

I have implemented a multipage CForm which uses Ajax. The form is based on the 
example at

http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

The  form works fine except that it does not save non ascii characters 
correctly eg.

É EUR  ç  £



If I use one very long form without Ajax the above characters are correctly 
saved

Help please, How can I fix this problem


Peter


Re: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread Peter Sparkes

Thanks Greg and Robby for your replies.

Unfortunately I can't get it to work. I assume encodeURIComponent goes into the 
flowscript:

   function multipage() {
   var lodgeId = cocoon.parameters.lodgeId;
   cocoon.request.setAttribute(lodgeId, lodgeId);

   var documentURI = cocoon.parameters[documentURI];
   // parse the document to a DOM-tree
   var document = loadDocument(documentURI);

   //document = decodeURIComponent (document);

   // get the documentURI parameter from the sitemap which contains the 
location of the form
   definition (model)
   var definitionURI = cocoon.parameters[definitionURI];

   //create new form
   var form = new Form(definitionURI);

   // get the documentURI parameter from the sitemap which contains the 
location of the binding
   file
var bindingURI = cocoon.parameters[bindingURI];
   form.createBinding(bindingURI);

// bind the document data to the form
form.load(document);

// show the form to the user until it is validated successfully
   form.showForm(lodgemul-display-pipeline.jx);

// bind the form's data back to the document

form.save(document);

// save the DOM-tree back to an XML file,
   document = encodeURIComponent(document);
saveDocument(document, documentURI);

// show the xml generated from the form
var success ='/BB/England/Devon/Bideford/'+ lodgeId+'.html';
   //cocoon.redirectTo('/office/' + lodgeno+'.htm');
cocoon.sendPage(success);
   }

document = encodeURIComponent(document); produces the following error when I 
submit the completed form

Can't find method org.apache.cocoon.xml.dom.DOMStreamer.stream(string).

What am I doing wrong

Peter

On 14/01/2013 14:27, gelo1234 wrote:
Ajax calls use default character encoding defined by HTTP 1.1 spec (which iso-8859-1, not UTF-8). 
You have to encode BEFORE sending and decode AFTER retrieving those strings.

Encode with encodeURIComponent, decode with decodeURIComponent (if Javascript).

Greetings,
Greg 



On 14/01/2013 14:22, Robby Pelssers wrote:


You will probably need to encode the characters if you make an ajax call…

var  somevalue = encodeURIComponent(“this is a value to be encoded”);

Robby

*From:*Peter Sparkes [mailto:pe...@didm.co.uk]
*Sent:* Monday, January 14, 2013 3:18 PM
*To:* Cocoon users
*Subject:* Multipage CForm using Ajax - Non ascii Characters

Hi

Cocoon 2.11

I have implemented a multipage CForm which uses Ajax. The form is based on the 
example at

http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

The  form works fine except that it does not save non ascii characters 
correctly eg.

É €  ç  £



If I use one very long form without Ajax the above characters are correctly 
saved

Help please, How can I fix this problem


Peter





Re: Flowscript - Move file to another directory

2013-01-02 Thread Peter Sparkes

Hi Robby,

Thank you very much, I spent several hours yesterday trying to find out how to do it without 
success. Thanks to you its now working.


What I am doing is upload multiple image files using the upload widget and then moving them to the 
required directory.


   function uploadprogress() {

var form = new Form(forms/uploadprogress_model.xml);
form.setAttribute(counter, new java.lang.Integer(0));
var k = form.showForm(uploadprogress-display-pipeline.jx);

var fileSource = D:/cocoon-2.1.11-wl/build/webapp/upload-dir/; 
//for testing
var fileTarget = 
D:/cocoon-2.1.11-wl/build/webapp/resources/imagesSmall/; //for testing

var fileSourcePath = ;
var fileTargetPath = ;
var file = ;

k.invalidate(); // do not allow return to the form

var files = [];
var repeater = form.getChild(uploads);
for (var i = 0; i  repeater.getSize(); i++) {
var upload = repeater.getRow(i).getChild(upload);
files[i] = {
filename: upload.value.fileName,
bytes: upload.value.size
};
   fileSourcePath = fileSource + upload.value.fileName;
   fileTargetPath = fileTarget + upload.value.fileName;
   file = new File(fileSourcePath);
   file.renameTo(new File(fileTargetPath));
}
cocoon.sendPage(upload-images-success.jx,
{
files: files
}
);
   }

Peter


On 01/01/2013 21:18, Robby Pelssers wrote:

http://stackoverflow.com/questions/4645242/how-to-move-file-from-one-location-to-another-location-in-java

The easiest is to use apache commons IO.  But you can also use the rename 
strategy but you will need to take care of a few things in that case.

Robby

-Original Message-
From: Peter Sparkes [mailto:pe...@didm.co.uk]
Sent: Tuesday, January 01, 2013 6:08 PM
To:users@cocoon.apache.org
Subject: Flowscript - Move file to another directory

Hi,

I am trying to copy image files from one directory to another, using 
flowscript, without any success.

Please has anyone got an example

java version 1.6.0_22

Thanks

Peter

-
To unsubscribe, e-mail:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail:users-h...@cocoon.apache.org










Flowscript - Move file to another directory

2013-01-01 Thread Peter Sparkes

Hi,

I am trying to copy image files from one directory to another, using 
flowscript, without any success.

Please has anyone got an example

java version 1.6.0_22

Thanks

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Flowscript - delete file

2012-12-29 Thread Peter Sparkes

Solved

I found the answer at 
http://markmail.org/message/7psype56uhu5kbad#query:+page:1+mid:ezqkl6i255bjdw75+state:results


I amended file.delete(); to:

file[delete]();

and it works,  the file is deleted. However, I don't know why it works

Thank you all for your help

Peter

On 29/12/2012 07:58, Peter Sparkes wrote:

Hi Martin and Robby,

Thank you both for your help, what I have ended up with is:

importClass(Packages.java.io.File);
importClass(Packages.java.io.FileNotFoundException);

function deletefile() {

//var filePath = cocoon.parameters[file];

var filePath = D:/cocoon-2.1.11-wl/build/webapp/BB/xml/.xml;  //for 
testing
var file = new File(filePath);
 try {
if (!file.exists()) {
   throw new FileNotFoundException(filePath);
}
file.delete();
cocoon.sendPage('deletefilesuccess',{file:filePath});
} catch (e) {
cocoon.sendPage('deletefileerror',{file:e});
}
}

However, file.delete(); produces a syntax error.

If I comment out file.delete(), the rest of the script works correctly:

  * If .xml exists, deletefilesuccess is accessed
  * If .xml does not exist, deletefileerror is accessed and I get:


  Error File java.io.FileNotFoundException: 
D:/cocoon-2.1.11-wl/build/webapp/BB/xml/.xml
  Not Found

What's wrong with file.delete(); ?

Regards

Peter



On 27/12/2012 18:35, Martin Heiden wrote:

Hi Peter,

Ok, I missed something:

  var xml_file = Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file 
+ .xml);

should be:

  var xml_file = new Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + 
file + .xml);

But you should try the function Robby sent to the list. It's much
cleaner.

Regards,

   Martin.


Thursday, December 27, 2012, 6:12:08 PM, you wrote:

PS Hi Martin

PS Thanks for your suggestion, unfortunately I get the same  error. The error 
log gives:

PS ERROR (2012-12-27) 15:30.46:723 [flow] (/office/deletefile_) 
PoolThread-4/JSErrorReporter:
PSfile:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, line 
13: missing name after .
PS operator
PS ERROR (2012-12-27) 15:30.46:723 [sitemap.handled-errors] 
(/office/deletefile_)
PS PoolThread-4/ErrorHandlerHelper: Sitemap: error calling function 
'deletefile'
PS  at map:call -
PSfile:///D:/cocoon-2.1.11-wl/build/webapp/office/sitemap.xmap:230:37
PS  at map:mount -
PSfile:///D:/cocoon-2.1.11-wl/build/webapp/sitemap.xmap:783:90
PS org.mozilla.javascript.EvaluatorException:
PSfile:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, line 
1: Compilation produced 1
PS syntax errors.
PS  at
PS 
org.apache.cocoon.components.flow.javascript.JSErrorReporter.runtimeError(JSErrorReporter.java:67)

PS regards

PS Peter


PS On 27/12/2012 11:42, Martin Heiden wrote:

Hi Peter,

PS  //Delete file
PS  Packages.java.io.File.xml_file.delete();

Try

xml_file.delete();

You just have to add the full path to the class when you
construct it. After this, the variable contains a reference and you
can just use it.

Regards,

Martin.


Thursday, December 27, 2012, 10:28:31 AM, you wrote:

PS Hi,

PS I am trying to delete xml files using the following flowscript:

PS function deletefile() {

PS  //file to be deleted
PS  var file =
PS Packages.java.lang.String(cocoon.parameters[file]);

PS  try {
PS  // creating a link to the file to be deleted
PS  var xml_file =
PS Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file
PS + .xml);

PS  //Delete file
PS  Packages.java.io.File.xml_file.delete();

PS  //  .txt file with OK message
PS  cocoon.sendPage(success.txt, null);
PS  }
PS  catch(ex){
PS  cocoon.log.error(ex);
PS  // Smth. went wrong. Sending a error.txt file to the browser
PScocoon.sendPage(error.txt, null);
PS  }

PS }

PS and get Compilation produced 1 syntax errors

PS The error log contains:

PS ERROR deletefile.js, line 13: missing name after . 
operator

PS line 13 is:

PS Packages.java.io.File.xml_file.delete();

PS What I am doing wrong?

PS Peter







-
To unsubscribe, e-mail:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail:users-h...@cocoon.apache.org





Ciao,
  Martin


-
To unsubscribe, e-mail:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail:users-h...@cocoon.apache.org








Re: Flowscript - delete file

2012-12-28 Thread Peter Sparkes

Hi Martin and Robby,

Thank you both for your help, what I have ended up with is:

importClass(Packages.java.io.File);
importClass(Packages.java.io.FileNotFoundException);

function deletefile() {

//var filePath = cocoon.parameters[file];

var filePath = D:/cocoon-2.1.11-wl/build/webapp/BB/xml/.xml;  //for 
testing
var file = new File(filePath);
 try {
if (!file.exists()) {
   throw new FileNotFoundException(filePath);
}
file.delete();
cocoon.sendPage('deletefilesuccess',{file:filePath});
} catch (e) {
cocoon.sendPage('deletefileerror',{file:e});
}
}

However, file.delete(); produces a syntax error.

If I comment out file.delete(), the rest of the script works correctly:

 * If .xml exists, deletefilesuccess is accessed
 * If .xml does not exist, deletefileerror is accessed and I get:


 Error File java.io.FileNotFoundException: 
D:/cocoon-2.1.11-wl/build/webapp/BB/xml/.xml
 Not Found

What's wrong with file.delete(); ?

Regards

Peter



On 27/12/2012 18:35, Martin Heiden wrote:

Hi Peter,

Ok, I missed something:

  var xml_file = Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file 
+ .xml);

should be:

  var xml_file = new Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + 
file + .xml);

But you should try the function Robby sent to the list. It's much
cleaner.

Regards,

   Martin.


Thursday, December 27, 2012, 6:12:08 PM, you wrote:

PS Hi Martin

PS Thanks for your suggestion, unfortunately I get the same  error. The error 
log gives:

PS ERROR (2012-12-27) 15:30.46:723 [flow] (/office/deletefile_) 
PoolThread-4/JSErrorReporter:
PS file:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, line 
13: missing name after .
PS operator
PS ERROR (2012-12-27) 15:30.46:723 [sitemap.handled-errors] 
(/office/deletefile_)
PS PoolThread-4/ErrorHandlerHelper: Sitemap: error calling function 
'deletefile'
PS  at map:call -
PS file:///D:/cocoon-2.1.11-wl/build/webapp/office/sitemap.xmap:230:37
PS  at map:mount -
PS file:///D:/cocoon-2.1.11-wl/build/webapp/sitemap.xmap:783:90
PS org.mozilla.javascript.EvaluatorException:
PS file:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, line 
1: Compilation produced 1
PS syntax errors.
PS  at
PS 
org.apache.cocoon.components.flow.javascript.JSErrorReporter.runtimeError(JSErrorReporter.java:67)

PS regards

PS Peter


PS On 27/12/2012 11:42, Martin Heiden wrote:

Hi Peter,

PS  //Delete file
PS  Packages.java.io.File.xml_file.delete();

Try

xml_file.delete();

You just have to add the full path to the class when you
construct it. After this, the variable contains a reference and you
can just use it.

Regards,

Martin.


Thursday, December 27, 2012, 10:28:31 AM, you wrote:

PS Hi,

PS I am trying to delete xml files using the following flowscript:

PS function deletefile() {

PS  //file to be deleted
PS  var file =
PS Packages.java.lang.String(cocoon.parameters[file]);

PS  try {
PS  // creating a link to the file to be deleted
PS  var xml_file =
PS Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file
PS + .xml);

PS  //Delete file
PS  Packages.java.io.File.xml_file.delete();

PS  //  .txt file with OK message
PS  cocoon.sendPage(success.txt, null);
PS  }
PS  catch(ex){
PS  cocoon.log.error(ex);
PS  // Smth. went wrong. Sending a error.txt file to the browser
PScocoon.sendPage(error.txt, null);
PS  }

PS }

PS and get Compilation produced 1 syntax errors

PS The error log contains:

PS ERROR deletefile.js, line 13: missing name after . 
operator

PS line 13 is:

PS Packages.java.io.File.xml_file.delete();

PS What I am doing wrong?

PS Peter







-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org






Ciao,
  Martin


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org






Flowscript - delete file

2012-12-27 Thread Peter Sparkes

Hi,

I am trying to delete xml files using the following flowscript:

   function deletefile() {

//file to be deleted
var file = Packages.java.lang.String(cocoon.parameters[file]);

try {
// creating a link to the file to be deleted
var xml_file = 
Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file
   + .xml);

//Delete file
Packages.java.io.File.xml_file.delete();

//  .txt file with OK message
cocoon.sendPage(success.txt, null);
}
catch(ex){
cocoon.log.error(ex);
// Smth. went wrong. Sending a error.txt file to the browser
  cocoon.sendPage(error.txt, null);
}

   }

and get Compilation produced 1 syntax errors

The error log contains:

   ERROR deletefile.js, line 13: missing name after . operator

line 13 is:

   Packages.java.io.File.xml_file.delete();

What I am doing wrong?

Peter



Re: Flowscript - delete file

2012-12-27 Thread Peter Sparkes

Hi Martin

Thanks for your suggestion, unfortunately I get the same  error. The error log 
gives:

ERROR (2012-12-27) 15:30.46:723 [flow] (/office/deletefile_) PoolThread-4/JSErrorReporter: 
file:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, line 13: missing name after . 
operator
ERROR (2012-12-27) 15:30.46:723 [sitemap.handled-errors] (/office/deletefile_) 
PoolThread-4/ErrorHandlerHelper: Sitemap: error calling function 'deletefile'

at map:call - 
file:///D:/cocoon-2.1.11-wl/build/webapp/office/sitemap.xmap:230:37
at map:mount - 
file:///D:/cocoon-2.1.11-wl/build/webapp/sitemap.xmap:783:90
org.mozilla.javascript.EvaluatorException: 
file:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, line 1: Compilation produced 1 
syntax errors.
at 
org.apache.cocoon.components.flow.javascript.JSErrorReporter.runtimeError(JSErrorReporter.java:67)


regards

Peter


On 27/12/2012 11:42, Martin Heiden wrote:

Hi Peter,

PS  //Delete file
PS  Packages.java.io.File.xml_file.delete();

Try

xml_file.delete();

You just have to add the full path to the class when you
construct it. After this, the variable contains a reference and you
can just use it.

Regards,

   Martin.


Thursday, December 27, 2012, 10:28:31 AM, you wrote:

PS Hi,

PS I am trying to delete xml files using the following flowscript:

PS function deletefile() {

PS  //file to be deleted
PS  var file =
PS Packages.java.lang.String(cocoon.parameters[file]);

PS  try {
PS  // creating a link to the file to be deleted
PS  var xml_file =
PS Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file
PS + .xml);

PS  //Delete file
PS  Packages.java.io.File.xml_file.delete();

PS  //  .txt file with OK message
PS  cocoon.sendPage(success.txt, null);
PS  }
PS  catch(ex){
PS  cocoon.log.error(ex);
PS  // Smth. went wrong. Sending a error.txt file to the browser
PScocoon.sendPage(error.txt, null);
PS  }

PS }

PS and get Compilation produced 1 syntax errors

PS The error log contains:

PS ERROR deletefile.js, line 13: missing name after . 
operator

PS line 13 is:

PS Packages.java.io.File.xml_file.delete();

PS What I am doing wrong?

PS Peter







-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org






Re: Lucene querybean - cocoon 2.11

2012-12-26 Thread Peter Sparkes

Solved:

2. Is there any way of excluding a file from being indexed on the value of one 
of its attributes?

The solution was put a xslt transformer in the sitemap - map:match 
pattern=screen/indexer

Peter


On 23/12/2012 08:59, Peter Sparkes wrote:

Hi,

I am using  a querybean to generate a Lucene index.

The sitemap pattern is ( adapted from the sample block :

map:match pattern=create.html
map:call function=indexCollection
map:parameter name=screen value=screen/indexer/
map:parameter name=lucene-directory 
value={global:lucene-directory}/
map:parameter name=lucene-analyzer 
value={global:lucene-analyzer}/
map:parameter name=lucene-merge-factor value=10/
map:parameter name=lucene-create-index value=false/
map:parameter name=lucene-content 
value=cocoon:/prepare4indexing//
map:parameter name=content-directory value=../BB/xml/
map:parameter name=include-pattern value=.xml$/
map:parameter name=result-directory value=/
map:parameter name=result-suffix value=/
/map:call
 /map:match

Please:

 1. What's the $ in map:parameter name=include-pattern value=.xml$/  for?
 2. Is there any way of excluding a file from being indexed on the value of one 
of its attributes?

Thanks

Peter











Re: Lucene querybean - cocoon 2.11

2012-12-26 Thread Peter Sparkes



On 26/12/2012 12:56, Francesco Chicchiriccò wrote:

On 26/12/2012 13:52, Peter Sparkes wrote:

Solved:

2. Is there any way of excluding a file from being indexed on the value of one 
of its attributes?

The solution was put a xslt transformer in the sitemap - map:match 
pattern=screen/indexer


Oh, nice, I couldn't help with that but


1. What's the $ in map:parameter name=include-pattern value=.xml$/  for?


should just mean 'anything ending with .xml', as per Java RegEx [1].

Regards.

[1] http://docs.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html


Thank you Francesco, I should have realised that the pattern in 
name=include-pattern meant  RexEx.




Peter


On 23/12/2012 08:59, Peter Sparkes wrote:

Hi,

I am using  a querybean to generate a Lucene index.

The sitemap pattern is ( adapted from the sample block :

map:match pattern=create.html
map:call function=indexCollection
map:parameter name=screen value=screen/indexer/
map:parameter name=lucene-directory 
value={global:lucene-directory}/
map:parameter name=lucene-analyzer 
value={global:lucene-analyzer}/
map:parameter name=lucene-merge-factor value=10/
map:parameter name=lucene-create-index value=false/
map:parameter name=lucene-content 
value=cocoon:/prepare4indexing//
map:parameter name=content-directory value=../BB/xml/
map:parameter name=include-pattern value=.xml$/
map:parameter name=result-directory value=/
map:parameter name=result-suffix value=/
/map:call
 /map:match

Please:

 1. What's the $ in map:parameter name=include-pattern value=.xml$/  for?
 2. Is there any way of excluding a file from being indexed on the value of one 
of its attributes?

Thanks

Peter


--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/




Re: Delete, move or rename files

2012-12-23 Thread Peter Sparkes

Thanks Robby,

On your suggestion I have tried to write an action to delete a file with out 
success.

Please has anyone got an example.

Peter

On 22/12/2012 15:47, Robby Pelssers wrote:


Not sure how you envisualize that?  Of course that is possible. Any application can access the 
filesystem it is installed on.  So you easily write code that will do any of the below operations. 
But I guess your question is if Cocoon does this magically for you?  No.  It might have components 
like a directory generator to easily get information about any folder. But you will still need to 
write actions that can handle delete / move / rename events.


Robby

*From:*Peter Sparkes [mailto:pe...@didm.co.uk]
*Sent:* Saturday, December 22, 2012 4:44 PM
*To:* users@cocoon.apache.org
*Subject:* Delete, move or rename files

Hi,

Is there anyway of

 1. deleting,
 2. moving
 3. renaming

xml files on the server.

Thanks

Peter





Lucene querybean - cocoon 2.11

2012-12-23 Thread Peter Sparkes

Hi,

I am using  a querybean to generate a Lucene index.

The sitemap pattern is ( adapted from the sample block :

map:match pattern=create.html
map:call function=indexCollection
map:parameter name=screen value=screen/indexer/
map:parameter name=lucene-directory 
value={global:lucene-directory}/
map:parameter name=lucene-analyzer 
value={global:lucene-analyzer}/
map:parameter name=lucene-merge-factor value=10/
map:parameter name=lucene-create-index value=false/
map:parameter name=lucene-content 
value=cocoon:/prepare4indexing//
map:parameter name=content-directory value=../BB/xml/
map:parameter name=include-pattern value=.xml$/
map:parameter name=result-directory value=/
map:parameter name=result-suffix value=/
/map:call
 /map:match

Please:

1. What's the $ in map:parameter name=include-pattern value=.xml$/  for?
2. Is there any way of excluding a file from being indexed on the value of one 
of its attributes?

Thanks

Peter









Delete, move or rename files

2012-12-22 Thread Peter Sparkes

Hi,

Is there anyway of

1. deleting,
2. moving
3. renaming

xml files on the server.

Thanks

Peter



CForms Character Encoding

2012-12-04 Thread Peter Sparkes

I am using C.2.11

I have a CForm implementation and there are, in the xml text, special 
characters such as:

£, Â, ⅗ and â

I am using UTF-8 encoding and such characters in the xml file are correctly displaced in the CForm 
and when the form is saved they are correctly saved in the xml file.


However, I am building another CForm, within the same Cocoon application, this time using the 
JXTemplate Generator and I am having encoding problems; the above characters are not correctly saved 
in the xml file.


In the sitemap I have:

map:generate type=jx src=forms/{1}_template.xml label=content1
map:parameter name=locale value={flow-attribute:locale}/
/map:generate

I suspect the locale setting but do not know how to set it to UTF-8

Help please

Peter





-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: CForms Character Encoding

2012-12-04 Thread Peter Sparkes

On 04/12/2012 08:46, Francesco Chicchiriccò wrote:

On 04/12/2012 09:40, Peter Sparkes wrote:

I am using C.2.11

I have a CForm implementation and there are, in the xml text, special 
characters such as:

£, Â, ⅗ and â

I am using UTF-8 encoding and such characters in the xml file are correctly displaced in the 
CForm and when the form is saved they are correctly saved in the xml file.


However, I am building another CForm, within the same Cocoon application, this time using the 
JXTemplate Generator and I am having encoding problems; the above characters are not correctly 
saved in the xml file.


In the sitemap I have:

map:generate type=jx src=forms/{1}_template.xml label=content1
map:parameter name=locale value={flow-attribute:locale}/
/map:generate

I suspect the locale setting but do not know how to set it to UTF-8


Hi Peter,
did you take a look at [1] and [2] (for C2.2 but most concepts apply to C2.1 as 
well)?

Regards.

[1] http://wiki.apache.org/cocoon/RequestParameterEncoding
[2] http://cocoon.apache.org/2.2/1366_1_1.html


Hi Francesco,

No, but I will now

Thank you

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: CForms Character Encoding

2012-12-04 Thread Peter Sparkes

On 04/12/2012 09:15, Peter Sparkes wrote:

On 04/12/2012 08:46, Francesco Chicchiriccò wrote:

On 04/12/2012 09:40, Peter Sparkes wrote:

I am using C.2.11

I have a CForm implementation and there are, in the xml text, special 
characters such as:

£, Â, ⅗ and â

I am using UTF-8 encoding and such characters in the xml file are correctly displaced in the 
CForm and when the form is saved they are correctly saved in the xml file.


However, I am building another CForm, within the same Cocoon application, this time using the 
JXTemplate Generator and I am having encoding problems; the above characters are not correctly 
saved in the xml file.


In the sitemap I have:

map:generate type=jx src=forms/{1}_template.xml label=content1
map:parameter name=locale value={flow-attribute:locale}/
/map:generate

I suspect the locale setting but do not know how to set it to UTF-8


Hi Peter,
did you take a look at [1] and [2] (for C2.2 but most concepts apply to C2.1 as 
well)?

Regards.

[1] http://wiki.apache.org/cocoon/RequestParameterEncoding
[2] http://cocoon.apache.org/2.2/1366_1_1.html


Hi Francesco,

No, but I will now

Thank you

Peter


Hi Francesco,

All working now

Thank you again

Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: CForms br /

2012-12-03 Thread Peter Sparkes

Hi Robby,

Thank you for your help, however, my programming skills proved not to be up to 
doing as you suggested.

What I have done instead is using the techniques in:

http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-taskTree.flow

to eliminate the br / and replace them with sub paras as in sub 1 and  sub 
2 below:

 ppara 1
   psub 1/p
   psub 2/p
 /p

The xslt formatting the html pages will then format the sub paras appropriately.

Peter


On 30/11/2012 09:44, Robby Pelssers wrote:


Did you already debug what you received back on the server side?  I’m interesting what value the 
form posts to the server.


http://cocoon.apache.org/2.1/apidocs/index.html?overview-summary.html

I would put a breakpoint on |*setValue 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/Field.html#setValue%28java.lang.Object%29*||(Object 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true newValue)|


||

|I think you can set it in 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/AbstractWidget.html|


||

|Robby|

*From:*Peter Sparkes [mailto:pe...@didm.co.uk]
*Sent:* Friday, November 30, 2012 7:33 AM
*To:* users
*Subject:* CForms br /

CForms with 2.1.11 cocoon.

I have a field widget with datatype string:

fd:field id=p required=false whitespace=trim
   fd:datatype base=string/
/fd:field

which is bound to a para in the  source document. Some paras contain br / 
elements.

On loading a document in the CForm the br / disappears, so on submitting the CForm the resulting 
saved xml does not contain the br /


Please, how can I preserve the br /

Thank you

Peter





CForms - nested repeaters

2012-11-30 Thread Peter Sparkes

Cocoon 2.1.11

I can't get a nested repeater to work.

Can anyone point to to an example please

Peter



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: CForms - nested repeaters

2012-11-30 Thread Peter Sparkes

Thank you Francesco

Just what I wanted.

Peter

On 30/11/2012 09:12, Francesco Chicchiriccò wrote:

On 30/11/2012 09:37, Peter Sparkes wrote:

Cocoon 2.1.11

I can't get a nested repeater to work.

Can anyone point to to an example please


Hi Peter,
I am not very familiar (any more) with CForms but do you mean something like 
http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-taskTree.flow ?


Regards.
--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/




CForms br /

2012-11-29 Thread Peter Sparkes

CForms with 2.1.11 cocoon.

I have a field widget with datatype string:

fd:field id=p required=false whitespace=trim
   fd:datatype base=string/
/fd:field

which is bound to a para in the  source document. Some paras contain br / 
elements.

On loading a document in the CForm the br /  disappears, so on submitting the CForm the resulting 
saved xml does not contain the br /


Please, how can I preserve the br /

Thank you

Peter



Upload widget cocoon-2.1.11

2012-10-14 Thread Peter Sparkes

Hi,

I want to use two upload widgets in a CForm.

Each widget will upload files to a different directory eg:

1. images/
2. pdfs/

Please how can I do it as the web.xml appears to only allow in

init-param
  param-nameupload-directory/param-name
  param-valueD:\test/param-value
 /init-param

to set one upload directory?

Also if I set

param-value../test/param-value

What's it relative to, I can't work it out?

Thanks

Peter



Re: Upload widget cocoon-2.1.11

2012-10-14 Thread Peter Sparkes

On 14/10/2012 10:18, Peter Sparkes wrote:

Hi,

I want to use two upload widgets in a CForm.

Each widget will upload files to a different directory eg:

 1. images/
 2. pdfs/

Please how can I do it as the web.xml appears to only allow in

init-param
  param-nameupload-directory/param-name
  param-valueD:\test/param-value
 /init-param

to set one upload directory?

Also if I set

param-value../test/param-value

What's it relative to, I can't work it out?


Solved;  What's it relative to - the cocoon servlet
Peter


Thanks

Peter





Work Opportunity

2011-01-17 Thread Peter Sparkes

Hi,

I maintain a number of websites, for different companies, using the following technologies - debian 
(lenny), apache2, Multiple instances oftomcat6 each servicing a different domain and Cocoon 2.1.11. 
Within cocoon I use xml, xslt, javascript etc.


One of the companies I work for is concerned that I am a one man company and that if I got run over 
by a bus they would have a problem.


What I am looking for is a individual or small company who could take over in the event that I was 
unable to look after the website.


I am located in Devon, England and the Server is in Yorkshire, England.

If you are interested, please, send me your telephone number so we discuss the 
it.

Regards

Peter Sparkes






Flash .swf in Cocoon 2.1.11

2010-12-07 Thread Peter Sparkes

Hi,

I am trying, without success, to display a flash .swf files using Cocoon 2.1.11

Help please

Peter



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Flash .swf in Cocoon 2.1.11

2010-12-07 Thread Peter Sparkes

Thanks Jasha,

The html page displays correctly, except that the  .swf file is not displayed, see 
http://www.chezmuta.com/flashTest.htm. However, 
http://www.chezmuta.com/images/plan-de-pistes-bernex-v3.swf displays the .swf correctly. The browser 
source page for flashTest.htm appears correct.


In my sitemap.xmap file I have

map:match pattern=images/*.swf
map:read mime-type=application/x-shockwave-flash 
src=resources/images/{1}.swf/
/map:match

Regards

Peter



On 7 December 2010 13:49, Peter Sparkes pe...@didm.co.uk 
mailto:pe...@didm.co.uk wrote:

Hi,

I am trying, without success, to display a flash .swf files using Cocoon 
2.1.11

Help please

Peter

What's the problem? Is it the HTML or do you see 404-not found responses for certain resources 
that have anything to do with the swf? Providing more information leads more likely to a solution ;)


Jasha Joachimsthal

j.joachimst...@onehippo.com mailto:j.joachimst...@onehippo.com - ja...@apache.org 
mailto:ja...@apache.org


Hippo
Europe   •   Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20 522 
4466
USA   •   San Francisco  755 Baywood Drive Second Floor  •  Petaluma CA 94954   •  +1 877 414 4776 
(toll free)

Canada  •   Montréal  5369 Boulevard St-Laurent #430  •  Montréal QC H2T 1S5  • 
 +1 (514) 316 8966
www.onehippo.com http://www.onehippo.com/  • www.onehippo.org http://www.onehippo.org/  • 
i...@onehippo.com mailto:i...@onehippo.com






Cocoon 2.1.11 Samples CForms Binding

2010-02-04 Thread Peter Sparkes
The function saveDocument(document, uri)  saves the xml as ISO-8859-1 
even though the OutputKeys are set as:


transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.METHOD, 
xml);
transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.ENCODING, 
UTF-8);


Please, is there any way to get saveDocument(document, uri) to save the 
xml as UTF-8


Thanks

Peter



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



mysql

2008-10-03 Thread Peter Sparkes

Hi,

I have to use |mysql instead of hsqldb and I don't know how to connect 
it to Cocoon, help please.


I am using Cocoon 2.1

Thanks

Peter

|

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



Re: mysql

2008-10-03 Thread Peter Sparkes

Thanks Bertrand

Regards

Peter

Hi,

On Fri, Oct 3, 2008 at 11:02 AM, Peter Sparkes [EMAIL PROTECTED] wrote:
  

...I have to use |mysql instead of hsqldb and I don't know how to connect it to
Cocoon, help please.

I am using Cocoon 2.1..



Then that page should help: http://wiki.apache.org/cocoon/MySQL

-Bertrand

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




No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.7.5/1704 - Release Date: 02/10/2008 21:35
  



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



Non Portal Basket

2008-10-02 Thread Peter Sparkes

Hi,

I want to implement a Basket. However, the only example I can find is 
using the Portal Engine, which I do not want to use.


Is there a way of implementing a basket without using the Portal Engine?

Regards

Peter Sparkes

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



Upload widget - Storing Data Permanently

2008-08-21 Thread Peter Sparkes

Hi,

When data is uploaded using the Upload Widget it is automatically 
cleaned up when the upload widget instance object is finalized by the JVM.


Please, how can I permanently store the data (image file)?

Thanks

Peter Sparkes

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



Re: Passing request parameter from the sitemap

2008-08-11 Thread Peter Sparkes

Kai Mütz  gave me the answer on  [EMAIL PROTECTED]

No. You are refering to a sitemap parameter not a request parameter. 
XQueryGenerator passes the parameters from sitemap to the XQuery. Thus 
you can use $myuser without declaring it.


Peter


Hi Andy,

Sorry typos in email.

sitemap extract:
map:match pattern=register-with-eXist
   map:generate src=register.xq type=xquery
  map:parameter name=user value=test/
  /map:generate

and register.xq extract:

declare namespace xdb=http://exist-db.org/xquery/xmldb;;
declare namespace request=http://exist-db.org/xquery/request;;
declare namespace session=http://exist-db.org/xquery/session;;

let $user := request:get-parameter(user, 'error'),
return
  p user  : {$user} /p

Returns   p user  : error /p

while http://localhost:8080/exist/register.xq?user=test

Returns  p user  :  test/p

Peter

2008/8/7 Peter Sparkes [EMAIL PROTECTED]:
  

I am trying to pass various request parameter from the sitemap to a eXist
xquery using:

map:match pattern=register-with-eXist
 map:generate src=register.xq type=xquery
!--map:parameter name=user value={flow-attribute:user}/--
map:parameter name=user value=test/
  /map:generate


I know the xquery is correct as I have tested it with the the URL
register.xql?pass=test



register.xq (as you have in the map:generate) or .xql?  Also, you have
pass=test in the URL but name=user value=test in the
map:parameter.  Are those what you're actually using or just typos in
your email?


Andy.
  




No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.5.12/1599 - Release Date: 07/08/2008 20:49
  





No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.5.12/1599 - Release Date: 07/08/2008 20:49
  



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



Re: Passing request parameter from the sitemap

2008-08-08 Thread Peter Sparkes

Hi Andy,

Sorry typos in email.

sitemap extract:
map:match pattern=register-with-eXist
  map:generate src=register.xq type=xquery
 map:parameter name=user value=test/
 /map:generate

and register.xq extract:

declare namespace xdb=http://exist-db.org/xquery/xmldb;;
declare namespace request=http://exist-db.org/xquery/request;;
declare namespace session=http://exist-db.org/xquery/session;;

let $user := request:get-parameter(user, 'error'),
   return
 p user  : {$user} /p

Returns   p user  : error /p

while http://localhost:8080/exist/register.xq?user=test

Returns  p user  :  test/p

Peter

2008/8/7 Peter Sparkes [EMAIL PROTECTED]:
  

I am trying to pass various request parameter from the sitemap to a eXist
xquery using:

map:match pattern=register-with-eXist
 map:generate src=register.xq type=xquery
!--map:parameter name=user value={flow-attribute:user}/--
map:parameter name=user value=test/
  /map:generate


I know the xquery is correct as I have tested it with the the URL
register.xql?pass=test



register.xq (as you have in the map:generate) or .xql?  Also, you have
pass=test in the URL but name=user value=test in the
map:parameter.  Are those what you're actually using or just typos in
your email?


Andy.
  




No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.5.12/1599 - Release Date: 07/08/2008 20:49
  




Image caching problem using FOP

2008-08-07 Thread Peter Sparkes

Hi,

I have pages that can be viewed as xhtml and pdf which is generated by 
FOP. When I change the images, using the same image filenames, the new 
images appear in the xhtml version, however the old images are shown in 
the pdf version. If  I use new images with different file names the new 
images appear  in the PDF. However as I am generating the image file 
names programmatically I have to keep the old names.


I am using

map:pipeline type=noncaching

If appears that FOP is caching the images somewhere, however I don't 
know how to find and delete the FOP cache


Help please

Peter

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



Re: Image caching problem using FOP

2008-08-07 Thread Peter Sparkes

I am using

fo:external-graphic src=

Hi,

I have pages that can be viewed as xhtml and pdf which is generated by 
FOP. When I change the images, using the same image filenames, the new 
images appear in the xhtml version, however the old images are shown 
in the pdf version. If  I use new images with different file names the 
new images appear  in the PDF. However as I am generating the image 
file names programmatically I have to keep the old names.


I am using

map:pipeline type=noncaching

If appears that FOP is caching the images somewhere, however I don't 
know how to find and delete the FOP cache


Help please

Peter

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



No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.5.12/1597 - Release Date: 07/08/2008 05:54
  




Passing request parameter from the sitemap

2008-08-07 Thread Peter Sparkes

Hi,

I am trying to pass various request parameter from the sitemap to a eXist xquery 
using:


map:match pattern=register-with-eXist
  map:generate src=register.xq type=xquery   
 !--map:parameter name=user value={flow-attribute:user}/--

 map:parameter name=user value=test/
   /map:generate


I know the xquery is correct as I have tested it with the the URL 
register.xql?pass=test

Help please, how do I pass parameters from the sitemap as request parameters?

Thanks

Peter


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



Re: Image caching problem using FOP

2008-08-07 Thread Peter Sparkes

Thanks Andy,

Now working

Thanks again

Peter

2008/8/7 Peter Sparkes [EMAIL PROTECTED]:
  

I have pages that can be viewed as xhtml and pdf which is generated by FOP.
When I change the images, using the same image filenames, the new images
appear in the xhtml version, however the old images are shown in the pdf
version. If  I use new images with different file names the new images
appear  in the PDF. However as I am generating the image file names
programmatically I have to keep the old names.



It's a FOP feature.  From http://xmlgraphics.apache.org/fop/0.94/graphics.html
FOP caches images between runs. There is one cache per FopFactory
instance. The URI is used as a key to identify images which means that
when a particular URI appears again, the image is taken from the
cache. If you have a servlet that generates a different image each
time it is called with the same URL you need to use a constantly
changing dummy parameter on the URL to avoid caching.

Like the man said, add a dummy request parameter to the URI with some
unique value e.g. a hash of the session ID and current time.


Andy.
  




No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.5.12/1597 - Release Date: 07/08/2008 05:54
  




PDF Image Caching Problem

2008-05-05 Thread Peter Sparkes

Hi,

I generate html and pdf, which contain images, from the a database. When 
I update an image the html correctly displays the new image, however the 
pdf incorrectly contains the old image. If I then change the new image 
file name the pdf displays the correct image. When I change the image 
file name back the old image is displayed in the pdf, not the new image.


It appears that the pdf is using a cached version of the image not the 
new version. Please, how can I get the pdf to display the new image 
rather than the old cashed image. I can't change the image file name in 
the production system.


I am using Cocoon 2.1.10

Thank you

Peter Sparkes


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



Re: PDF Image Caching Problem

2008-05-05 Thread Peter Sparkes

Hi Mika,

Thanks for the info on open files with the 'noncaching' option. My 
application was crashing every 4 to 5 days and I could not find the 
reason; I got round it by restarting tomcat/cocoon once a day using a 
cron job. I think that I will also leave the image caching problem for 
latter, I have spent enough time on it and restarting cocoon once a day 
means that the pdf catches up with the html within 24 hours which, while 
not ideal, is acceptable


Thank for you help

Peter

Hi Peter,

unfortunetely I couldn't solve the problem and as it isn't so crucial 
at the moment, I have left it behind for now on.


Actually there might be another problem (or bug) lying around if you 
produce htmls' with 'noncaching' option. Cocoon seems to be leaving 
files open when using html-serializer with noncaching option in your 
pipeline. And eventually your application can crash because you exceed 
the maximum open files that your OS tolerates. (Cocoon 2.1.11 / Centos 
4.6)


mika

Peter Sparkes kirjoitti:

Hi

I have tried using  map:pipeline type=noncaching and invalidate 
the PDF by changing the XSLT that produces it. Neither makes any 
difference.


It appears that FOP is getting the image from its own cache which is 
not being updated by the new version of the image. Like you I get the 
new image when I restart tomcat and hence cocoon


Have you managed to fix the problem?

Peter

Hi,

this is what Joerg Heinicke wrote about the similar problem of mine:

My guess is it's actually the PDF that is taken from the cache. I 
guess the cache key for the PDF does not take included resources 
like your images into account. If that's true you just have to 
invalidate the PDF. I don't know how exactly your PDF pipeline looks 
like but you might want to touch (in the Linux sense, changing the 
file's timestamp) an XSLT or the input XML.


(See: image caching on 4-5 March at the users-list)

mika

Peter Sparkes kirjoitti:

Hi,

I generate html and pdf, which contain images, from the a database. 
When I update an image the html correctly displays the new image, 
however the pdf incorrectly contains the old image. If I then 
change the new image file name the pdf displays the correct image. 
When I change the image file name back the old image is displayed 
in the pdf, not the new image.


It appears that the pdf is using a cached version of the image not 
the new version. Please, how can I get the pdf to display the new 
image rather than the old cashed image. I can't change the image 
file name in the production system.


I am using Cocoon 2.1.10

Thank you

Peter Sparkes


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



Sendmail using Flow - Attachments

2008-03-29 Thread Peter Sparkes

Hi,

I am successfully sending email using Flow. However, I want to attach a 
html document to it that is generated via a sitemap and I can't get that 
to work.


Please how do I attach a document that is generated by a sitemap

Peter Sparkes

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



Re: Sendmail using Flow - Attachments

2008-03-29 Thread Peter Sparkes

More info

I am trying to attach a document generated by the pipeline statsOffice 
in a sitemap in the directory stats


When using

mms.addAttachmentURL(cocoon:///stats/statsOffice);

I Get the following error

java.lang.RuntimeException: The current URI (/stats/statsOffice) doesn't 
start with given prefix (stats)


Peter

Hi,

I am successfully sending email using Flow. However, I want to attach 
a html document to it that is generated via a sitemap and I can't get 
that to work.


Please how do I attach a document that is generated by a sitemap

Peter Sparkes

-
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: upload widget

2008-03-17 Thread Peter Sparkes

Thanks Grzegorz,

Unfortunately I can't get it to work, code is:

function upload() {
  
   var form = new Form(forms/upload_model.xml);

   var k = form.showForm(upload-display-pipeline.jx);

   k.invalidate();

   var widget = form.getChild(upload);
   var uploadedContent = handleUpload(form);
   var part  = widget.getValue();
   part.copyToFile(new.pdf) ;
...


The pdf file is uploaded, but deleted at the end of the request. However 
it is not copied to new.pdf


Please, what am I doing wrong ?

Peter Sparkes


Peter Sparkes pisze:

Hi,

Following the /upload/ sample in the CForms Block Samples I am trying 
to upload files, however, the uploaded files are deleted at the end 
of a request.


Please how do I permanently save the uploaded files.


From form object get upload widget and ask it for its value which is 
Part[1] object.


You should do something like that:

  part = form.getChild(upload_widget).getValue();

Then it's easy because Part interface has handy methods for accessing 
the uploaded data.


[1] 
http://cocoon.apache.org/2.2/core-modules/core/2.2/apidocs/org/apache/cocoon/servlet/multipart/Part.html 



I hope this helps.



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



upload widget

2008-03-15 Thread Peter Sparkes

Hi,

Following the /upload/ sample in the CForms Block Samples I am trying to 
upload files, however, the uploaded files are deleted at the end of a 
request.


Please how do I permanently save the uploaded files.

Thanks

Peter Sparkes

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



Upload widget

2008-03-08 Thread Peter Sparkes

Hi,

Please, using the Upload widget, how do I specify the location on the 
server I want a file uploaded to.


Thanks

Peter

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



Re: Cforms and Character Encoding

2008-01-23 Thread Peter Sparkes

Thanks Joerg,

The problem turned out to be in web.xml

I amended

init-param
   param-nameform-encoding/param-name
   param-valueISO-8859-1/param-value
/init-param

To

init-param
   param-nameform-encoding/param-name
   param-valueUTF-8/param-value
/init-param

and now everything is in UTF-8 and works properly

The problem was that the form was sending UTF-8 but it was being read as 
ISO-8859-1


Peter

On 08.12.2007 13:37, Peter Sparkes wrote:

I am using Cforms in Cocoon 2.1.10 to amend an XML file. The 
character encoding is UTF-8


The Euro sign € gets converted to â#130;¬ and UK pound sign £ to £
from the field widget. I am using the saveDocument function from the 

samples and have set
transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.ENCODING, 
UTF-8);


Please, how do I correct this problem?


I can't tell you how to correct it since I don't know where it goes 
wrong. But what happens is that a 2-byte-character (as in UTF-8) is 
read byte by byte (as in ISO-8859-1). Maybe it is only a problem with 
watching the file without an encoding-aware editor which reads it in 
ISO-8859-1?


Joerg


-
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: Cforms and Character Encoding

2008-01-23 Thread Peter Sparkes

Thanks for the advice

I have tested with various versions of IE and Firefox and all' fine

Peter

Peter Sparkes wrote:

The problem turned out to be in web.xml
I amended
  param-nameform-encoding/param-name
  param-valueISO-8859-1/param-value
To
  param-nameform-encoding/param-name
  param-valueUTF-8/param-value
and now everything is in UTF-8 and works properly


Just a word of caution: make sure you test your forms on every 
possible web browser.

I've had trouble with this setting in the past.


Tobia

-
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]



cgi - Awstats Webstats

2008-01-13 Thread Peter Sparkes

Hi,

I want to use Awstats Web stats on my site (Apache 2, tomcat5.5, cocoon 
2.1).


To access the stats on  a NON Cocoon site I would use :

www.mysite.com/cgi-bin/awstats.pl?config=awstat.conf

On Cocoon this throws an error as it does not match any pipeline

Please, how can I  run Awstats on Cocoon?

Thanks

Peter



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



Re: cgi - Awstats Webstats

2008-01-13 Thread Peter Sparkes

Yes Apache 2

Peter Sparkes :
  

Hi,

I want to use Awstats Web stats on my site (Apache 2, tomcat5.5, cocoon
2.1).

To access the stats on  a NON Cocoon site I would use :

www.mysite.com/cgi-bin/awstats.pl?config=awstat.conf

On Cocoon this throws an error as it does not match any pipeline

Please, how can I  run Awstats on Cocoon?



I don't think it's a Cocoon problem but more problem with your configuration. 
The question is how
you deploy Cocoon application. Is there httpd server in front of Cocoon 
configured?

  


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



Foreign Language Teaching Website

2008-01-05 Thread Peter Sparkes

Hi,

I have a client who wishes to develop a website to teach a foreign 
language, which uses non-Latin characters, to English speakers. The site 
will have:


   * text in both language
   * audio linked to the text for pronunciation etc.
   * text and audio interactive help from tutors and other students.

Any ideas or suggestions on how to implement it would be appreciated

Regards

Peter Sparkes


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



Re: New server recommendations?

2007-11-26 Thread Peter Sparkes
I am using Apache 2, Debian etch, java 1.5, tomcat 5 and Cocoon 2.1 and 
got the whole thing up and running in under a day. I have very little 
experience in setting up such a system so  it can't be too difficult.


I found http://edwardaux.wordpress.com/2006/09/20/3/ very helpful in 
setting the system up so that I could host multiple sites.


Peter

Peter Flynn wrote:
  

I think the last time I asked, the recommendation was to make httpd
proxy Tomcat [...] Does anyone have any specific Dos or Donts about
this platform or configuration?



My personal experience with Tomcat for use with Cocoon 2.1 has been
terrible, both on RHEL and Debian.

We ended up using the (quite old) version of Jetty provided with Cocoon
itself, along with the cocoon.sh wrapper script and Apache reverse proxy
functionality, and it's been working like a charm ever since.

The only gotcha has to do with the AJP13 protocol, see here:
http://marc.info/?l=xml-cocoon-usersm=119201336509954

We haven't switched to Cocoon 2.2 yet, so I can't say much about it.


Tobia

-
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]



  1   2   >