Re: Move ContentManager to Sling API

2007-10-05 Thread Torgeir Veimo


On 5 Oct 2007, at 15:56, Felix Meschberger wrote:


What do you think of moving the o.a.s.content.ContentManager interface
to the Sling API and provide it through the ComponentRequest  
instead of

having to access a request attribute:

public interface ComponentRequest extends HttpServletRequest {

public ContentManager getContentManager();

}

What do you think ? If feedback is positive, I would also include this
in the Sling API proposal (SLING-28).


Having done some work recently with Day Communique, one of the  
annoying things was that it subclasses HttpServletRequest.


-1

--
Torgeir Veimo
[EMAIL PROTECTED]





Re: Move ContentManager to Sling API

2007-10-05 Thread Torgeir Veimo


On 5 Oct 2007, at 17:30, Felix Meschberger wrote:


Hi Torgeir,

Am Freitag, den 05.10.2007, 17:25 +0100 schrieb Torgeir Veimo:

Having done some work recently with Day Communique, one of the
annoying things was that it subclasses HttpServletRequest.


Can you please elaborate on this ? Because we initially did not extend
HttpServletRequest but found that extending it would make the
implementation much easier in multiple places not the least support  
for

running JSP scripts.


I feel it's cleaner to fetch the manager from some sort of factory  
instance. It wouldn't expose the implementation details of how the  
manager is kept local to the request, nor does it make any dependent  
code reliant on any such implementation details staying stable.


As you say yourself, you now keep the manager as a request-scoped  
attribute, but would like to make a subclass of HttpServletRequest  
include a method to retrieve it. If you used a factory to retrieve  
the manager, that change wouldn't have any impact on any code that  
uses that manager.


The factory method to retrieve the manager could easily take an  
HttpServletRequest as parameter, which would allow you to implement  
it in any way you choose.


--
Torgeir Veimo
[EMAIL PROTECTED]





Re: Move ContentManager to Sling API

2007-10-08 Thread Torgeir Veimo

On Mon, 2007-10-08 at 08:22 +0200, Felix Meschberger wrote:
 Am Freitag, den 05.10.2007, 21:36 +0100 schrieb Torgeir Veimo:
  I feel it's cleaner to fetch the manager from some sort of factory  
  instance. It wouldn't expose the implementation details of how the  
  manager is kept local to the request, nor does it make any dependent  
  code reliant on any such implementation details staying stable.
 
 Well, the implementation in fact is to use a factory to get the
 ContentManager. Look at the ContentResolverFilter class.
 
 But this is different from the question on how we provide the
 ContentManager to components: As the return value of a declared method
 or as a well known request attribute. The first solution locks the
 Component into the API and forces the implementation of the API itself
 into providing a ContentManager object.
 
 The second solution of just having the request attribute makes the
 existence of a ContentManager an implementation detail of the API
 implementation but locks the Component into the API implementation,
 which IMHO is more of a problem than being locked into the API.
 
  As you say yourself, you now keep the manager as a request-scoped  
  attribute, but would like to make a subclass of HttpServletRequest  
  include a method to retrieve it. If you used a factory to retrieve  
  the manager, that change wouldn't have any impact on any code that  
  uses that manager.
 
 The ContentManager is core to Sling - without the ContentManager Sling
 cannot operate because it is used by Sling - the ContentResolver
 implementation to be precise - to resolve paths to Content instances. So
 Sling cares to have the ContentManager handy and just provides it to
 components to manage the Content.
 
 Regarding extending HttpServletRequest: The ComponentRequest interface
 already extends the HttpServletRequest interface, so adding a getter for
 the ContentManager would just add to the ComponentRequest interface.

I have to admit I haven't started working closely with Sling yet, so I
don't have the full overview of the API yet.

My concern for subclassing core interfaces in the servlet API is due to
deployment and testing concerns. If you have an API where you allow
users of the API to rely on there always being subclassed instances of
HttpServletRequest available, then you also lock any deployment
configuration into always providing it. 

With my experience with different servlet containers and deployment
models, one cannot always ensure that specific servlet filters are
handling requests at all times in a given servlet container. Eg. try
getting servlet filters to work 100% of the time for error pages in
tomcat. Thus, I always prefer a mechanism for retrieving manager
instances which do not rely on subclassing HttpServletRequest or
employing filters.

The testing issue is a bit more simple, mainly concerned with making it
easier to test code by using interfaces and classes that can easily be
mocked. HttpServletRequest is not the best in that regard.

-- 
-Tor



Re: [jira] Commented: (SLING-64) Refactor Servlets and Script resolution

2007-10-18 Thread Torgeir Veimo


On 18 Oct 2007, at 07:59, Carsten Ziegeler wrote:


Sorry for trying hard to be a pita :) but again, can we please let all
these discussions take place in the mailing list?
I think it's easy to first discuss a topic in the mailing list and  
then

create a jira which either sums up the discussion or references the
mailing list archives.


Ok, here is my proposal from the Jira issue comment:

How about abstracting this a bit, instead of relying on servlets to  
say themselves if they can handle a request, to use factories, or  
rather, mappers.


A manager would resolve a request to a sling servlet by iterating  
through its configured mappers and stopping once a suitable sling  
servlet is found. If no mapper resolves a servlet, the default sling  
servlet is called.


public interface ServletMapper {
public SlingServlet findServlet(SlingServletRequest request,  
Resource resource) throws Exception;

}

A configuration file would specify the order of the mappers, along  
with any configuration parameters each mapper needs. (A simple  
digester implementation would allow configuration parameters to be  
set using reflection.)


A default mapper which maps to servlets based on url and/or jcr node  
type or resource type can be provided which would be sufficient in  
most cases. For specific needs a sling api user would implement his  
own mapper.


Sitemesh uses a similar setup with great success for decorating web  
pages based on any combination of url patterns, request parameters  
and others. I'm using such a mapper approach successfully in our own  
prototype crm framework.



--
Torgeir Veimo
[EMAIL PROTECTED]





Re: Sling-API

2007-10-29 Thread Torgeir Veimo


On 27 Oct 2007, at 16:42, Felix Meschberger wrote:


Hi,

Am Freitag, den 26.10.2007, 16:38 +0200 schrieb Torgeir Veimo:

Some suggestions:

2. Generalise the Servlet into a sort of View component. The best
analogy is probably Struts' ActionForward class. Wouldn't it be
appropriate to use a JSP as a view component for a Resource? I feel
that having the SlingMainServlet resolve to view components is
duplicating functionality available in the servlet container. A
SlingForward could either be initialised with a resource type,
requesting handling by the appropriate SlingServlet for the resource
type, by a normal path parameter to forward to a JSP decided by the
servlet container, or some other constant to request handling by a
script execution servlet. The above interface would then contain the
method


This is too much overhead and in fact is one of the main concerns I  
have
with Struts. I think the current solution of resolving the request  
to a

