Re: GWT Tests with Sling
2009/6/26 Felix Meschberger : > Hi, > > Torgeir Veimo schrieb: >> 2009/6/26 Felix Meschberger : >>> 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
Re: GWT Tests with Sling
2009/6/26 Felix Meschberger : > 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
>> 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: Moving rewriter to contrib
2009/6/9 Carsten Ziegeler : > 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: Proxying Resoruces
2009/5/25 Felix Meschberger : > * 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: [VOTE] Graduate Apache Sling as a top level project
+1 -- -Tor
Re: Security in Sling
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 > 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: look who's using sling..
Sorry false alarm, ipfw was pulling jokes on me... 2009/4/20 Alexander Klimetschek > On Mon, Apr 20, 2009 at 11:22 AM, Torgeir Veimo > 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..
http://plugins.jquery.com/index.html -- -Tor
Re: Contrib bundles.
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: [POLL] getting rid of scripting (almost)
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 > Hi, > > Vidar Ramdal schrieb: > > On Wed, Apr 1, 2009 at 10:49 AM, Michael Dürig > 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: JCR Explorer (was: Summer of Code is upon us)
null); this.onDataReturnReplaceRows.apply(this, arguments); }; var callback1 = { success : myCallback, failure : myCallback, scope : myDataTable }; // construct path for node var path = "/"; if (node.depth > 0) { for (var i = 1, j = node.depth; i < j; i++) { path = path + node.getAncestor(i).label + "/"; } path = path + node.label; } // append .json to fetch node properties in json format myDataSource.sendRequest(path + ".json", callback1); }); tree.draw(); } return { init: function() { buildTree(); } } } (); </pre><tt> YAHOO.util.Event.onDOMReady(YAHOO.example.treeExample.init, </tt><tt>YAHOO.example.treeExample,true); </tt><pre style="margin: 0em;"> 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" ] }; </pre><tt> myDataTable = new YAHOO.widget.DataTable("detail", myColumnDefs, </tt><tt>myDataSource, {scrollable:true, initialRequest:".json"}); </tt><pre style="margin: 0em;"> </pre><tt> // custom handling of data, since json returned contains object </tt><tt>properties, not array items </tt><tt> myDataSource.doBeforeParseData = function (oRequest, </tt><tt>oFullResponse) { </tt><pre style="margin: 0em;"> var oNewResponse = ""; for (var j in oFullResponse) { </pre><tt> oNewResponse = oNewResponse + '{"name":"'+j </tt><tt>+'","value":"'+oFullResponse[j]+'"},\n'; </tt><pre style="margin: 0em;"> } </pre><tt> oNewResponse = '({"properties":[' + oNewResponse </tt><tt>+ ']})'; </tt><pre style="margin: 0em;"> 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() { </pre><tt> this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, </tt><tt>YAHOO.widget.DataTable.CLASS_ERROR); </tt><pre style="margin: 0em;"> this.onDataReturnAppendRows.apply(this, arguments); }; var callbackObj = { success : mySuccessHandler, failure : myFailureHandler, scope : myDataTable }; return { oDS: myDataSource, oDT: myDataTable }; }(); }); -- Torgeir Veimo torg...@pobox.com
Re: sling for apachecon site
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: How can I realize authentication in sling?
On 12 Mar 2009, at 14:17, Vidar Ramdal wrote: On Thu, Mar 12, 2009 at 9:55 AM, Alexander Klimetschek > wrote: On Thu, Mar 12, 2009 at 9:49 AM, Vidar Ramdal 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-857 patch
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: SLING-857 patch
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
[jira] Commented: (SLING-857) Support XSL transformations when importing XML for initial-content
[ https://issues.apache.org/jira/browse/SLING-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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.
Re: tomcat + JNDI + sling 3
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: [continuum] BUILD FAILURE: Sling - Apache Sling Scripting Core implementation -
On 24 Jan 2009, at 02:57, contin...@vmbuild.apache.org wrote: Online report : http://vmbuild.apache.org/continuum/buildResult.action?buildId=139101&projectId=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: Since sling is support ing for jackrabbit 1.5 why doesn't providehttp api for user manager?
On 9 Jan 2009, at 03:00, Rory Douglas wrote: Actually, if you need to, it's simple to access the "security" workspace (if you have the admin credentials): [...] Having SlingRequest implement getRemoteUser(), getUserPrincipal() and isUserInRole() would help a lot. -- Torgeir Veimo torg...@pobox.com
Re: script selector when resource has no resourceType property
On 7 Jan 2009, at 22:25, Felix Meschberger wrote: * otherwise use primary node type Shouldn't node type determination be scriptable like other things in sling? -- Torgeir Veimo torg...@pobox.com
Re: direct script execution
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
direct script execution
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? -- Torgeir Veimo torg...@pobox.com
Re: default node type for webdav collections
On 3 Jan 2009, at 20:35, Bertrand Delacretaz wrote: Hi, On Sat, Jan 3, 2009 at 7:09 AM, Torgeir Veimo 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: default node type for webdav collections
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: script selector when resource has no resourceType property
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: script selector when resource has no resourceType property
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
script selector when resource has no resourceType property
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: modify resource bundle jar file
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
Re: default node type for webdav collections
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
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
default node type for webdav collections
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
add node type definitions
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
[jira] Commented: (SLING-795) JSON dump of / children fails due to /system synthetic resource
[ https://issues.apache.org/jira/browse/SLING-795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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.
Re: json on root node
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
Re: json on root node
On 24 Dec 2008, at 01:43, Bertrand Delacretaz wrote: On Mon, Dec 22, 2008 at 2:00 AM, Torgeir Veimo 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
json on root node
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: User identity for event scripts (was: [jira] Created: (SLING-788)...)
On 19 Dec 2008, at 23:44, Felix Meschberger wrote: Really, so then we have be slightly different: +--- 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 /xyz and then define cron files to have certain names, or live under /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
Re: Problems Implementing a Custom AccessManager
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
user management
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: Replacing JcrResourceResolverFactory by a Sling ResourceResolverFactory
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]
Re: using sling w jackrabbit client
On 22 Oct 2008, at 10:01, Felix Meschberger wrote: I do not exactly understand, where you are heading ;-) Are you trying to access an existing repository instance registered in a JNDI context ? No. Or are you trying to create a repository instance which you want to register in a JNDI context ? Yes. I already got it working. I was initially confused wrt java: prefix and the read-only context as defined in the j2ee specs. It's only an interim solution until more of our application itself is OSGi based. -- Torgeir Veimo [EMAIL PROTECTED]
using sling w jackrabbit client
I'm trying to use sling with a different repository than the default one, which is proving a bit of a challenge. Since we distribute the repository.xml file within the webapp itself, we cannot configure the repository using standard model 2 configuration with jndi Resource and ResourceParam, since it only allows repository.xml to be read from disk. If I try to set up and register a repository in jndi I get an exception javax.naming.NamingException: Context is read only The normal RegistryHelper.registerRepository() method in jackrabbit gives the same result. It appears that adding stuff to the jndi configuration runtime is not allowed per J2EE spec. Does anyone know any workaround for this? It seems that using Sling with a non-standard repository is only available over RMI unless the repository is configured with a repository.xml file living in the file system. -- Torgeir Veimo [EMAIL PROTECTED]
sling home directory
Is there a simple way to configure the sling home directory to be something like sling/${contextName} where ${contextName} is the same as the contextPath the sling webapp is running under, in a multi webapp setup? This would make it easier to run multiple sling installations under the same web container. -- Torgeir Veimo [EMAIL PROTECTED]
Re: is there any way to user sling whithout OSGi
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: is there any way to user sling whithout OSGi
On 6 Sep 2008, at 08:55, tung vu duc wrote: Hi cool Day Software developers, Am answering as a mere user, not related to Day.. how to use sling whithout OSGi (without Felix). This will be hard. I'd figure it would be easier to leave felix in, it's not too large. I think, the most developers, who would like to use sling, will integrate it into their own web app but do't use sling alone, whithout a server-side web framwork. For a normal web app is sling with Felix too heavy and complex. It's certainly possible to integrate into an existing webapp. You can extract the guts of the war file and embed into yours. The issue I think it to get a resource provider set up that can serve resources from the webapp, in addition to the sling repository, this would allow JSP files to reside in their usual places in your legacy applications WAR file. A file system resource provider has already been implemented and is in the samples directory of the sling source. I believe this can be modified to use the servlet context getResource() method instead of using the filesystem directly. Search the mailing list for SLING-583 to see some discussion on this topic and how to set up. Secondly, sling can be set up to use an existing repository, there was some hints provided on the mailing list, but I don't remember the subject lines. Searching the mailing list should give some pointers. -- Torgeir Veimo [EMAIL PROTECTED]
Re: How to beginn with Microsling
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: [jira] Created: (SLING-583) Implement a file system resource provider
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: [jira] Created: (SLING-583) Implement a file system resource provider
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
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
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
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
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: problem with sling web app under tomcat with other jcr apps
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: problem with sling web app under tomcat with other jcr apps
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]
problem with sling web app under tomcat with other jcr apps
Deploying a sling web application into tomcat where there are other application running using a local JCR repository seems to cause tomcat to be unable to cleanly shut down. Am suspecting there might be some class loader issue here. Any clues? The other JCR application has it's own jackrabbit libraries in WEB-INF/ lib, and a custom repository.xml file in WEB-INF with the repository configured using TransientRepository. I could possibly try running tomcat in an profiler, but what exactly should I look for? -- Torgeir Veimo [EMAIL PROTECTED]
Re: Image rendering (image creation / manipulation)
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: combine jsp processing in sling with jsp processing in servlet container?
On 4 Jul 2008, at 18:24, Bertrand Delacretaz wrote: On Fri, Jul 4, 2008 at 9:30 AM, Torgeir Veimo <[EMAIL PROTECTED]> wrote: ...Do the sling servlet handle JSPs residing both in the file system and the repository?... No, all Sling script engines look for scripts in the repository only. To change this you'd have to modify or replace the SlingServletResolver class. That was my assumption. We have a legacy application with a number of JSPs present. It would be handy if the servlet containers JSP servlet could resume processing if a URL was not handled by the sling servlet. I'm not yet too familiar with the sling resolver framework to know if it could be implemented by it. -- Torgeir Veimo [EMAIL PROTECTED]
Re: combine jsp processing in sling with jsp processing in servlet container?
On 4 Jul 2008, at 17:25, Bertrand Delacretaz wrote: The launchpad/webapp web.xml contains this: sling *.jsp 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]
combine jsp processing in sling with jsp processing in servlet container?
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: sling without maven
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]
Re: Making files referenceable during content loading
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]
sling without maven
Is there a writeup on what's required to integrate sling into another webapp in a non maven world? My assumption would be to first get a osgi container integrated, then sling and the jar files it depends on. But a step by step guide would be handy.. -- Torgeir Veimo [EMAIL PROTECTED]
The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found
Am using maven 2.0.9. What's missing in my setup? Macintosh:sling torgeir$ mvn jetty:run [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Sling (Parent) [INFO] Sling - Maven Plugin to create Jackrabbit OCM descriptors [INFO] Sling - Servlet Extension API [INFO] Sling - Scripting Implementation API [INFO] Sling - Repository API Bundle [INFO] Sling - Repository ClassLoader [INFO] Sling - Scripting - JSP Support [INFO] Sling - Maven Plugin for Compiling JSP Sources into Bundles [INFO] Sling - Maven Plugin for Supporting Bundle Development [INFO] Sling - testing utilities [INFO] Sling - Sling JSON Library [INFO] Sling - OSGi LogService Implementation [INFO] Sling - MIME type mapping support [INFO] Sling - Commons OSGi support [INFO] Sling - Thread Support [INFO] Sling - Scheduler Support [INFO] Sling - AdapterManager implementation [INFO] Sling - Resource Resolver [INFO] Sling - Engine Implementation [INFO] Sling - JCR Base Bundle [INFO] Sling - Initial Content Loader [INFO] Sling - Jackrabbit API Bundle [INFO] Sling - Repository Accessor [INFO] Sling - Jackrabbit Embedded Repository [INFO] Sling - Object Content Mapping [INFO] Sling - Simple WebDAV Access to repositories [INFO] Sling - Servlet Resolver [INFO] Sling - Default GET Servlets [INFO] Sling - Default POST Servlets [INFO] Sling - Scripting Core implementation [INFO] Sling - Scripting - Freemarker Support [INFO] Sling - Scripting - JavaScript Support [INFO] Sling - Scripting - JSP Support, Core Tag Library [INFO] Sling - Scripting - JST Support [INFO] Sling - Scripting - Ruby Support [INFO] Sling - Scripting - Velocity Support [INFO] Sling - APT parser [INFO] Sling - APT servlet [INFO] Sling - Bundle Resource Provider [INFO] Sling - Dojo JavaScript Library [INFO] Sling - Dojo Data Exension [INFO] Sling - Event Support [INFO] Sling - HTTP Header Authentication [INFO] Sling - Internationalization Support [INFO] Sling - Sample Sling Application [INFO] Sling - Sample Path Based Resource Type Provider [INFO] Sling - Webloader Service [INFO] Sling - Webloader User Interface [INFO] Sling - Launchpad Base [INFO] Sling - Launchpad Content [INFO] Sling - Launchpad Application [INFO] Sling - Launchpad Application [INFO] Sling - Launchpad Web Application [INFO] Sling (Builder) [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 15 seconds [INFO] Finished at: Mon Jun 02 19:15:49 EST 2008 [INFO] Final Memory: 5M/10M [INFO] -------- -- Torgeir Veimo [EMAIL PROTECTED]
Re: JCR Explorer
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: Sling projects and mentors for GSoC?
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: Sling projects and mentors for GSoC?
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?
On 13 Mar 2008, at 12:59, Bertrand Delacretaz wrote: The basic features of a JCR explorer are IMHO to allow browsing the repository, CRUD operations on nodes and properties, searching nodes, file uploads and downloads, and admin features. I think for Sling, this project could as well be an example/reference application as a useful tool. 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. -- Torgeir Veimo [EMAIL PROTECTED]
Re: LDAP user authentication
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: LDAP user authentication
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? 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. -- Torgeir Veimo [EMAIL PROTECTED]
Re: Discover Sling in 15 minutes
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
On 29 Jan 2008, at 23:01, Bertrand Delacretaz wrote: On Jan 29, 2008 1:40 PM, Torgeir Veimo <[EMAIL PROTECTED]> wrote: When running mvn jetty:run in launchpad/launchpad-webapp I get .../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... That constant comes from sling/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ ujax/UjaxPostServlet.java did you svn up your sling folder and rebuild it all with "mvn clean install"? Yes. Did an svn update, and now I get another error. I'll try again a bit later.. [ERROR] BUILD FAILURE [INFO] [INFO] Compilation failure /Users/torgeir/java/src/sling/15minutes/sling/jcr/resource/src/main/ java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java: [63,7] org.apache.sling.jcr.resource.internal.JcrResourceResolver is not abstract and does not override abstract method map(java.lang.String) in org.apache.sling.api.resource.ResourceResolver /Users/torgeir/java/src/sling/15minutes/sling/jcr/resource/src/main/ java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java: [63,7] org.apache.sling.jcr.resource.internal.JcrResourceResolver is not abstract and does not override abstract method map(java.lang.String) in org.apache.sling.api.resource.ResourceResolver -- Torgeir Veimo [EMAIL PROTECTED]
Re: Discover Sling in 15 minutes
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: ujax ponderings
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: [RT] Shall we merge microsling into Sling?
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: [RT] Shall we merge microsling into Sling?
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: microsling: extension vs. mime-type script resolution
On 20 Nov 2007, at 13:26, Bertrand Delacretaz wrote: I agree that this is a bit involved, but it is flexible, standardizes the way scripts are resolved, and the concept of a "resource type" is fairly unique and very useful I think . Let's see how you'd do that, if there's a simple way that still leads to clear conventions I'm all ears. I still think that this is ok to provide as the default way to resolve script. But in microsling it's also the only way. -- Torgeir Veimo [EMAIL PROTECTED]
Re: [VOTE] Sling API
[] +1 Sling API is good enough to refactor Sling +1 -- Torgeir Veimo [EMAIL PROTECTED]
Re: Sling-API
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: Sling-API
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
On 26 Oct 2007, at 12:05, Felix Meschberger wrote: * ResourceResolver The ResourceResolver is added and provides the functionality to access Resources and list children, which was formerly provided by the SlingRequest interface. A new ResourceManager interface extending the ResourceResolver is added, which may be implemented to provide seemless content mapping. The ResourceManager extends ResourceResolver and servlets may cast to get the functionality. I would like to open the discussion now on this Any comments are welcome. Thanks in advance. Some suggestions: 1. I still feel that the mechanism to resolve a servlet is a bit too hard coded. I'd suggest adding a ServletResolver interface, which would work similar to the ResourceResolver. The selectSlingServlet() method would then resolve a Servlet using the configured ServletResolver(s). The body of the current selectSlingServlet() method could form a DefaultSlingServletResolver to maintain current functionality. public interface ServletResolver { /** Find the Servlet that request must process for the loaded Resource. */ Servlet getServlet(HttpServletRequest request, Resource resource) throws SlingException; } Example usage: I need to use a different servlet for export. I'd then configure a ServletResolver that looks for an ?export=true request parameter and returns the export servlet. Another example is if I need to print debug information while coding. I'd then configure a ServletResolver that looks for ?Debug=true parameters and returns the debug servlet. 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 SlingForward getSlingForward() (HttpServletRequest request, Resource resource) throws SlingException; 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. -- Torgeir Veimo [EMAIL PROTECTED]
Re: [jira] Commented: (SLING-64) Refactor Servlets and Script resolution
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]
[jira] Commented: (SLING-64) Refactor Servlets and Script resolution
[ https://issues.apache.org/jira/browse/SLING-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535735 ] Torgeir Veimo commented on SLING-64: 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. > Refactor Servlets and Script resolution > --- > > Key: SLING-64 > URL: https://issues.apache.org/jira/browse/SLING-64 > Project: Sling > Issue Type: Improvement > Components: microsling >Reporter: Felix Meschberger > Fix For: 2.0.0 > > Attachments: SLING-64.patch > > > microsling currently defines a SlingServlet interface which has a canProcess > method used to decide whether a servlet is capable of handling a request or > not. I think, this mechanism will not scale well if we add more script > engines or more servlets. > As a first step towards a simpler approach, I propose the following: >* Merge the DefaultSlingServlet and the SlingPostServlet to a single > DefaultSlingServlet >* Replace Rhino and Velocity servlets by respective ScriptEngines (and > define the interface for that) >* Refactor the SlingScriptResolver such that after resolving the script, > it is also evaluated through a ScriptEngine >* Refactor MicroSlingServlet such, that > (1) check for a servlet by resource type > (2) try to evaluate a script > (3) fall back to the DefaultSlingServlet >* Also in the MicroSlingServlet register servlets by type (currently there > are none of course) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Move ContentManager to Sling API
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: Move ContentManager to Sling API
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
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]