Repeater add row replaces old data

2007-06-08 Thread Barbara Slupik

Hello

I am trying to add a row in a CForms repeater but the new row  
replaces some of the old data in the collection.


I am using Cocoon-2.1.10 with Hibernate-3.2, Spring-2.0.4 and  
MySQL-5.0.37. The repeater rows are loaded from the database and  
displayed correctly on the screen. When I try to add a new row  
sometimes it works and after the form is submited my collection  
contains all rows from the repeater. But most times the last object  
in the original collection gets replaced by the new repeater row and  
a null object is added to the collection. I think that the problem  
might be with the row id. I was experimenting with it but cannot make  
it work.


Below are some parts of the code. Please can anyone offer some help  
or suggestions for how to make it work.


Barbara

Beans
==
// Party is the main item on the form
public class Party {
...
private Long partyID;
private Collection addresses=new ArrayList();
...
public void setAddresses(Collection addresses) {
this.addresses=addresses;
int i=0;
Iterator it=addresses.iterator();
while (it.hasNext()) {
NameAddress address=(NameAddress)it.next();
address.setId(i);
i=i+1;
}

}
public void addAddress(NameAddress address) {
//address.setId(addresses.size());
addresses.add(address);
address.setParty(this);
}
}

// NameAddress are the items which appear in the repeater,  
nameAddressID is the id from the database

public class NameAddress {
private int id;
private Long nameAddressID;
private Long partyID;
...
}

Binding
===

  fb:repeater id=addresses parent-path=. row-path=addresses
fb:identity
  fb:value id=id path=id/
  !--fb:value id=nameAddressID path=nameAddressID/--
/fb:identity
!-- executed on updates AND right after the insert --
fb:on-bind
  fb:javascript id=id path=id direction=save
fb:save-form
  if (widget.getValue()==null) {
var form = widget.getForm();
var count = 
form.getAttribute(addressCounter);
jxpathPointer.setValue(count);

form.setAttribute(addressCounter, count+1);
}
/fb:save-form
  /fb:javascript
  !--fb:value id=nameAddressID path=nameAddressID/--
...
/fb:on-bind
!-- executed in case a row has been deleted --
fb:on-delete-row
  fb:delete-node/
/fb:on-delete-row
!-- executed in case a new row has been added --
fb:on-insert-row
  fb:insert-bean classname=net.expertys.model.NameAddress  
addmethod=addAddress/

/fb:on-insert-row
  /fb:repeater
 ...

Flow
===

function Party() {
getApplication();
var id=cocoon.request.getParameter(id);
var party=application.readParty(new java.lang.Long(id));
var formDefinition=cocoon.parameters[form-defn];
var formBinding=cocoon.parameters[form-bind];
var form=new Form(formDefinition);
form.setAttribute(addressCounter,party.getAddresses().size());
form.createBinding(formBinding);
form.load(party);
form.showForm(Party-display);
if (form.isValid) {
if (id==null) {}
else {
form.save(party);
application.saveParty(party);
cocoon.sendPage(Party?id=+id);
}
}
else {cocoon.redirectTo(Parties(1))};
}


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



Re: Repeater add row replaces old data

2007-06-18 Thread Barbara Slupik
I solved the problem. The collection filled with data by Hibernate  
was not sorted. After adding order-by into the set definition in my  
Party.hbm.xml all works fine:


class name=net.expertys.model.Party table=Party
id name=partyID column=partyID type=long
generator class=increment/
/id
		set name=addresses inverse=true cascade=all,delete-orphan  
order-by=nameAddressID

key column=partyID/
one-to-many class=net.expertys.model.NameAddress/
/set
/class

I use the database id nameAddressID to identify the repeater rows, no  
extra ids are necessary.


Barbara

On 8 Jun, 2007, at 10:46 pm, Barbara Slupik wrote:


Hello

I am trying to add a row in a CForms repeater but the new row  
replaces some of the old data in the collection.


I am using Cocoon-2.1.10 with Hibernate-3.2, Spring-2.0.4 and  
MySQL-5.0.37. The repeater rows are loaded from the database and  
displayed correctly on the screen. When I try to add a new row  
sometimes it works and after the form is submited my collection  
contains all rows from the repeater. But most times the last object  
in the original collection gets replaced by the new repeater row  
and a null object is added to the collection. I think that the  
problem might be with the row id. I was experimenting with it but  
cannot make it work.


Below are some parts of the code. Please can anyone offer some help  
or suggestions for how to make it work.


Barbara

Beans
==
// Party is the main item on the form
public class Party {
...
private Long partyID;
private Collection addresses=new ArrayList();
...
public void setAddresses(Collection addresses) {
this.addresses=addresses;
int i=0;
Iterator it=addresses.iterator();
while (it.hasNext()) {
NameAddress address=(NameAddress)it.next();
address.setId(i);
i=i+1;
}

}
public void addAddress(NameAddress address) {
//address.setId(addresses.size());
addresses.add(address);
address.setParty(this);
}
}

// NameAddress are the items which appear in the repeater,  
nameAddressID is the id from the database

public class NameAddress {
private int id;
private Long nameAddressID;
private Long partyID;
...
}

Binding
===

  fb:repeater id=addresses parent-path=. row-path=addresses
fb:identity
  fb:value id=id path=id/
  !--fb:value id=nameAddressID path=nameAddressID/--
/fb:identity
!-- executed on updates AND right after the insert --
fb:on-bind
  fb:javascript id=id path=id direction=save
fb:save-form
  if (widget.getValue()==null) {
var form = widget.getForm();
var count = 
form.getAttribute(addressCounter);
jxpathPointer.setValue(count);

form.setAttribute(addressCounter, count+1);
}
/fb:save-form
  /fb:javascript
  !--fb:value id=nameAddressID path=nameAddressID/--
...
/fb:on-bind
!-- executed in case a row has been deleted --
fb:on-delete-row
  fb:delete-node/
/fb:on-delete-row
!-- executed in case a new row has been added --
fb:on-insert-row
  fb:insert-bean classname=net.expertys.model.NameAddress  
addmethod=addAddress/

/fb:on-insert-row
  /fb:repeater
 ...

Flow
===

function Party() {
getApplication();
var id=cocoon.request.getParameter(id);
var party=application.readParty(new java.lang.Long(id));
var formDefinition=cocoon.parameters[form-defn];
var formBinding=cocoon.parameters[form-bind];
var form=new Form(formDefinition);
form.setAttribute(addressCounter,party.getAddresses().size());
form.createBinding(formBinding);
form.load(party);
form.showForm(Party-display);
if (form.isValid) {
if (id==null) {}
else {
form.save(party);
application.saveParty(party);
cocoon.sendPage(Party?id=+id);
}
}
else {cocoon.redirectTo(Parties(1))};
}


-
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]



Authentication block

2008-06-11 Thread Barbara Slupik

Hello

I am trying to move my cocoon applications from cocoon-2.1.10 to  
cocoon-2.2.0. I cannot make the tomcat security (realm) work with  
cocoon-2.2.0 so I tried to use authentication block instead.


=== My application context ===

bean name=org.apache.cocoon.auth.SecurityHandler/simple

class=org.apache.cocoon.auth.impl.SimpleSecurityHandler
scope=singleton
property name=userProperties
value
manager=mana
manager.roles=admin_admin
agent001=agen
agent001.roles=admin_user
/value
/property
/bean

bean name=org.apache.cocoon.auth.Application/cocoon-app
class=org.apache.cocoon.auth.impl.StandardApplication
scope=singleton
	property name=securityHandler  
ref=org.apache.cocoon.auth.SecurityHandler/simple/

/bean

=== My sitemap ===

map:match pattern=
map:redirect-to uri=login/
/map:match

map:match pattern=home
map:act type=cauth-is-logged-in
map:parameter name=application value=cocoon-app/
map:generate src=menu/home.xml/
map:transform type=role-filter/
		map:transform type=i18nmap:parameter name=locale  
value={request:locale}//map:transform

map:serialize type=xhtml/
/map:act
map:redirect-to uri=login/
/map:match

map:match pattern=login
map:act type=cauth-is-logged-in
map:parameter name=application value=cocoon-app/
map:redirect-to uri=home/
/map:act
map:generate src=menu/login.xml/
	map:transform type=i18nmap:parameter name=locale  
value={request:locale}//map:transform

map:serialize type=xhtml/
/map:match

map:match pattern=j_security_check
map:act type=cauth-login
map:parameter name=application value=cocoon-app /
map:parameter name=name value={request-param:j_username} /
map:parameter name=password value={request-param:j_password} 
/
map:redirect-to uri=home /
/map:act
map:redirect-to uri=error /
/map:match

 It looks like it logs in correctly, goes to home and displays menu/ 
home.xml, but the role-filter transformation can't see admin_admin role.


How to define roles in SimpleSecurityHandler? Are they recognised by  
role-filter transformer?
My users are in MySQL database. I use Hibernate. Should I use  
DAOSecurityHandler to get my users? How to use DAOSecurityHandler?


Best regards

Barbara

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



Re: [2.2] Cforms, selection-list on Repeater

2008-06-20 Thread Barbara Slupik
I think you need to get to the repeater row to access your widget.  
Perhaps something like this will work:


var profiles=form.lookupWidget(profiles);
for (var i=0; ilt;profiles.size; i++) {
var row=profiles.getRow(i);
var profile=row.lookupWidget(profile).value;
}

Barbara


On 20 Jun, 2008, at 9:24 am, Alessandro Vincelli wrote:



I'm using cocoon 2.2. In CForms 1.1 the selection-list  of
type flow-jxpath doesn't work.

fd:repeater id=profiles
fd:widgets
fd:field id=profile
fd:labelProfile/fd:label
fd:datatype base=integer /
fd:selection-list  type=flow-jxpath
list-path=profileSL  value-path=upId label-path=upName
/
/fd:field
/fd:widgets
/fd:repeater

In alternative, I'm trying to use the method
setSelectionList on Field Object, but i can't acces to
this widget inside the repeater.
For example this code doesn't work:
form.lookupWidget(profiles).lookupWidget(profile)

I read the api, but I can't understand how to access on the
widget inside the repeater, before the creation of the
RepeaterRows.

Any suggestions?
thanks in advance
Alessandro

-
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: Access tomcat session from cocoon

2008-06-24 Thread Barbara Slupik

In cocoon-2.2 I had to add this:

filter
filter-namespringRequestContextFilter/filter-name
		filter-classorg.springframework.web.filter.RequestContextFilter/ 
filter-class

/filter

filter-mapping
filter-namespringRequestContextFilter/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping

to my application web.xml file.

I am getting my user in flow.js with cocoon.request.getRemoteUser()  
and checking user role with cocoon.request.isUserInRole(user-role).


Barbara

On 24 Jun, 2008, at 12:42 pm, Johannes Hoechstaedter wrote:


I have not found anything useful for my specific problem, yet.

I tried: {session:username},{session:user} and {session:getAttribute 
(., 'username')}


can't anybody help?

Can I use the sessionhandlerimpl for my problem?

Johannes Hoechstaedter schrieb:

Hi everybody,

My cocoon application runs in a tomcat container. The tomcat  
manages the authentication for the url of my application (a  
container based authentication). So now: I don't use the  
authentication framework. How can I access session attributes like  
username, ... ?


Thanx for any help
cheers





-
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: some words about property configuration

2008-06-25 Thread Barbara Slupik

I use properties to configure my database connection.

In my block application context I have:

  bean id=myDataSource  
class=org.apache.commons.dbcp.BasicDataSource destroy-method=close

property name=driverClassName
  value${myDatabase.driverClassName}/value
/property
property name=url
  value${myDatabase.url}/value
/property
property name=username
  value${myDatabase.username}/value
/property
property name=password
  value${myDatabase.password}/value
/property
  /bean

My properties are defined in cocoon/properties/application.properties  
file in my application src/main/webapp/WEB-INF and in block  
rcl.properties file for development environment:


myDatabase.driverClassName=com.mysql.jdbc.Driver
myDatabase.url=jdbc:mysql://localhost:3307/dbname? 
useUnicode=trueamp;characterEncoding=utf8amp;autoReconnect=true

myDatabase.username=dbuser
myDatabase.password=dbpassword

Barbara

On 25 Jun, 2008, at 9:44 am, Johannes Hoechstaedter wrote:


Hi,

I want to have some infomations about configuration of cocoon by  
property files. The documentation on http://cocoon.apache.org/2.2/ 
core-modules/core/2.2/1261_1_1.html seems to be not up to date. Can  
you please point out a place where I can find some updated  
documentation?


Johannes

-
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: Form base authentication in tomcat

2008-06-25 Thread Barbara Slupik

I had the same problem. I fixed it by adding:

filter
filter-namespringRequestContextFilter/filter-name
		filter-classorg.springframework.web.filter.RequestContextFilter/ 
filter-class

/filter

filter-mapping
filter-namespringRequestContextFilter/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping

to my application web.xml file.

Barbara

On 25 Jun, 2008, at 2:43 pm, Johannes Hoechstaedter wrote:


Hi everybody,

how can I etablixh a form based authentication in coconn running in  
tomcat?


My web.xml login-config looks as follows:

login-config
 auth-methodFORM/auth-method
 realm-nameExample Form-Based Authentication Area/realm-name
 form-login-config
   form-login-page/myBlock1/login/form-login-page
   form-error-page/myBlock1/login/form-error-page
 /form-login-config
   /login-config

I have a match pattern in my sitemap for this:

map:match pattern=login
 !-- init --
map:generate src=resource/internal/ 
pageTemplate.xml /
 map:transform type=xslt  
src=resource/internal/transform2LoginForm.xsl /

 !-- html ouptut --
  map:serialize type=xhtml/
/map:match

Running this pattern in jetty works fine, and my login form is  
shown. But when I load my webapp into Tomcat and when I run it,  
Tomcat doesn't complain, too. I get no Error message as I am  
expecting. The thing is, that I  get only an empty screen. Do  
anybody know something?


cheers
Johannes

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





Re: Odd Behavior with HSSFSerializer

2008-06-25 Thread Barbara Slupik

I had the same problem. I fixed it like this:

!--
Style regions are built for each column for max 999 rows.
Larger regions do not seem to work.
That's why styles template is called more then once if number of rows  
to print exceedes 999.

--
xsl:template name=styles
xsl:param name=startRow/
xsl:param name=size/
xsl:variable name=endRow
xsl:choose
			xsl:when test=($size - $startRow) gt; 999xsl:value-of  
select=$startRow + 998//xsl:when

xsl:otherwisexsl:value-of 
select=$size//xsl:otherwise
/xsl:choose
/xsl:variable
Styles
StyleRegion ...
			xsl:attribute name=startRowxsl:value-of select=$startRow// 
xsl:attribute
			xsl:attribute name=endRowxsl:value-of select=$endRow// 
xsl:attribute

Style ...
...
/Style
/StyleRegion
...
/Styles
xsl:if test=($size - $startRow) gt; 999
xsl:call-template name=styles
			xsl:with-param name=startRowxsl:value-of select=$startRow +  
999//xsl:with-param
			xsl:with-param name=sizexsl:value-of select=$size// 
xsl:with-param

/xsl:call-template
/xsl:if
/xsl:template

The template is called for the first time with:

xsl:call-template name=styles
xsl:with-param name=startRow1/xsl:with-param
xsl:with-param name=sizetotal-nr-of-elements/xsl:with-param
/xsl:call-template

Barbara

On 25 Jun, 2008, at 4:21 pm, Matthew Monkan wrote:



I produced a simple Excel document by querying my database and  
using the
HSSFSerializer. It's a simple document; the spreadsheet just  
formats the

data into the same grid layout you would see on a database GUI upon
submitting the query.

Anyway, I realized that no matter the numerical data that goes into  
the
HSSFSerializer, Excel defaults to outputting them with the trailing  
0's cut

off. (22.90 becomes 22.9.)

I downloaded Gnumeric, formatted numbers to show 2 decimal places,  
saved the
document to Gnumeric XML, and opened it to see what XML was needed  
to format
the decimal properly. (I want all my numbers rounded to two decimal  
places.)


Here is the XML I currently use in my stylesheet:

  xsl:when test=/page/title='MOU Alert'
gmr:StyleRegion startCol=5 startRow=3 endCol=5
  xsl:attribute name=endRow
xsl:value-of
select=count(/page/content/sql:rowset/sql:row)+3 /
  /xsl:attribute
  gmr:Style HAlign=1 VAlign=2 WrapText=0  
ShrinkToFit=0

Rotation=0 Shade=0 Indent=0 Locked=1 Hidden=0 Fore=0:0:0
Back=:: PatternColor=0:0:0 Format=0.00
gmr:Font Unit=10 Bold=0 Italic=0 Underline=0
StrikeThrough=0 Script=0Arial/gmr:Font
  /gmr:Style
/gmr:StyleRegion
  /xsl:when

If you look at gmr:Style's Format attribute, this is the input  
that is
needed to produce the correct decimal places. This specific snippet  
of code
should round all data in Column 6 (Gnumeric starts counting at 0,  
so Col=5
is the sixth column) starting at row 3 and ending with the last row  
of data.


If you look at the count function under xsl:attribute  
name=endRow, this
returns the value 4500 from my particular test data. This  
dynamically tells
what row to stop applying the formatting to. There is no way to  
specify
unbounded for endRow, so this count function is the only way I can  
get it to

apply the formatting to every row for any instance of data queried.

Now here's the odd behavior. This code works perfectly when I  
query data
that is a few hundred rows long. If there is, for example, 500 rows  
being
queried the count function correctly returns 503, which is the last  
row I

want formatted. (My data outputs on rows 3 to 503 to make room for a
heading.) But when I query data from around 700 or so upward (I  
haven't
found an exact cutoff yet), it will never apply the formatting.  
(All the

numbers will have trailing 0's cut off and not rounded to two decimal
places.) This is extremely irritating, and this will need to work for
thousands of rows. If I simply replace the count fuction with a  
number like
250, it works. (Rows 3-253 are formatted properly, and the few  
thousand
remaining are left unformatted.) If I start putting in values like  
2000,
3500, 11480, it won't apply formatting to ANY row. It gives me the  
cold

shoulder.:-O

I was wondering if anyone ran has run into a similar problem and  
knows a

fix. If I was ambiguous anywhere, just let me know and I'll clarify.

Thanks,
Matt
--
View this message in context: http://www.nabble.com/Odd-Behavior- 
with-HSSFSerializer-tp18115088p18115088.html

Sent from the Cocoon - Users mailing list archive at Nabble.com.


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





Re: Form base authentication in tomcat

2008-06-26 Thread Barbara Slupik
I had the same problem. In the end I put my styles inside login form,  
because the link to css did not work. I hope someone knows better  
solution.


Barbara

On 26 Jun, 2008, at 9:34 am, Johannes Hoechstaedter wrote:


same behaviour with:

html
head
titletest/title
link href=../../resource/external/style/style-main.css  
type=text/css rel=stylesheet /

/head
body

Johannes Hoechstaedter schrieb:

Hi,

can you explain me why I can't add a style sheet to the login  
form? everything works without style and favicon, but when I add  
these features tomcat cannot find the resourc and I the login  
procedure doesn't work anymore. Tomcat crashes with an exception,  
or the url which is build by after successfully logged in is  
broken. This behavior depends on the path.


resource /..style.css
../resource/style.css

Result:
javax.servlet.ServletException: No pipeline matched request
org.apache.cocoon.ResourceNotFoundException: No pipeline matched  
request


../../resource.style.css

Result:
broken URL. The request is forwarded into my style sheet after  
login, and not into the pipeline pattern.


../../../resource ...style.css

Result:
No block for /resource/external/style/style.css

In none of these cases the style is applied to the login page. The  
start of my page is for example:


html
header
titletest/title
link href=../../resource/external/style/style-main.css  
type=text/css rel=stylesheet /

/header
body

Is it possible to apply a css to a tomcat login form?

thanks in advance
cheers
Johannes




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





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




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



Re: Cocoon 2.1.11, repeater binding and JavaScript

2008-06-26 Thread Barbara Slupik
I had similar problem. I solved it by sorting the id used by  
repeater. I use Hibernate, so I added order-by in my hbm file:


set name=reservations inverse=true cascade=all,delete-orphan  
order-by=reservationID


/set

I had to do this although reservationID is the primary key on my  
database table. My binding looks like this:


fb:repeater id=reservations parent-path=. row-path=reservations
fb:identity
fb:value id=reservationID path=reservationID/
/fb:identity
...
/fb:repeater

Barbara

On 26 Jun, 2008, at 5:27 pm, [EMAIL PROTECTED] wrote:


Dear Mailing List,

I'm faced with a repeater binding issue and after many hours of  
googling and testing I don't really know how to go on...


I'm using CForms with the binding framework and JavaScript for flow  
and objects (representing the records) to edit my DB-records. After  
some experimenting this works very well.
Now I'm trying to use a repeater to directly edit child-recs of a  
record. In the respective Javascript-Object (representing the  
parent-rec) I use a property this.attribute = new java.util.Vector 
(); which holds the child-record-objects.
The children are shown correctly in the repeating widgets and the  
(changed) values are saved back to the JS-objects as expected.


the binding config:
fb:context xmlns:fb=http://apache.org/cocoon/forms/1.0#binding;
xmlns:fd=http://apache.org/cocoon/forms/1.0#definition;
path=/

fb:value id=probenteil_id path=probenteil_id/
fb:value id=datum path=datum/
fb:value id=bemerkung path=bemerkung/

!-- attribute repeater --
fb:repeater id=attribute parent-path=. row-path=attribute
fb:identity
fb:value id=row_id path=id
fd:convertor datatype=integer/
/fb:value
/fb:identity
fb:on-bind
fb:value id=attribut_id path=attribut_id/
fb:value id=wert_dec path=@wert_dec/
/fb:on-bind
!--
fb:on-insert-row
fb:insert-bean addmethod=add/
/fb:on-insert-row
 --
/fb:repeater
/fb:context


The Problem:
when I add a row in the repeater (in this case the 4th), fill in  
the required values and submit the form I get
Cannot create a relative context for a non-existent node: /. 
[EMAIL PROTECTED]'attribute'][4]
... OK, as the action for on-insert-row is commented out, but when  
I use it (remove the comment) I get
java.lang.NoSuchMethodException:  
org.mozilla.javascript.NativeObject.add().


My thought was, that the insert-bean in on-insert-row will call the  
method {addmethod} of the object what is bound to the repeater  
widget (in my case the property 'attribute' what holds an instance  
of java.util.Vector)



I would be very grateful if you can help me to solve (and/or  
understand) what's wrong here!


Many thanks!
 Gerd

-
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: xsl match pattern

2008-06-27 Thread Barbara Slupik

Do you have something like this in your stylesheet:

xsl:stylesheet  ...
xmlns:dir=your-url
...


Barbara

On 27 Jun, 2008, at 8:43 am, Johannes Hoechstaedter wrote:


Hello,

can anybody tell me how to match this node in xsl?

dir:directory name=configuration lastModified=1214405055546  
date=25.06.08 16:44 size=0 sort=name reverse=false  
requested=true/


xsl:template match=dir:directory  doesn't work.
cheers
Johannes

-
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: xpath-function substring-before

2008-06-27 Thread Barbara Slupik

I do

xsl:value-of select=substring-before('astt','tt')/

and this works fine.

Barbara

On 27 Jun, 2008, at 10:48 am, Johannes Hoechstaedter wrote:


Hi everybody,

I found out, that

fn:substring('astt', 2) is working but

fn:substring-before('astt', 't') not (NoSuchMethodException)

I am using saxon and xmlns:fn=http://www.w3.org/2005/xpath- 
functions.


Is this an cocoon issue?

cheers
Johannes

-
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: xpath-function substring-before

2008-06-27 Thread Barbara Slupik

No, xerces. Barbara

On 27 Jun, 2008, at 11:54 am, Johannes Hoechstaedter wrote:


Do you use saxon? I doesn't work for me.

Barbara Slupik schrieb:

I do

xsl:value-of select=substring-before('astt','tt')/

and this works fine.

Barbara

On 27 Jun, 2008, at 10:48 am, Johannes Hoechstaedter wrote:


Hi everybody,

I found out, that

fn:substring('astt', 2) is working but

fn:substring-before('astt', 't') not (NoSuchMethodException)

I am using saxon and xmlns:fn=http://www.w3.org/2005/xpath- 
functions.


Is this an cocoon issue?

cheers
Johannes

 
-

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




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





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




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



Re: Creating webapp

2008-06-27 Thread Barbara Slupik

I defined all my blocks as dependencies in my web application pom file.

In each block I have block-servlet-service.xml which looks like this:

  bean id=xxx.yyy.myBlock.service  
class=org.apache.cocoon.sitemap.SitemapServlet
servlet:context mount-path=/myBlock context- 
path=blockcontext:/myBlock/

servlet:connections
entry key=ajax 
value-ref=org.apache.cocoon.ajax.impl.servlet/
entry key=forms value- 
ref=org.apache.cocoon.forms.impl.servlet/

/servlet:connections
/servlet:context
  /bean

My main block contains menu with links to access other blocks. I call  
my application in jetty like this:


http://localhost:/myMainBlock/

Barbara

On 27 Jun, 2008, at 7:00 pm, Boris Goldowsky wrote:


I have an application that runs fine with mvn jetty:run, but now I am
trying to make a webapp block so that I can install it into Tomcat.  I
created a webapp with the archetype, put a dependency on my main block
into the pom, and made sure everything was mvn Installed.  But I  
cannot

get the webapp to run either with jetty or Tomcat.

The error on startup is:

org.springframework.beans.factory.BeanCreationException: Error  
creating

bean with name 'org.cast.indira.service': Invocation of init method
failed; nested exception is java.net.MalformedURLException: Could not
resolve blockcontext:/indira/ due to java.net.MalformedURLException:
Unknown block name indira in block context uri blockcontext:/indira/

where indira is one of two service-providing blocks.  Here's how the
main block is configured:

  bean name=org.cast.iss.service
class=org.apache.cocoon.sitemap.SitemapServlet
servlet:context mount-path= context-path=blockcontext:/iss/
  servlet:connections
entry key=cewf value-ref=org.cast.cewf.service/
entry key=indira value-ref=org.cast.indira.service/
  /servlet:connections
/servlet:context
  /bean

I don't know if this is related, but in target/work/blocks the  
following

directories get created by mvn jetty:run:

cewf
cocoon-ajax-impl
cocoon-forms-impl
indira-3.0-SNAPSHOT
iss

note that that one block is created with a different naming convention
from the others.  I don't know why that would be.

Any hints on how to fix or debug this??

Thanks

Bng


-
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: How to access configuration files and properties after packaging

2008-07-03 Thread Barbara Slupik
I use properties to define my database connection. I my development  
environment I add my properties into block rcl.properties and I can  
test blocks individually with jetty. rcl.properties file is not  
included in block jar file. In my application I created cocoon/ 
properties/application.properties file in src/main/webapp/WEB-INF.  
This file contains all properties from all application blocks. When  
my application runs in tomcat I have cocoon/properties/ 
application.properties in my WEB-INF and I can edit it without  
changing jar files.


Barbara

On 3 Jul, 2008, at 1:04 pm, Johannes Hoechstaedter wrote:


How can I access the web-inf folder?

Robin Rigby schrieb:
Try a third set of resources, that are not packaged in the war  
file, in
addition to internal and external.  The path to them can be  
configured as I

described.  The sitemap does something like:
map:pipeline id=non-war-resource
map:match pattern=resource/nonwar/**
map:read src={path.to.non.war.resources}/{1} /
etc
 Robin

-Original Message-
From: Johannes Hoechstaedter [mailto:[EMAIL PROTECTED]  
Sent: 03 July 2008 12:45

To: users@cocoon.apache.org
Subject: Re: How to access configuration files and properties after
packaging


Robin Rigby schrieb:

Here is one way that seems to work.  Make a separate set of  
configuration

for development and the default for production.

\src\main\resources\META-INF\cocoon\properties\config.properties
\src\main\resources\META-INF\cocoon\dev\properties\config.properties
and run during development with

mvn -Dorg.apache.cocoon.mode=dev jetty:run

It is documented somewhere _if_ you can find it.  I suppose the  
same would

work in Tomcat, ect



Thank you for your answer Robin, but your configuration files are  
still packaged in in the jar file, or? Thats what I want to pretend.


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




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






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




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



Re: Cocoon installation howto?

2008-07-07 Thread Barbara Slupik
I am using cocoon with maven and jetty in my development environment.  
I develop and test individual blocks. Then I build my block jar files  
and my cocoon application. Once everything works in maven/jetty  
development environment I build application war file and put it in my  
test environment which runs with tomcat. Test/production environment  
does not need maven or jetty and does not need to download anything,  
everything is already included in jar files.


Barbara

On 7 Jul, 2008, at 6:11 pm, jantje wrote:



Hi there, I have used older versions of cocoon for over years.. Now  
I want to

go to cocoon 2.2.

But now I have to use Maven, and on the cocoon website there is not  
a lot of

information about maven and cocoon.

Therefore I have downloaded this: cocoon-2.2.0.tar.gz

When I open the file, there is no information about installing  
cocoon? I

have tryed java -jar cocoon-core-2.2.0.jar Nothing works..

Following the tutorials on the cocoon website, with maven I have made
blocks.. running cocoon.. But this is very basic.. And I want to  
add cocoon
to a live cd, so maven using the internet to download files does  
not satisfy

me :-(

Maybe there is documentation I am missing, but can't find it.  
Anyhow, does

someone know how to install cocoon-2.2.0.tar.gz???

Thanks..
--
View this message in context: http://www.nabble.com/Cocoon- 
installation-howto--tp18321699p18321699.html

Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
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: Cocoon installation howto?

2008-07-07 Thread Barbara Slupik

I create my blocks with:

mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-block - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=myBlock


This creates all folders and files necessary to run it in jetty,  
including pom.


Put your files and sitemap in COB-INF. Go to myBlock folder in your  
terminal and run


mvn jetty:run

Then test your block with url similar to this:

http://localhost:/myBlock/

I suppose that you did all this and now you have some errors? Do you  
have svg2png serializer defined in your sitemap?


Barbara


On 7 Jul, 2008, at 7:53 pm, jantje wrote:



Ok, so I do this:
  mvn archetype:generate -DarchetypeCatalog=http:// 
cocoon.apache.org

  mvn jetty:run

Then I copy some little cocoon application (sitemap, and three or fore
files) to:
  myBlock1/src/main/resources/COB-INF/

And then? How do I know what I should write in pom? f.i. when I use:
  map:serialize type=svg2png /

Thanks..





Barbara Slupik-3 wrote:


I am using cocoon with maven and jetty in my development environment.
I develop and test individual blocks. Then I build my block jar files
and my cocoon application. Once everything works in maven/jetty
development environment I build application war file and put it in my
test environment which runs with tomcat. Test/production environment
does not need maven or jetty and does not need to download anything,
everything is already included in jar files.

Barbara

On 7 Jul, 2008, at 6:11 pm, jantje wrote:



Hi there, I have used older versions of cocoon for over years.. Now
I want to
go to cocoon 2.2.

But now I have to use Maven, and on the cocoon website there is not
a lot of
information about maven and cocoon.

Therefore I have downloaded this: cocoon-2.2.0.tar.gz

When I open the file, there is no information about installing
cocoon? I
have tryed java -jar cocoon-core-2.2.0.jar Nothing works..

Following the tutorials on the cocoon website, with maven I have  
made

blocks.. running cocoon.. But this is very basic.. And I want to
add cocoon
to a live cd, so maven using the internet to download files does
not satisfy
me :-(

Maybe there is documentation I am missing, but can't find it.
Anyhow, does
someone know how to install cocoon-2.2.0.tar.gz???

Thanks..
--
View this message in context: http://www.nabble.com/Cocoon-
installation-howto--tp18321699p18321699.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


 
-

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]




--
View this message in context: http://www.nabble.com/Cocoon- 
installation-howto--tp18321699p18323968.html

Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
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: Cocoon installation howto?

2008-07-08 Thread Barbara Slupik

I build cocoon-2.2 application like this:

1. Create block myBlock

cd /.../cocoon-2.2.0
mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-block - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=myBlock



2. Test myBlock in maven/jetty

cd /.../cocoon-2.2.0/myBlock
mvn jetty:run

http://localhost:/myBlock/


3. Build myBlock jar file and update maven repository. I assume that  
version number is 1.0, version number is defined in myBlock pom file


cd /.../cocoon-2.2.0/myBlock
mvn package

mvn install:install-file -DgroupId=my.domain -DartifactId=myBlock - 
Dversion=1.0 -Dpackaging=jar -Dfile=target/myBlock-1.0.jar



4. Create cocoon web application cocoon-webapp

cd /.../cocoon-2.2.0
mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-webapp - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=cocoon-webapp



5. Add myBlock (all your blocks) to cocoon-webapp pom file

dependency
  groupIdmy.domain/groupId
  artifactIdmyBlock/artifactId
  version1.0/version
/dependency


6. Test cocoon-webapp in maven/jetty

cd /.../cocoon-2.2.0/cocoon-webapp
mvn jetty:run

http://localhost:/myBlock/


7. Package cocoon-webapp. This will create cocoon-webapp-1.0.war file

cd /.../cocoon-2.2.0/cocoon-webapp
mvn package


8. Put cocoon-webapp-1.0.war file in your tomcat/webapps and start  
the application with url similar to this


http://localhost:8080/cocoon-webapp-1.0/myBlock/


I hope that the above is correct, I might have forgotten something.  
Actually I created build.sh command file in every block and in cocoon- 
webapp and put all necessary mvn packaging repository update commands  
there.


Barbara



On 8 Jul, 2008, at 8:55 am, Ken Starks wrote:


Barbara Slupik wrote:
I am using cocoon with maven and jetty in my development  
environment. I develop and test individual blocks. Then I build my  
block jar files and my cocoon application. Once everything works  
in maven/jetty development environment I build application war  
file and put it in my test environment which runs with tomcat.  
Test/production environment does not need maven or jetty and does  
not need to download anything, everything is already included in  
jar files.


Barbara

I am in a similar position to jantje. I am very much not a java  
person, but

I do like cocoon a lot as a database/xml/xslt framework. I am a
'development team' of one person at my site!

Suppose I have a small application that  runs under jetty (on port  
).

i.e.
in a shell in my application directory, myApp:  mvn jetty:run
in my browser: http://localhost/myApp/

Now I want to run it under Tomcat, but I don't know what to do.
1. You say 'put it in my test environment.'
   What exactly is 'my test environment'? Is it simply a directory  
called 'test', which

   is at (typically for windows)
   C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\test
 or if not, what is it, and where?

P.S. I have tried that, and it didn't work, but I have no idea whether
   it should have worked or not.
   In my browser, i went to 'http://localhost/myApp/'
 (Tomcat is at the default http port, port 80, on my box, and  
my old

  system works fine:  http://localhost/cocoon/one/
http://localh

2. You say 'everything is already included in jar files'
What did I do to make that happen?
Where should these jar files be stored, so I can look into that  
directory?

How can I check they work?
Or do I already know that, working under jetty they are  
available system-wide.

If not, is there a check command such as
   'java -jar cocoon_2.2.jar --version'  or similar


On 7 Jul, 2008, at 6:11 pm, jantje wrote:



Hi there, I have used older versions of cocoon for over years..  
Now I want to

go to cocoon 2.2.

snip many similar questions I have



Thanks..
--






-
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: Cocoon installation howto?

2008-07-08 Thread Barbara Slupik

I don't use SVGSerializer, but I see that it is in Batik block now.

Go to cocoon website, Blocks 2.2/Batik/Project Documentation/Project  
Reports/JavaDocs to see java docs.


I think that you have to add Batik into your pom file.

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

Group/version info can be found in Blocks 2.2/Batik/Project  
Documentation/Project Information/Project Summary


Barbara

On 8 Jul, 2008, at 8:47 am, jantje wrote:



So I do exactly like you say, Barbara:

  mvn archetype:create -DarchetypeGroupId=org.apache.cocoon
-DarchetypeArtifactId=cocoon-22-archetype-block - 
DarchetypeVersion=1.0.0

-DgroupId=my.domain -DartifactId=myBlock
  cd myBlock
  mvn jetty:run
  konqueror http://localhost:/myBlock/

I get this error:

  Caused by:  
org.springframework.beans.factory.BeanDefinitionStoreException:
Unable to read Avalon configuration from 'sitemap.xmap'.; nested  
exception
is  
org.apache.avalon.framework.configuration.ConfigurationException:  
Unable

to create class for  component with role
org.apache.cocoon.serialization.Serializer/svg2png with class:
org.apache.cocoon.serialization.SVGSerializer

And this is my sitemap (I have adde the definition for the  
serializer, on

your advise.. Normally I don't do this..):

  http://users.skynet.be/sb015553/sitemap.xmap

Thanks, this is not easy :-)














Barbara Slupik-3 wrote:


I create my blocks with:

mvn archetype:create -DarchetypeGroupId=org.apache.cocoon -
DarchetypeArtifactId=cocoon-22-archetype-block -
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=myBlock

This creates all folders and files necessary to run it in jetty,
including pom.

Put your files and sitemap in COB-INF. Go to myBlock folder in your
terminal and run

mvn jetty:run

Then test your block with url similar to this:

http://localhost:/myBlock/

I suppose that you did all this and now you have some errors? Do you
have svg2png serializer defined in your sitemap?

Barbara


On 7 Jul, 2008, at 7:53 pm, jantje wrote:



Ok, so I do this:
  mvn archetype:generate -DarchetypeCatalog=http://
cocoon.apache.org
  mvn jetty:run

Then I copy some little cocoon application (sitemap, and three or  
fore

files) to:
  myBlock1/src/main/resources/COB-INF/

And then? How do I know what I should write in pom? f.i. when I use:
  map:serialize type=svg2png /

Thanks..





Barbara Slupik-3 wrote:


I am using cocoon with maven and jetty in my development  
environment.
I develop and test individual blocks. Then I build my block jar  
files

and my cocoon application. Once everything works in maven/jetty
development environment I build application war file and put it  
in my
test environment which runs with tomcat. Test/production  
environment
does not need maven or jetty and does not need to download  
anything,

everything is already included in jar files.

Barbara

On 7 Jul, 2008, at 6:11 pm, jantje wrote:



Hi there, I have used older versions of cocoon for over years..  
Now

I want to
go to cocoon 2.2.

But now I have to use Maven, and on the cocoon website there is  
not

a lot of
information about maven and cocoon.

Therefore I have downloaded this: cocoon-2.2.0.tar.gz

When I open the file, there is no information about installing
cocoon? I
have tryed java -jar cocoon-core-2.2.0.jar Nothing works..

Following the tutorials on the cocoon website, with maven I have
made
blocks.. running cocoon.. But this is very basic.. And I want to
add cocoon
to a live cd, so maven using the internet to download files does
not satisfy
me :-(

Maybe there is documentation I am missing, but can't find it.
Anyhow, does
someone know how to install cocoon-2.2.0.tar.gz???

Thanks..
--
View this message in context: http://www.nabble.com/Cocoon-
installation-howto--tp18321699p18321699.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


-- 
--

-
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]




--
View this message in context: http://www.nabble.com/Cocoon-
installation-howto--tp18321699p18323968.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


 
-

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]




--
View this message in context: http://www.nabble.com/Cocoon- 
installation-howto--tp18321699p18333754.html

Sent from the Cocoon - Users mailing list

Re: Problems with ContextListener

2008-07-09 Thread Barbara Slupik

I had similar problem. I fixed it by adding:

filter
filter-namespringRequestContextFilter/filter-name
		filter-classorg.springframework.web.filter.RequestContextFilter/ 
filter-class

/filter

filter-mapping
filter-namespringRequestContextFilter/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping

to my application web.xml file.

Barbara

On 9 Jul, 2008, at 4:01 pm, Kjetil Kjernsmo wrote:


Hi all,

We have a Cocoon 2.2-application that is deployed on Tomcat 5.5.  
Right now, it
is doing a lot of processing, mainly indexing of strings with  
Lucene, at
startup. This is taking a lot of time, but needs doing in some form  
or the
other. The problem now is that it appears to do everything it  
should be

doing, but then just sits there.

This is implemented with a ContextListener, and while this is not  
directly
Cocoon code, I assume that it is something people here use  
frequently, so I

figured it is worth a try. The current calling code is this:
https://submarine.computas.com/sublima/trunk/blocks/sublima-app/src/ 
main/java/com/computas/sublima/app/listener/ContextListener.java


I've inserted a log message after
indexService.createInternalResourcesMemoryIndex();
too, and I see this message. So, everything indicates our code has  
finished

running.

But then, it just stops. I get no message that indicates the server  
has
started. Now, I cannot connect, but previously I was just getting a  
404. I've
tried to restart all relevant servers (including the database),  
remove the
deployed directory, removed the war. Rebuilt the war oh-so-many  
times. But
I'm really not getting anywhere. And there are no further errors.  
There is

zero CPU usage, and the amount of RAM consumed doesn't increase.

Also, this only happens on my Ubuntu 8.04 development environment,  
not on

Windows. I haven't tried to deploy it on the Linux production box.

When I first start the server, I get an exception, but this happens  
in the
first second, and then things seem to run OK, so I have sort of  
discounted it
as irrelevant, but perhaps it is relevant, so for completeness, I  
include it:


ContainerBackgroundProcessor[StandardEngine[Catalina]] ERROR
[/sublima-webapp-1.0-SNAPSHOT] - Exception sending context  
initialized event

to listener instance of class
com.computas.sublima.app.listener.ContextListener
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:474)
at EDU.oswego.cs.dl.util.concurrent.BoundedBuffer.take 
(Unknown Source)
at com.hp.hpl.jena.graph.query.BufferPipe.fetch 
(BufferPipe.java:43)
at com.hp.hpl.jena.graph.query.BufferPipe.hasNext 
(BufferPipe.java:69)

at
com.hp.hpl.jena.graph.query.SimpleQueryEngine$1.hasNext 
(SimpleQueryEngine.java:59)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterBlockTriplesQH 
$StagePattern.hasNextBinding(QueryIterBlockTriplesQH.java:97)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext 
(QueryIteratorBase.java:69)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBin 
ding(QueryIterRepeatApply.java:59)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext 
(QueryIteratorBase.java:69)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterDefaulting.hasNextBind 
ing(QueryIterDefaulting.java:45)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext 
(QueryIteratorBase.java:69)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBin 
ding(QueryIterRepeatApply.java:59)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext 
(QueryIteratorBase.java:69)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding 
(QueryIterConvert.java:47)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext 
(QueryIteratorBase.java:69)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBin 
ding(QueryIteratorWrapper.java:29)

at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext 
(QueryIteratorBase.java:69)

at
com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext 
(ResultSetStream.java:62)

at
com.computas.sublima.app.service.IndexService.getFreetextToIndex 
(IndexService.java:366)

at
com.computas.sublima.app.service.IndexService.createInternalResourcesM 
emoryIndex(IndexService.java:62)

at
com.computas.sublima.app.listener.ContextListener.contextInitialized 
(ContextListener.java:31)

at
org.apache.catalina.core.StandardContext.listenerStart 
(StandardContext.java:3764)

at
org.apache.catalina.core.StandardContext.start(StandardContext.java: 
4216)

at

Re: Problems with ContextListener

2008-07-10 Thread Barbara Slupik
I don't really know. It looks like some requests have to be forwarded  
to cocoon. I had this problem with tomcat authentication. It was just  
stopping like yours.  I found the solution here: http://www.mail- 
archive.com/[EMAIL PROTECTED]/msg43933.html


Barbara

On 10 Jul, 2008, at 10:05 am, Kjetil Kjernsmo wrote:


On Wednesday 09 July 2008 17:15:13 Barbara Slupik wrote:

I had similar problem. I fixed it by adding:


Wow, that worked! Thanks a lot! But I don't understand what it  
does, could

anyone explain...?

Kind regards

Kjetil Kjernsmo
--
Senior Knowledge Engineer
Direct: +47 6783 1136 | Mobile: +47 986 48 234
Email: [EMAIL PROTECTED]
Web: http://www.computas.com/

|  SHARE YOUR KNOWLEDGE  |

Computas AS  Vollsveien 9, PO Box 482, N-1327 Lysaker | Phone:+47  
6783 1000 |

Fax:+47 6783 1001


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





Re: Cocoon installation howto?

2008-07-12 Thread Barbara Slupik

Perhaps you need to add this into your pom file:

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

Barbara

On 12 Jul, 2008, at 9:11 am, jantje wrote:




Thanks, So now I have downloaded dojo-0.4.3-ajax.zip

But how can My block get access to Ajax? You say I could make a  
block of it:

  You might need the cocoon-ajax block to get access to it.

How should I do this?

Thanks for your reply!








William Moore wrote:


Hi

It's inside the zip file here:

https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/ 
cocoon-ajax-impl/src/main/resources/org/apache/cocoon/dojo/resources/


You might need the cocoon-ajax block to get access to it.

Best regards

William

On 8 Jul, 2008, at 7:15 pm, jantje wrote:



Thanks! I use Ajax, like in the cocoon2.2 examples.. These examples
need a
dojo.js file. I don't know what this file does, but Ajax needs it in
this
example.. So I get this error:

Caused by:
org.apache.avalon.framework.configuration.ConfigurationException:
Couldn't absolutize ajax:/resource/external/dojo/dojo.js. Make sure
that the
configuration of your servlet-service contains a connection to
'ajax:/resource/external/dojo/dojo.js'.

Do you know where I can find this file in the repository?

Thanks,
jantje..






William Moore wrote:


Hi jantje

The source is in this folder on the cocoon svn:

https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon- 
samples-style/cocoon-samples-style-default/src/main/resources/ 
COB-INF/common/style/xsl/html/


Which puts it in the cocoon-samples-style block. I think you could
either put the block into your application or copy the file into  
our

block and use it directly.

Best regards

William




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



Re: C2.2 - Web archetype whodunnit!

2008-07-13 Thread Barbara Slupik
I test my blocks in maven/jetty. After everything works I do the  
following:


1. Build myBlock jar file and update maven repository. I assume that  
version number is 1.0, version number is defined in myBlock pom file


cd /.../cocoon-2.2.0/myBlock
mvn package

mvn install:install-file -DgroupId=my.domain -DartifactId=myBlock - 
Dversion=1.0 -Dpackaging=jar -Dfile=target/myBlock-1.0.jar


2. Package cocoon-webapp. This will create cocoon-webapp-1.0.war file

cd /.../cocoon-2.2.0/cocoon-webapp
mvn package

3. Test cocoon-webapp in maven/jetty

cd /.../cocoon-2.2.0/cocoon-webapp
mvn jetty:run

http://localhost:/myBlock/

4. To test in tomcat put cocoon-webapp-1.0.war file in tomcat/webapps  
and start the application with url similar to this


http://localhost:8080/cocoon-webapp-1.0/myBlock/

Barbara

On 13 Jul, 2008, at 5:06 pm, David Legg wrote:

In true detective style I'm trying to work out whodunnit!  It's  
probably the butler! but in case it's not I'd appreciate any help.


I've successfully built a Cocoon block and a brand new Cocoon  
generator and between them created a pipline to produce some HTML.   
When I change into the Cocoon block's directory and type 'mvn  
jetty:run' all is well and I can view the block's output in a  
browser with no trouble.


I now want to create a Cocoon web application block in order to  
generate a war file and also begin adding other blocks to handle  
other aspects of the web application.  I've followed (and edited!)  
the tutorials so I wasn't expecting any problems here... but I  
wasn't so lucky!


Having created the web app block (as per the deployment tutorial  
[1]) I updated the pom file so that the web app block knew about  
the other blocks.  When I changed into the Web app block's  
directory and ran 'mvn jetty:run' I noticed a lot of messages  
scroll off the screen but Jetty seemed to launch ok.  However when  
I try viewing the output in a browser I get 404 errors.  So it  
looks like Jetty is running but the browser requests are either not  
being passed on to Cocoon at all or the Cocoon web app block is not  
passing the request on to the appropriate Cocoon block underneath it.


The trouble is I'm looking at a lot of messages from various  
systems that mean nothing to me.


When I looked at the messages that scrolled off the screen they  
contained the following: -


[...]
2008-07-13 12:57:46.840::INFO:  jetty-6.1.7
2008-07-13 12:57:53.708::INFO:  No Transaction manager found - if  
your webapp requires one, please configure one.
log4j:WARN No appenders could be found for logger  
(org.springframework.util.ClassUtils).

log4j:WARN Please initialize the log4j system properly.
2008-07-13 12:57:55.126::WARN:  failed  
[EMAIL PROTECTED]/,D: 
\projects\meerkat\meerkat-webapp\target\meerkat-webapp-1.0-SNAPSHOT}
java.lang.AbstractMethodError:  
org.slf4j.impl.Log4jLoggerAdapter.trace(Ljava/lang/String;)V
   at org.apache.commons.logging.impl.SLF4JLog.trace 
(SLF4JLog.java:82)
   at  
org.springframework.core.CollectionFactory.createConcurrentMapIfPossib 
le(CollectionFactory.java:195)
   at org.springframework.web.context.ContextLoader.clinit 
(ContextLoader.java:153)
   at  
org.springframework.web.context.ContextLoaderListener.createContextLoa 
der(ContextLoaderListener.java:53)
   at  
org.springframework.web.context.ContextLoaderListener.contextInitializ 
ed(ContextLoaderListener.java:44)
   at org.mortbay.jetty.handler.ContextHandler.startContext 
(ContextHandler.java:540)

[...]

It looks like I've got a lot of homework to do...

Should I be worried about not having a transaction manager?
Do I need appenders for my logger?
What might cause a java.lang.AbstractMethod error and where do I  
start looking?


I'm willing to add additional documentation to the site but I  
suspect there are some fundamental things I need to add to the  
tutorial like how to set up the logger, how to do simple spring  
bean configuration and how the Cocoon web application archetype works.


Regards,
David Legg

[1] http://cocoon.apache.org/2.2/1362_1_1.html


-
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: Problem building Cocoon (the requested operation cannot be performed on a file with a user-mapped section open)

2008-07-14 Thread Barbara Slupik
I use maven/jetty in my development environment and tomcat for test/ 
production. I build cocoon-2.2 application like this:


1. Create block myBlock

cd /.../cocoon-2.2.0
mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-block - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=myBlock



2. Test myBlock in maven/jetty

cd /.../cocoon-2.2.0/myBlock
mvn jetty:run

http://localhost:/myBlock/


3. Build myBlock jar file and update maven repository. I assume that  
version number is 1.0, version number is defined in myBlock pom file


cd /.../cocoon-2.2.0/myBlock
mvn package

mvn install:install-file -DgroupId=my.domain -DartifactId=myBlock - 
Dversion=1.0 -Dpackaging=jar -Dfile=target/myBlock-1.0.jar



4. Create cocoon web application cocoon-webapp

cd /.../cocoon-2.2.0
mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-webapp - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=cocoon-webapp



5. Add myBlock (all application blocks) to cocoon-webapp pom file

dependency
  groupIdmy.domain/groupId
  artifactIdmyBlock/artifactId
  version1.0/version
/dependency


6. Package cocoon-webapp. This will create cocoon-webapp-1.0.war file

cd /.../cocoon-2.2.0/cocoon-webapp
mvn package


7. Test cocoon-webapp in maven/jetty

cd /.../cocoon-2.2.0/cocoon-webapp
mvn jetty:run

http://localhost:/myBlock/


8. Put cocoon-webapp-1.0.war file in tomcat/webapps and start the  
application with url similar to this


http://localhost:8080/cocoon-webapp-1.0/myBlock/


Barbara


On 14 Jul, 2008, at 9:29 am, Robby Pelssers wrote:

Well, since I am still facing the same problem I did a thorough  
search on the internet and I noticed I was not the only one having  
this problem:




http://carlback.blogspot.com/2007/03/apex-cocoon-pdf-and-more.html   
(number 13)




http://www.nabble.com/Build-2.1.8-with-Java-1.5- 
td2181360.html#a2182531




http://www.nabble.com/Installation-problem-td12611184.html#a12612781





Here a little article about the problem called “Buggy  
MemoryMapping in the JDK”


http://www.theresearchkitchen.com/blog/archives/date/2005/05







And here the complete discussion on the website of sun:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4724038







I haven’t found any real good workarounds so I am glad to hear any  
proposals.




Cheers,

Robby



















Re: Apache commons-fileupload returns an empty list

2008-07-15 Thread Barbara Slupik

I use CForms upload widget to upload files and it works fine.

Barbara

On 15 Jul, 2008, at 12:08 pm, Magnus Haraldsen Amundsen wrote:


Hi,

I want to use commons-fileupload to handle fileupload in my webapp.  
I’ve followed the tutorial at http://commons.apache.org/fileupload/ 
using.html but line


List /* FileItem */ items = upload.parseRequest 
(request.getCocoonRequest());


always gives me an empty list. items.size() == 0.

I suspect that this is because the HttpServletRequest is already  
parsed somewhere within Cocoon. Is there a workaround for this  
problem?


-Magnus



IMPORTANT NOTICE: This message may contain confidential  
information. If you have received this e-mail in error, do not use,  
copy or distribute it. Do not open any attachments. Delete it  
immediately from your system and notify the sender promptly by e- 
mail that you have done so. Thank you.






Re: [C2.2] set web.xml params

2008-07-24 Thread Barbara Slupik
I use maven/jetty in my development environment. I put my web.xml  
file in myBlock folder and in my pom file I define:

  plugin
groupIdorg.mortbay.jetty/groupId
artifactIdmaven-jetty-plugin/artifactId
version.../version
configuration
...
webXmlweb.xml/webXml
/configuration
  /plugin
This tells jetty to use my web.xml file and not the one that is  
generated.


In myApplication I just edit web.xml file in src/main/webapp/WEB-INF.

Barbara

On 24 Jul, 2008, at 3:09 pm, Matthias Müller wrote:


hi there,

i try to migrate my cocoon 2.1 project to 2.2

i need to set the enable-uploads param to true in WEB-INF/web.xml  
since my upload widgets won't work properly otherwise.
but as far as i understand, the web..xml is generated during the  
deployment process.


so, where do i have to set the right properties?

is it the rcl.proporties in the projects root? i tried to set  
'org.apache.cocoon.uploads.enable=true' but i didn't receive a  
change in the generated web.xml.
i also tried to edit the in META-INF/cocoon/spring/block-servlet- 
service.xml, like this


servlet:init-params
  entry key=enable-uploads value=true /
  entry key=upload-max-size value=1000 /
/servlet:init-params

with the same result.

regards,
matthias



  __
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com


-
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: Questions about migration from cocoon 2.1 to cocoon 2.2

2008-07-24 Thread Barbara Slupik
I am using cocoon with maven and jetty in my development environment.  
I develop and test individual blocks. Then I build my block jar files  
and my cocoon application. Once everything works in maven/jetty  
development environment I build application war file and put it in my  
test environment which runs with tomcat. Test/production environment  
does not need maven or jetty.


I don't know if you can have non-jar blocks. One of my blocks does  
not contain any java code - just pure html, but still it's a jar file  
inside my cocoon application.


Barbara

On 24 Jul, 2008, at 9:47 am, lingerer huang wrote:


Hi,cocooners
I have been using cocoon 2.1 for 4 years.Recent weeks I begin  
thinking about
migration to cocoon 2.2.After some research and reading the post  
mail list

like:
http://marc.info/?l=xml-cocoon-usersm=121215707010191w=2
I still have some questions about migration.
My apps base on cocoon 2.1.x ,using forms/portal/flowscript/ 
jxtemplate a
lot,and combine hibernate and spring.My apps run on tomcat or other  
web
container,in most schemes,we just update some flowscript,form  
define xml or

other jxtemplate xml file and don't need to restart the server(It's
important for running system).After I did some research on cocoon  
2.2,I got

theses question:
1.Does my custom app in cocoon 2.2 must be a block?Can I just using  
the core
block and place files(like sitemap/resource files) just like cocoon  
2.1?

The answer decide if I can migrade from 2.1 to 2.2 without much work
2.If ONLY block can exist in cocoon 2.2 ,can block exist in a file  
system

style and not in a jar style under a production environment?
I pack a cocoon 2.2 war form trunk and run it on tomcat,I found the  
block
file will be exact to tomcat work directory,So cocoon 2.2 MUST run  
like 2.1
when pipeline needs,I'm just want to know if I can do it  not by  
block jar
but block directory and the change in the directory will automatic  
publish
to tomcat work directory.The answer decide if I can just update  
resource
files and not update jar file,in most cases this means no reload  
required.
3.If block jar style is required,can the Cocoon Block preparation  
work under

production environment?
In my experiences only spring osgi or similar provide jar hot  
replace ,can

Cocoon Block preparation provide this?
4.How does Cocoon Block preparation provide RAD with other web  
container not
control by maven?Or how to confige maven to use other web container  
like

tomcat?
My team never use maven and all using Eclipse base IDE and run apps in
IDE(tomcat mostly),I just want to know if I can just cut the  
leaning pains

for maven and using the old style way to develop apps on cocoon 2.2

Can any help?

Thanks in advance

Roy




-
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: Cocoon 2.2.1 - Context path at root doesn't work

2008-07-27 Thread Barbara Slupik
Before cocoon-2.2 I was using tomcat in my development, test and  
production environments. Now I use maven/jetty for development and  
tomcat for test/production. In maven/jetty I change my block cforms,  
sitemap and flow and I can see the changes after refreshing the  
screen. When development is finished I package my block, build the  
application war file and put it in my tomcat test environment.


Barbara

On 27 Jul, 2008, at 8:05 pm, Hugh Sparks wrote:


Hugh suffers regression:
[...wants to allow the SitemapServlet context path
to point to the webapp root directory for some but
not all webapps...]



Grzegorz Kossakowski writes:
Is there anything that stops you from using one block for
migration? I guess your life should be  much easier in that
case.


It is not entirely an issue of migration. I think there are
other good reasons to allow some webapps easy access to files
in the root directory.


[...]
You may convince us that we need to support blockless style
of using 2.2 by pointing out some serious limitation that
block architecture introduces. At this moment, I fail to
see any.


Let me try.

First of all, the block architecture and the use of Spring is a  
fantastic development: It is now possible to create servlets using  
Cocoon that deploy and behave like java servlets. And with
Spring, they can be created and interconnected entirely by editing  
configuration files. Cocoon has truly become Web glue for web  
applications. This is a great thing! In my opinion there are

no serious limitations introduced by the block architecture.
Only advantages!

But I feel that a distinction should be made between software and  
content: It is a fine thing to assemble functional components from  
a network of servlets. I have several

applications very well suited to this pattern. Even some
content naturally belongs in the instance variables of servlets.

But packing all content into blocks is another matter: One of
the greatest contributors to software productivity in my opinion is  
the use of interactive development environments. Being able to  
navigate into the web server's root directory and edit html with  
only a browser refresh needed to see the changes is very powerful.  
It is simply not reasonable to restart the web server when simple  
eye-candy content is modified. Not only

does it take time, but it disrupts the transactions of other
users who access the site. I realise we have the RCL, but
what happens when we deploy blocks with other servlet
containers?
Web developers expect to have instant gratification when it
comes to changing simple content and would have serious
reservations about adopting a tool that prevents this sort
of experience. And cocoon - for its entire history until
a few days ago - did support this interactive style as well
as the blocks style. Why not preserve both capabilities?
Particularly since it makes cocoon far more accessible to
outsiders.

As an example: I configure tomcat so the cocoon webapp is a  
symbolic link to the apache server root directory. The WEB_INF and  
META_INF for cocoon are right at the top level of my website.  
Apache recognizes special urls and uses a proxy connection to send  
these requests to Tomcat and on to Cocoon.

The top level sitemap.xmap is also at the apache root directory.

What is gained by this?

I can edit any content - html, css, sitemaps, and flowscript  
without disturbing any of the running software or (in most

cases,) anyone accessing the site.  Most importantly, I can
see the effects of these changes by simply refreshing the
browser page.

The content at the webserver root can be mixed:

Apache handles requests it does best with its vast
assortment of modules and languages while cocoon handles content
it does best. And these domains are not independent: I have
applications where the same content may be accessed by both
apache and cocoon. A simple example is the set of css
stylesheets.

So what I'd like to preserve is a hybrid environment: It is a  
valuable innovation to have blocks as independent

servlets configured by Spring. But I feel that putting all
content into blocks is a barrier to developer productivity
and shuts out the ability of some-but-not-all web tools to
share content with cocoon.

I'd like to mention another advantage of interactive programming  
environments: The preservation of state:


It takes very little time to update a block with maven. The same is  
true for recompiling a C source code file in a traditional  
application. The real cost is re-establishing the state of a  
complex network of interacting components. In many cases, this  
takes far more time than rebuilding the entire site. But with  
interactive tools (think Smalltalk) you can explore the state of  
the running program, recompile a particular method and continue  
running. True, you may want to restart the whole thing to verify  
that the changes are consistent, but much of the time, particularly  
when only static content is 

Re: Migrating Cocoon 2.1 project to Cocoon 2.2

2008-07-27 Thread Barbara Slupik
In cocoon-2.2 everything runs as blocks. So you have to put your old  
application into one or more blocks and create cocoon-2.2 application  
to run them. There are some changes which are described Migration  
guide, for example for cforms go to cocoon page, Blocks 2.2/Forms/ 
Migration guide and follow the instruction.


Now I use maven/jetty in my development environment because this  
allows to see changes in cforms, css, sitemap, flow, etc immediately  
after refreshing the screen. My test and production environment runs  
with tomcat.


I build cocoon-2.2 application like this:

1. Create block myBlock

cd /.../cocoon-2.2.0
mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-block - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=myBlock



2. Test myBlock in maven/jetty

cd /.../cocoon-2.2.0/myBlock
mvn jetty:run

http://localhost:/myBlock/


3. Build myBlock jar file and update maven repository. I assume that  
version number is 1.0, version number is defined in myBlock pom file


cd /.../cocoon-2.2.0/myBlock
mvn package

mvn install:install-file -DgroupId=my.domain -DartifactId=myBlock - 
Dversion=1.0 -Dpackaging=jar -Dfile=target/myBlock-1.0.jar



4. Create cocoon web application cocoon-webapp

cd /.../cocoon-2.2.0
mvn archetype:create -DarchetypeGroupId=org.apache.cocoon - 
DarchetypeArtifactId=cocoon-22-archetype-webapp - 
DarchetypeVersion=1.0.0 -DgroupId=my.domain -DartifactId=cocoon-webapp



5. Add myBlock (all my blocks) to cocoon-webapp pom file

dependency
  groupIdmy.domain/groupId
  artifactIdmyBlock/artifactId
  version1.0/version
/dependency


6. Package cocoon-webapp. This will create cocoon-webapp-1.0.war file

cd /.../cocoon-2.2.0/cocoon-webapp
mvn package


7. Put cocoon-webapp-1.0.war file in my tomcat/webapps and start the  
application with url similar to this


http://localhost:8080/cocoon-webapp-1.0/myBlock/


Barbara

On 25 Jul, 2008, at 11:06 am, JLe wrote:



Hi all,

I have an existing Cocoon application written under cocoon 2.1 (old  
version)
now, after the release of 2.2.0 i am going to upgrade my  
application to

the new cocoon release because of performance reasons.
Does anyone already have experience doing this? - are there some  
special

things being aware of, some things to note?

Thanks in advance...
--
View this message in context: http://www.nabble.com/Migrating- 
Cocoon-2.1-project-to-Cocoon-2.2-tp18648820p18648820.html

Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
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: cocoon + db4odjects.jar

2008-07-29 Thread Barbara Slupik
I use cocoon with MySQL, Hibernate and cForms and I don't know  
db4objects, so the suggestions below might be wrong


1. Adding jar file

You should place your database in pom file. I have mysql defined like  
this:


dependency
groupIdmysql/groupId
artifactIdmysql-connector-java/artifactId
version5.0.5/version
/dependency

Try to find your database in maven repository. If it is not there you  
have to add your database jar file into your local maven repository  
by running something like this:


mvn install:install-file -DgroupId=xxx -DartifactId=xxx -Dversion=xxx  
-Dpackaging=jar -Dfile=path/database.jar


2. Creating xml

2.1. sitemap:

map:match pattern=*-flow
map:call function={1}/
/map:match
map:match pattern=*-jx
map:generate type=jx src=views/{1}.jx/
map:serialize type=xml/
/map:match

2.2. flow

function myData() {
	var appCtx=cocoon.context.getAttribute 
(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

application=appCtx.getBean(myApplicationService);
var myData=application.readMyData();
cocoon.sendPage(myData-jx,{myData: myData});
}

2.3. myData.jx file

myData xmlns:jx=http://apache.org/cocoon/templates/jx/1.0;
jx:forEach var=myDatum items=${myData}
		myDatum code=${myDatum.getID()}${myDatum.getSomethingElse()}/ 
myDatum

/jx:forEach
/myData

First you run url .../myData-flow, which will go to flow, get to your  
java code to read the data and call myData-jx. myData.jx will get the  
data from object and build your xml file.


Barbara

On 28 Jul, 2008, at 10:48 pm, jantje wrote:



Well,

Actually I try to replace the old XSP. So I want to generate xml. A  
large
chunk of this xml has to be generated with java source code  
(accessing a
java database). In XSP it was simple: XSP, containing executable  
java source

code, and generating xml..

I don't even know how to start in cocoon 2.2, because I don't know the
alternative for XSP and I also can't find information (or  
documentation) on

this.

Maybe in jx, It is possible, but there I can't find tags in which  
I can

include java source code, like I did in XSP.

Thanks for your replies..





jantje wrote:


Hi there, is het possible to use the db4objects database with  
Cocoon 2.2?


If so, then where should I place the the .jar file? And how can I  
execute

java source in cocoon? Is this possible in map:generate type=jx
src=cocoon:/{1}.test.xml /

Thanks..



--
View this message in context: http://www.nabble.com/cocoon-%2B- 
db4odjects.jar-tp18689963p18700489.html

Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
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: Finding a new name for Corona (a Cocoon rewrite)

2008-07-30 Thread Barbara Slupik
Unfortunately this does not sound good in Polish. It means bottom, on  
which you sit.


Barbara

On 30 Jul, 2008, at 8:36 pm, [EMAIL PROTECTED] wrote:


Pupa

Corona is the core of Cocoon without the shell.  What is inside a
cocoon is called a pupa.

PUPA (always all capitals as an acronym) was the name of a software
project until 2002 when the project became GNU's Grub 2.  Cocoon Pupa
is unlikely to be confused with an obsolete name for a pre-release
boot loader.

Checklist:
- Easily pronounceable in most languages.  (Are there any modern
languages without the a P sound?)
- Negative cultural connotations?  (The only American connotation
should not be negative for anybody over five years old.)
- Not currently used in software.

solprovider

On 7/30/08, Reinhard Pötz [EMAIL PROTECTED] wrote:

Dear community,

 in the Cocoon whiteboard (a folder in our SVN repository where every
committer can put into any Cocoon related stuff without having to  
ask) some
of us have started with a rewrite of Cocoon. This rewrite, which  
has the

working title Corona, has two main goals:

  1. Become the best platform available for RESTful services and
RESTful web applications based on the concept of pipelines.

  2. Provide a generic pipeline Java API with SAX
and STaX based default implementations.

 Since we would like to make this work available to a broader  
audience, we

want to start with a series of alpha releases. Unfortunately the name
Corona is already used together with software (Eclipse Corona).  
This means

that we have to find some other name.

 So far we came up with Cocoon Silk and Cocoon Fibre. Both  
names have
been rejected: Silk because Borland has some testing software and  
Fibre
because in German it sounds very much like Fieber which  
translates to

fever. That isn't a good choice either.

 As you can see, the name should be easily pronounceable for  
people having

many different native languages, shouldn't have bad or irritating
connotations for people coming from different countries/culters  
and mustn't

be in use together with software.

 Any suggestions are highly appreciated!
 Reinhard Pötz   Managing Director,  
{Indoqa} GmbH



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



Re: how to use formMap.put() ?

2008-07-31 Thread Barbara Slupik

I pass parameters to my forms and form widgets like this:

var form=new Form(myFormDefinition);
form.setAttribute(myAttribute,myAttribute);

form.lookupWidget(myWidget).setAttribute(myAttribute,myAttribute);

Barbara

On 31 Jul, 2008, at 5:11 pm, Мария Григорьева wrote:


How to use formMap.put() to pass the parameters to the fromMap???

For example,

var composit = dao.composition.get(experiment.get(id_compositions));
formMap.put(key, composit);

But it doesn’t work…

How can I do it ???




Re: using formMap.put()

2008-07-31 Thread Barbara Slupik
I don't know what are you trying to do. I was using parameters in  
repeater action like this:


fd:repeater-action id=addSomething command=add-row  
repeater=myRepeater

  fd:on-action
fd:javascript
  var form=event.source.form;
  var repeater=form.getChild(myRepeater);
  var row=repeater.getRow(repeater.getSize() - 1);
  row.getChild(myWidget).setValue(form.getAttribute 
(myAttribute));

/fd:javascript
  /fd:on-action
/fd:repeater-action

or inside ft:repeater-rows like this:

jx:if test=${form.getAttribute('myAttribute') 
==something}tdft:widget id=myWidget//td/jx:if


Barbara


On 31 Jul, 2008, at 5:23 pm, Мария Григорьева wrote:


How to pass the repeater to the formMap.put ?

I’m trying smth like this:

formMap.put(test, comp_in_composition);

But, only the null values returned.

formMap = {test=[{type=null, amount=null, select=false},  
{type=null, amount=null, select=false}, {type=null, amount=null,  
select=false}, {type=null, amount=null, select=false}]


What should I do to pass the repeater parameter?




Re: Selection list from multivaluefield

2008-08-04 Thread Barbara Slupik

You can do something like this:

* definition

fd:multivaluefield id=myField
fd:datatype base=string/
fd:selection-list src=cocoon:/my-selection-list cache=true/
/fd:multivaluefield

* template

ft:widget id=myFieldfi:styling list-type=checkbox//ft:widget

* binding

fb:value id=myField path=myField/

* object

private String[] myField;

Set values in myField array and they will be automatically selected  
on the screen.


Barbara


On 4 Aug, 2008, at 1:44 pm, Gary Larsen wrote:


Hi All,



Is it possible to set a selection list from a multivaluefield  
definition on

the same form?  The multivaluefield definition would use binding
(direction=load) to move the values into the form.



Currently I'm using 2.1.9.



Thanks!

gary

winmail.dat- 


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: Binding on different xml paths

2008-08-04 Thread Barbara Slupik
Can you please explain it once again? I don't really understand your  
problem.


Barbara

On 28 Jul, 2008, at 6:00 pm, Héléna Tanguy wrote:


Hello,

I'm working on a cocoon form with binding on xml document. Now  
everything works correctly.
But I must make an evolution to this form, the binding must be made  
on 2 xml different paths.


For example:
Some widgets are binded with this xml path: myData/contacts/contact 
[position=x]/name, etc
Some other widget must be binded with this other xml path: myData/ 
customers/customer[position=x]/customerId, etc.
I must display in my form the contact name and the customer id. The  
contact in position 1 is the same person than the customer in  
position 1, etc.
I precise that the xml format cannot be modified, it is a standard  
format.


In the existing form, the binding was made with myData/contacts/ 
contact[position=x], but it is not possible to bind the other  
widget with this xml path.


So my question is: how to do the binding with these 2 xml paths ?  
Is it possible to pass a parameter in the binding file to precise  
the position for the person ?


Thank you



-
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: cocoon 2.2 war app logging + Tomcat 6

2009-06-12 Thread Barbara Slupik

Hello

I have this:

  bean name=org.apache.cocoon.spring.configurator.log4j
 
class=org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator

scope=singleton
property name=settings  
ref=org.apache.cocoon.configuration.Settings/

property name=resource value=/WEB-INF/log4j.xml/
  /bean

in my application context.

My log4j.xml is in my cocoon-webapp/src/main/webapp/WEB-INF and it  
contains:


	appender name=APPLICATION  
class=org.apache.log4j.RollingFileAppender
		param name=File   value=${org.apache.cocoon.work.directory}/ 
cocoon-logs/application.log /

param name=Append value=false / 
param name=MaxFileSize value=4096KB/
param name=MaxBackupIndex value=1/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d %t %-5p %c{2} - 
%m%n/
/layout 
/appender
...
category name=my.package
priority value=DEBUG /
appender-ref ref=APPLICATION/
/category

This works for me in tomcat.

Barbara

On 11 Jun, 2009, at 11:12 am, Gintare Ragaisiene wrote:


Hello,

I've deployed cocoon 2.2 WAR application into Tomcat 6. The problem  
is, that WAR contains my custom-made block myclubbingguide.jar and  
errors from this blocks is not visible nor in the logs/catalina.out  
nor in the cocoon-logs/log4j.log.


So , again, my webbapp structure is:

WAR app
|
+myclubbingguide.jar block
|
+...ather libraries

I've reasearched this:

1)
myclubbingguide.jar block has custom log4j.xml :

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

  appender name=CORE class=org.apache.log4j.ConsoleAppender
  param name=target value=System.err/
  layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d{ISO8601} %c{2} %p  
- %m%n/

  /layout
/appender

  root
priority value=error/
appender-ref ref=CORE /
  /root
/log4j:configuration

and when it runs separately from war throught mvn jetty:run, then  
logging works ok.


2)
when I run WAR app with mvn jetty:run, the log messages apears in  
console either. And it's ok.


3)
when I run WAR deployed on Tomcat 6, Syste.out.println() messages  
goes to logs/catalona.out, but no error messages from  
myclubbingguide.jar block can be viewed. And it is a problem.



Why Tomcat don't listens block's log4 setup? Is there must be  
log4j.xml or web.xml or some ather file of WAR edited? Where I  
should exepect those error messages to apear?



Thank you,
regards,
Gintare




Resource outside jar

2009-07-01 Thread Barbara Slupik

Hello

I am using cocoon-2.2.0. I want to define an xml file with printers  
configuration. This file should be outside application jar because my  
client will configure his own printers there. Printers defined in the  
xml file will be displayed on one of the application screens so that  
user can select a printer from the list. Is it possible to do? How?


Barbara

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



Re: Resource outside jar

2009-07-01 Thread Barbara Slupik
Production environment runs on my client's server. Development  
environment runs on my computer.


My client has multiple users. He wants to change and add new printers  
but he does not want to rebuild the application every time printer  
details change.


What I am trying to do is to apply the same pattern which has been  
applied in an older application running in cocoon-2.0. In that  
application there is one Printers.xml file for all users and it  
contains information about printers (for example which render to use:  
pcl or postscript). User selects some processing parameters and a  
printer and submits a batch job as a jms request. The request goes to  
jms server which does the processing and prints the results on user's  
printer.


The new cocoon-2.2.0 application is sending jms requests - this works  
ok. Now I need to add printers. Of course I could put the printers  
into the database but I prefer to stay with xml file.


Barbara

On 1 Jul, 2009, at 9:26 am, Bart Remmerie wrote:


Where is the server running ?
Are there multiple clients running on one server ?  Or is the server
running @ the client ?

Bart

On Wed, Jul 1, 2009 at 9:21 AM, Barbara
Slupikbarbara_slu...@wro.vectranet.pl wrote:

Hello

I am using cocoon-2.2.0. I want to define an xml file with printers
configuration. This file should be outside application jar because  
my client
will configure his own printers there. Printers defined in the xml  
file will
be displayed on one of the application screens so that user can  
select a

printer from the list. Is it possible to do? How?

Barbara

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






--
Bart Remmerie
+32 (0477) 78.88.76
remme...@gmail.com

-
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.2 : Maven vs. customized web.xml

2009-07-01 Thread Barbara Slupik
I use jetty for development. I have my web.xml in my block directory,  
where pom.xml file is. In my pom.xml file I define:


plugin
groupIdorg.mortbay.jetty/groupId
artifactIdmaven-jetty-plugin/artifactId
version6.1.7/version
configuration
...
webXmlweb.xml/webXml
/configuration
/plugin

Jetty uses my web.xml file and does not overwrite it.

Barbara

On 1 Jul, 2009, at 6:40 pm, Tomek Piechowicz wrote:


Hello.
I want to use XQueryServlet in my application so I added servlet  
configuration to my web.xml but after I started jetty server maven  
overwrited my web.xml :(.


Is it possible to prevent maven from changing web.xml every time it  
starts jetty server ?


Regards,
Tomasz.

-
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: Resource outside jar

2009-07-09 Thread Barbara Slupik

Benjamin, thanks for your help.

I use Spring Configurator for database settings. It works very well.

I decided to put my Printers.xml file in context, that is in my block/ 
application webapp. My client can add his custom Printers.xml to the  
application webapp after installation. Printers.xml is outside jar, so  
my client can modify it easily at any time.


In my sitemap I refer to Printers.xml file like this:

map:generate src=context://Printers.xml/
map:read mime-type=text/xml src=context://Printers.xml/

It works both in jetty and tomcat.

Barbara

On 6 Jul, 2009, at 4:56 pm, Benjamin Boksa wrote:


Hi Barbara,

The new cocoon-2.2.0 application is sending jms requests - this  
works ok. Now I need to add printers. Of course I could put the  
printers into the database but I prefer to stay with xml file.



take a look at the Spring Configurator, you could easily use it to  
provide the configuration path to your application or even use it to  
do the complete printer configuration.


Hope that helps

Benjamin


-
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: CForms 2.1 javascript validation not working

2009-07-12 Thread Barbara Slupik

Hello

I use cocoon-2.2.0 and do my validation like this:

fd:validation
fd:javascript
var success=true;
		if (some-test) {widget.setValidationError(new  
Packages.org.apache.cocoon.forms.validation.ValidationError(my- 
error,true)); success=false;}

return success;
/fd:javascript
/fd:validation

and in my flow I have:

form.load(my-data);
form.showForm(my-form);
if (form.isValid) {
form.save(my-data);
...
}

Barbara

On 11 Jul, 2009, at 2:42 pm, Gary Larsen wrote:


Hi,



For some reason javascript validation stopped working on all forms  
(2.1.9):




  fd:validation

fd:javascript

  cocoon.log.error(test validation: return false);

  return false;

/fd:javascript

 /fd:validation



The validation is fired on a submit widget yet the form is still  
being submitted.  Would anyone have an idea what may be wrong?




Thanks for any suggestions!  I’m stumped right now.

gary





Re: Error uploading files.

2009-08-25 Thread Barbara Slupik

Hello

Do you have enctype=multipart/form-data in your ft:form-template  
element? It should look similar to this:


ft:form-template action=#{$cocoon/continuation/id}.continue  
method=POST enctype=multipart/form-data


See http://cocoon.apache.org/2.2/blocks/forms/1.0/483_1_1.html

Barbara

On 18 Aug, 2009, at 10:27 am, Tomek Piechowicz wrote:


Hi.
I`m trying to upload file via upload widget in CForms (Cocoon 2.2).  
When I try to upload text files everything goes fine, but when I try  
to upload zip, pdf or jpeg files then server throws exception :


Caused by: org.apache.cocoon.ResourceNotFoundException: Error during  
resolving of the input stream


Does anyone know what this error means ?

Regards,
Tomek Piechowicz

-
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: Starting out with Cocoon 2.2

2009-09-12 Thread Barbara Slupik

Hello

I wrote two applications using CForms, Spring and Hibernate in Cocoon  
2.1. It found it relatively easy to upgrade them to Cocoon 2.2. I  
think that CForms, Spring and Hibernate work very well together.


But the same client also has a couple of old applications which still  
run in Cocoon 2.0 and use a lot of xsp. They can be upgraded to Cocoon  
2.1 but not to Cocoon 2.2 because it does not have xsp. They would  
have to be re-written using new techniques but there is no budget for  
it at present. If we upgrade we have to decide where to move them to:  
Cocoon 2.2 or Cocoon 3.0 which is not an easy decision with the  
current status of Cocoon.


Barbara


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



Re: embedding fonts

2009-10-09 Thread Barbara Slupik

Hello

Do you have metrics files with hungarian characters? If I remember  
well you have to get ttf fonts with hungarian characters and build xml  
metric files with commands similar to these:


java -classpath classes:lib\fop.jar;lib\avalon-framework- 
cvs-20020806.jar;lib\xml-apis.jar;lib\xercesImpl-2.2.1.jar;lib 
\xalan-2.4.1.jar org.apache.fop.fonts.apps.TTFReader -d DEBUG fonts 
\TIMES.ttf fonts\TIMES.xml
java -classpath classes:lib\fop.jar;lib\avalon-framework- 
cvs-20020806.jar;lib\xml-apis.jar;lib\xercesImpl-2.2.1.jar;lib 
\xalan-2.4.1.jar org.apache.fop.fonts.apps.TTFReader -d DEBUG fonts 
\TIMESBD.ttf fonts\TIMESBD.xml
java -classpath classes:lib\fop.jar;lib\avalon-framework- 
cvs-20020806.jar;lib\xml-apis.jar;lib\xercesImpl-2.2.1.jar;lib 
\xalan-2.4.1.jar org.apache.fop.fonts.apps.TTFReader -d DEBUG fonts 
\TIMESBI.ttf fonts\TIMESBI.xml
java -classpath classes:lib\fop.jar;lib\avalon-framework- 
cvs-20020806.jar;lib\xml-apis.jar;lib\xercesImpl-2.2.1.jar;lib 
\xalan-2.4.1.jar org.apache.fop.fonts.apps.TTFReader -d DEBUG fonts 
\TIMESI.ttf fonts\TIMESI.xml


Then you build your configuration file userconfig.xml:

configuration
fonts
 font metrics-file=fonts/TIMES.xml kerning=yes embed-file=fonts/ 
TIMES.ttf

font-triplet name=TimesNewRoman style=normal weight=normal/
 /font
 font metrics-file=fonts/TIMESBD.xml kerning=yes embed- 
file=fonts/TIMESBD.ttf
font-triplet name=TimesNewRoman,Bold style=normal  
weight=normal/

 /font
 font metrics-file=fonts/TIMESBI.xml kerning=yes embed- 
file=fonts/TIMESBI.ttf
font-triplet name=TimesNewRoman,BoldItalic style=normal  
weight=normal/

 /font
 font metrics-file=fonts/TIMESI.xml kerning=yes embed- 
file=fonts/TIMESI.ttf
font-triplet name=TimesNewRoman,Italic style=normal  
weight=normal/

 /font
/fonts
/configuration

Once you have done all this you can refer to your userconfig.xml in  
your sitemap.


Ttf (true type fonts) can be found on the net or perhaps you have them  
in your operating system.


Barara

On 9 Oct, 2009, at 11:39 am, Laurent Medioni wrote:


You refer to a D:/fop-fonts/config.xml in your sitemap ?
Can you summarize what you are usingm what you have done so far and  
what you get at the end ?

Thanks.


From: Rover Rock [mailto:rockro...@gmail.com]
Sent: jeudi, 8. octobre 2009 23:02
To: users@cocoon.apache.org
Subject: Re: embedding fonts

Ok, I see.

Are the fonts provided through your config file Unicode fonts ?
I use only the default install, i did not modify any config file and  
Unicode fonts settings. Where and what can i do?:)
+ When you use fop elements (in your xml or in a xsl) how are the  
fo:root parameters configured ? The Locale should be among them +  
the default font, ….

I didnt configure fo:root parameters...



ï This email and any files transmitted with it are CONFIDENTIAL and  
intended
 solely for the use of the individual or entity to which they are  
addressed.
ï Any unauthorized copying, disclosure, or distribution of the  
material within

 this email is strictly forbidden.
ï Any views or opinions presented within this e-mail are solely  
those of the

 author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
ï An electronic message is not binding on its sender. Any message  
referring to

 a binding engagement must be confirmed in writing and duly signed.
ï If you have received this email in error, please notify the sender  
immediately

 and delete the original.



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



CForms suggestion-list: setting value

2010-07-14 Thread Barbara Slupik

Hello

How to set a value on a suggestion-list?

I am using cocoon-2.1.11 with Firefox 3.6.6.

The cocoon sample listed below does not seem to work. I think that it  
should display the suggestion list set to Bruno Dumon but it  
displays the list with no initial value. You have to start typing to  
get suggestions or press the arrow to get a drop down with all elements.


The sample:

  fd:field id=personId
  fd:datatype base=integer/
  fd:initial-value16/fd:initial-value
  fd:suggestion-list type=javascript
  ![CDATA[
function addSuggestion(bean) {
suggestions.push({value: bean.value, label: bean.label});
}

function personList() {
  return [
  {value: 1, label: Donald Ball},
  {value: 2, label: Sylvain Wallez},
  {value: 3, label: Carsten Ziegeler},
  {value: 4, label: Torsten Curdt},
  {value: 5, label: Marcus Crafter},
  {value: 6, label: Ovidiu Predescu},
  {value: 7, label: Christian Haul},
  {value: 8, label: Jeremy Quinn},
  {value: 9, label: Stefano Mazzocchi},
  {value: 10, label: Pierpaolo Fumagalli},
  {value: 11, label: Davanum Srinivas},
  {value: 12, label: Antonio Gallardo},
  {value: 13, label: Ugo Cei},
  {value: 14, label: David Crossley},
  {value: 15, label: Bertrand Delacrétaz},
  {value: 16, label: Bruno Dumon},
  {value: 17, label: Daniel Fagerstrom},
  {value: 18, label: Leszek Gawron},
  {value: 19, label: Ralph Goers},
  {value: 20, label: Vadim Gritsenko},
  {value: 21, label: Jorg Heymans},
  {value: 22, label: Jörg Heinicke},
  {value: 23, label: Jean-Baptiste Quenot}
];
}

function startsWith(string1, string2) {
  return (new  
java 
.lang.String(string1.toLowerCase())).startsWith(string2.toLowerCase());

}

function searchByString() {
  for (var i = 0; i  list.length; i++) {
if (startsWith(list[i].label, filter)) {
  addSuggestion(list[i]);
}
  }
}

function searchById() {
  for (var i = 0; i  list.length; i++) {
if (list[i].value == parseInt(filter)) {
  addSuggestion(list[i]);
}
  }
}

var suggestions = [];
var list = personList();
if (filter) {
  var phase = cocoon.request.getParameter(phase);
  if (phase  phase.equals(init)) {
if (!isNaN(parseInt(filter))) {
  searchById();
} else {
  cocoon.log.error(The filter: ' + filter + ' must be  
a number.);

}
  } else {
searchByString();
  }
} else {
  suggestions = list;
}
return suggestions;
  ]]
  /fd:suggestion-list
/fd:field


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



Re: Configuration process of cocoon-2.2.0

2010-09-12 Thread Barbara Slupik
You might find some information in Cocoon installation howto thread in http://marc.info/?l=xml-cocoon-usersm=121545072805686w=2 
. You don't need to configure cocoon to run in tomcat as far as I  
know. The same cocoon application can run in tomcat and jetty for  
example.


Barbara

On 7 Sep, 2010, at 12:31 pm, Shweta Singhai wrote:


Hi All,

I am new user of cocoon-2.2.0, can anyone tell me the complete  
process of configure the cocoon application with tomcat server.




Thanks.

Shweta Singhai
………
The IMPOSSIBLE is often UNTRIED





Re: form encoding issues

2010-09-29 Thread Barbara Slupik

Hello

I followed the instruction here http://cocoon.apache.org/2.2/1366_1_1.html 
. For cocoon-2.1.11 I set


init-param
  param-namecontainer-encoding/param-name
  param-valueUTF-8/param-value
/init-param

init-param
  param-nameform-encoding/param-name
  param-valueUTF-8/param-value
/init-param

in my web.xml instead of org.apache.cocoon.containerencoding=utf-8 and  
org.apache.cocoon.formencoding=utf-8. I had to create  
SetCharacterEncodingFilter as well. All works fine in utf-8.


Barbara


Hi,

I'm stumbling on a character encoding issue (cocoon-2.1.10) and  
really can't see why. Apparently, text input in a form is passed on  
in a wrong encoding. I've set Cocoon's default encoding in all  
thinkable places as UTF-8:


web.xml:

servlet
servlet-nameCocoon/servlet-name
!-- .. --
init-param
param-namecontainer-encoding/param-name
param-valueUTF-8/param-value
/init-param
init-param
param-nameform-encoding/param-name
param-valueUTF-8/param-value
/init-param
!-- ... --
/servlet

sitemap.xmap

map:serializer logger=sitemap.serializer.xhtml mime-type=text/ 
html name=xhtml
   pool-max=${xhtml-serializer.pool-max}  
src=org.apache.cocoon.serialization.XMLSerializer
doctype-public-//W3C//DTD XHTML 1.0 Transitional//EN/doctype- 
public
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 
/doctype-system

encodingUTF-8/encoding
/map:serializer

Yet, when I execute following pipeline:

map:match pattern=test
map:generate src=test.xml/
map:transform src=test.xsl
map:parameter name=use-request-parameters value=true/
/map:transform
map:serialize type=xhtml/
/map:match

...with following minimal source files:

test.xml
===
?xml version=1.0 encoding=UTF-8?
test/

test.xsl (which will mainly echo the previous input)
==
?xml version=1.0 encoding=UTF-8?
xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;  
version=2.0

xsl:param name=input/
xsl:template match=/
html
head
meta http-equiv=Content-type content=text/html; charset=UTF-8 /
/head
body
form action=test accept-charset=UTF-8 method=get
input type=text value={$input} name=input/
input type=submit/
/form
pcurrent input: xsl:value-of select=$input//p
/body
/html
/xsl:template
/xsl:stylesheet

Yet, entering a string with accented characters, like e.g. 'très  
annoying', this comes out as: 'très annoying'...
On the other hand, when entering the according URL (http://localhost:/test?input=tr%C3%A8s+annoying 
) directly, the characters are passed on correctly. Does anyone  
know how this can be fixed?


Any hints much appreciated!

Ron Van den Branden

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





Re: Deploying a Cocoon 2.2 webapp in Tomcat 6.0.20

2010-10-04 Thread Barbara Slupik

I had similar problem. I fixed it by adding:

filter
filter-namespringRequestContextFilter/filter-name
		filter-classorg.springframework.web.filter.RequestContextFilter/ 
filter-class

/filter

filter-mapping
filter-namespringRequestContextFilter/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping

to my application web.xml file.

Barbara

On 4 Oct, 2010, at 1:01 pm, Florian Schmitt wrote:


Hi,

i'm quite new regarding cocoon 2.2 and i'm stuck trying to deploy a
Cocoon 2.2 webapp in Tomcat 6.0.20. I've spent two days googling,
going through the tutorials at cocoon.apache.org and the nice article
at http://www.csparks.com/cocoon/c22without, but without any success.

I followed those steps to create a minimal webapp :

- create a new dir for the complete webapp
== create a new block:
- in that new dir, run mvn archetype:generate
-DarchetypeCatalog=http://cocoon.apache.org;
- select 2 to create a block, enter groupId, artifactId block,
version and package
- change to block subdir created by maven, run mvn install to
build and install block in repo;
== create a new webapp
- change back to parent dir
- run mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org 
 again

- select 3 to create a webap, enter same groupId, artifactId webapp,
same version and same package with new artifactId appended
- modified webapp/pom.xml to add the block dependency;
- change to package subdir created by maven, run mvn package
jetty:run to build webapp and test it using Jetty;
- open http://localhost:/block/ - works :-)
== deploy it in tomcat
- open Tomcat manager app, select webapp/target/webapp-1.0.0.war,  
hit deploy;

- Tomcat replies OK, displaying webapp-1.0.0 as deployed but not
started; starting manually fails. :-(
- Tomcat log contains the stacktrace attached.

I found some hints online regarding class loaders, but i'm not
experienced enough to fix this on my own.

I tried to add

dependency
groupIdjavax.servlet/groupId
artifactIdservlet-api/artifactId
version2.5/version
/dependency

to webapp/pom.xml because it seems that Tomcat can't find the
javax.servlet.ServletContextListener class, but that didn't help.

Are there any step i missed? TIA for any help!

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




Re: switch Cocoon 2.2 spring dependencies from 2.5.1 to 2.5.6

2010-10-19 Thread Barbara Slupik

Hello

I am trying to do it but no success so far. I changed spring  
dependencies in cocoon-6.pom dependencyManagement  section but get  
error when starting my block in jetty. What else do I need to change?


Error:
2010-10-19 09:39:10.268:/:INFO:  Initializing Spring root  
WebApplicationContext
2010-10-19 09:39:11.448::WARN:  failed  
org.mortbay.jetty.plugin.jetty6pluginwebappcont...@c4edc7{/,/Developer/ 
Expertys/cocoon-2.2/admin/target/rcl/webapp}
java.lang.AbstractMethodError:  
org 
.apache 
.cocoon 
.tools 
.rcl 
.springreloader 
.SynchronizedConfigureableWebApplicationContext 
.setConfigLocation(Ljava/lang/String;)V
	at org.springframework.web.context.ContextLoader.createWebApplicationContext 
(ContextLoader.java:253)


Barbara

On 8 Apr, 2010, at 11:31 am, Thomas Markus wrote:


Hi,

set your version in dependecyManagement section

cocoon2.2 with spring 2.5.6 works fine here (since 2 weeks)

regards
Thomas

Am 07.04.2010 17:04, schrieb Robby Pelssers:

Hi all,

Just wondering if anyone tried to switch to a newer version of  
spring while using Cocoon2.2.  It currently has a dependency on  
several spring-xxx.jar version 2.5.1.


I need to integrate spring-ws within my cocoon application and this  
is giving me headaches (probably) due to dependency conflicts.


So can anyone explain how to make the switch (on Cocoon side) from  
using spring 2.5.1 to spring 2.5.6?


And how big is the risk that Cocoon will not work anymore?


Any help is very much appreciated.

Kind regards,
Robby Pelssers




-
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: switch Cocoon 2.2 spring dependencies from 2.5.1 to 2.5.6

2010-10-28 Thread Barbara Slupik

Hello

The error was caused by the wrong version for ehcache. It works fine  
with ehcache-1.2.4.


I defined spring-2.5.6 dependencies in my application:

dependency
  groupIdorg.springframework/groupId
  artifactIdspring-web/artifactId
  version2.5.6/version
/dependency
dependency
  groupIdorg.springframework/groupId
  artifactIdspring-orm/artifactId
  version2.5.6/version
/dependency
dependency
  groupIdorg.springframework/groupId
  artifactIdspring-jdbc/artifactId
  version2.5.6/version
/dependency

instead of changing cocoon poms. It works fine.

Barbara

On 19 Oct, 2010, at 11:09 am, Barbara Slupik wrote:


Hello

I am trying to do it but no success so far. I changed spring  
dependencies in cocoon-6.pom dependencyManagement  section but get  
error when starting my block in jetty. What else do I need to change?


Error:
2010-10-19 09:39:10.268:/:INFO:  Initializing Spring root  
WebApplicationContext
2010-10-19 09:39:11.448::WARN:  failed  
org.mortbay.jetty.plugin.jetty6pluginwebappcont...@c4edc7{/,/ 
Developer/Expertys/cocoon-2.2/admin/target/rcl/webapp}
java.lang.AbstractMethodError:  
org 
.apache 
.cocoon 
.tools 
.rcl 
.springreloader 
.SynchronizedConfigureableWebApplicationContext 
.setConfigLocation(Ljava/lang/String;)V
	at org.springframework.web.context.ContextLoader.createWebApplicationContext 
(ContextLoader.java:253)


Barbara

On 8 Apr, 2010, at 11:31 am, Thomas Markus wrote:


Hi,

set your version in dependecyManagement section

cocoon2.2 with spring 2.5.6 works fine here (since 2 weeks)

regards
Thomas

Am 07.04.2010 17:04, schrieb Robby Pelssers:

Hi all,

Just wondering if anyone tried to switch to a newer version of  
spring while using Cocoon2.2.  It currently has a dependency on  
several spring-xxx.jar version 2.5.1.


I need to integrate spring-ws within my cocoon application and  
this is giving me headaches (probably) due to dependency conflicts.


So can anyone explain how to make the switch (on Cocoon side) from  
using spring 2.5.1 to spring 2.5.6?


And how big is the risk that Cocoon will not work anymore?


Any help is very much appreciated.

Kind regards,
Robby Pelssers




-
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




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



HSSF serializer stand-alone

2010-11-09 Thread Barbara Slupik

Hello

I am using HSSF serializer as stand-alone in java. It works with  
cocoon-2.0.4.jar:


  void serializeHSSF(Document doc, OutputStream out) throws Exception
  {
PipedOutputStream outStream=new PipedOutputStream();
PipedInputStream inStream=new PipedInputStream(outStream);
HSSFSerializer hssf=new HSSFSerializer();
hssf.setLogger((new  
org.apache.commons.logging.impl.LogKitLogger(HSSF)).getLogger()); // 
only with cocoon-2.0

hssf.initialize();
hssf.setOutputStream(out);
XMLReader  
reader=SAXParserFactory.newInstance().newSAXParser().getXMLReader();

reader.setContentHandler(hssf);
serializeXML(doc,outStream,false);
reader.parse(new InputSource(inStream));
out.flush();
out.close();
LOG.debug(HSSF serialization completed);
  }

but it fails on reader.parse(new InputSource(inStream));  with  
cocoon-2.1.11.jar and cocoon-poi-2.1.11.jar:


 [java] java.lang.NullPointerException
 [java] 	at  
org 
.apache 
.cocoon 
.components 
.elementprocessor 
.impl.poi.hssf.elements.EPStyleRegion.initialize(EPStyleRegion.java:93)
 [java] 	at  
org 
.apache 
.cocoon 
.serialization 
.ElementProcessorSerializer 
.startElement(ElementProcessorSerializer.java:347)
 [java] 	at  
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
 [java] 	at  
org 
.apache 
.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown  
Source)
 [java] 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl 
$FragmentContentDispatcher.dispatch(Unknown Source)
 [java] 	at  
org 
.apache 
.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 [java] 	at  
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 [java] 	at  
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 [java] 	at org.apache.xerces.parsers.XMLParser.parse(Unknown  
Source)
 [java] 	at  
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 [java] 	at org.apache.xerces.jaxp.SAXParserImpl 
$JAXPSAXParser.parse(Unknown Source)


Does anybody use cocoon-2.1 HSSF serializer as  stand-alone? How do  
you run it?


Barbara

Re: CForms validation in Cocoon-2.1.12

2013-12-05 Thread Barbara Slupik

Hello

The problem is caused by a license statement in blocks/forms/resources/ 
org/apache/cocoon/forms/resources/js/templates/InfoPopup.html which  
has been added in Cocoon-2.1.12. The fix is to remove the license.  
Perhaps it is possible to move it inside the span.. but I did not  
test it.


Barbara

On 4 Dec 2013, at 18:47, gelo1234 wrote:


Hello Barbara,

My pure guess: the problem might be with different Dojo version. Did  
you check that there is exactly the same Dojo Toolkit between 2.1.11  
and 2.1.12 ?
When this is not the case, the next possible cause of error might be  
generating unnecessary ?xml ... version=... header within your XML  
data (in Ajax request?)



Greetings,
Greg




2013/12/4 Barbara Slupik barbara_slu...@wro.vectranet.pl
Hello

I am trying to upgrade from Cocoon-2.1.11 to Cocoon 2.1.12.

I have a problem with CForms validation - the ! error icon  
validation-message.gif is not displayed. Dojo debug message is:


DEBUG: dojo.widget.Parse: error: [Exception... Node cannot be  
inserted at the specified point in the hierarchy code: 3  
nsresult: 0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)  
location: http://172.16.1.5/branch/_cocoon/resources/dojo/dojo.js  
Line: 173]


My form definition:
fd:field ...
  fd:validation
fd:javascript
  if (my condition) {
widget.setValidationError(new  
Packages.org.apache.cocoon.forms.validation.ValidationError(my  
error message,[],[true]));

return false;
  }
  return true;
/fd:javascript
  /fd:validation
/fd:field

My sitemap:
  map:transformers default=xsltc.../map:transformers

  map:match pattern=*-display
map:generate type=jx src=forms/{1}_tmpl.xml
  map:parameter name=locale value={session-attr:locale}/
/map:generate
map:transform type=browser-update/
map:transform type=i18nmap:parameter name=locale  
value={session-attr:locale}//map:transform
map:transform type=xslt src=stylesheets/forms- 
styling.xsl
  map:parameter name=resources-uri  
value={request:contextPath}/_cocoon/resources/
  map:parameter name=dojo-locale value={session- 
attr:locale}/

  map:parameter name=dojo-debug value=true/
/map:transform
map:select type=ajax-request
  map:when test=true
map:serialize type=xml/
  /map:when
  map:otherwise
...
map:serialize type=html/
  /map:otherwise
/map:select
  /map:match

The same thing works in Cocoon-2.1.11. Changing default transformer  
to xslt does not make any difference.


Does anyone know what is wrong with it and how to fix it?

Thanks

Barbara


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






Re: Stateless form.processForm

2014-11-13 Thread Barbara Slupik

Hello

Do you have main_template.xml in your main-display-pipeline? Perhaps  
is is enough to define your form template without continuation, like  
ft:form-template action=xxx method=POST. Also perhaps you don't  
need any processing in flow.js after form.showForm(main-display- 
pipeline, data).


Barbara

On 12 Nov 2014, at 17:22, Oliver Bienert wrote:


Hello Cocoon users,

I have created a cocoon 2.2 project. It uses cforms to present a  
record
from an h2 database to the user. I use continuations and a page  
redirect

to switch between records:

   var form = new Form(cocoon://resource/internal/ 
main_definition.xml);
   form.createBinding(cocoon://resource/internal/ 
main_binding.xml);

   // Get data from database and update model
   var bean = javaMain.fillBean(active);
   // Load bean data into form
   form.load(bean);
   form.showForm(main-display-pipeline, data);
   // After submit: Load form data into model
   form.save(bean);
   // Save bean to database
   ...
   // Issue a http redirect from client
   cocoon.sendPage(redirect);

In the sitemap I issue the redirect via redirect-to uri=...

Works so far but I don't really feel this the right way to present  
records to a user.
I mean I don't need a flow between pages so IMHO I don't need  
continuation.


I found out about sending a form stateless by using sendForm.
When the form is submitted I could reattached data by  
form.processForm(viewdata).


Now here I'm stuck. How do I create an appropriate viewData map? I  
googled several hours, but to no avail.

I found a solution with javaflow, but that's not an option for me:

   FormInstance form = new FormInstance(forms/ 
formdefinition.xml);

   Form model = (Form) form.getModel();
   FormContext formContext = new FormContext(getRequest(),  
Locale.getDefault());

   model.process(formContext);

How would I do that in Javascript?

I tried something along those lines:

   function processForm() {
   var javaMain = cocoon.getComponent(mainbean);
   var form = new Form(cocoon://resource/internal/ 
main_definition.xml);
   form.createBinding(cocoon://resource/internal/ 
main_binding.xml);

   var request = cocoon.request;
   var bean = javaMain.newBean();
   form.processForm(request);
   form.save(bean);
   }

but get an error:

org.mozilla.javascript.EvaluatorException:  
servlet:org.apache.cocoon.forms.impl.servlet+:/resource/internal/ 
flow/javascript/Form.js, line 157: Java class  
org.apache.cocoon.environment.http.HttpRequest has no public  
instance field or method named CocoonFormsInstance.


How is this supposed to work?

Regards Oliver



-
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