Servlet (taking the Resource and other request properties (method,
selectors, extension) into account is appropriate. If the response
should be rendered by another Servlet (be it a normal servlet, be it a
script, or whatever) may be implemented by standard request  
forwarding.


My main concern is that I'm interested in seeing model resolution and  
view resolution separated. I guess with the current framework, model  
resolution is opaque to Sling, and the Resource component represents  
the view.


A better example than in my previous message is a blog. Ideally, the  
model for the blog would be loaded first. Then, depending on the view  
being RSS or normal HTML view, a view resolver would direct to the  
correct Servlet. With the current framework, a single component would  
be needed for both RSS and normal view?



3. Extend the MicroslingRequestContext implementation to resolve a
number of ResourceResolver and ServletResolver from the service
locator. They should be orderly configured, and each one tried until
one actually resolves a Resource / Servlet. This would be needed for
the suggested ServletResolver setup to be easily extended as
suggested above.


I do not think, that this is appropriate for microsling. For the real
Sling we might implement such feature of chained Resource- and
ServletResolvers as actual requirements would raise. On the API  
level, I

would not codify this.


The reason for this is to facilitate overriding the default resolver.  
How would you do that in a situation where you need only a few  
special cases, but otherwise the default behaviour? My preference for  
such cases would be to have it in the API, since it would otherwise  
require using implementation specific coding.


--
Torgeir Veimo
[EMAIL PROTECTED]





Re: Sling-API

2007-10-29 Thread Torgeir Veimo


On 29 Oct 2007, at 14:54, Bertrand Delacretaz wrote:


Hi Torgeir,

On 10/29/07, Torgeir Veimo [EMAIL PROTECTED] wrote:
...2. Generalise the Servlet into a sort of View component.  
The best

analogy is probably Struts' ActionForward class


...My main concern is that I'm interested in seeing model  
resolution and

view resolution separated. I guess with the current framework, model
resolution is opaque to Sling, and the Resource component represents
the view


Not sure what you mean by Resource component. In microsling (which
drives the Sling API redesign), Components are gone, there's only

-The Resource, which represents, in its simplest form, a JCR Node
-The Servlet (or script) which handles the request

So, although MVC does not really apply here, If we want to think in
MVC terms I'd say the Resource is the Model, and the Servlet is the
view (in the case of a GET method), or the controller (in the case of
a POST/PUT/DELETE/unsafe) method.

If we follow this reasoning, you'd handle a POST request by having
microsling call a first controller script that manipulates data, and
forwards to a GET request which calls the view script.

Does that make sense to you? I think working in this way might help
people embrace the REST style, which is IMHO a nice side effect.


Yes I guess the terminology is a bit confusing. A Resource is also  
something used in WebDAV. But I guess the naming issue is done and  
dusted already.


...A better example than in my previous message is a blog.  
Ideally, the

model for the blog would be loaded first. Then, depending on the view
being RSS or normal HTML view, a view resolver would direct to the
correct Servlet. With the current framework, a single component would
be needed for both RSS and normal view?...


If by component you mean a microsling Servlet/Script, then the answer
is no: the request selectors (.rss.xml) or extension (.rss) will cause
a different rendering script to be used.


This is fine for new implementation. What if one need to implement  
legacy services, where the url patterns used are different?


Providing the request selector as the default mechanism is good.  
Having it as the only mechanism is bad.



3. Extend the MicroslingRequestContext implementation to resolve a
number of ResourceResolver and ServletResolver from the service
locator


...The reason for this is to facilitate overriding the default  
resolver.

How would you do that in a situation where you need only a few
special cases, but otherwise the default behaviour?...


I think we all agree on that for Sling, but do we want this in
microsling, and if yes how do we implement that cleanly? The easiest
thing that comes to mind is a composite pattern: as seen from the API,
there's only one ResourceResolver, but internally that
ResourceResolver can use a chain of ResourceResolvers.


Ok, Felix also stated this clearly. My preference would be to have  
only one sling, where OSGi is optional though.


--
Torgeir Veimo
[EMAIL PROTECTED]





Re: [RT] Shall we merge microsling into Sling?

2007-12-17 Thread Torgeir Veimo


On 17 Dec 2007, at 19:33, Bertrand Delacretaz wrote:



I think microsling is now ready to become just a specific
configuration of Sling.

I'm pretty sure we can graft the microsling stuff on Sling as a set of
OSGi bundles, without requiring any OSGi knowledge from beginners, and
keep microsling's ease of use, all of microsling's current features,
and the testable in 15 minutes from scratch requirement.

Empowering users to jump from simple microsling scripted stuff to
full-blown OSGi-based java modules, within the same framework and
webapp, sounds quite exciting to me.

WDYT?



Would this enable microsling to run without any OSGi framework at all?

--
Torgeir Veimo
[EMAIL PROTECTED]





Re: [RT] Shall we merge microsling into Sling?

2007-12-17 Thread Torgeir Veimo


On 17 Dec 2007, at 20:03, Bertrand Delacretaz wrote:

...Would this enable microsling to run without any OSGi framework  
at all?...


No, but as Carsten says in his synchronicity email (we didn't talk
about that off-list before, honest ;-), the Apache Felix OSGi runtime
is quite small, and starts very quickly.



But there are still issues for those that still need to be able to  
deploy into tomcat, if OSGi is required?


--
Torgeir Veimo
[EMAIL PROTECTED]





Re: ujax ponderings

2008-01-22 Thread Torgeir Veimo


On 23 Jan 2008, at 02:39, David Nuescheler wrote:


btw. for generic ujax prototyping i usually use these installers here:
http://dev.day.com/microsling/content/blogs/main/microjax.html
which make things a lot more transparent since there is a jcr
explorer that comes with it...



Note:

Remote Verification. You acknowledge and agree that the Software may  
contain
verification and reporting functionality that allows the remote  
reporting of
your usage of the Software for the purpose of verifying your  
compliance with

these terms and conditions. 

--
Torgeir Veimo
[EMAIL PROTECTED]





Re: Discover Sling in 15 minutes

2008-01-29 Thread Torgeir Veimo


On 29 Jan 2008, at 23:55, Felix Meschberger wrote:


Hi Torgeir,

Sorry for that, I am currently committing SLING-198 fixes. If you  
update

the jcr/resource project now, it should compile.




A few files still missing?

INFO] Compiling 53 source files to /Users/torgeir/java/src/sling/ 
15minutes/sling/sling/core/target/classes
[INFO]  


[INFO] Compilation failure

/Users/torgeir/java/src/sling/15minutes/sling/sling/core/src/main/java/ 
org/apache/sling/core/impl/SlingHttpServletResponseImpl.java:[35,37]  
cannot find symbol

symbol  : class PathResolver
location: package org.apache.sling.jcr.resource

/Users/torgeir/java/src/sling/15minutes/sling/sling/core/src/main/java/ 
org/apache/sling/core/impl/SlingHttpServletResponseImpl.java:[247,8]  
cannot find symbol

symbol  : class PathResolver
location: class org.apache.sling.core.impl.SlingHttpServletResponseImpl

/Users/torgeir/java/src/sling/15minutes/sling/sling/core/src/main/java/ 
org/apache/sling/core/impl/SlingHttpServletResponseImpl.java:[247,73]  
cannot find symbol

symbol  : class PathResolver
location: class org.apache.sling.core.impl.SlingHttpServletResponseImpl


--
Torgeir Veimo
[EMAIL PROTECTED]





Re: Discover Sling in 15 minutes

2008-01-29 Thread Torgeir Veimo


On 29 Jan 2008, at 21:22, Bertrand Delacretaz wrote:


I've started working on this page:

http://cwiki.apache.org/confluence/display/SLING/Discover+Sling+in+15+minutes


When running mvn jetty:run in launchpad/launchpad-webapp I get

[...]
[INFO] [compiler:testCompile]
[INFO] Compiling 29 source files to /Users/torgeir/java/src/sling/ 
15minutes/sling/launchpad/launchpad-webapp/target/test-classes
[INFO]  


[ERROR] BUILD FAILURE
[INFO]  


[INFO] Compilation failure

/Users/torgeir/java/src/sling/15minutes/sling/launchpad/launchpad- 
webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ 
ujax/PostServletDeleteTest.java:[44,75] cannot find symbol

symbol  : variable DEFAULT_CREATE_SUFFIX
location: class org.apache.sling.ujax.UjaxPostServlet

/Users/torgeir/java/src/sling/15minutes/sling/launchpad/launchpad- 
webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ 
ujax/PostServletDeleteTest.java:[45,75] cannot find symbol

symbol  : variable DEFAULT_CREATE_SUFFIX
location: class org.apache.sling.ujax.UjaxPostServlet

--
Torgeir Veimo
[EMAIL PROTECTED]





Re: LDAP user authentication

2008-02-21 Thread Torgeir Veimo


