RE: XML-Serializer encoding

2006-01-16 Thread Ard Schrijvers
Think you should have no problem at all when you just serialize everything as 
utf-8:


UTF-8


AS
  
> 
> 
> Hi,
> 
> I have several newsfeeds that I want to incorporate in my 
> portal, each 
> one of these feeds has its own coplet. but these feeds are encoded 
> differently. some are in ISO-8859-1, others in UTF-8. Now there is no 
> way that I can change the legacy encoding of these. unfortunately it 
> seems that even though I set the encoding of the 
> xml-serializers (in the 
> corresponding pipeline) that I use for those feeds to whatever, the 
> UTF-8-feeds are not displayed properly. is there a way that I 
> can change 
> the encoding in cocoon so the feeds that arrive in encoding 
> "a" can be 
> changed to encoding "b"? I wouldn't mind having them all in UTF-8...
> 
> any help would be very much appreciated.
> 
> best regards,
> 
> christian
> 
> -
> 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]



AW: AW: How to make Generator cacheable?

2006-01-16 Thread Christian Barth
Title: AW: AW: How to make Generator cacheable?






Ok, I see. 

Here is my new code:

public Serializable getKey() {

    return objekt+objekt_ID+geb_ID+stock_ID+abweichungen+suchtyp;

    }

public SourceValidity getValidity() {

    try {

    TaminoClient tc = new                               TaminoClient("http://localhost/tamino/BSDB30032005/Hessen");

    tc.setSAXimplementer("com.jclark.xml.sax.Driver");

    String query = "/[EMAIL PROTECTED]"+geb_ID+"]";

    TaminoResult tr = tc.query(query);

    long lastModified = tr.getLastModified().getTime();

    System.out.println("Letzte Aenderung: "+lastModified);

    TimeStampValidity timeStamp = new TimeStampValidity(lastModified);

    return timeStamp;

    } catch (TaminoError e) {

        e.printStackTrace();

        return null;

    }

}


If this is he correct why, I have another problem: the line tr.getLastModified().getTime(); always returns 0. But I don't know why.

Can anybody help?


Thanks,

Barthi


> -Ursprüngliche Nachricht-

> Von: g[R]eK [mailto:[EMAIL PROTECTED]]

> Gesendet: Sonntag, 15. Januar 2006 22:01

> An: users@cocoon.apache.org

> Betreff: Re: AW: How to make Generator cacheable?

> 

> Christian Barth napisał(a):

> > The caching is working now with the following code

> > 

> > But as you can see, The Cache expires after 5 minutes. What I want is,

> that

> > is gets invalid, when the LastModificationDate of my DB has changed.

> >

> > In the getKey()-Method I have already searialized the timestamp of the

> last

> > modification, But now I don't know how to test, if the Cache is still

> valid

> > in the getValidity()-Method.

> >

> > Can anybody help?

> I think you confuse things about caching. The key of cache should not be

> a timestamp. The key is unique identifier of your particular

> configuration (e.g. your database url), and validity object contains

> information needed to check if entry with particular key is still valid.

> In your case, you can return whatever you want in your getKey() method

> (if you have only i configuration). The getValidity() should return

> TimeStampValidity[1].

> 

> Check [2] for further information. Hope this helps.

> 

> [1]

> http://excalibur.apache.org/apidocs/org/apache/excalibur/source/impl/valid

> ity/TimeStampValidity.html

> [2] http://cocoon.zones.apache.org/daisy/documentation/writing/690.html




Cocoon PHP integration

2006-01-16 Thread tarun . b

Hi All,

I am having a problem in integrating
PHP with Apache Cocoon. Can somebody help me in giving some pointer regarding
how is the PHP integration possible with Apache Cocoon. It will be really
helpful for me.


Regards
Tarun Bajaj
Tata Consultancy Services Limited
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you



How to access the session context with flowscript?

2006-01-16 Thread Tino Breddin

Hi,

this is my first approach to flowscript, so i am confronted with 3 
questions right now.
I want to read the id of the current user from the session context, pass 
it to a java method and get the returned object and forward it to the 
pipeline.



flowtest.js:

importClass(my.package.CodeSnippetCreator);

