Re: App level variable in flow
Upayavira, > How do I store a java object in some application context or an > application level variable, just once during servlet container startup, > > when I'm writing an app that uses flow? Could you not write it as I component, include it in cocoon.roles so that it'll be loaded automatically at startup and access it in flow via cocoon.getComponent()? Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDOUserException: Object not PersistenceCapable
Eric, Is the class listed in your repository.xml and the repository.xml lies somewhere in the classpath? AFAIK, OJB raises ObjectNotPersistenceCapable in two cases: 1. The class hasn't been enhanced (which can't be it in your case) 2. No description of the class can be found in repository.xml Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: role-based access to pages and parts of pages - ideas?
Helma, > Any ideas? might not be of much use for you, cause I am not using the authentication-fw, but I thought, I'd tell you anyway. I am using a structure very much like the authentication-fw, but using my own actions, thus a lot lighter and tailored exactly to my needs (thus not as nice and flexible as the framework). There are actions for logging in, logging out, authenticating and protecting, just like the framework.My sitemap looks very much like the one in the authentication-example without flow (thus not the one you adopted). Unlike the framework, my protecting action takes a parameter "role" and it checks whether the user who is locked in has that role. If so, access is granted. so something like: That way, I keep everything in the sitemap and my actions. Also, I could do authorization depending on the url and the user who is logged in, e.g.: Here everything in protected/admin could only be accessed by users with role admin. HTH. Maybe you can derive an idea for your problem from this. I am also happy to share the code, if you want to have a look. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: role-based access to pages and parts of pages - ideas?
Helma, I'll tell you a little more about me approach (it was a rather rough summary I gave you). Maybe some of the problems you see are solved already. > 1. I have various roles (between 5 and 10) which overlap in access > authentication, so every pipeline would need to check for several roles > and if I need to add extra roles I need to revisit every pipeline. :-( I don't actually check for roles, but use resources as another level of abstraction: resources are what we want to protect (e.g. certain urls, combinations of urls and request-params, whatever) roles have access to resources users have roles E.g. you have a type of patient record that can be accessed by nurses and doctors. So you have roles "nurse" and "doctor" both of which can access the resource "patient record x". Now the authorization goes like this: user smith requests access to "patient record x". The authorizer checks which roles have access to "patient record x" and then whether user smith has any of these roles. So in our case smith could be doctor or nurse and would be granted access either way. The sitemap still looks the same, but instead of a role you pass a resource to the action. > 2. My sitemap is growing rapidly and by adding enormous amounts of > comment I'm trying to keep it clear, but I find it more and more > difficult to find what I'm looking for. So configuring authorisation in > the sitemap is not really my idea of keeping it clear and separated. > 3. I want a general way of handling several pages, i.e. with a minimal > number of pipelines. If in future I add a page, I want it to be > integrated without touching the sitemap. I was thinking of adding > access rules to the source of the form, but that would also spread the > authorization. :-( I agree with Alex, it might be useful to have a look at your sitemap, if we can. Authorization generally shouldn't add a lot of overhead. What I do is use sub-sitemaps for protected areas. So in my main sitemap I have This way any request of form //host/protected/* needs authorization. The autorization is done based on the requested url (the url after protected/ is actually the authorization resource). So in our example above the request could be //host/protected/patient-record-x. The authorizer than checks (in my case against a database) if any of the user's roles has access to that resource. If so, the request is passed on to the protected sitemap. Notice, that you will never have to change anything about this to add new pages to the protected sitemap. You only need to make sure the user's roles have access to the new resource (in my case, by adding an entry in the database). The protected sitemap stays clear of authorization functionality. > 4. One or more roles may have more features/information on a page than > others. This would mean I have to customize role checking for every > page item. :-( For that I wrote a transformer. My pages contain statements of the form On encountering a cms:auth tag the transformer checks whether the user has that role. If so, it passes on the enclosed content. If not, it filters it. HTH Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: role-based access to pages and parts of pages - ideas?
Alex, > I really like Stefan's idea of authorization > transformer, which filters data based on your > permissions. Thanks. Good ideas in your mail, too. I think I'll rethink some of my sitemap. > Have you thought of contributing it to > the project? The project's approach to authorization is the authentication-framework which I don't understand to enough depth to integrate my transformer with it. However, if you're interested or if you think, you could make something worthwhile out of it, I am happy to send you the class. It's very short and simple, anyway. I took the inspiration from the FilterTransformer, but it's even simpler than that. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: role-based access to pages and parts of pages - ideas?
Nicolas, > I'm interested: I've done the same work but with an XSL Stylesheet but > a java class would be better. Where can we get it? I've sent you a copy of my classes off-list. It is, however, as I pointed out before, tailored to my own little authentication system, not to cocoon's framework. Since the transformer is very simple, it should be very easy to adapt, though, given some knowledge of the cocoon framework (which I don't have enough of). To make you understand the code, here's a quick outline of my system: Just like cocoon's authorization handlers, it uses an Avalon component Authorizer that does the actual checking of permissions of a user that is logged in (I sent you this class to make you understand better). This component is used by the transformer and by an AuthorizerAction. User information is - again, just like in cocoon's framework - stored in a session context. Creation of this context is done by an AuthenticationAction that checks the identity of a user (again, I've included the class). Hope you can make something out of it. Feel free to ask questions. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: role-based access to pages and parts of pages - ideas?
Alex, >It would be great if you could. We can also bring >this up with the developers to see what they think I am happy to help, if someone gives my a quick breakdown on how the authorization-fw works. I am quite short of time at the moment and I can't run through the code/documentation myself. From what I've gathered so far you have to get hold of the Handler or the HandlerManager or something and then ask it to authorize. Details, anyone? Also, I don't think the authorization framework uses various roles per user, does it? So the transformer could only filter based on the user (but that might be good enough in many cases) Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Authentication framework problem
Hi Nesto, not a complete answer, but some pointers that might help you: > 1) writing a simple action that checks the user parameters > (username/password) provided through a web form, with those stored in > the database. Here the problem, for me, is to write java code that > reuse the connection pool set for other pipelines (but at a transform > level). I have no idea... You need to get hold of the DataSourceSelector to get hold of a pooled connection: 1.Write an action that extends ServiceableAction. 2.Overwrite the service method: public void service(ServiceManager manager) throws ServiceException { this.dbselector = (ServiceSelector) manager.lookup(DataSourceComponent.ROLE + "Selector"); super.service(manager); } [I am assuming dbSelector is a private field of the action of class ...avalon.framework.service.ServiceSelector.] 3. Overwrite the dispose method to release the component: public void dispose() { this.manager.release(this.dbselector); super.dispose(); } Now you can use the dbselector anywhere in your action code to obtain a datasource which in turn can give you a connection: DataSourceComponent datasource = (DataSourceComponent)this.dbselector.select("nameofyourpool"); Connection conn = datasource.getConnection(); conn is of class java.sql.Connection, so from here you should be able to get on yourself using JDBC. NOTE: I am still not very experienced with avalon and components, so the code might not be ideal, but it works for me. If someone has corrections, I'd be happy to hear them. For a good example of obtaining a pooled connection and using it, look at the SQLTransformer. > 2) customize the authentication resource, to use the existing > authentication framework. But Where can I add the custom code that > queries my database? Do I Have to change only the AuthAction class? I don't know the authentication-framework particularly well, but the authentication handler takes a uri that has to return some xml to grant authorization or not, doesn't it? You could just write an esql-xsp-page to query your database and return the xml accordingly. That would probably be a lot easier than the action-approach, if you're already using the framework. HTH Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wildcardhostmatcher / mount: session lost
Hi, I've got a very odd behaviour in conjunction with the WildcardHostMatcher: My main sitemap contains the following snippet: Every time a new request is received, the session is reset / regenerated with a new id. If however, I use a uri-prefix (whichever), it works, the session persists. Any suggestions anyone? Any help would be greatly appreciated, I'm totally stuck. Thanks Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: building Collection from JDO problems
Hi Bert, > Does the problem with object identities mean that OJB is not the right > way to go when building forms that display editable lists? If that is > that case I lost quite a lot of time just trying to find an quicker way > to build web forms. > What are the limitiations of OJB exactly? thought I'd point this out to you, since it cost me a lot of time and I still haven't solved it in a satisfying way. AFAIK, there is a bug in the current OJB release rc5 with the use of javax.jdo.Query (as you use in your retrieve method). The objects in the collection it returns are actually not persistent as they should be. The nasty implication is: You retrieve a collection, you edit it via your form. You call transaction.commit() and the database doesn't get updated! The only way to retrieve a persistent object is by using getObjectByIdentity (or something like that) like they do in the JDO tutorial on the OJB site. They recently fixed the bug (get the latest CVS HEAD and compile it yourself), however, I am still running into a problem: I have got an object of class User that contains a field roles that is a collection of Role objects. When I retrieve a collection of User objects via Query, the respective Role objects are retrieved with them automatically. The users are persistent as they should be (thanks to the bug being fixed), the connected roles however still aren't. So by the time you commit, OJB tries to re-create the roles in the database and you get duplicate key errors. I haven't had the time yet to ask the OJB people about it. This is not to do with your current problems, but I thought I'd point it out to you before you run into it. For the moment, I actually gave up on OJB-JDO after spending a lot of time on it and just use the OJB PersistenceBroker-API which so far works perfectly and reliably for my relatively small persistence needs. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
limitation in woody-repeater binding and collections
Hi, here's an issue I came across the other day and it took me quite a while to figure out, so I thought I'd let everyone know and maybe someone could include a note in the WoodyBinding documentation on the wiki: I had a bean with a Collection of type HashSet which I was trying to bind to a Woody Form. Reading it worked perfectly, updating, too. But inserting a couple of new elements at a time caused a problem: The binding seemed to save only some elements and create empty collection elements (no values set) for others. Tracing the problem through the woody code, I realised that the code implies the use of ordered collections such as LinkedList, ArrayList... Woody first creates a new element instance and adds it to the collection. It then obtains it from the collection using jxpath syntax "mybean/collection[count]" to fill in the values. "count" is the new number of elements in the collection (after insertion) which assumes that the new element has been added at the end. This is true for Lists, but not for my HashSet. So, in fact, any odd element would be retrieved, possibly the new one and possibly not. That produced an unpredictable behaviour where element values would be overwritten and others left blank. Maybe that could be pointed out more clearly on the wiki page where it only says that the property has to be of type Collection. Might save others some time. Thanks Stefan __ Nachrichten, Musik und Spiele schnell und einfach per Quickstart im WEB.DE Screensaver - Gratis downloaden: http://screensaver.web.de/?mc=021110 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
best practice for minor form changes/optional elements
Hi, just wondering whether anyone has got any thoughts on this/best practices to offer: I have got a woody form that I need to display in very slight variations, e.g. a certain button should only be visible under certain conditions that I can check in my flow. The options I can see are: 1. Have several form templates, one for each variation. Don't like that very much, too much duplication. 2. Send a request parameter to the formpipeline. Assign an extra attribute "req-param" to the optional elements . Then write a transform that checks for the "req-param" attribute and filters the corresponding element if no request parameter by that name is given. 3. Use jxtemplate generator to generate the formtemplate and use the context object to pass a value that determines whether to display a certain element or not. Inside the jxtemplate I'd enclose the element in an if-statement. Any thoughts? Thanks a lot Stefan __ Nachrichten, Musik und Spiele schnell und einfach per Quickstart im WEB.DE Screensaver - Gratis downloaden: http://screensaver.web.de/?mc=021110 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
again: best practice for minor form changes/optional elements
Hi, I thought I'd give this a second try, since I didn't get any replies the first time round. I'd appreciate any kind of comment/suggestion. Thanks! Just wondering whether anyone has got any thoughts on this/best practices to offer: I have got a woody form that I need to display in very slight variations, e.g. a certain button should only be visible under certain conditions that I can check in my flow. The options I can see are: 1. Have several form templates, one for each variation. Don't like that very much, too much duplication. 2. Send a request parameter to the formpipeline. Assign an extra attribute "req-param" to the optional elements . Then write a transform that checks for the "req-param" attribute and filters the corresponding element if no request parameter by that name is given. 3. Use jxtemplate generator to generate the formtemplate and use the context object to pass a value that determines whether to display a certain element or not. Inside the jxtemplate I'd enclose the element in an if-statement. Any thoughts? Thanks a lot Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ant static generation - class not found DOMError
Hi, I am trying to use the "cocoon" ant task to generate a static website. The error I am getting is: NoClassDefFound: org.w3c.dom.DOMError. Guessing that it should be in xml-apis.jar and checking, I found that the class, indeed, doesn't exist. Not in the lastest xml-apis.jar from CVS, either, though. What do I need to replace? Thanks a lot Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ant static generation - class not found DOMError
Hi Martin, thanks for your help. I doesn't work, though, unfortunately. > SET > ANT_OPTS="-Djava.endorsed.dirs=D:\cocoon-2.1.4-src\cocoon-2.1.4\lib\en > dorsed"-Xms64m -Xmx512m What is "-Xms64m -Xmx512m". I set the ant option as you did, but didn't understand what this second part is. I don't think, though, that it is a problem of the libraries not being found. Cause the missing class org.w3c.dom.DOMError really doesn't seem to exist. I googled for it and could only find it as part of the JDK 1.5 beta API, so I figured it was a fairly new class and I might have to update one of my libraries. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ant static generation - class not found DOMError
Hi Upayavira, thanks for helping. > Does it work with the CLI instead of the ant task? No, unfortunately that doesn't work, either. I used the sample xconfig file from http://cocoon.apache.org/2.1/userdocs/offline/configuration.html#Sample+xconf+File with minor changes for my project. I can see the CLI loading all the jars, but as soon as it starts executing, I get the error: Main Class: org.apache.cocoon.Main Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at Loader.invokeMain(Unknown Source) at Loader.run(Unknown Source) at Loader.main(Unknown Source) Caused by: java.lang.NoClassDefFoundError: org/apache/commons/cli/Options at org.apache.cocoon.Main.setOptions(Main.java:132) at org.apache.cocoon.Main.main(Main.java:255) ... 7 more Before, while loading the jars, it said however, that commons-cli-1.0.jar was added and that one does contain org.apache.commons.cli.Options. So, since CLI didn't work, I tried the ant task, but, as I said, not with any more success. > Are you using > org.apache.cocoon.CocoonTask? (There's an older one in the scratchpad > which I'll remove soon). Yes, I am. I copied the sample ant task from http://cocoon.apache.org/2.1/userdocs/offline/ant.html#Sample+Ant+Task and made some minor modifications for my own project. Thanks Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actions and Session
Giancarlo, the SessionModule that you access by {session:...} only provides general info about the session like session-id etc. You need to use the SessionAttributeModule to access attributes. like your username. Use {session-attr:username} instead (if you haven't changed the module name to something else than "session-attr" in your cocoon.xconf which I suppose you haven't) Stefan [EMAIL PROTECTED] schrieb am 15.09.03 16:32:50: Hi, I'm just trying to figure out the differences between Parameter and ObjectModelHelper; using authentication framework with DatabaseAuthenticatorAction, i put a var (username) into session: Then i try to access this var in an action, but i don't know where to find it; in my sitemap i use , but session var username is empty. Here is my sitemap: -- Ing. Giancarlo Rosso MCR Srl [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Bestes Testergebnis: Stiftung Warentest Doppelsieg fur WEB.DE FreeMail und WEB.DE Club. Nur fuer unsere Nutzer! http://f.web.de/?mc=021182 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actions and Session
Giancarlo, the SessionModule that you access by {session:...} only provides general info about the session like session-id etc. You need to use the SessionAttributeModule to access attributes. like your username. Use {session-attr:username} instead (if you haven't changed the module name to something else than "session-attr" in your cocoon.xconf which I suppose you haven't) Stefan [EMAIL PROTECTED] schrieb am 15.09.03 16:32:50: Hi, I'm just trying to figure out the differences between Parameter and ObjectModelHelper; using authentication framework with DatabaseAuthenticatorAction, i put a var (username) into session: Then i try to access this var in an action, but i don't know where to find it; in my sitemap i use , but session var username is empty. Here is my sitemap: -- Ing. Giancarlo Rosso MCR Srl [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Die Besten ihrer Klasse! WEB.DE FreeMail (1,7) und WEB.DE Club (1,9) - bei der Stiftung Warentest - ein Doppelsieg! http://f.web.de/?mc=021184 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tutorial - MySQL - NoValidConnectionException: No valid JdbcConnection class available
Flavio, if you have tried all the reasonable things and doublechecked your settings (which I think you have from previous posts on this thread), it's most likely to be a version problem. I ran into the same problem when I upgraded from MySQL 4.0 to 4.1 and had to replace my old mysql-jdbc-connector by version 3.08. What helped me was getting the (by then) most recent version 1.1.1 of the excalibur datasource-jar from their website and replacing the old one in the WEB-INF/lib folder. Also, there are (or at least there used to be) two versions of cocoon-2.0.4, one for JVM 1.2,1.3 and one for JVM 1.4. The excalibur datasource component is different in the two. Since you are using the binary version, have you doublechecked you got the right one? For reference, my system: tomcat 4.1 jdk 1.3 mysql 4.1 mysql-jdbc-connector 3.0.8 excalibur datasource 1.1.1 Hope this is of any help. Unfortunately I don't know too much about cocoon internals and dependencies myself. Stefan [EMAIL PROTECTED] schrieb am 15.09.03 10:39:43: Hi John, sorry but this is not the solution ... i modified my cocoon.xconf as you suggested but the error is still the same. Anyway i always use mysql in standalone mode without specifing the port number, i think it takes the default port. I am not expert in using cocoon, but i think that the problem depends from other things, like, maybe, the version of tha avalon framework or something like this ... I say so because, trying to work around the problem, i put these same configuration tags in the .xsp file, just before the esql:connection, and this runs ; i know that isn't the right place but runs ... this means that the datasource tags are right and driver connection works, isn't it ?? Thanks a lot Flavio > Flavio wrote: > > jdbc:mysql://localhost/cocoon > > This looks wrong. Surely the url for the jdbc db must be > ://:, eg > jdbc:mysql://localhost:3306 > > I think 3306 is the port for MySQL. MS SQLServer uses 1433. > > John > > > - > 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] __ Bestes Testergebnis: Stiftung Warentest Doppelsieg fur WEB.DE FreeMail und WEB.DE Club. Nur fuer unsere Nutzer! http://f.web.de/?mc=021182 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
possible to put identifier in cocoon list subject?
Hi all, this might be my own personal problem, but maybe other people have got the same: My spam filter doesn't allow for filtering for sender addresses, so there is no way for me to identify cocoon-list messages and allow them to come through and I always have to fetch them manually. Would there be a possibility of putting an identifying string at the beginning of the subject of messages from the list like other lists do, such as [cocoon-users] or something? That would be most helpful to me. But then again, might be this is only my problem, so I should find another mail provider. Thought I'd ask anyway, since it might save me the hassle of an address change. Thanks Stefan __ Doppelsieg fur WEB.DE FreeMail und Club bei Stiftung Warentest! Beste Sicherheitswertung und Verfuegbarkeit! http://f.web.de/?mc=021181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: possible to put identifier in cocoon list subject?
Steven, thanks for replying. First of all, I made a little mistake in my previous post. Of course, it allows to filter by sender addresses (that doesn't help, though, since there are many, many senders on the cocoon list), but it doesn't allow to filter by recipient. Apart from sender, I can filter by cc and subject. That's all. So unfortunately your suggestion won't work either. It's server-side, though, so maybe I should just do like you and use a client-side tool. Thanks Stefan On Tue, 16 Sep 2003 10:03:10 +0200 Steven Noels <[EMAIL PROTECTED]> wrote: > Stefan Klein wrote: > > > Hi all, > > > > this might be my own personal problem, but maybe other people have > > got the same: My spam filter doesn't allow for filtering for sender > > addresses, so there is no way for me to identify cocoon-list messages > > and allow them to come through and I always have to fetch them > > manually. Would there be a possibility of putting an identifying > > string at the beginning of the subject of messages from the list like > > other lists do, such as [cocoon-users] or something? That would be > > most helpful to me. > > > > But then again, might be this is only my problem, so I should find > > another mail provider. Thought I'd ask anyway, since it might save me > > the hassle of an address change. > > Can you sort/filter on "list-post" header? That's the most robust one > for processing mailing list mails. I use this successfully (client-side) > with Mozilla (Thunderbird 0.2). > > Cheers, > > > -- > Steven Noelshttp://outerthought.org/ > Outerthought - Open Source Java & XMLAn Orixo Member > Read my weblog athttp://blogs.cocoondev.org/stevenn/ > stevenn at outerthought.orgstevenn at apache.org > > > - > 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: Actions and Session
>This way a can get session attributes either as parameter passed from sitemap, >or with Session object in an Action. Am i right? Not sure whether I got you right: You mean, assign {session-attr:username} to an action parameter and then use the parameter in the action? This seems to me an overly complicated way of doing this. Simply accessing the session object in the action, as you suggest as well, seems a lot more reasonable. Stefan __ Doppelsieg fur WEB.DE FreeMail und Club bei Stiftung Warentest! Beste Sicherheitswertung und Verfuegbarkeit! http://f.web.de/?mc=021181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File Upload With Action
Hi Johannes, take a look at the following bit of code. I use the FilePartArray rather than the FilePart. FilePartArray is a byte array holding the file contents in memory rather than a reference to a file already stored on disc, i.e. the file is not saved automatically and the data will be lost by the end of the request unless you've saved it (as I do below). I think, you also need to set the "autosave-uploads"-parameter in web.xml to false to make this work. For more info see http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon If you need more info, let me know. Stefan Here's the code: Request request = ObjectModelHelper.getRequest(objectModel); FilePartArray filePartArray=(FilePartArray)request.get("uploaded_file"); OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("/your/path/to/file.jpeg"))); // here put filename and where to save it InputStream in = filePartArray.getInputStream(); byte[] buf = new byte[8*1024]; int length; while ((length = in.read(buf)) != -1) out.write(buf,0,length) On Mon, 13 Oct 2003 08:05:14 + Johannes Becker <[EMAIL PROTECTED]> wrote: > Hi, > > I looked at the "FileUploadWithAction" at Wiki > (http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadWithAction). Since I'm > not a good programmer, could anyone tell me how to store the file > permanently on disc? > I found this thread: > http://archives.real-time.com/pipermail/cocoon-users/2003-September/038914.html > Is this what I need? > > Thanks > Jonny > > _ > Schützen Sie Ihren Posteingang vor unerwünschten E-Mails. > http://www.msn.de/antispam Jetzt Hotmail-Junk-Filter aktivieren! > > > - > 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: not working in xsl-file
Which stylesheet processor are you using? I was playing around with Lenya (a CMS based on Cocoon) the other day and they'd made XSLTC the default and it crashed on xsl:includes saying something like "could't get transformer handler...". Replacing XSLTC by Xalan did the job. I didn't go into detail trying to find the problem. Does anybody know whether XSLTC has a problem with/does not support xsl:include's? Stefan On Fri, 24 Oct 2003 20:27:49 + Johannes Becker <[EMAIL PROTECTED]> wrote: > Hi, > > I'm desperatly trying to do an xsl file. > > I'm using: in my xsl-file. > Cocoon does not complain it can't find the file, but the stylesheet > isn't being generated. Any ideas? > > Do I have to tell the sitemap about the included file? If yes, how? > > Jonny > > _ > 5 neue Buddies = 50 FreeSMS. http://messenger-mania.msn.de > Messenger-Mania - FreeSMS und 666 Webcams abräumen mit dem MSN > Messenger! > > > - > 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: Reading and passing parameters in the sitemap
Jan, > have the following problem: I would like to pass the parameter > "gr_name" to the redirect-uri which is used in the pipeline. Use input modules. The RequestParameterModule lets you do exactly that. Just put {request-param:gr_name} into the redirect-uri. (Also see http://wiki.cocoondev.org/Wiki.jsp?page=InputModules) > Furthermore - I would like to pass the path of the saved > file there, are there any possibilities to do this? Would the pass not simply be "e:/cocoon-2.1.2/build/webapp/LetterMan/grafiken/{1}/" as you as parameter to the action? Or maybe "e:/cocoon-2.1.2/build/webapp/LetterMan/grafiken/{1}/{request-param:gr_n ame}" if you want the path+filename. If not, get back to me. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
unittesting flow
Hi, I was wondering if someone has got a hint on how to unittest flow (javaflow in my case, but I guess it'd be the same for any flow). I searched the wiki and the archives without luck. I saw the callFunction-method in SitemapComponentTestcase which looks like what I want, but couldn't get it to work. I have used SitemapComponentTestcase to unittest generators before, so I think I know what I am doing. I created my .xtest-file, added the flow- interpreters role (copied from cocoon.roles) and added a component- instance for JavaInterpreter. Still I get an exception "Could not retrieve interpreter..." when I call callFunction with type "java". Debugging I find that indeed the interpreter-selector doesn't contain the JavaInterpreter. Am I missing something? It'd be great to get a working example of how to use callFunction or at least a short comment on what the parameters are and what needs to be added to .xtest, just to make sure I am not overlooking something. Or if someone has got a different way of unittesting flow I'd be very happy to hear it. I am going to use flow extensively in my project and I want to make sure I can test it properly. HTTP-testing, as has been suggested before on the list, doesn't go deep enough. Thanks a lot for any help! Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]