On 21 Feb 2008, at 22:47, Vidar Ramdal wrote:


On 21 Feb 2008, at 22:25, Vidar Ramdal wrote:

Does anyone have a working example of configuring Sling to using an
external LDAP server for authentication?

On 2/21/08, Torgeir Veimo [EMAIL PROTECTED] wrote:

I'd assume this is sort of orthogonal to Sling at the moment?

One option would be to employ something like Spring security or
SecurityFilter with an appropriate LDAP realm impl. This would make
sure all requests would return something sane in the
getUserPrincipal() and isUserInRole() calls. You could then code
accordingly in your Sling components.


I see. But using a servlet filter would not enforce security on the
JCR itself. Perhaps it would be easier to setup Jackrabbit with LDAP,
and then handle authorization issues when Sling connects to
Jackrabbit.



If Jackrabbit actually supported any authorisation.. (I assume you  
know it's planned for JCR 2.0, see also https://issues.apache.org/jira/browse/JCR-1171) 
. You can store ACLs as node children though (we currently do this,  
but we don't enforce security through the AccessManager mechanism  
provided by JCR itself but at a higher level).


My general experience is that many application might need the concept  
of ownership (eg your blog posts are only editable by you), but that  
read permissions are mostly set at world-readable. The concept of  
ownership would be integral to your domain model, and should probably  
be enforces as part of any DAO layer. If you need anything more  
advanced than that, all access to the JCR nodes should go through a  
proper DAO layer, also for reading, which would sort of make it wise  
to use something else than Sling.


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: Sling projects and mentors for GSoC?

2008-03-13 Thread Torgeir Veimo


On 13 Mar 2008, at 13:18, Bertrand Delacretaz wrote:

On Thu, Mar 13, 2008 at 2:08 PM, Torgeir Veimo [EMAIL PROTECTED]  
wrote:


... How about defining a formal remote protocol for JCR instead? ...


Doesn't have to be instead IMHO, that sounds like a totally
different project, isn't it?


...having a defined, formal
protocol to interact with a JCR repository would be ideal. I'm
thinking something similar to webdav but more appropriate for JCR
repositories


Do you mean formalizing/clarifying what Sling does with ujax, etc?

Or rather defining a new protocol, REST-based I assume?

If you're thinking about the latter, I'm not sure if it's in scope for
Sling, that might be more a Jackrabbit project, IMHO.


I was thinking more of in the context of GSoC.

Sling would be an ideal environment to implement a prototype for such  
a protocol.


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: Sling projects and mentors for GSoC?

2008-03-13 Thread Torgeir Veimo


On 13 Mar 2008, at 15:49, Felix Meschberger wrote:



How about defining a formal remote protocol for JCR instead? A JCR
explorer is of course a useful tool, but having a defined, formal
protocol to interact with a JCR repository would be ideal. I'm
thinking something similar to webdav but more appropriate for JCR
repositories.


I am not sure, whether I understand you correctly. Currently the
Jackrabbit protocol has an RMI library, which allows plain-JCR  
remoting

over RMI. In addition there is a simple WebDAV servlet, which allows
filesystem-like access over WebDAV to the repository and there is a  
JCR

WebDAV servlet, which in fact remotes the JCR API over WebDAV using
defined WebDAV functionality such as DASL etc.



The webdav protocol doesn't map fully to the JCR data model. And RMI  
is not really that useful when the client is not a Java client.


But I guess it opens up a lot of questions, I guess. How do you send  
JCR data over the wire? XML or JSON?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: JCR Explorer

2008-04-22 Thread Torgeir Veimo


On 22 Apr 2008, at 18:03, Craig L. Ching wrote:

Well, if someone is going to do extjs, that isn't something I'm  
interested in being involved with.



Slightly unrelated, but still relevant; I thought Apache didn't allow  
GPL'd code in their projects. Has that changed with the GPL version 3?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: Making files referenceable during content loading

2008-07-02 Thread Torgeir Veimo


On 2 Jul 2008, at 12:21, Bryce Ewing wrote:

I understand what he is saying here, but I am curious as to why you  
say CMS in particular?



My guess is that it comes down to flexibility. It's sort of the same  
argument that structure prohibits flexibility. Reference integrity is  
not very often needed, and causes much more headaches down the road.  
Imagine if you couldn't remove an article you created simply because  
some other article someone else created is linked to it.


Maybe you can store the actual UUID in a string instead of using a  
reference? It would be similar to a reference, as it uses the UUID  
internally, just that reference integrity is not maintained if the  
document the UUID belong to is deleted.


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: sling without maven

2008-07-02 Thread Torgeir Veimo


On 27 Jun 2008, at 16:58, Felix Meschberger wrote:

Right, the first step is to have your webapp start an OSGi framework  
instance.



I had a look at the examples here; 
http://felix.apache.org/site/launching-and-embedding-apache-felix.html

The Custom Felix Loader example seems to have an error; It defined the  
configMap twice and references a configProps which is not defined. I  
assume the first definition should be of a Map configProps?


If you look at the Sling launchpad/webapp you see, that the required  
bundles are just added to the WEB-INF/resources/bundles folder and  
picked up from there by the Sling main class which launches the  
Felix framework. You may choose to use this integration, just adapt  
the SlingServlet to your needs or rip out what you need.



I think that would be the easiest approach.

--
Torgeir Veimo
[EMAIL PROTECTED]






combine jsp processing in sling with jsp processing in servlet container?

2008-07-03 Thread Torgeir Veimo
Sling seems to take over all JSP page processing, so JSP pages now  
have to remain in the repository?


What's the easiest way to enable the servlet container to retain  
processing requests which are not handeled by the sling servlet? I  
know it's technically possible to do programmatically with tomcat using


RequestDispatcher disp =  
request.getSession().getServletContext().getNamedDispatcher(default);

disp.forward(request, response);

but it would be nice if this could be done using simple configuration.  
Would be very handy when integrating sling into an existing web  
application which needs to retain JSP processing by the servlet  
container.



--
Torgeir Veimo
[EMAIL PROTECTED]






Re: combine jsp processing in sling with jsp processing in servlet container?

2008-07-04 Thread Torgeir Veimo


On 4 Jul 2008, at 17:25, Bertrand Delacretaz wrote:



The launchpad/webapp web.xml contains this:

   !-- Overwrite Mappings which may be present in default web.xml  
files --

   servlet-mapping
   servlet-namesling/servlet-name
   url-pattern*.jsp/url-pattern
   /servlet-mapping

So maybe removing it would do the trick?



Do the sling servlet handle JSPs residing both in the file system and  
the repository?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: Image rendering (image creation / manipulation)

2008-07-06 Thread Torgeir Veimo


On 7 Jul 2008, at 14:48, Bryce Ewing wrote:

One of the issues I see with this is that it would require the  
imageio and jai libraries to be added somewhere that would then be  
visible to this even though in most cases nobody would use jsp for  
this etc.  Also I don't think this would be that easy for someone  
who doesn't know a reasonable amount about jai and imageio.



Our experience with adding image manipulation capabilities to our  
product has been that JAI is possible to use, but in practise requires  
too much memory and / or is too slow for real usage. You be better off  
writing a wrapper around the convert utility of ImageMagick.


It would be handy to have an open source utility library that would be  
easy to plug into sling, with different backends for image  
manipulation implemented either with JAI or wrappers as described.


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: problem with sling web app under tomcat with other jcr apps

2008-07-16 Thread Torgeir Veimo


On 16 Jul 2008, at 17:25, Carsten Ziegeler wrote:

'm not sure but it could be that you have problems because there are  
two repositories in your installation: the one from your webapp and  
the

other one embedded into Sling.



The only way these could talk across web application would be through  
rmi?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: problem with sling web app under tomcat with other jcr apps

2008-07-16 Thread Torgeir Veimo


On 16 Jul 2008, at 19:41, Torgeir Veimo wrote:



On 16 Jul 2008, at 17:25, Carsten Ziegeler wrote:

'm not sure but it could be that you have problems because there  
are two repositories in your installation: the one from your webapp  
and the

other one embedded into Sling.



The only way these could talk across web application would be  
through rmi?



My point is; I would see an issue if the webapps were merged in some  
ways, but shey should be able to live completely separately otherwise?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: [jira] Created: (SLING-583) Implement a file system resource provider

2008-08-11 Thread Torgeir Veimo


On 25 Jul 2008, at 23:53, Felix Meschberger (JIRA) wrote:

The filesystem resource provider is your friend: Create a  
configuration mapping sling.home into the resource tree and start  
looking at it.



Can someone provide the exact details of what to change in  
sling.properties for this to work? The current value of sling.home is  
defined as


sling.home = sling

Also, is this provider in current trunk?

--
Torgeir Veimo
[EMAIL PROTECTED]






Re: [jira] Created: (SLING-583) Implement a file system resource provider

2008-08-12 Thread Torgeir Veimo


On 12 Aug 2008, at 16:00, Felix Meschberger wrote:

Nothing needs to be changed to the sling.properties file. Just  
create a configuration object with the Provider Root set to the  
location where you want to hook (mount) the filesystem provider in  
the resource tree and set the Filesystem Root to . (just a  
single dot), which is converted to meaning the location of $ 
{sling.home}.



Also, is this provider in current trunk?


The provider is in the trunk at samples/fsresource.



Ok, I found it and tried configuring with eg. provider.roots = test  
and provider.file = .


I still cannot seem to trigger that this one is being used when trying  
to access localhost/sling/test/. Any ideas?



--
Torgeir Veimo
[EMAIL PROTECTED]






Re: [jira] Created: (SLING-583) Implement a file system resource provider

2008-08-12 Thread Torgeir Veimo


On 12 Aug 2008, at 19:43, Felix Meschberger wrote:

Ok, I found it and tried configuring with eg. provider.roots = test  
and provider.file = .
I still cannot seem to trigger that this one is being used when  
trying to access localhost/sling/test/. Any ideas?


Could it be that the provider.roots property must be set with a  
leading slash as in /test ?


I just tested it with the current trunk state of the provider and it  
seems to work just fine.



Ok, I'm obviously doing something wrong..

Starting with a fresh org.apache.sling.launchpad.webapp-4-incubator- 
SNAPSHOT.war (from trunk) deployed as sling.war into a tomcat  
instance. Also deploying FsResourceProvider bundle using mangement  
console.


I notice that in the configuration management dropdown there are two  
instances. Is this correct? (Also, it seems that the name and  
description strings are not being used. I see strings like  
resource.resolver.name, resource.resolver.description,  
provider.file.description etc.)


I try to configure setting providers.roots and provider.file selecting  
save (which seems to save the settings ok). I also try selecting  
create configuration, but this seems to have no effect. Is this my  
problem? I have


Configuration Information
Persistent Identity (PID)   org.apache.sling.fsprovider.FsResourceProvider
Configuration Binding   None


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: [jira] Created: (SLING-583) Implement a file system resource provider

2008-08-12 Thread Torgeir Veimo


On 12 Aug 2008, at 20:30, Felix Meschberger wrote:


Torgeir Veimo schrieb:
Starting with a fresh org.apache.sling.launchpad.webapp-4-incubator- 
SNAPSHOT.war (from trunk) deployed as sling.war into a tomcat  
instance. Also deploying FsResourceProvider bundle using mangement  
console.


ok, freshly built FsResourceProvider from svn-up-ed checkout ?

I notice that in the configuration management dropdown there are  
two instances. Is this correct? (Also, it seems that the name and  
description strings are not being used. I see strings like  
resource.resolver.name, resource.resolver.description,  
provider.file.description etc.)


This sounds like an incompletely built FsResourceProvider bundle.  
The latest trunk state should have real readable labels and  
descriptions.


Macintosh-3:fsresource torgeir$ svn update
At revision 685114.

I built it by running mvn clean install in the samples/fsresource  
directory. I've checked that the resulting jar contains the  
metatype.properties file.


I try to configure setting providers.roots and provider.file  
selecting save (which seems to save the settings ok). I also try  
selecting create configuration, but this seems to have no effect.  
Is this my problem? I have

Configuration Information
Persistent Identity (PID) 
org.apache.sling.fsprovider.FsResourceProvider

Configuration Binding None


This says, that the configuration is not actually used.

Is the FsResourceProvider bundle started ?


Yes. I guess it's the create configuration that fails then. Would the  
cause of this show up in any logs? The settings is stored;


Macintosh-3:fsresource torgeir$ cat ~/java/apache-tomcat-6.0.14/sling/ 
config/org/apache/sling/fsprovider/FsResourceProvider.config

service.pid=org.apache.sling.fsprovider.FsResourceProvider
provider.roots=/test
provider.file=.

I have these entries in my errors.log;

12.08.2008 20:00:08.748 *INFO* [FelixDispatchQueue]  
org.apache.sling.fsresource BundleEvent INSTALLED
12.08.2008 20:00:08.749 *INFO* [FelixDispatchQueue]  
org.apache.sling.fsresource BundleEvent RESOLVED
12.08.2008 20:00:08.751 *INFO* [Background Install /Users/torgeir/java/ 
apache-tomcat-6.0.14/temp/install48384.tmp]  
org.apache.sling.fsresource Servi
ce [org.apache.sling.fsprovider.FsFolderServlet,85] ServiceEvent  
REGISTERED
12.08.2008 20:00:08.752 *INFO* [FelixDispatchQueue]  
org.apache.sling.fsresource BundleEvent STARTED
12.08.2008 20:00:08.753 *INFO* [SCR Component Actor]  
org.apache.sling.fsresource Service  
[org.apache.sling.fsprovider.FsResourceProvider,86] Service

Event REGISTERED
12.08.2008 20:00:08.755 *INFO* [SCR Component Actor]  
org.apache.sling.servlets.resolver Service [ServletResourceProvider  
for Servlets at [/apps/slin

g/fs/folder/GET.servlet],88] ServiceEvent REGISTERED
12.08.2008 20:00:08.755 *INFO* [SCR Component Actor]  
org.apache.sling.fsresource Service  
[org.apache.sling.fsprovider.FsFolderServlet,87] ServiceEve

nt REGISTERED

but nothing that seems to be related to the configuration creation  
request.


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: [jira] Created: (SLING-583) Implement a file system resource provider

2008-08-12 Thread Torgeir Veimo


On 12 Aug 2008, at 21:19, Felix Meschberger wrote:



Ah ! That is the point. The FsResourceProvider is a component  
factory. The configuration you are showing is not one which causes  
FsResourceProvider to activate. If you are using the old (I think  
this is default) 1.0 release of the Felix Web Console, you should  
select the FsResourceProvider configuration and click on Create to  
create a new configuration instance.


I am trying, but nothing is happening..

Alternatively, you may update to the latest Web Console plugin  
snapshot, select the FsResourceProvider configuration factory from  
the lower selection list and create a new instance to configure.


I use sling trunk current. How do I update to the latest web console  
plugin snapshop most easily?


Are there supposed to be two selection lists in the configuration  
management console?


Also, when I create a configuration, shouldn't it appear as an  
additional item in the selection list, with the name of the component  
suffixed with it's uuid?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: [jira] Created: (SLING-583) Implement a file system resource provider

2008-08-12 Thread Torgeir Veimo


On 12 Aug 2008, at 21:43, Felix Meschberger wrote:


Hi,

Torgeir Veimo schrieb:

On 12 Aug 2008, at 21:19, Felix Meschberger wrote:


Ah ! That is the point. The FsResourceProvider is a component  
factory. The configuration you are showing is not one which causes  
FsResourceProvider to activate. If you are using the old (I think  
this is default) 1.0 release of the Felix Web Console, you should  
select the FsResourceProvider configuration and click on Create  
to create a new configuration instance.

I am trying, but nothing is happening..
Alternatively, you may update to the latest Web Console plugin  
snapshot, select the FsResourceProvider configuration factory from  
the lower selection list and create a new instance to configure.
I use sling trunk current. How do I update to the latest web  
console plugin snapshop most easily?


I would say download it from [1] and use the console to install it  
from the bundles page.



Ah! That fixed it. Now I get

Index of /test
Name   Last modified
Size  Description


config/Tue Aug 12 19:57:06 EST 2008   -
felix/ Tue Aug 12 20:00:08 EST 2008   -
jackrabbit/Tue Aug 12 21:55:47 EST 2008   -
logs/  Tue Aug 12 19:57:05 EST 2008   -
sling.properties   Tue Aug 12 21:36:26 EST 2008   4660
when fetching localhost:8080/sling/test/
Is there any way to configure it to map to the actual webapp, or do I  
have to create my own resource provider using something like  
servletContext.getResource() ?


Also, when will this new console make it to sling trunk?

Thank you for your time!

--
Torgeir Veimo
[EMAIL PROTECTED]






Re: How to beginn with Microsling

2008-09-05 Thread Torgeir Veimo


On 5 Sep 2008, at 20:48, tung vu duc wrote:

But i don't still understand how to beginn now. I have successful  
builded sling (the whole from trunk) with maven. what modules of  
whole sling should one need
to have the functionaties of Microsling and how to integrate these  
with a Jackrabbit Repo.



You can take the resulting sling war file and put it into any web  
container, eg tomcat. It contains the jackrabbit jars, and will  
automatically set up a repository, which will be available instantly,  
also via webdav. Then you can immediately put content and scripts into  
sling using eg curl.


Macintosh-3:sling torgeir$ find . -name *.war
./launchpad/testing/target/org.apache.sling.launchpad.testing-4- 
incubator-SNAPSHOT.war
./launchpad/webapp/target/org.apache.sling.launchpad.webapp-4- 
incubator-SNAPSHOT.war


Use the bottom one, and rename it eg. sling.war before adding it to  
tomcat. Your sling instance would then be available at http://localhost:8080/sling/


Check eg with http://localhost:8080/sling/system/console/bundles or  
try http://localhost:8080/sling/index.html


I guess you've already read http://incubator.apache.org/sling/site/discover-sling-in-15-minutes.html 
 ?


--
Torgeir Veimo
[EMAIL PROTECTED]






Re: is there any way to user sling whithout OSGi

2008-09-06 Thread Torgeir Veimo


On 6 Sep 2008, at 16:19, Bertrand Delacretaz wrote:


Replacing the jacrkabbit-server bundle by the jackrabbit-client one,
and configuring that with the repository access parameters, should be
enough for that.



Does that imply RMI?

--
Torgeir Veimo
[EMAIL PROTECTED]






Re: Replacing JcrResourceResolverFactory by a Sling ResourceResolverFactory

2008-11-11 Thread Torgeir Veimo


On 11 Nov 2008, at 23:09, Bertrand Delacretaz wrote:


I tend to agree, and IIUC the various comments in this thread, being
able to mount additional resources (files, rss feeds, you name it), at
least read-only, at the JCR level, would help a lot.



An additional feature would be the possibility to mount various back- 
ends at the same paths, so that if a resource is not found in one back- 
end, the other one is tried. This would be more useful for Sling than  
for JCR though.


--
Torgeir Veimo
[EMAIL PROTECTED]






user management

2008-12-11 Thread Torgeir Veimo
Even though user management will not be part of sling it would be good  
to have a common implementation. So I'm wondering if anyone else is  
working on something here, and / or if this would fit into a sort of  
sling-commons project.


With user management I'm thinking about;

glue between login form page and jcr authenticatio
user node type definitions with most common properties for basic  
users; uid, password,

basic group node types
basic manager for managing users and groups; add/remove/update, change  
group membership.



--
Torgeir Veimo
torg...@pobox.com






Re: Problems Implementing a Custom AccessManager

2008-12-16 Thread Torgeir Veimo


On 17 Dec 2008, at 03:59, Rory Douglas wrote:

As for the AccessManager, I think there are plans to upgrade Sling  
to Jackrabbit 1.5, so it may be more worthwhile to wait for that   
use the repository-ACL-based AccessManager that comes with 1.5  
rather than implementing your own.  Or ping me  I can send you what  
I cobbled together for ACL-based control.



ACLs are not suitable for most web applications. They're declarative,  
while most interactive web applications require implicit or  
application specific security constraints. Sling really needs to allow  
custom AccessManager implementations.



--
Torgeir Veimo
torg...@pobox.com






Re: User identity for event scripts (was: [jira] Created: (SLING-788)...)

2008-12-19 Thread Torgeir Veimo


On 19 Dec 2008, at 23:44, Felix Meschberger wrote:



Really, so then we have be slightly different:

 cron_root
 +--- admin
+ crontab of admin
 +--- xyz
+ crontab of user xyz



If you're sneaking in user management the back way, why not just  
define user directories as people-root/xyz and then define cron  
files to have certain names, or live under people-root/xyz/crontab  
or similar?


User management is standard in most web application these days so it  
will sooner or later find its way into sling in any case.


--
Torgeir Veimo
torg...@pobox.com






json on root node

2008-12-21 Thread Torgeir Veimo
Using http://localhost:8080/.json works, but trying http://localhost:8080/.infinity.json 
 or http://localhost:8080/.1.json gives me an exception and error 500;


org.apache.sling.commons.json.JSONException: Misplaced endArray.
org.apache.sling.commons.json.io.JSONWriter.end(JSONWriter.java:203)
	org.apache.sling.commons.json.io.JSONWriter.endObject(JSONWriter.java: 
237)
	 
org 
.apache 
.sling 
.servlets.get.helpers.JsonResourceWriter.dump(JsonResourceWriter.java: 
128)
	 
org 
.apache 
.sling 
.servlets.get.helpers.JsonResourceWriter.dump(JsonResourceWriter.java: 
78)
	 
org 
.apache 
.sling 
.servlets 
.get.helpers.JsonRendererServlet.doGet(JsonRendererServlet.java:94)
	 
org 
.apache 
.sling 
.api 
.servlets 
.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:262)