function callGetCode() {
   var user = cocoon.session.getAttribute("ID");
   CodeSnippetCreator csc = new CodeSnippetCreator();
   var code = csc.getCode(user);
   return code;
   }
--

The requested code shall be xml, so that i can forward it to the 
pipeline, were the code will be aggregated with other parts. The java 
method getCode(String user) gets some information about the user and 
then creates a specific xml snippet.
Is this way to access the session and call java right? Currently i can 
not test it, it is just a idea i had to write down :-)


Thanks,
Tino

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



Re: Cocoon PHP integration

2006-01-16 Thread Johannes Textor
Hi Tarun,

my suggested way of "integration" would be not to integrate them at all,
but to rather "aggregate" them using apache's ModProxy or some similar
technology. Cocoon wiki has a great article about ModProxy at
http://wiki.apache.org/cocoon/ApacheModProxy

Example: You have a cocoon based site and want to have some bulletin
board, NOW. You decide PhpBB suits your needs. Then you can put that
into some other directory out of Cocoon's sight and "mount" it with
ModProxy at http://www.yoursite.com/bb/

Of course, that's no true integration, although it would be possible to
share the same database between PHP and Cocoon, thus being able to use
each other's content. It's still the best thing you can do IMHO. Cocoon
and PHP are so very different that its not straightforward to "truly"
integrate them.

There is also a PHP block in Cocoon, but sincerely I have no idea what
it does and I'm not sure if it was ever actually used by somebody.

HTH,
Johannes

[EMAIL PROTECTED] schrieb:

>
> Hi All,
>
> I am having a problem in integrating PHP with Apache Cocoon. Can
> somebody help me in giving some pointer regarding how is the PHP
> integration possible with Apache Cocoon. It will be really helpful for
> me.
>
>
> Regards
> Tarun Bajaj
> Tata Consultancy Services Limited
> Mailto: [EMAIL PROTECTED]
> Website: http://www.tcs.com
>
>Notice: The information contained in this e-mail message and/or attachments to 
>it may contain confidential or privileged information. If you are not the 
>intended recipient, any dissemination, use, review, distribution, printing or 
>copying of the information contained in this e-mail message and/or attachments 
>to it are strictly prohibited. If you have received this communication in 
>error, please notify us by reply e-mail or telephone and immediately and 
>permanently delete the message and any attachments. Thank you
>
>  
>


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



Ajax multivaluefield/double-listbox problem

2006-01-16 Thread Fabrizio Sitzia
Hello

I'm experiencing problems when rendering a multivaluefield using the
'double-listbox' styling - when that multivaluefield is contained in a
repeater, and Ajax is enabled for the form (ft:form-template ajax="true")

The 'double-listbox'-styled fields in the repeater stop working as soon as
some action, involving a round-trip to the server and a partial
re-rendering of the repeater, is being performed (for example adding or
deleting a repeater row)
After such a round-trip, a click on any of the double-listbox's UI
elements (double-click on an item, click on an option-transfer button)
will yield the Javascript error "optNx is not defined".

The form works fine if Ajax is disabled, or if a styling other than
'double-listbox' is used for rendering the multivaluefields (default
styling as a multiple-selection list, or list-type='checkbox' styling)

Has somebody out there experienced this problem, or even better, come with
a fix for it?


I would like to keep Ajax enabled - especially as it avoids the 'jump to
top-of-page' effect when adding or deleting rows on lengthy forms. And I
would like to also keep the 'double-listbox', simply because to most users
they are a lot more intuitive to use than html's default
multiple-selection boxes, and less noisy than a bunch of checkboxes.


BTW: The Cocoon version I'm using is 2.1.8
The problem does not appear to be browser-specific (same behaviour with
IE6 on Windows, Firefox on both Windows and OSX, Safari on OSX)


Fabrizio


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



XSL-Problem. I can't find the error

2006-01-16 Thread Christian Barth
Title: XSL-Problem. I can't find the error






Hi!

 

In the file view_bsksuche_edit2.xsl I'm calling the sitemap at 


bs-portlets-suchergebnis.


From there I'm calling the xsl view_bsksuche.xsl where the problem occurs.

I need the parameter "typ" which I'm passing to the pipeline via hidden field in view_bsksuche_edit2.xsl.


