[c3] cocoon-all

2011-10-29 Thread Thorsten Scherler
Hi all, 

I noticed that all recent new modules have not been added to cocoon-all.
Should I sync the the pom?

salu2
-- 
Thorsten Scherler 
codeBusters S.L. - web based systems

http://www.codebusters.es/



Re: Piwi to join the ASF?

2011-10-29 Thread Thorsten Scherler
On Sat, 2011-10-29 at 13:55 +0200, Christian Grobmeier wrote:
> Hello all,
> we, the maintainers of the Piwi Framework are currently discussing if
> we move to the ASF.http://code.google.com/a/apache-extras.org/p/piwi/?redir=1
> Piwi is an xml/xslt transformation framework in PHP. The reason I
> write to this list is because Piwi has stolen many things from Cocoon
> :-) We are speaking of Generators, Pipelines, Transformers,
> Serializers etc. As you can imagine, Piwi is some kind of PHP
> implementation of Cocoon. Due to the different nature of PHP we differ
> on various places from Cocoon. But after all you can say, if you
> manage to work with Cocoon, you have a good chance to understand Piwi
> very quickly.
> Therefore it might make sense to run Piwi as some kind of Cocoon subproject.
> 
> Piwis goal is to create web applications quickly (as so many frameworks).
> 
> One of the problems we currently are facing is community. Piwi has
> only a small community, users know each one face to face. There are
> many strong frameworks out there, like the Zend MVC. This might be a
> problem Zeta Components is facing too (another ASF project).
> 
> Now I am an ASF committer and member, working on various projects
> (including the incubator). For me it makes perfect sense to move the
> project to the incubator and start building up a community. Other
> projects like Zeta Components and log4php might benefit from it.
> Anyway, to make this happen we need help. We are only two guys and
> therefore we are looking for other Apache Committers who are
> interested in stepping up as initial committers, mentors, champion.
> Please shout, if you are interested or let me know what you think abou it
> 
> Cheers,Christian

Hi Christian,

I can remember http://markmail.org/thread/g3gddotmzdwdc6v5 and
especially Davids answer http://markmail.org/message/ujr7jrvmgddwcmmc
ATM IMO substitute forrest with cocoon and you would have an answer.

Do not get me wrong but I am not sure whether similarity in concepts
justify being subproject of cocoon. Regarding the community I do not
think that being subproject of cocoon would help with that neither. 

salu2
-- 
Thorsten Scherler 
codeBusters S.L. - web based systems

http://www.codebusters.es/



[c3] bug in "controller-aware-string-template"? (was Re: svn commit: r1195029 )

2011-10-29 Thread Thorsten Scherler
On Sat, 2011-10-29 at 20:49 +, thors...@apache.org wrote:
> Propchange: cocoon/cocoon3/trunk/cocoon-shiro/rcl.properties
> --
> svn:eol-style = native
> 
> Added:
> cocoon/cocoon3/trunk/cocoon-shiro/src/main/java/org/apache/cocoon/shiro/rest/AbstractShiroLogin.java
> URL:
> http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-shiro/src/main/java/org/apache/cocoon/shiro/rest/AbstractShiroLogin.java?rev=1195029&view=auto
> ==
> ---
> cocoon/cocoon3/trunk/cocoon-shiro/src/main/java/org/apache/cocoon/shiro/rest/AbstractShiroLogin.java
>  (added)
> +++
> cocoon/cocoon3/trunk/cocoon-shiro/src/main/java/org/apache/cocoon/shiro/rest/AbstractShiroLogin.java
>  Sat Oct 29 20:49:09 2011
> @@ -0,0 +1,113 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + */
> +package org.apache.cocoon.shiro.rest;
> +
> +import java.util.HashMap;
> +import java.util.Map;
> +
> +import org.apache.cocoon.rest.controller.annotation.RESTController;
> +import org.apache.cocoon.rest.controller.annotation.RequestParameter;
> +import org.apache.cocoon.rest.controller.method.Get;
> +import org.apache.cocoon.rest.controller.method.Post;
> +import org.apache.cocoon.rest.controller.response.RedirectResponse;
> +import org.apache.cocoon.rest.controller.response.RestResponse;
> +import org.apache.cocoon.rest.controller.response.URLResponse;
> +import org.apache.commons.lang3.StringUtils;
> +import org.apache.shiro.SecurityUtils;
> +import org.apache.shiro.authc.IncorrectCredentialsException;
> +import org.apache.shiro.authc.UnknownAccountException;
> +import org.apache.shiro.authc.UsernamePasswordToken;
> +import org.apache.shiro.session.Session;
> +import org.apache.shiro.subject.Subject;
> +import org.apache.shiro.web.util.SavedRequest;
> +import org.apache.shiro.web.util.WebUtils;
> +import org.slf4j.Logger;
> +import org.slf4j.LoggerFactory;
> +
> +@RESTController
> +public abstract class AbstractShiroLogin implements Post, Get{
> +
> +protected abstract String getErrorLogin() ;
> +protected abstract String getDefaultTo();
> +protected abstract String getLoginPage() ;
> +
> +@RequestParameter
> +private String username;
> +@RequestParameter
> +private String password;
> +@RequestParameter
> +protected String to;
> +protected static final Logger LOG =
> LoggerFactory.getLogger(AbstractShiroLogin.class);
> +
> +public RestResponse doPost() throws Exception {
> +// create a UsernamePasswordToken using the
> +// username and password provided by the user
> +UsernamePasswordToken token = new
> UsernamePasswordToken(username,
> +password);
> +Subject subject = SecurityUtils.getSubject();
> +boolean error = true;
> +try {
> +subject.login(token);
> +error = false;
> +} catch (UnknownAccountException ex) {
> +LOG.error("UnknownAccountException", ex);
> +} catch (IncorrectCredentialsException ex) {
> +// password provided did not match password found in
> database
> +// for the username provided
> +LOG.error("IncorrectCredentialsException", ex);
> +} catch (Exception e) {
> +LOG.error("Exception", e);
> +} finally {
> +token.clear();
> +}
> +// clear the information stored in the token
> +if (error) {
> +Map data = new HashMap();
> +data.put("error", true);
> +data.put("to", getTo());
> +return new URLResponse(getErrorLogin(), data);
> +} else {
> +return new RedirectResponse(getTo());
> +}
> +}
> +
> +public RestResponse doGet() throws Exception {
> +Subject subject = SecurityUtils.getSubject();
> +Session session = subject.getSession();
> +SavedRequest savedRequest = (SavedRequest) session
> +.getAttribute(WebUtils.SAVED_REQUEST_KEY);
> +if (null != savedRequest) {
> +to = savedRequest.get

[c3] Cocoob-shiro + sample

2011-10-29 Thread Thorsten Scherler
Hi all, 

I just committed the integration of apache shiro into c3.
http://svn.apache.org/viewvc?rev=1195029&view=rev

You need to do an svn up and build as always and then
cd cocoon-shiro-sample
mvn jetty:run

Browse to localhost:/ and give it a try.

enjoy!

salu2
-- 
Thorsten Scherler 
codeBusters S.L. - web based systems


Tel.: +34 954 520 169
http://www.codebusters.es/



[jira] [Commented] (COCOON3-77) Text and JSON serializers

2011-10-29 Thread Thorsten Scherler (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/COCOON3-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139376#comment-13139376
 ] 

Thorsten Scherler commented on COCOON3-77:
--

Andre can you prepare a svn diff since I am really keen to apply this patch.

> Text and JSON serializers
> -
>
> Key: COCOON3-77
> URL: https://issues.apache.org/jira/browse/COCOON3-77
> Project: Cocoon 3
>  Issue Type: Improvement
>  Components: cocoon-optional
>Affects Versions: 3.0.0-alpha-3
>Reporter: Andre Juffer
>Priority: Minor
> Attachments: EncodingJsonSerializer.java, 
> EncodingTextSerializer.java, JsonSerializer.java, TextEncoder.java, 
> TextSerializer.java, pom.xml, tribc-cocoon-3.xml
>
>
> Serveral classes have been created for serializing text and JSON in the 
> sitemap. The JsonSerializer also checks whether the JSON text actually is 
> valid. The organization of the classes follows the encoding serializers (such 
> as the EncodingHTMLSerializer).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[c3] sitemapNode setParameters( Map) ? (was Re: [c3] Implementing presentation logic in c3)

2011-10-29 Thread Thorsten Scherler
On Sat, 2011-10-29 at 16:39 +0200, Francesco Chicchiriccò wrote:
> On 28/10/2011 12:58, Thorsten Scherler wrote:
> > [...]
> Finally, I've also made a fix for passing non-String parameters to ST, 
> so $if$ is actually doing its job (take a look at cocoon-stringtemplate 
> unit tests): unfortunately, this does not seem to work for sitemap, so I 
> preferred not to update StringTemplate samples in cocoon-sample.
> 
> Can anyone confirm (and possibly point out where to look, in case) that 
> sitemap parameters are always cast to String?

/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/InvocationImpl.java

resolveParameter(String){
...
 return result.toString();
}

I am not sure if we can change
org.apache.cocoon.sitemap.node.SitemapNode but in that interface we
define:
 void setParameters(Map parameters);
I reckon Map would the one we are looking for.

WDYT?

salu2
-- 
Thorsten Scherler 
codeBusters S.L. - web based systems

http://www.codebusters.es/



Re: [c3] Implementing presentation logic in c3

2011-10-29 Thread Thorsten Scherler
On Sat, 2011-10-29 at 16:39 +0200, Francesco Chicchiriccò wrote:
> On 28/10/2011 12:58, Thorsten Scherler wrote:
> > [...]
> > I patched only the transformer, here my observation:
> > - the attribute approach works fine.
> > - the second one cuts of element generation from that point on.
> >
> > it is a start. ;)
> 
> I've just committed an update to StringTemplateTransformer, now using 
> StringTemplateGenerator's commodities - i.e. taking the whole document 
> as input: as said before, this was the same approach taken for JX 
> generator / transformer; moreover, ST requires a plain String as input 
> and does not provide any SAX-related features for rendering.
> This means that everything managed by StringTemplateGenerator is now 
> managed in the same way by StringTemplateTransformer (including XML 
> attributes, working in both).
> 

Nice. I will give it a go ASAP.

slu2
-- 
Thorsten Scherler 
codeBusters S.L. - web based systems

http://www.codebusters.es/



Re: [c3] Implementing presentation logic in c3

2011-10-29 Thread Francesco Chicchiriccò

On 28/10/2011 12:58, Thorsten Scherler wrote:

[...]
I patched only the transformer, here my observation:
- the attribute approach works fine.
- the second one cuts of element generation from that point on.

it is a start. ;)


I've just committed an update to StringTemplateTransformer, now using 
StringTemplateGenerator's commodities - i.e. taking the whole document 
as input: as said before, this was the same approach taken for JX 
generator / transformer; moreover, ST requires a plain String as input 
and does not provide any SAX-related features for rendering.
This means that everything managed by StringTemplateGenerator is now 
managed in the same way by StringTemplateTransformer (including XML 
attributes, working in both).


Finally, I've also made a fix for passing non-String parameters to ST, 
so $if$ is actually doing its job (take a look at cocoon-stringtemplate 
unit tests): unfortunately, this does not seem to work for sitemap, so I 
preferred not to update StringTemplate samples in cocoon-sample.


Can anyone confirm (and possibly point out where to look, in case) that 
sitemap parameters are always cast to String?


Regards.

--
Francesco Chicchiriccò

Apache Cocoon Committer and PMC Member
http://people.apache.org/~ilgrosso/



Piwi to join the ASF?

2011-10-29 Thread Christian Grobmeier
Hello all,
we, the maintainers of the Piwi Framework are currently discussing if
we move to the ASF.http://code.google.com/a/apache-extras.org/p/piwi/?redir=1
Piwi is an xml/xslt transformation framework in PHP. The reason I
write to this list is because Piwi has stolen many things from Cocoon
:-) We are speaking of Generators, Pipelines, Transformers,
Serializers etc. As you can imagine, Piwi is some kind of PHP
implementation of Cocoon. Due to the different nature of PHP we differ
on various places from Cocoon. But after all you can say, if you
manage to work with Cocoon, you have a good chance to understand Piwi
very quickly.
Therefore it might make sense to run Piwi as some kind of Cocoon subproject.

Piwis goal is to create web applications quickly (as so many frameworks).

One of the problems we currently are facing is community. Piwi has
only a small community, users know each one face to face. There are
many strong frameworks out there, like the Zend MVC. This might be a
problem Zeta Components is facing too (another ASF project).

Now I am an ASF committer and member, working on various projects
(including the incubator). For me it makes perfect sense to move the
project to the incubator and start building up a community. Other
projects like Zeta Components and log4php might benefit from it.
Anyway, to make this happen we need help. We are only two guys and
therefore we are looking for other Apache Committers who are
interested in stepping up as initial committers, mentors, champion.
Please shout, if you are interested or let me know what you think abou it

Cheers,Christian
-- 
http://www.grobmeier.de


Re: [c3] New module cocoon-shiro

2011-10-29 Thread Simone Tripodi
Hi Thorsten,
I think that it would be a great add-on. +1 to add that module, have a nice job!
Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Fri, Oct 28, 2011 at 11:20 AM, Thorsten Scherler  wrote:
> Hi all,
>
> is there an interest of the community to have a cocoon-shiro module?
>
> I could extract the integration code to an official c3 module that I
> have done so far since it is pretty generic, but only if there is some
> interest from the community.
>
> salu2
> --
> Thorsten Scherler 
> codeBusters S.L. - web based systems
> 
> http://www.codebusters.es/
>
>