How do I fetch child nodes of the root node in json format? This is  
with sling current trunk from last week.


--
Torgeir Veimo
torg...@pobox.com






Re: json on root node

2008-12-23 Thread Torgeir Veimo


On 24 Dec 2008, at 01:43, Bertrand Delacretaz wrote:

On Mon, Dec 22, 2008 at 2:00 AM, Torgeir Veimo torg...@pobox.com  
wrote:

Using http://localhost:8080/.json works, but trying
http://localhost:8080/.infinity.json or http://localhost: 
8080/.1.json gives

me an exception and error 500;...


Fixed, see https://issues.apache.org/jira/browse/SLING-795



Updating to current trunk, I'm still getting the same exception.. Is  
there a way to check runtime that I'm actually running the code from  
the svn revision number given in the above jira issue?


--
Torgeir Veimo
torg...@pobox.com






Re: json on root node

2008-12-24 Thread Torgeir Veimo


On 24 Dec 2008, at 18:58, Carsten Ziegeler wrote:


I've applied a patch in revision 729281 which outputs justa n empty
object in these cases. Could you please test, if it now works for you?



With the latest SVN version, I still get an exception fetching 
http://localhost:8080/.1.json

What is the expected method to retrieve the children of the root node  
in JSON format.

Exception;
org.apache.sling.commons.json.JSONException: Misplaced endArray.
org.apache.sling.commons.json.io.JSONWriter.end(JSONWriter.java:203)
	org.apache.sling.commons.json.io.JSONWriter.endObject(JSONWriter.java: 
237)
	 
org 
.apache 
.sling 
.servlets.get.helpers.JsonResourceWriter.dump(JsonResourceWriter.java: 
128)
	 
org 
.apache 
.sling 
.servlets 
.get 
.helpers.JsonResourceWriter.dumpSingleResource(JsonResourceWriter.java: 
137)
	 
org 
.apache 
.sling 
.servlets.get.helpers.JsonResourceWriter.dump(JsonResourceWriter.java: 
124)
	 
org 
.apache 
.sling 
.servlets.get.helpers.JsonResourceWriter.dump(JsonResourceWriter.java: 
78)
	 
org 
.apache 
.sling 
.servlets 
.get.helpers.JsonRendererServlet.doGet(JsonRendererServlet.java:94)
	 
org 
.apache 
.sling 
.api 
.servlets 
.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:262)

--
Torgeir Veimo
torg...@pobox.com






add node type definitions

2009-01-01 Thread Torgeir Veimo
What is the easiest way to add new node type definitions to a running  
sling instance? Would be handy if it could be done with a suitable  
curl command.


--
Torgeir Veimo
torg...@pobox.com






default node type for webdav collections

2009-01-01 Thread Torgeir Veimo
When mounting the sling webdav servlet in os x finder, creating  
directories result in them having primaryNodetype set to nt:folder.  
The docs indicates that the default type is configured to be  
sling:Folder, but I cannot find this setting when looking in the felix  
console. Do I need to add this configuration myself?


--
Torgeir Veimo
torg...@pobox.com






Re: modify resource bundle jar file

2009-01-01 Thread Torgeir Veimo


On 30 Dec 2008, at 06:40, Felix Meschberger wrote:

(1) To upload with the Maven Sling Plugin: you may build and deploy  
in a

single Maven call:

  $ mvn clean package \
  -Dsling.url=http://localhost:/system/console \
  org.apache.sling:maven-sling-plugin:2.0.2-incubator:install



Where is the sling maven plugin located? maven complains it cannot  
find it in the default repositories.


Will this command update all the deployed sling bundles?

--
Torgeir Veimo
torg...@pobox.com






Re: default node type for webdav collections

2009-01-01 Thread Torgeir Veimo


On 2 Jan 2009, at 00:22, Felix Meschberger wrote:

Functionality to easily configure the node types used is only  
available
with the jcr/webdav bundle as of Rev. 725679 (as per SLING-767).  
Using a

top of trunk build of the module should give you the configuration
option in the felix console Configuration page.

It has IIRC also only recently been implemented, that the default node
type for folders is sling:Folder.


Do you know when? I have sling trunk from a few days ago running.  
Where is the correct way to configure this manually? I had a look at  
the configuration settings for the webdav servlet, but I couldn't find  
any setting for the default node type.


--
Torgeir Veimo
torg...@pobox.com






Re: modify resource bundle jar file

2009-01-01 Thread Torgeir Veimo


On 2 Jan 2009, at 16:04, Torgeir Veimo wrote:



On 30 Dec 2008, at 06:40, Felix Meschberger wrote:

(1) To upload with the Maven Sling Plugin: you may build and deploy  
in a

single Maven call:

 $ mvn clean package \
 -Dsling.url=http://localhost:/system/console \
 org.apache.sling:maven-sling-plugin:2.0.2-incubator:install



Where is the sling maven plugin located? maven complains it cannot  
find it in the default repositories.


It looks like it's running ok if invoked in the launchpad directory.


Will this command update all the deployed sling bundles?



It does not seem to work for the launchpad though. It get the following;

[INFO] /Users/torgeir/java/src/sling/sling/launchpad/webapp/target/ 
org.apache.sling.launchpad.webapp-4-incubator-SNAPSHOT.jar is not an  
OSGi Bundle, not uploading


Is there a way to update the complete launchpad instance in one go?

--
Torgeir Veimo
torg...@pobox.com






script selector when resource has no resourceType property

2009-01-02 Thread Torgeir Veimo
Is it possible to use non-default scripts for resources that have no  
resourceType property?


Also, is it possible to request a script directly, eg. use a request  
such as /apps/notes/html.esp, and make that script execute instead of  
being returned as plaintext?


The document at http://cwiki.apache.org/SLING/url-to-script-resolution.html 
 is desperately lacking in examples..


--
Torgeir Veimo
torg...@pobox.com






Re: script selector when resource has no resourceType property

2009-01-02 Thread Torgeir Veimo


On 2 Jan 2009, at 18:44, Torgeir Veimo wrote:

Is it possible to use non-default scripts for resources that have no  
resourceType property?



According to http://dev.day.com/microsling/content/blogs/main/slingrequestprocessrevisited.html 
, requesting /content/notes.html should end up in executing the  
script /apps/notes/html.esp? It doesn't seem to happen in my setup  
with current sling trunk. (I get a Resource dumped by  
HtmlRendererServlet page).


If the selected resource has no special resource type a script will  
be looked up based on the content path. For example, the script for / 
content/corporate/jobs.html will be searched in /apps/corporate.


That sentence, if still correct, should probably be added to 
http://cwiki.apache.org/SLING/url-to-script-resolution.html

--
Torgeir Veimo
torg...@pobox.com






Re: script selector when resource has no resourceType property

2009-01-02 Thread Torgeir Veimo


On 3 Jan 2009, at 05:07, Felix Meschberger wrote:

If the selected resource has no special resource type a script  
will be

looked up based on the content path. For example, the script for
/content/corporate/jobs.html will be searched in /apps/corporate.


You have to make sure, the Sample Path Based Resource Type Provider
(samples/path-based-rtp) is installed.


Ok, I found the configuration for DefaultResourceTypeProvider.  
However, looking at the source for this component, it seem to be used  
only for node types of type nt:unstructured?


http://svn.apache.org/repos/asf/incubator/sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/DefaultResourceTypeProvider.java


--
Torgeir Veimo
torg...@pobox.com






Re: default node type for webdav collections

2009-01-02 Thread Torgeir Veimo


On 3 Jan 2009, at 04:58, Felix Meschberger wrote:


Torgeir Veimo schrieb:


Do you know when? I have sling trunk from a few days ago running.  
Where


Rev. 725679 dates from the 11. Dec. 2008.


If I take the current sling svn trunk code, do a mvn install in the  
root, then a mvn install in launchpad/webapp, then use the resulting  
war file in the target directory, then I should get the latest sling  
trunk code?



is the correct way to configure this manually? I had a look at the
configuration settings for the webdav servlet, but I couldn't find  
any

setting for the default node type.


The configuration to look for is Simple WebDAV Servlet
(org.apache.sling.jcr.webdav.impl.servlets.SimpleWebDavServlet). This
should provide a whole lot of options. One of which is the Collection
Primary Type option, which defaults to sling:Folder.



The simple webdav servlet configuration only has options for the  
authentication realm and the root path. Am a bit at a loss here..


--
Torgeir Veimo
torg...@pobox.com






Re: default node type for webdav collections

2009-01-03 Thread Torgeir Veimo


On 3 Jan 2009, at 20:35, Bertrand Delacretaz wrote:


Hi,

On Sat, Jan 3, 2009 at 7:09 AM, Torgeir Veimo torg...@pobox.com  
wrote:
...If I take the current sling svn trunk code, do a mvn install in  
the root,
then a mvn install in launchpad/webapp, then use the resulting war  
file in
the target directory, then I should get the latest sling trunk  
code?...


Yes, but the launchpad app and webapp modules do not necessarily use
snapshot versions of all bundles, some dependencies are still on the
released versions of bundles.




Ok, so launchpad != latest trunk. What is the easiest way to run the  
latest modules?



Note that you could also have updated the org.apache.sling.jcr.webdav
bundle manually after starting the launchpad webapp, for example by
building the webapp bundle using

 mvn -P autoInstallBundle clean install -D
sling.url=http://localhost:/system/console



Thank you! running this command in jcr/webdav fixed my problem!

--
Torgeir Veimo
torg...@pobox.com






Re: direct script execution

2009-01-05 Thread Torgeir Veimo


On 6 Jan 2009, at 07:19, Felix Meschberger wrote:


Hi Torgeir,

Torgeir Veimo schrieb:
Is it possible to request a script directly, eg. use a request such  
as

/apps/notes/html.esp, and make that script execute instead of being
returned as plaintext?


This is not currently possible (though the implementation would be
rather simple).

The problem is that we also support WebDAV on / through the Sling
WebDAV bundle. So, for WebDAV we might want to expect the script to be
returned as plaintext to be able to edit and modify it.

I could imagine two options: (1) we add a configuration setting, which
controls whether scripts are executed or not or (2) add a servlet to
handle a special extension, which would execute the script. I would
prefer this second option.



Maybe it could be possible to set a resource type, sling:Script on  
these, to allow execution? They could be edited if accessed through  
the /dav/ prefix.


--
Torgeir Veimo
torg...@pobox.com






Re: [continuum] BUILD FAILURE: Sling - Apache Sling Scripting Core implementation -

2009-01-23 Thread Torgeir Veimo


On 24 Jan 2009, at 02:57, contin...@vmbuild.apache.org wrote:


Online report : 
http://vmbuild.apache.org/continuum/buildResult.action?buildId=139101projectId=759

Build statistics:
State: Failed


I think these emails are only useful to those with commit privileges,  
and not everyone on the list.


--
Torgeir Veimo
torg...@pobox.com






Re: tomcat + JNDI + sling 3

2009-02-12 Thread Torgeir Veimo


On 12 Feb 2009, at 03:27, Tyson Norris wrote:


[...]
However, the templating system (of Magnolia 3.6 - I will mention 4.0  
later) is based on JSPs that must be managed via filesystem  
deployment.



Please let me know if you have comments/suggestions on this approach.


Did you look into the file system provider for Sling? It allows  
resources to be located on disk and thus would allow legacy support  
for JSPs stored as files through slings JSP support.


--
Torgeir Veimo
torg...@pobox.com






Re: SLING-857 patch

2009-02-27 Thread Torgeir Veimo


On 27 Feb 2009, at 16:24, Vidar Ramdal wrote:


As for Torgeir's request [1] for a custom entity resolver, I haven't
had time to look at it for now, but I believe it should be doable.



This would just be a simple dependency injection? Aren't there  
standard ways of doing this in osgi?


--
Torgeir Veimo
torg...@pobox.com






Re: SLING-857 patch

2009-02-27 Thread Torgeir Veimo


On 27 Feb 2009, at 19:44, Torgeir Veimo wrote:



On 27 Feb 2009, at 16:24, Vidar Ramdal wrote:


As for Torgeir's request [1] for a custom entity resolver, I haven't
had time to look at it for now, but I believe it should be doable.



This would just be a simple dependency injection? Aren't there  
standard ways of doing this in osgi?



It's not so much a generic entity resolver that I'm in need of, more a  
way to include files which would also be inside a bundle. But the  
possibility to resolve eg html style entities would be very useful.


--
Torgeir Veimo
torg...@pobox.com






Re: How can I realize authentication in sling?

2009-03-13 Thread Torgeir Veimo


On 12 Mar 2009, at 14:17, Vidar Ramdal wrote:

On Thu, Mar 12, 2009 at 9:55 AM, Alexander Klimetschek aklim...@day.com 
 wrote:

On Thu, Mar 12, 2009 at 9:49 AM, Vidar Ramdal vi...@idium.no wrote:

For the application I'm developing, I have abandoned the ACL concept
alltogether. Instead, I'm implementing my own access management  
logic

from scratch.

I find that in many web applications, a typical ACL concept is not  
the

best solution.


Interesting, could you elaborate? Is this similar to the reasons
mentioned in a presentation by Zed Shaw (
http://dev.day.com/microsling/content/blogs/main/theaclisdead.html )?


That was certainly an interesting watch (especially the stripper  
part).


In my case, it's not that ACLs are too limited. Our access rules are
much simpler than what can be described with ACLs.
And exactly because our rules are simpler, it was just easier to
describe them with a couple of Java classes.


I have to agree, having programmatically security is much more useful  
in a lot of scenarios.


One example is when the security requirements changes. If you have a  
lot of ACLs in a very large repository, it becomes a nightmare to  
change.


It would be very handy to be able to express permission in terms of  
scripts, with an appropriate selector mechanism.



--
Torgeir Veimo
torg...@pobox.com






Re: sling for apachecon site

2009-03-13 Thread Torgeir Veimo


On 13 Mar 2009, at 15:23, David Nuescheler wrote:

i am trying to make it out to apache con europe, but i am not sure  
that i definitely will make it.



Is the informal get-together happening? I seem to recall that there  
wasn't enough people signing up for it.


--
Torgeir Veimo
torg...@pobox.com






Re: JCR Explorer (was: Summer of Code is upon us)

2009-03-19 Thread Torgeir Veimo
 + /;
}
path = path + 
node.label;
}
// append .json to fetch node 
properties in json format
myDataSource.sendRequest(path + 
.json, callback1);
});

tree.draw();

}
return {
init: function() {
buildTree();
}
}
} ();

			YAHOO.util.Event.onDOMReady(YAHOO.example.treeExample.init,  
YAHOO.example.treeExample,true);


YAHOO.util.Event.addListener(window, load, function() 
{

YAHOO.example.XHR_JSON = function() {

var myColumnDefs = [
{key:name, sortable:true, 
resizeable:true},
{key:value, sortable:true, 
resizeable:true}
];

myDataSource = new 
YAHOO.util.DataSource();

myDataSource.responseType = 
YAHOO.util.DataSource.TYPE_JSON;
myDataSource.connXhrMode = 
queueRequests;
myDataSource.responseSchema = {
resultsList: properties,
fields: [ name, value ]
};

	myDataTable = new YAHOO.widget.DataTable(detail, myColumnDefs,  
myDataSource, {scrollable:true, initialRequest:.json});


	// custom handling of data, since json returned contains object  
properties, not array items
	myDataSource.doBeforeParseData = function (oRequest,  
oFullResponse) {

var oNewResponse = ;
for (var j in oFullResponse) {
   		oNewResponse = oNewResponse + '{name:'+j 
+',value:'+oFullResponse[j]+'},\n';

}
	oNewResponse = '({properties:[' + oNewResponse  
+ ']})';

return eval(oNewResponse);
};
var mySuccessHandler = 
function(request, response, payload) {
for (var rate in response) {
alert(YAHOO.lang.dump(rate));
}
this.set(sortedBy, null);

this.onDataReturnAppendRows.apply(this, arguments);
};

var myFailureHandler = function() {
		this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,  
YAHOO.widget.DataTable.CLASS_ERROR);


this.onDataReturnAppendRows.apply(this, arguments);
};

var callbackObj = {
success : mySuccessHandler,
failure : myFailureHandler,
scope : myDataTable
};

return {
oDS: myDataSource,
oDT: myDataTable
};

}();

});

/script


/body
/html

--
Torgeir Veimo
torg...@pobox.com






Re: [POLL] getting rid of scripting (almost)

2009-04-01 Thread Torgeir Veimo
Well I think sling should be changed to work with flat file systems instead
of JCR. Putting data into a typed node tree puts too many constraints on
what data we can put into it.

2009/4/1 Felix Meschberger fmesc...@gmail.com

 Hi,

 Vidar Ramdal schrieb:
  On Wed, Apr 1, 2009 at 10:49 AM, Michael Dürig michael.due...@day.com
 wrote:
 
  +1 if we make Whitespace [1] the primary language for Sling.
 
  [1] http://compsoc.dur.ac.uk/whitespace/
 
  +1
 
  I took a look at Whitespace, and liked it so much that I decided to
  port the entire Sling codebase to it.
 
  I'm sure you will agree, so as soon as I get my svn account, I'll
  start replacing the ugly, old-fashioned Java classes with clean, white
  Whitespace files.

 If you like clean languages you should consider my new Null proposal [1]
 currently being discussed. It is based on the Null programming language.

 Regards
 Felix

 [1] http://wiki.apache.org/incubator/NullProposal




Re: Contrib bundles.

2009-04-17 Thread Torgeir Veimo
We (Sakai Kernel Development Team), are starting to create a number  
of OSGi bundles and services as extensions to Sling.


Can you describe what the functionality of these are and what the  
Sakai project aim to do?


I had a look at http://groups.google.com/group/sakai-kernel/web/why-what-how-k2 
 and it's a bit vague, but it seems to be some sort of community  
software?


--
Torgeir Veimo
torg...@pobox.com






Re: look who's using sling..

2009-04-20 Thread Torgeir Veimo
Sorry false alarm, ipfw was pulling jokes on me...

2009/4/20 Alexander Klimetschek aklim...@day.com

 On Mon, Apr 20, 2009 at 11:22 AM, Torgeir Veimo torg...@netenviron.com
 wrote:
  http://plugins.jquery.com/index.html

 That gives a 404 and I didn't find anything when searching for Sling
 on the jquery site. The site itself seems to be running with Drupal.
 So what do you mean? ;-)

 Regards,
 Alex

 --
 Alexander Klimetschek
 alexander.klimetsc...@day.com




-- 
-Tor


look who's using sling..

2009-04-20 Thread Torgeir Veimo
http://plugins.jquery.com/index.html

-- 
-Tor


Re: Security in Sling

2009-04-22 Thread Torgeir Veimo
The servlet container usually have default security policies defined, which
can easily be changed. Eg for tomcat, look at conf/catalina.policy.
Am not sure what facilities ogsi containers provide in this area though?

2009/4/22 Jukka Zitting jukka.zitt...@gmail.com

 Hi,

 I was thinking about the implications of giving a user write access to
 a subtree of the repository. With that access the user could now
 upload a new script and create a node that invokes that script when
 rendered.

 What if the script contains something like System.exit(1)? Or
 something even more malicious?

 Do we have mechanisms for preventing attack scenarios like that?

 BR,

 Jukka Zitting




-- 
-Tor


Re: [VOTE] Graduate Apache Sling as a top level project

2009-05-18 Thread Torgeir Veimo
+1

-- 
-Tor


Re: Proxying Resoruces

2009-05-25 Thread Torgeir Veimo
2009/5/25 Felix Meschberger fmesc...@gmail.com:

  * external redirects (hard coded support for regular expressions)

Slightly unrelated, how would you go about accessing data in an
external JCR repository? I assume some sort of proxy resource provider
would be necessary?

Eg. having user data stored in a separate JCR repository.

-- 
-Tor


Re: Moving rewriter to contrib

2009-06-09 Thread Torgeir Veimo
2009/6/9 Carsten Ziegeler cziege...@apache.org:
 I've added a new bundle in our whiteboard: the rewriter.
 The rewriter bundle allows to rewrite the output from Sling. It is
 possible to configure a pipeline (based on SAX events) which processes
 the whole output.
 This pipeline can be used for various use cases, like checking the links
 in the content, adding stuff, using xslt to generate different output etc.

 I'm planning to move this from the whiteboard to the contrib section.
 If noone objects, I'll do this in the next days.

Could it possibly be used to allow page decoration by configuration?
Eg. add a header / footer to all pages at url /a/b/c?

-- 
-Tor


Re: GWT Tests with Sling

2009-06-25 Thread Torgeir Veimo
 I'm in the development team of a new CMS which is based on Sling.

It seems there are several that are doing this, basing their admin
console on GWT. There might be an opportunity to put together an open
source project here around this, since there would otherwise be a lot
of duplicate effort, and I don't think there's much competitive
advantage in having a proprietary admin console for an open source
cms.

-- 
-Tor


Re: GWT Tests with Sling

2009-06-25 Thread Torgeir Veimo
2009/6/26 Felix Meschberger fmesc...@gmail.com:
 Hi,

 Torgeir Veimo schrieb:
 I'm in the development team of a new CMS which is based on Sling.

 It seems there are several that are doing this, basing their admin
 console on GWT. There might be an opportunity to put together an open
 source project here around this, since there would otherwise be a lot
 of duplicate effort, and I don't think there's much competitive
 advantage in having a proprietary admin console for an open source
 cms.

 What do you mean by admin console ? If you have something like the
 Felix Web Console [1] in mind, there is already such a beast, which is
 being actively developed.

 Otherwise, I would be eager to hear your requirements and to discuss,
 whether we could use the Web Console for your requirements or whether
 another console is required.

No I was of course thinking about content editors. The admin console
is an umbrella term we use internally here to mean those things.

-- 
-Tor


Re: GWT Tests with Sling

2009-06-25 Thread Torgeir Veimo
2009/6/26 Felix Meschberger fmesc...@gmail.com:
 Hi,

 Torgeir Veimo schrieb:
 2009/6/26 Felix Meschberger fmesc...@gmail.com:
 Hi,

 Torgeir Veimo schrieb:
 I'm in the development team of a new CMS which is based on Sling.
 It seems there are several that are doing this, basing their admin
 console on GWT. There might be an opportunity to put together an open
 source project here around this, since there would otherwise be a lot
 of duplicate effort, and I don't think there's much competitive
 advantage in having a proprietary admin console for an open source
 cms.
 What do you mean by admin console ? If you have something like the
 Felix Web Console [1] in mind, there is already such a beast, which is
 being actively developed.

 Otherwise, I would be eager to hear your requirements and to discuss,
 whether we could use the Web Console for your requirements or whether
 another console is required.

 No I was of course thinking about content editors. The admin console
 is an umbrella term we use internally here to mean those things.

 Thanks for the clarification.

 In this case, I would assume, that the Sling project is probably a good
 candidate to be such an open-source project.

Even GWT based content editors? It would drag in a number of
dependencies, not all of them apache licensed.

-- 
-Tor


[jira] Commented: (SLING-795) JSON dump of / children fails due to /system synthetic resource

2008-12-27 Thread Torgeir Veimo (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12659331#action_12659331
 ] 

Torgeir Veimo commented on SLING-795:
-

http://localhost:8080/.1.json still fails with the same exception with current 
trunk, rev 729624 using the launchpad war.

 JSON dump of / children fails due to /system synthetic resource
 ---

 Key: SLING-795
 URL: https://issues.apache.org/jira/browse/SLING-795
 Project: Sling
  Issue Type: Bug
  Components: Servlets Get
Reporter: Bertrand Delacretaz
Assignee: Bertrand Delacretaz
Priority: Minor
 Fix For: Servlets Get 2.0.4


 Requesting http://localhost:8080/.1.json for example fails with 
 org.apache.sling.commons.json.JSONException: Misplaced endArray

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (SLING-857) Support XSL transformations when importing XML for initial-content

2009-02-24 Thread Torgeir Veimo (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12676298#action_12676298
 ] 

Torgeir Veimo commented on SLING-857:
-

It would be handy to be able to specify a custom entity resolver as well. Any 
chance to get that incorporated?

 Support XSL transformations when importing XML for initial-content
 --

 Key: SLING-857
 URL: https://issues.apache.org/jira/browse/SLING-857
 Project: Sling
  Issue Type: New Feature
  Components: JCR Contentloader
Reporter: Vidar S. Ramdal
Assignee: Felix Meschberger
Priority: Minor
 Fix For: JCR Contentloader 2.0.4

 Attachments: SLING-857.diff


 As described at http://markmail.org/thread/qxi6qw77vgymrdim
 Implementing support for XSL transformations while loading initial-content 
 XML, by looking for the xml-stylesheet processing instruction.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.