The problem is, that cocoon doesn't recognize the parameter. And I don't know why!


Could you please have a look.


Thanks!



 <<...>>  <<...>>  <<...>> 




http://apache.org/xsp"; xmlns:xsp-util="http://apache.org/xsp/util/2.0"; > 
		
			

	String suchtyp = ;
	if (suchtyp.equals("A")) {
		Sie benötigen Unterstützung bei der Planung einer/eines:   
		(Suchtyp  )
	}
	else if (suchtyp.equals("B")) {
		
		}

Bitte passen Sie im Fenster unten die Gewichtung der einzelnen Vergleichsattribute Ihren Vorstellungen entsprechend an.
Wenn Sie rechts auf 'Suchen' klicken, wird Ihre Suchanfrage ausgeführt.
Sollen auch Sonderlösungen und genehmigte Abweichungen von der Bauordnung angezeigt werden?
 (JA = Abweichungen anzeigen; NEIN = keine Abweichungen anzeigen;
  AUSSCHLIESSLICH = es werden nur Abweichungen angezeigt):


	bs-portlets-suchergebnis
	
		
			Ja
		
	
	
		
		Nein
		
			
		
		
		Ausschließlich		
		
		
	
	
		if (!suchtyp.equals("A")) {
			

		
		}
		
			

		
			

		
			

		
		
		String stock_ID = ;
		if (!stock_ID.equals("")) {
			

		
		}
		
	

			


http://www.w3.org/1999/XSL/Transform";>





	
	
		
function highlight(color, key) {
	document.getElementById(key).style.backgroundColor = color;
}

function openBvh(bvh_id, session) {
	FensterNeu = window.open('http://localhost:8080/cocoon/app/bsf-brandschutz?id=5', '_blank');
	FensterNeu.focus();
}

function updateDetails(id) {
	self.open("http://web.de";);
}
	
		
	
		
		
			

	BeschreibungÄhnlichkeit


			
		

		
	





highlight('yellow', '') 
highlight('white', '') 
 
openBvh('')
updateDetails('')

	
	
		 in Stockwerk "$stock" von Gebaeude "" in Bauvorhaben ""
		
	
	
	Gebaeude "" in Bauvorhaben ""
	
	


 "" aus Bauvorhaben 
			"" in Gebaeude ""
			



kommt noch





 

sitemapPart.xmap
Description: Binary data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Substitute whitespace in request parameters in sitemap?

2006-01-16 Thread Antony Grinyer
Hi,

Is there any way to substitute whitespace with '%20' in a URL within the
sitemap? I am passing in basic Xqueries containing spaces as a request
parameter to my sitemap (from an HTML page, not from XSL so I cannot use
the strip whitespace attribute); however, as the xqueries contain spaces
the URL becomes malformed when the sitemap attempts to call the URL?

Any ideas gratefully welcome.

Thanks a lot,
Ant


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



Re: XSL-Problem. I can't find the error

2006-01-16 Thread Geert Josten

Hi,

It is a bit confusing that you are referring to XSP pages as .xsl files. Apart from that, your 
snippet looks okay on first impression. You are passing {request-param:typ} as a map:parameter to 
the relevant map:transforms, as far as I can see just from glancing at it. I do notice that you are 
using xinclude. Are you performing HTTP requests to Cocoon internally with Xinclude? If so, pass the 
query string on to it or simply call Cocoon through the cocoon protocol.


Regards,
Geert

PS: would be nice if you could slim down the example.

Christian Barth wrote:


Hi!
 
In the file* view_bsksuche_edit2.xsl* I'm calling the sitemap at


*bs-portlets-suchergebnis.*

 From there I'm calling the xsl* view_bsksuche.xsl* where the problem 
occurs.
I need the parameter "typ" which I'm passing to the pipeline via hidden 
field in view_bsksuche_edit2.xsl.


The problem is, that cocoon doesn't recognize the parameter. And I don't 
know why!


Could you please have a look.

Thanks!


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



Re: XML-Serializer encoding

2006-01-16 Thread christian b
Thank you, Ard

I already did that. But it doesn't change anything. I found this in my
web.xml in the WEB-INF folder of my cocoon-build:



  container-encoding
  ISO-8859-1


Servlet-Container used is Tomcat 5.0.28

I switched the encoding parameter to UTF-8 to check whether it would
work, and it seems to. But still the coplets aren't encoded properly.

Then I saw that the whole page is encoded in ISO-8859-1, having been
serialized in HTML (as seen in the doctype of the page). So I looked
for the HTML-Serializer in my portal/sitemap.xmap and changed the
encoding of the html-serializer, too. no difference

these are the feed-adresses that I want to incorporate. both don't
have an encoding set (do RSS-feeds have to have that?) but they
clearly contain UTF-8 encoded characters.

http://www.industrial-technology-and-witchcraft.de/index.php/ITW/itw-rss20/
http://www.netzpolitik.org/feed/

so, I guess that somewhere along the line from generating to
serializing these feeds are messed with in a way that the encoding set
in the serializers has no effect whatsoever.

suggestions as to where this could be, anyone?

it would be greatly appreciated :)

regards, christian

2006/1/16, Ard Schrijvers <[EMAIL PROTECTED]>:
> Think you should have no problem at all when you just serialize everything as 
> utf-8:
>
>  name="xml" pool-grow="4" pool-max="32" pool-min="4" 
> src="org.apache.cocoon.serialization.XMLSerializer">
> UTF-8
> 
>
> AS

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



RE: Substitute whitespace in request parameters in sitemap?

2006-01-16 Thread Antony Grinyer
Sorted - needed to use 'url-encode' on my parameters in the sitemap.

Ant

-Original Message-
From: Antony Grinyer [mailto:[EMAIL PROTECTED] 
Sent: 16 January 2006 11:10
To: users@cocoon.apache.org
Subject: Substitute whitespace in request parameters in sitemap?

Hi,

Is there any way to substitute whitespace with '%20' in a URL within the
sitemap? I am passing in basic Xqueries containing spaces as a request
parameter to my sitemap (from an HTML page, not from XSL so I cannot use
the strip whitespace attribute); however, as the xqueries contain spaces
the URL becomes malformed when the sitemap attempts to call the URL?

Any ideas gratefully welcome.

Thanks a lot,
Ant


-
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: AW: How to make Generator cacheable?

2006-01-16 Thread Ard Schrijvers

>Ok, I see. 
>Here is my new code:
>public Serializable getKey() {
>return objekt+objekt_ID+geb_ID+stock_ID+abweichungen+suchtyp;
>}

Well, I don't see the rest of your code, but certainly would not do it like 
this:

You just do something like:


protected String cacheKey = null;

public void setup(SourceResolver resolver, Map objectModel, String src, 
Parameters parameters){
.   
.
.
cacheKey =  someconstructedcachekeydependingonparamtersforexample
}

public Serializable getKey() {
   return cacheKey;
}


Now, in very short, cocoon does the setup() of your generator, creating the 
cacheKey, then does a getKey(), if it finds one that matches, it checks your 
getValidty() and if that also matches gives you your cached output (I left out 
some steps, but these are the important ones)

Also notice, that for checking the validity of the cache, cocoon always does 
the component setup(). Make sure, that the component setup() does not involve 
heavy objects creations, since this implies havy cachekey lookups for cocoon

AS

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



RE: XSL-Problem. I can't find the error

2006-01-16 Thread Christian Barth
Title: RE: XSL-Problem. I can't find the error






> -Original Message-

> From: Geert Josten [mailto:[EMAIL PROTECTED]] 

> Sent: Monday, January 16, 2006 12:42 PM

> To: users@cocoon.apache.org

> Subject: Re: XSL-Problem. I can't find the error

> 

> Hi,

> 

> It is a bit confusing that you are referring to XSP pages as 

> .xsl files. 


Well, that's right. Maybe I'll change it.


> Apart from that, your snippet looks okay on first 

> impression. You are passing {request-param:typ} as a 

> map:parameter to the relevant map:transforms, as far as I can 

> see just from glancing at it. I do notice that you are using 

> xinclude. Are you performing HTTP requests to Cocoon 

> internally with Xinclude? If so, pass the query string on to 

> it 


That was the step I had forgotten. Now I have the parameter in the xsl-file.

But fo rany reason, the if-Clause isn't executed. Could you please have a look again?


Here is the code: