Re: Continuum or Hudson?
2009/6/9 Juan José Vázquez Delgado : >> As people here seem to prefer Hudson, lets use that one. > > I have no experience with TeamCity [1] but I feel this could be > another option. Any feedback with this tool? Yes, we're using it in our shop. It was a breeze to set up, and doesn't make any noise unless there's something wrong. I don't know Hudson well enough to compare features, though. > [1] http://www.jetbrains.com/teamcity/ -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Content Packaging
2009/6/3 John Crawford : > Is anyone aware of content / node packaging built-in functionality? I found > a url [1] on initial content loading with Sling, but may be a little > incomplete. The docs are undergoing an update. Currently there's a more up-to-date description of the content loading mechanism at http://cwiki.apache.org/confluence/display/SLING/Content+Loading > [1] http://incubator.apache.org/sling/site/content-loading.html -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Geographical Datastore and Posgis integration
2009/5/27 pub cog : > The actual search is based on postgis sql builtin function. > > Currently the process has 2 main steps: > Step n°1- on ressource creation/update, I parse the provided kml > file to extract geographical informations > create a 'geom' (4) using > postgis function and store it in a database table column > Step n°2- on search I transform query coordinnates into a 'geom' and > use it against the computed geom(s) created above > I found rows in > the db and return them as a list > > > How could I do this with Sling ? Just a quick thought. I don't know much about KML, but from the docs it looks like a fairly simple XML format. Have you considered storing the KML data as JCR nodes, and not as KML files? That would certainly make it easier to implement advanced search features, as you describe. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [VOTE] Use repository.a.o for deployments
2009/5/27 Felix Meschberger : > Hi all > > After the discussion, lets vote on using repository.apache.org for > deployments. [...] [X] +1 use repository.a.o (Nexus repository) for deployment -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: AW: Content Loading question.
>> I might have some knowledge on this, especially loading >> content as XML files. 2009/5/25 Mike Müller : > [...] Feel free to change/correct/append everything you like > and let me know when you've finished. Mike, I added a small section on using custom XML formats in content loading. Let me know if it should be improved in any way. Again, thanks for driving the documentation process forward. It is highly appreciated. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: AW: Content Loading question.
>> Mike, >> Yes If I get things working I will, >> I have several use cases I need to cover. >> 1. Uploading about 1000 html and other UI files. >> 2. Protecting those files from changes with base folder ACL's >> 3. Setting up a template structure with some node properties >> being set >> on both files and folders. >> >> As I get things done, I will share. >> Ian 2009/5/24 Mike Müller : > Do you have solved your problems. If yes, do you have some > example files, and maybe explanaitions about the content loading > features. I would like to update the docs, but do not have enough > experience on this special topic. So every hint and help is welcome. Hi Mike, I might have some knowledge on this, especially loading content as XML files. Is there a wiki page I could update? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [VOTE] Graduate Apache Sling as a top level project
> After the second release and an ever growing community, I think we are > ready to graduate from the Incubator. [X] +1 Graduate as a top level project -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Creating a user mailing list? (was: [DISCUSS] Graduation)
2009/5/14 Bertrand Delacretaz : > I don't think need a user mailing list right now, IMHO our community > is too small to warrant separate lists. I agree. In other projects, that have two mailing lists, it's sometimes hard to decide which one to write to. Also, the 'user' list sometimes seem less of a priority to the developers, so that questions asked there are often left unanswered for some time. Until the volume of traffic to sling-dev becomes unmanageable, I see no great need to have a separate user list. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: creating new properties with HTTP request
>>>> I need to create more properties with HTTP request. When I send HTTP >>>> request >>>> with query string, which contents only one property, it's ok. >>>> I don't know, how can I separate more properties. (I tried coma and >>>> semicolon ) >> >> 2009/5/12 Tobias Bocanegra : >>> try '&' as delimiter. >>> >>> see: http://en.wikipedia.org/wiki/Query_string >>> and: >>> https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent > Vidar Ramdal schrieb: >> Actually, the semicolon is recommended by W3C [1], as the use of '&' >> often brings along some interesting escaping problems: >> >> "We recommend that HTTP server implementors, and in particular, CGI >> implementors support the use of ";" in place of "&" to save authors the >> trouble of escaping "&" characters in this manner." >> >> So maybe we should support ';' as a delimiter, in addition to '&'. >> WDYT? 2009/5/13 Felix Meschberger : > Sure. Now it of course depends on how is parsing the parameters. In the > case of URL paramaters and application/x-www-form-urlencoded POST data, > it is the servlet container parsing the parameters and we do nothing > about it. Ah, of course. Parsing the query string into parameters should probably be the job of the servlet container. However, from a quick look into Jetty, it doesn't seem to support ';' [1]. [1] http://jetty.mortbay.org/jetty/jetty-6/xref/org/mortbay/util/UrlEncoded.html#188 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: creating new properties with HTTP request
>> I need to create more properties with HTTP request. When I send HTTP request >> with query string, which contents only one property, it's ok. >> I don't know, how can I separate more properties. (I tried coma and >> semicolon ) 2009/5/12 Tobias Bocanegra : > try '&' as delimiter. > > see: http://en.wikipedia.org/wiki/Query_string > and: > https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent Actually, the semicolon is recommended by W3C [1], as the use of '&' often brings along some interesting escaping problems: "We recommend that HTTP server implementors, and in particular, CGI implementors support the use of ";" in place of "&" to save authors the trouble of escaping "&" characters in this manner." So maybe we should support ';' as a delimiter, in addition to '&'. WDYT? [1] http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.2 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Releases in the future
2009/5/12 Juan José Vázquez Delgado : > As Ian describes, a custom launchpad, including Sling and some other > bundles, is a typical enterprise-ready package for "Sling solutions". Agreed. > IMHO, there is not an easy way to package a Sling based software > solution now. Along these, I see in Apache Felix Karaf [1] (a.k.a. > Apache ServiceMix Kernel) a better approach in order to have > enterprise-ready solutions over OSGi environments. WDYT? Karaf looks very useful. For us, developing a bunch of our own jars and scripts, it would greatly simplify deploying and packaging of our own application. > [1] http://felix.apache.org/site/apache-felix-karaf.html -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Use cases for bundle-based Jackrabbit customizations?
2009/5/6 Bertrand Delacretaz : > In an ideal world, I think it should be possible to use separate > bundles to provide classes for all elements of the repository.xml > configuration that have a "class" attribute. Hear, hear! > [...] > Could people give a quick description of their use cases that require > customizing these things? Please also briefly indicate if/how that > works now. I need some custom AccessManager logic, therefore I created the PluggableAccessManager, see SLING-880 [1]. This patch provides an interface that can be implemented by custom bundles. The interface is really a simplified version of AccessManager. This again was inspired by a tip from Rory Douglas [2], who pointed me to PluggableDefaultLoginModule. The PluggableAccessManager works for me, but being able to plugin a "real" Jackrabbit AccessManager, would sure be nice. It would also be useful if DefaultAccessManager could be exported, as it is much easier to override certain methods in that, than to implement the interface from scratch. [1] https://issues.apache.org/jira/browse/SLING-880 [2] http://markmail.org/thread/wlqm3yjpbyokwcvy -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [Vote] Release Apache Sling 5
> You'll find the releases at: > http://people.apache.org/~cziegeler/releases/sling +1 Good work! -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: storing repo content in svn
2009/5/3 Dominik Süß : > This initial-content can be deployed via the maven-sling-plugin. > JCR-Properties can be uploaded as JSON or XML File having the same name > (extended by .json or .xml) parallel to your targetnode. The structure you > have to use is the same as the default xml or json renderer. You may also use other XML formats, if you should need that, by using an XSLT stylesheet with your XML. This thread might be of interest: http://markmail.org/thread/qxi6qw77vgymrdim -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [VOTE] Update to Community Roles and Processes
2009/5/1 Felix Meschberger : > We can leave the vote open for more time, no problem with me. And we can > continue to discuss. +1 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Welcome Mike Mueller as Documentation Committer
2009/4/30 Felix Meschberger : > Based on his sustained contributions to the Sling documentation in the > last months, the Sling PPMC has decided to give Mike Müller write access > to the Sling website content wiki. > > Thanks again, Mike, for your contributions and keep up the good work. Great! Welcome on board, Mike! -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: JCR2 upgrade plans ?
2009/5/3 Ian Boston > I think this may be a question of what is exported from the bundle. At the > moment the jackrabbit-server bundle doesn't expose much more than the real > API's which IMHO is correct, however it does mean that customizations have to > live inside the server bundle. As you say, this has been done to make the > access manager pluggable in trunk Sling. But this was done because of the way DefaultAccessManager is linked to the rest of the Jackrabbit stuff. If DefaultAccessManager could be separated out in a bundle of its own, we would have a pluggable accessmanager by definition. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Unified system for tags
2009/4/23 Vidar Ramdal : > These are just some loose thoughts that have been brewing in my mind > lately, after reading Richardson/Ruby: RESTful Web Services [1]. > > In order to make Sling (even) more buzzword compliant, I have been > thinking about a system for tags. > 2009/4/24 Juan José Vázquez Delgado : >> ...That is a nice feature but IMHO is more suitable for specific use >> cases, such as CMS systems, than for Sling itself 2009/4/24 Bertrand Delacretaz : > IMHO that shouldn't prevent implementing it under contrib - not all > Sling users will need it, but using Sling for CMSish apps is certainly > a common use case. Certainly, this could be a bundle supplied under contrib. For a start, the bundle could contain this: - Script/servlet for retrieving a tag's meta-info (/tags/tagname) (at least as an example - users would want to create their own script) - Script/servlet for retrieving content tagged with a certain tag (/tags/tagname.list) (same as above) - Script/servlet for deleting a tag When a tag is deleted, it should be removed from all nodes that uses it - PostProcessor for adding tags This could work like this: The postprocessor monitors POSTs, and checks if a "tags" property is modified. If the "tags" property contains a new tag (a tag that does not yet exist under /tags), it is created there. Does this sound as a reasonable approach? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: AccessControlManager question.
2009/4/24 Ian Boston : > Excellent :), > Thank you, > I should be able to refactor our JR 14 access manager onto this quite > easily. > > One question, > I see its all or nothing, if the plugin is there isGranted doesnt look at > the default. > I was wondering if there was a way of checking the default, and then checkin > the plugin, knowing the defaults response. That way the plugin could enhance > the default ACM where possible. (ie chain) That's a good point. But I think > this.accessManagerPlugin.isGranted(namePathResolver.getJCRPath(absPath), > permissions,super.isGranted(absPath, permissions)); would cause a lot of overhead, because you'd effectively check permissions twice - once with the plugin, once with DefaultAccessManager. And the permission checking is actually quite heavy. Instead, how about letting AccessManagerPlugin.isGranted return a Boolean (as opposed to the lower-case boolean). The plugin can return true or false as before, but can also return null to indicate that DefaultAccessManager should be used. Would that be sufficient in your case? > There appear to be some public methods that don't delegate to the plugin. > like > > + public boolean isGranted(Path parentPath, Name childName, int > permissions) throws RepositoryException { > + return super.isGranted(parentPath, childName, permissions); > + } > > and checkPermission > > was that intentional ? Well, the intention was to keep the AccessManagerPlugin interface as simple as possible, to reduce unnecessary work on impementors. At the time of writing it, I didn't see a need for checkPermission, since the DefaultAccessManager#checkPermission does nothing but call isGranted, and throwing an exception if isGranted returns false. The same goes for isGranted(parentPath, childName, permissions): The only thing it does, is appending childName to parentPath, and calling isGranted on the resulting path. See the source code for DefaultAccessManager at [1]. Do you think you'll need to override those methods? I guess it's now big harm in adding them. [1] http://tinyurl.com/ctmxlv -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: AccessControlManager question.
>>> -- snip -- >>> Is there a better way of implementing Owner and a Dynamic membership >>> which wont generate huge load at session initiation ? >> [...] >> To be able to plugin an access manager, I had to make some minor >> changes in the Jackrabbit Server bundle. These changes are waiting in >> a patch at SLING-880 [1]. I'll see if I can get consensus on applying >> that patch. >> >> [1] https://issues.apache.org/jira/browse/SLING-880 2009/4/24 Ian Boston : > Thank you, I will take a look and no doubt learn some more. I applied the patch yesterday, so the feature is now available in the trunk. Let me know if something is unclear. You might also find this thread interesting: http://markmail.org/message/eojsal2vjtopcxb2 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Unified system for tags
> On Thu, Apr 23, 2009 at 10:16 PM, Vidar Ramdal wrote: >>... In order to make Sling (even) more buzzword compliant, I have been >> thinking about a system for tags. [...] 2009/4/24 Bertrand Delacretaz : > Sounds good, and as Felix says I just wrote a blog entry about this > yesterday [2]. [...] OK, I'm subscribing to your blog. From now on. Promise. >> ...Accessing a tag's URL would output nodes that have the given tag. The >> list could of course be rendered in different formats (json, xml, >> etc) > > Good idea, but maybe with a specific selector? [...] True. >> [...] But, Sling being a WEB framework, maybe tags should be a more >> integrated part of the framework > I agree with Juanjo, that a tagging system is not a core component. > And I agree with you that it's a common use case, so contrib is > probably the place? The tagging system would then be one or several > bundles, servlets, observation components if needed, etc. Sounds good. There's one thing: It might be useful to let a tag (or a set of tags) only be available for a certain branch of the resource tree. Especially if a repository is hosting content for several independent websites, you'd want each website to have its own tags tree. Do you handle that in CQ5 - if so, how? > [1] http://oreilly.com/catalog/9780596529260/ > [2] http://dev.day.com/microsling/content/blogs/main/cq5tags.html > -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: SLING-880
> On Thu, Apr 23, 2009 at 10:59 PM, Vidar Ramdal wrote: >> Being a new committer, I'm not sure how everything is supposed to be >> done. Can we (that is, I) apply the patch in SLING-880 [1], or does it >> need a review or a vote or something first? 2009/4/23 Jukka Zitting : > Sling uses the CTR policy (commit-then-review, [1]) so you're free to > commit anything that you think is good for the project. If people > disagree, they may then ask you to revert or revise the change (don't > worry if this happens to you, it's just a sign that people pay > attention and that you're pushing the limits :-). Cool. I applied SLING-880 then. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
SLING-880
Being a new committer, I'm not sure how everything is supposed to be done. Can we (that is, I) apply the patch in SLING-880 [1], or does it need a review or a vote or something first? [1] https://issues.apache.org/jira/browse/SLING-880 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: AccessControlManager question.
2009/4/23 Ian Boston : > Hi, > I've spent the last few days looking at the impl of the AccessControlManager > and I have noticed several things. > > ACL's contain , multiple ACE's mapped by a Principal which must resolve by > the UserManager to an Authorizable. (the ModifyAceServlet indicates this) > The set of Authorizables that a user is a member of must be pre-determined > at jcr session time so the privileges can be compiled. > > --- > > I want to add 2 concepts to AuthZ, but keep the DefaultAccessControlManager > and the accessmanger servlet bundle if possible. > > The additions are, owner and dynamic group. > > Owner. > Permissions are granted to a sub tree on the basis that the user owns the > node in question. There may be many nodes, owned by different users, and the > ownership (denoted by a jcr property xyz:owner) may change. > > Dynamic Group: > Non determinable. > There is a class of memberships that can only be determined by querying. eg > The resource is only readable between 10:00 and 12:00 on 23/04/2009 to > members of First Year Physics class accessing the resource from the IP range > 131.111.21.0/128 (although *if* you knew this group existed, you could test > on every request, but that could become expensive when only 1 resource out > of millions needed this sophistication) > > Is there a better way of implementing Owner and a Dynamic membership which > wont generate huge load at session initiation ? I have been doing some stuff with dynamic policies myself, and ended up with writing a PluggableAccessManager. This way you can supply your access control logic in your own bundle, and have Sling using it, without touching the default bundles in Sling. The only thing you need to change is the AccessManager element in your repository.xml. The PluggableAccessManager extends DefaultAccessManager, and provides an interface for you to implement your own access control logic. To be able to plugin an access manager, I had to make some minor changes in the Jackrabbit Server bundle. These changes are waiting in a patch at SLING-880 [1]. I'll see if I can get consensus on applying that patch. [1] https://issues.apache.org/jira/browse/SLING-880 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Unified system for tags
These are just some loose thoughts that have been brewing in my mind lately, after reading Richardson/Ruby: RESTful Web Services [1]. In order to make Sling (even) more buzzword compliant, I have been thinking about a system for tags. Yes, I'm talking about those keywords that you label your bookmarks with on del.icio.us, photos on Flickr and so on. Of course, a tag could just be a (multi-value) string property on a node. But a tag could also be considered to be a resource in its own right, with its own URL (e.g. /tags/). (The concept of tags as resources is very much present in [1]). Accessing a tag's URL would output nodes that have the given tag. The list could of course be rendered in different formats (json, xml, etc). Accessing /tags would give a list of tags that are in use. That list would be useful when a user is applying tags to nodes (in auto-complete fields etc). In its simplest form, this could be implemented with a servlet or two. But, Sling being a WEB framework, maybe tags should be a more integrated part of the framework. In what way, though, I'm not sure. Perhaps we could do some tricks with indexing or observation, so that retrieving a tag (and its resources) could be speedier. As I hope I made clear, this is not something I've thought through in any way, and I'm not even sure if it's such a generic usecase that it should be included in Sling - maybe it's just specific to certain applications. WDYT? [1] http://oreilly.com/catalog/9780596529260/ -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: svn commit: r766087 - in /incubator/sling/trunk/bundles/commons/json/src: main/java/org/apache/sling/commons/json/jcr/JsonJcrNode.java test/java/org/apache/sling/commons/json/jcr/JsonJcrNodeTest
2009/4/17 Tobias Bocanegra : > hi, > those 2 files are missing the apache license header. > regards, toby > > btw: i think .* imports are discouraged by apache coding conventions. Sorry about that, freshman mistake :) Added the license header and fixed the imports in rev#766143. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Welcome Vidar Ramdal as our new Sling committer!
2009/4/16 Philipp Koch : > are you using https connection? 2009/4/16 Bertrand Delacretaz : > http://www.apache.org/dev/committers.html#commit-403 should help! Thanks, both of you. https was the key. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Welcome Vidar Ramdal as our new Sling committer!
2009/4/6 Bertrand Delacretaz : > Vidar's account has been created, used vramdal should have commit > access on Sling now. > > Vidar, note that your first commit message needs to be moderated in, > it might take longer than usual to appear. > [...] > And don't hesitate to ask, if anything's unclear! I'm about to commit a patch for SLING-924 (my first commit ever, hurray!), but I'm getting a 403 error from the server: > svn commit --username vramdal --password xx . -m "SLING-924 Fixes > JsonItemWriter.dump(NodeIterator, Writer) + test" svn: Commit failed (details follow): svn: Server sent unexpected return value (403 Forbidden) in response to MKACTIVITY request for '/repos/asf/!svn/act/6cd2c7e1-0bd8-4fcf-94c3-aa1b04748dd8' Am I doing something wrong? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: JsonItemWriter outputs no nodes
> Vidar Ramdal schrieb: >> [...] >> I'd be happy to create a JIRA task and fix this, should you agree that >> this is a bug (as I suspect it is). > > Yes, I agree (now that I read it correctly ;-) ) OK, created SLING-924 for this. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: JsonItemWriter outputs no nodes
2009/4/15 Felix Meschberger : >> I'm using o.a.s.commons.json.jcr.JsonItemWriter.dump(NodeIterator, > > I have to admit, that the JsonItemWriter is kind of strange in light of > the resource tree: it dumps (part of) the repository but not the > resource tree > >> Writer), and I'm experiencing that it does not output any nodes. >> The method calls dumpSingleNode for each node in the iterator, and >> passes a 0 for maxRecursionLevels, which makes no sense to me. > > This is true and desired, since this method AFAICT is intended to only > dump the nodes and their properties of a NodeIterator. That is the desired behaviour, yes, but that is not how it currently works. dump(NodeIterator) does not dump ANY node, regardless of recursion level, because the test at JsonItemWriter#134: recursionLevelActive(currentRecursionLevel, maxRecursionLevels) .. always returns false, because currentRecursionLevel == 1 and maxRecursionLevels == 0. Isn't this a bug? I made a testcase: JsonItemWriter writer = new JsonItemWriter(null); MockNode node1 = new MockNode("/node1"); MockNode node2 = new MockNode("/node2"); final NodeIterator it = new MockNodeIterator(new Node[]{node1, node2}); final StringWriter sw = new StringWriter(); writer.dump(it, sw); System.out.println(sw.toString()); This prints an empty JSON array: []. However, with the change I proposed in the previous mail: JsonItemWriter#76: - dumpSingleNode(it.nextNode(), w, 1, 0); + dump(it.nextNode(), w, 1, 1); ... the test prints the expected two JSON objects: [{"name":"node1"},{"name":"node2"}] I'd be happy to create a JIRA task and fix this, should you agree that this is a bug (as I suspect it is). -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
JsonItemWriter outputs no nodes
Hi, I'm using o.a.s.commons.json.jcr.JsonItemWriter.dump(NodeIterator, Writer), and I'm experiencing that it does not output any nodes. The method calls dumpSingleNode for each node in the iterator, and passes a 0 for maxRecursionLevels, which makes no sense to me. This is the only place where dumpSingleNode is used. It seems everything works smoothly when replacing JsonItemWriter#76: - dumpSingleNode(it.nextNode(), w, 1, 0); + dump(it.nextNode(), w, 1, 1); Is there a reason why dump(NodeIterator, Writer) calls dumpSingleNode() and not dump()? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Experiment with the Hudson CI service, who wants an account?
On Wed, Apr 8, 2009 at 4:13 PM, Bertrand Delacretaz wrote: > Among the Sling committers, who would like to have an account on the > Hudson server? > I'll include your usernames in the accounts request. Sure (username: vramdal). Is using Hudson part of some ASF policy? We're using TeamCity in our company, it's relly easy to set up, and it's free for open source projects (http://www.jetbrains.com/teamcity/buy/index.jsp). -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Felix Framework update
On Tue, Apr 7, 2009 at 2:48 PM, Felix Meschberger wrote: > [...] > Otherwise I would say, that we take the next step and start cutting the > release. Cool! > To this avail, I hereby nominate Carsten Ziegeler as our release manager > for this second Sling release. My congratulations, or condolences, depending on your view :) -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Sling @ JavaZone 2009
I'm thinking of submitting a presentation on Sling at this year's JavaZone in Oslo (http://www.java.no/javazone/2009/) in September. This could give some publicity for the project, and potentially attract new Sling users in Norway (not to mention a free ticket to the conference and free beer in the speaker's lounge :). For this, I have to submit an abstract before April 15. I'll probably go with a presentation similar to Bertrand's at ApacheCon EU - an introduction to Sling and the technologies it is built on, and a demo of some cool stuff you can do with sling (like the blogging app). Does anyone have any particular subject wishes for what should be included in the presentation? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Remove old JcrResourceResolver implementation
On Mon, Apr 6, 2009 at 1:59 PM, Felix Meschberger wrote: > ...For this reasons, I would like to remove (svn rm) the old implementation > and to also drop the JcrResourceResolverFactoryImpl configuration option > to select the old or new implementation... +1 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Support XML-compliant script delimiter
On Mon, Apr 6, 2009 at 11:17 AM, Bertrand Delacretaz wrote: > On Mon, Apr 6, 2009 at 11:14 AM, Vidar Ramdal wrote: >> On Mon, Apr 6, 2009 at 11:06 AM, Bertrand Delacretaz >> wrote: >>> I'd much prefer a permissive parser that only uses XMLish tags to >>> delimit code sections - assuming that meets your requirement of editor >>> friendliness. >> >> I think so, yes. Although a pure XML parser would be much easier to >> implement, I guess :) > > Yes, but what a pain for users downstream, if all scripts have to be > well-formed XML! Well, depends on the tools you use. If you use an XML editor, I'd say it's easier to avoid syntax errors - and even get valid XHTML in the end. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Support XML-compliant script delimiter
> On Mon, Apr 6, 2009 at 10:45 AM, Vidar Ramdal wrote: >> But should the .espx in fact be an XML parser (thus, fail if the input >> document is not valid XML)? On Mon, Apr 6, 2009 at 11:06 AM, Bertrand Delacretaz wrote: > I'd much prefer a permissive parser that only uses XMLish tags to > delimit code sections - assuming that meets your requirement of editor > friendliness. I think so, yes. Although a pure XML parser would be much easier to implement, I guess :) -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Support XML-compliant script delimiter
On Mon, Apr 6, 2009 at 11:00 AM, Felix Meschberger wrote: > Hi, > > Yes, maybe this should be parsed and then "serialized" again to plain > ECMAScript code for the Rhino Interpreter ... This raises now a > performance concern (with me at least). For now I've created SLING-912 for this. I'll see if I can get time to look at it, or, if anyone else feels inspired, be my guest. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Support XML-compliant script delimiter
> Vidar Ramdal schrieb: >> This is off the top of my head from the Jackrabbit/Sling BOF at ApacheCon: >> >> It would be of great use to support another script delimiter in script >> files. The current delimiters (<% and %>) does not play well with most >> IDEs (at least the one I've tried). At least in IntelliJ IDEA, you can >> mix XML/HTML with other languages (and have auto-completion and error >> checking) only if it is delimited by a valid XML element. >> >> We have at least two options here: >> >> 1. Use the standard HTML
Re: [POLL] What to do with ResourceResolver.resolve(String path) (was: [jira] Commented: (SLING-909) JcrResourceResolver2.resolve returns null for non-existing resources while api doc says otherwise
>> On Fri, Apr 3, 2009 at 1:34 PM, Vidar Ramdal wrote: >>> If I can disregard the points of backwards compatibility and >>> documentation for a second, I'd say: I've allways regarded >>> NonExistingResource as something of a hack, so I wouldn't mind trying >>> to avoid it as much as possible. A null returned when a resource does >>> not exist, is certainly easier to grasp for Sling newbies. > Alexander Klimetschek schrieb: >> Yes, but that's why there are the "getResource()" methods (returning >> null) [...] On Fri, Apr 3, 2009 at 2:06 PM, Felix Meschberger wrote: > In addition to what Alex said: resolve() is really used by the Sling > engine to resolve the URL to a resource. Not returning null here makes > the whole processing a lot easier and simpler. [...] OK, you convinced me :) -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [POLL] What to do with ResourceResolver.resolve(String path) (was: [jira] Commented: (SLING-909) JcrResourceResolver2.resolve returns null for non-existing resources while api doc says otherwise
On Fri, Apr 3, 2009 at 8:20 AM, Felix Meschberger wrote: > [...] > Do we want to keep the ResourceResolver.resolve(String path) method > return null if the reource cannot be found (backwards compatible case) > or do we want to have the method return NonExistingResource (consistency > case). If I can disregard the points of backwards compatibility and documentation for a second, I'd say: I've allways regarded NonExistingResource as something of a hack, so I wouldn't mind trying to avoid it as much as possible. A null returned when a resource does not exist, is certainly easier to grasp for Sling newbies. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Some serious build issues
On Fri, Apr 3, 2009 at 10:35 AM, Felix Meschberger wrote: > See also SLING-905 [1]. Ah, thanks, I had missed that issue. A Felix upgrade did the trick. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Some serious build issues
On a fresh checkout, I currently get integration test failures (org.apache.sling.launchpad.webapp.integrationtest.*): Server does not seem to be ready, after 6 msec, got the following 119 Exceptions:org.apache.sling.commons.testing.integration.HttpStatusCodeException: Expected status code 302 for POST, got 404, URL=http://localhost:/org.apache.sling.launchpad.testing-4-incubator-SNAPSHOT/WaitForSlingStartup/1238746620941 ... With -Dmaven.test.skip=true, the build completes, but Sling does not seem to start. On launchpad/webapp/mvn jetty:run, I get Jetty started allright, but it has no content - http://localhost:/ and http://localhost:/system/console gives 404. The error.log only has these lines in it: 03.04.2009 10:24:13.150 *INFO* [FelixStartLevel] org.apache.sling.commons.log.LogServiceFactory LogManager: Logging set up from context 03.04.2009 10:24:13.156 *INFO* [FelixStartLevel] org.apache.sling.commons.log Service [org.apache.sling.commons.log.LogServiceFactory,7] ServiceEvent REGISTERED 03.04.2009 10:24:13.157 *INFO* [FelixStartLevel] org.apache.sling.commons.log Service [org.apache.sling.commons.log.LogReaderServiceFactory,8] ServiceEvent REGISTERED 03.04.2009 10:24:13.158 *INFO* [FelixDispatchQueue] org.apache.sling.commons.log BundleEvent STARTED 03.04.2009 10:24:13.167 *INFO* [FelixDispatchQueue] org.apache.felix.framework BundleEvent STARTED 03.04.2009 10:24:13.167 *INFO* [FelixDispatchQueue] org.apache.felix.framework FrameworkEvent STARTED 03.04.2009 10:24:13.168 *INFO* [main] org.apache.felix.framework Service [Equinox Servlet Bridge,9] ServiceEvent REGISTERED The system.out displays: 2009-04-03 10:24:07.379::INFO: jetty-6.1.5 2009-04-03 10:24:08.587::INFO: No Transaction manager found - if your webapp requires one, please configure one. 2009-04-03 10:24:09.074:/:INFO: sling: Setting sling.home=sling/_ (servlet context path) 2009-04-03 10:24:09.075:/:INFO: sling: Checking launcher JAR in sling/_ 2009-04-03 10:24:11.447:/:INFO: sling: Installed or Updated launcher JAR file from file:/Users/vramdal/devlibs/sling-clean/launchpad/webapp/target/org.apache.sling.launchpad.webapp-4-incubator-SNAPSHOT/WEB-INF//resources/org.apache.sling.launchpad.base.jar 2009-04-03 10:24:11.468:/:INFO: sling: Loading launcher class org.apache.sling.launchpad.base.webapp.SlingServletDelegate 2009-04-03 10:24:11.475:/:INFO: sling: Starting launcher ... 2009-04-03 10:24:11.475:/:INFO: sling: Starting Sling in sling/_ 2009-04-03 10:24:13.184:/:INFO: sling: Sling successfully started in sling/_ 2009-04-03 10:24:13.184:/:INFO: sling: Startup completed 2009-04-03 10:24:13.184:/:INFO: sling: Servlet sling initialized 2009-04-03 10:24:13.239::INFO: Started selectchannelconnec...@0.0.0.0: Any ideas? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [POLL] getting rid of scripting (almost)
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. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: [RT] docs should be in bundles
On Wed, Apr 1, 2009 at 8:49 AM, Bertrand Delacretaz > [...] I think the only sane way for docs to be in > sync with the bundles is to have those docs *inside* the bundles. And > maintain them alongside the source code. [...] I'm all for maintaining docs along the source, but I don't think I would want the docs to be available on a URL in a production system. > [...] And providing a tool, or build profile, that strips the docs from > bundles is > not hard. [...] Cool, but how about the released jars? Would they contain the docs? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Sling Release
On Wed, Apr 1, 2009 at 9:37 AM, Felix Meschberger wrote: > Hi all, > > Just wanted to inform you all (at least the ones not sitting on > felix-dev@), that the Felix project is currently voting on the 1.6.0 > release of the Felix framework. I tested Sling with the release > candidate and apart from a small issue in Sling [1], it works flawlessly. > > I assume that, given the vote passes, we should release Sling next week. > > WDYT ? Great. Is there a list of issues that should be resolved before the release? And, more specifically, will SLING-880 [1] be on that list? :) [1] https://issues.apache.org/jira/browse/SLING-880 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Support XML-compliant script delimiter
This is off the top of my head from the Jackrabbit/Sling BOF at ApacheCon: It would be of great use to support another script delimiter in script files. The current delimiters (<% and %>) does not play well with most IDEs (at least the one I've tried). At least in IntelliJ IDEA, you can mix XML/HTML with other languages (and have auto-completion and error checking) only if it is delimited by a valid XML element. We have at least two options here: 1. Use the standard HTML
Re: Welcome Vidar Ramdal as our new Sling committer!
On Mon, Mar 30, 2009 at 11:11 AM, Bertrand Delacretaz wrote: > Vidar, if you'd like to introduce yourself in a few words here, you're > welcome to! Thanks! My interest in Sling comes from the fact that the company I'm working for, is developing a new web-based CMS product. After evaluating several platforms, we decided to go with Sling. Sling was a good fit for us, but there's allways something missing or needing improvement, and we have contributed patches to the Sling project for the stuff we have needed. Thanks to the highly responsive Sling committers, we have found it easy to involve ourselves in the project. So, I hope that, with my newly achieved committer status, I can help even more people to get involved. I'm excited about the future of Sling, and looking forward to contributing to it. (And, BTW, ApacheCon was great fun. I'm really happy I could meet you guys there, and will almost definitely be coming back next year). -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: JCR/Sling meetup in Amsterdam, confirmed? (was: sling for apachecon site)
On Wed, Mar 18, 2009 at 12:03 PM, Jukka Zitting wrote: > The latest sign up figures look more promising and we've secured > sponsors for the meetup, so let's go forward with the event. > > To reduce the conflict with the Lucene meetup that at least a few of > us would like to attend and to give late arrivals a better chance to > attend the JCR meetup, I suggest that we start the meetup only at 8pm > instead of the originally planned 7pm. On Tuesday 24th, right? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: JCR/Sling meetup in Amsterdam, confirmed? (was: sling for apachecon site)
On Mon, Mar 16, 2009 at 10:56 AM, Jukka Zitting wrote: > [...] > So, I would in fact rather skip the meetup and focus all the energy to > a larger BOF session. WDYT? +1 from me. I'll probably not be able to make it to a Monday/Tuesday meetup, so a larger BOF is good for me. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: JCR/Sling meetup in Amsterdam, confirmed? (was: sling for apachecon site)
On Sat, Mar 14, 2009 at 1:31 PM, Alexander Klimetschek wrote: > On Sat, Mar 14, 2009 at 9:31 AM, Bertrand Delacretaz > wrote: >> I haven't seen info about Tuesday's Jackrabbit/Sling meetup being >> canceled, do you have more details? >> >> My info comes from >> http://wiki.apache.org/apachecon/ApacheMeetupsEu09 >> and >> http://wiki.apache.org/jackrabbit/JcrMeetupMarch2009 >> which don't explicitely confirm the meeting, but do not announce >> cancellation either. >> >> Jukka/Arje, is the meetup confirmed? > > Would be nice to confirm the meeting and the date (looks like Tuesday > has more people available), because I'd like to schedule my travels > now (I am not attending ApacheCon). If the JcrMeetup happens, does that exclude a BOF session? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Re: How can I realize authentication in sling?
On Fri, Mar 13, 2009 at 1:00 AM, Alexander Klimetschek wrote: > On Thu, Mar 12, 2009 at 2:17 PM, Vidar Ramdal wrote: >> One of the main goals of the application we're developing, is that it >> must be dead simple for our users. Our users are NOT computer-savvy in >> any way, so they will certainly not be able to grasp the concept of >> ACLs. Thus, we'd have to abstract the logic in some >> user-understandable manner anyway, and as I've tried to describe, we >> think it's easier to describe the rules using Java (or any programming >> language, really) than with ACLs. > > I wasn't saying that the end-users should fiddle around with a > repository explorer and set the basic ACLs themselves - there still > must be a GUI for it. Exactly. But our pedagogic skills are not good enough to make that GUI understandable for our users. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Re: How can I realize authentication in sling?
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. For instance, we have a feature for moderated comments on a webpage. The rules for comments are simple: Anyone have permission to read approved comments, and to post new comments. Comments have to be approved by a moderator before they are readable to everyone. This implies that the moderator must have read and delete access to all comments. Should we implement this with ACLs, we'd have to take make sure to set the correct ACL on every new comment posted. Allthough the case of comments is fairly simple, we could have more complex cases where ACLs would be more complex, and even prone to errors. It is definately possible to define this rules with ACLs, but it makes more sense to implement it with a custom policy. We know that every comment field should have the same access logic, so why should we have to copy ACLs to every instance of it? And the sling:resourceType property already defines a comment field, so why not just hook up a policy class to respond to those requests. > In general, if you consider access control during the modeling of your > content structure and use inheritance of ACLs, it is actually quite > simple to do. And can be configured by administrators later without > changing the code. One of the main goals of the application we're developing, is that it must be dead simple for our users. Our users are NOT computer-savvy in any way, so they will certainly not be able to grasp the concept of ACLs. Thus, we'd have to abstract the logic in some user-understandable manner anyway, and as I've tried to describe, we think it's easier to describe the rules using Java (or any programming language, really) than with ACLs. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Re: How can I realize authentication in sling?
On Wed, Mar 11, 2009 at 8:49 PM, Eric Norman wrote: > Hi yanjie, > > I attached a proposed patch to enable changing the ACL via a web form to > http://issues.apache.org/jira/browse/SLING-879 Hi yanjie, 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. I have attached a patch at https://issues.apache.org/jira/browse/SLING-880 for a pluggable AccessManager, which will allow you to implement your own access management policies. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: ESP vs. JSP vs. ?
On Tue, Mar 10, 2009 at 10:37 AM, Douglas José wrote: > Hi Andreas, > > There is one thing I miss when writing a ESP: lack of IDE integration. > Anyway, the JSP integration is normally not perfect when writing a Sling > application, specially because some implicitly defined objects [1], which > the IDE is normally not aware. IDE support is troublesome with ESP, in my experience. I have yet to find a good IDE that fully understands the script delimiters (<% and %>), which I tend to use a lot when mixing HTML and Javascript. So I have to set code highlighting, syntax checking etc manually, depending on which part of the file I work on. It would be useful if a valid XML delimiter, like , were supported. At least my IDE (IntelliJ) would understand that the stuff inside the
Re: Using a custom AccessManager
On Fri, Mar 6, 2009 at 3:44 PM, Rory Douglas wrote: > Prior to Jackrabbit 1.5, I did similar work for an ACL-based AccessManager > (see [1]). The difference was I hacked the server bundle to export the > desired classes & created an AccessManagerFacade that would load up > implementations from bundles. > > You can look at o.a.s.jcr.jackrabbit.server.security.LoginModulePlugin and > o.a.s.jcr.jackrabbit.server.impl.security.PluggableDefaultLoginModule for > another approach that doesn't require exporting core Jackrabbit classes, but > does require providing delegate classes for any core API you want to expose > outside the jackrabbit-server bundle. Interesting, thanks! So, maybe the best approach would be a PluggableAccessManager. What do you guys think? I could have a shot at implementing it, if you think it's a good idea. BTW, I think you forgot the link [1] - I'd really like to see it :) -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Using a custom AccessManager
I'm in a situation where I want to write my own Jackrabbit AccessManager (I think). However, to do so, I must implement org.apache.jackrabbit.core.security.AccessManager, and none of the org.apache.jackrabbit.core.* packages are exported by any of the Jackrabbit bundles provided by Sling, so I'm unable to provide my AccessManager in a bundle. I have got my stuff running by hacking/extending the jackrabbit-server bundle, but this is hardly optimal. Does anyone have any suggestions for a better approach? Or maybe we could provide some extension point in Sling, to plug-in a custom AccessManager bundle into the supplied jackrabbit-server bundle? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Jackrabbit User Admininstration
On Fri, Feb 27, 2009 at 10:53 AM, Felix Meschberger wrote: > Eric Norman contributed Jackrabbit User Administration as part of > SLING-875 [1]. Thanks alot for this, this fills an important gap IMHO. I have started to look at Eric's UserManager stuff, and it looks really useful. However, I'm unable to get it to work ("Invalid operation specified for POST request") when running the samples attached to SLING-875. Are we still waiting for SLING-651, or is there some other problem I'm running into? > [1] https://issues.apache.org/jira/browse/SLING-875 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Compilation failure: org.osgi.framework.Constants stuff
Just in case someone has the same problem as I did with org.osgi.framework.Constants: My problem disappeared when upgrading to Maven 2.0.10. On Tue, Feb 17, 2009 at 5:12 PM, Vidar Ramdal wrote: > Hi, > > I'm unable to build Sling at the moment (fresh checkout, clean install): > INFO] Compilation failure > > /Users/vramdal/dev/sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java:[396,68] > cannot find symbol > symbol : variable FRAMEWORK_STORAGE > location: interface org.osgi.framework.Constants > > /Users/vramdal/dev/sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java:[397,72] > cannot find symbol > symbol : variable FRAMEWORK_BEGINNING_STARTLEVEL > location: interface org.osgi.framework.Constants > > > I see Felix (Meschberger) has updated the dependency to (Apache) Felix > Framework 1.5.0-SNAPSHOT - maybe something has changed in > 1.5.0-SNAPSHOT since then? > > -- > Vidar S. Ramdal - http://www.idium.no > Akersgata 16, N-0158 Oslo, Norway > -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: SLING-857 patch
On Mon, Mar 2, 2009 at 8:51 AM, Bertrand Delacretaz wrote: > Hi Vidar, > > On Fri, Feb 27, 2009 at 2:43 PM, Vidar Ramdal wrote: >> Any change of having the SLING-857 patch (reviewed and possibly) >> commited any day soon? Pretty-please-with-sugar-on-top?... > > I had a look now that Felix committed that patch, and IIUC there are > no automated tests for that feature, could you add some? D'oh, I had a test (no, really :), but I forgot to svn add before svn diff, so it was not included in the original patch. I have attached a patch for the testcase to the JIRA issue. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: SLING-857 patch
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. Maybe Torgeir would open a new issue for it? >> Vidar Ramdal schrieb: >>> Any change of having the SLING-857 patch [...] > On Fri, Feb 27, 2009 at 3:47 PM, Felix Meschberger wrote: >> Yes, I planned it for today -- or this weekend. Would this suite your >> needs ? On Fri, Feb 27, 2009 at 4:18 PM, Vidar Ramdal wrote: > Absolutely. I was just afraid it was lost in the system somewhere. > Thanks, and have a great weekend! [1] https://issues.apache.org/jira/browse/SLING-857?focusedCommentId=12676298#action_12676298 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: SLING-857 patch
On Fri, Feb 27, 2009 at 3:47 PM, Felix Meschberger wrote: > Hi Vidar, > > Vidar Ramdal schrieb: >> Any change of having the SLING-857 patch (reviewed and possibly) >> commited any day soon? Pretty-please-with-sugar-on-top? >> We're preparing an internal release of our product, and it would make >> it easier for us to be able to run on a non-modified Sling base. > > Yes, I planned it for today -- or this weekend. Would this suite your > needs ? Absolutely. I was just afraid it was lost in the system somewhere. Thanks, and have a great weekend! -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
SLING-857 patch
Any change of having the SLING-857 patch (reviewed and possibly) commited any day soon? Pretty-please-with-sugar-on-top? We're preparing an internal release of our product, and it would make it easier for us to be able to run on a non-modified Sling base. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [Proposal] Script resolution: Consider request extension for all methods
On Mon, Feb 23, 2009 at 3:05 PM, Felix Meschberger wrote: > Your proposal would more be like an extension to SLING-864 [1]: If the > adressed resource does not exist, extract the sling:resourceType > parameter and use that as the resourceType ? Right. That was what I had in mind, yes. What I haven't thought about, is how Sling should handle a request to reset the resourceType - that is, when the resource already exists, and the client posts an updated resource with a new resourceType. Should we run /apps/old/resourceType/POST.esp or /apps/new/resourceType/POST.esp? > Or maybe better: In case of a non-existing resource use the > sling:resourceType parameter as the value of the > Resource.getResourceSuperType() call. > > This would allow handling of this request parameter, but would not break > existing code expecting non-existing resource to have the predefined > resource type "sling:nonexisting". Sounds cool. > There is just one catch: Do we open up here for a security or > vulnerability issue ? I'll leave that question open :) -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [Proposal] Script resolution: Consider request extension for all methods
On Mon, Feb 23, 2009 at 2:54 PM, Alexander Klimetschek wrote: > I don't think the client should be able to define the resource type. > This is clearly something that must be defined by the server. Hmmm. IMHO, the client is already defining the resource type (by posting the sling:resourceType field). Remember that I'm only talking about content that is being created. When the client is posting new content (that the server doesn't already know), I'd say the client knows more about the resource type than the server does. >> Yes, but you would have to implement that logic in a generic POST >> servlet/script, which would examine the resourceType field of the >> posted data, before forwarding. > > Non-existing resources have the sling:nonexisting resource type, which > will soon also include selectors and extension in the resolution > process (SLING-864). Ah, true. That'll solve my case anyway. Thanks for pointing out. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [Proposal] Script resolution: Consider request extension for all methods
On Mon, Feb 23, 2009 at 1:49 PM, Alexander Klimetschek wrote: > On Mon, Feb 23, 2009 at 1:37 PM, Vidar Ramdal wrote: >> How about including resourceType as well when selecting a non-GET >> script? This would make the process more in line with GET script >> selection. > > Not sure what you mean... The resource type is respected for all > cases. The samples Felix gave in his answer are all using a resource > type: he requested the resource /content/a which has the node type > nt:file, which leads to /libs/nt/file/POST.jsp or > /apps/nt/file/POST.jsp for the simple POST case. > > Similarly, if you'd set a resource type "sample/type" on the resource, > the POST script would be at /libs/sample/type/POST.jsp or > /apps/sample/type/POST.jsp. This has always worked in Sling that way. Ah, sorry, I see that my message was confusing. What I mean is considering resourceType when posting NEW content. That would imply picking it up from the request params (the posted data), as you say below. Let's say I have a script at /apps/test/something/POST.esp. Now, I POST some data to /testcontent: name: testcontent sling:resourceType: test/something Because /testcontent did not already exist, the POST.esp script is not run. However, when I do the exact same request again, the script is invoked, producing a different result. This seems illogical to me. >> I've had some cases where I want to post some content of a certain >> resourceType, to any location, while doing something special to the >> data being posted. >> >> The resourceType should be extracted from the fields being posted (if >> available), or from the already existing node (if it exists). > > I don't think it is a good idea to let the resource type be defined in > the request. Inside Sling however, using include or forward, you can > override the resource type. Yes, but you would have to implement that logic in a generic POST servlet/script, which would examine the resourceType field of the posted data, before forwarding. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [Proposal] Script resolution: Consider request extension for all methods
On Mon, Feb 23, 2009 at 1:09 PM, Felix Meschberger wrote: > [...] > In the meantime, we loosened this and decided to consider selectors for > selecting scripts for non-GET requests. Considering this I am very much > in favor of supporting extensions for non-GET requests in general. How about including resourceType as well when selecting a non-GET script? This would make the process more in line with GET script selection. I've had some cases where I want to post some content of a certain resourceType, to any location, while doing something special to the data being posted. The resourceType should be extracted from the fields being posted (if available), or from the already existing node (if it exists). -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Compilation failure: org.osgi.framework.Constants stuff
On Wed, Feb 18, 2009 at 9:01 PM, John Langley wrote: > I ran into something similar yesterday, however in my case a command > line driven maven build was fine, whereas a maven build from within > eclipse was failing in the way that Vidar describes. In my (failing) case I was already running maven from the command line, so I didn't even have that option left :( But you inspired me to try running maven through my IDE (Intellij IDEA), and that actually works. Weird. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Compilation failure: org.osgi.framework.Constants stuff
> Vidar Ramdal schrieb: >> I'm unable to build Sling at the moment (fresh checkout, clean install): >> INFO] Compilation failure >> [...] >> I see Felix (Meschberger) has updated the dependency to (Apache) Felix >> Framework 1.5.0-SNAPSHOT - maybe something has changed in >> 1.5.0-SNAPSHOT since then? > What platform (OS, Java Version, Maven Version) are you using in this > failed build ? OS X 10.5.6, Java 1.6 (also tried 1.5, same result), Maven 2.0.7 I looked into the .jars downloaded by Maven (both org.apache.felix.framework-1.5.0-SNAPSHOT.jar and org.apache.felix.framework-1.5.0-20090217.191803-5.jar), and they both include the two missing constants in org.osgi.framework.Constants. Can we exclude the OSGi Core jar from the launchpad/base build? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: felix.service.urlhandlers disabled?
On Wed, Feb 18, 2009 at 3:22 PM, Felix Meschberger wrote: > As of Rev. 745521 I have enabled the URLHandlers by default again. See > also SLING-862 [1] Great, thanks -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Proposal: Extend o.a.s.j.c.i.r.XmlReader to support XSL transformations
On Tue, Feb 17, 2009 at 1:05 PM, Felix Meschberger wrote: > Lets go with the ContentReader API change you propose. It is not > exported from the bundle so we are free to adapt it as we need. Patch awaiting approval at https://issues.apache.org/jira/browse/SLING-857 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
felix.service.urlhandlers disabled?
Is there a reason for felix.service.urlhandlers=false in sling.properties? I had another case with this earlier, and I was under the impression that urlhandlers were to be enabled by default in the next release [1]. [1] http://markmail.org/message/qwfetelev7qjrzge -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Compilation failure: org.osgi.framework.Constants stuff
Hi, I'm unable to build Sling at the moment (fresh checkout, clean install): INFO] Compilation failure /Users/vramdal/dev/sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java:[396,68] cannot find symbol symbol : variable FRAMEWORK_STORAGE location: interface org.osgi.framework.Constants /Users/vramdal/dev/sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java:[397,72] cannot find symbol symbol : variable FRAMEWORK_BEGINNING_STARTLEVEL location: interface org.osgi.framework.Constants I see Felix (Meschberger) has updated the dependency to (Apache) Felix Framework 1.5.0-SNAPSHOT - maybe something has changed in 1.5.0-SNAPSHOT since then? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Proposal: Extend o.a.s.j.c.i.r.XmlReader to support XSL transformations
On Fri, Feb 13, 2009 at 6:22 PM, Vidar Ramdal wrote: > One easy way to get extensible format support, at least when speaking > of XML formats, is to let XmlReader look for a reference to an XSL > stylesheet in the XML file ( href="stylesheet.xsl"?>). I've come really close to implementing this, but I have hit a wall when it comes to resolving the location of the XSL. In the example above, one would consider "stylesheet.xsl" to be a relative path to the XSL - relative from the XML file. However, I can't make XmlReader resolve the XSL file, as XmlReader only gets an InputStream of the XML, which contains no information on the XML's location. One option would be to change o.a.s.j.c.i.ContentReader#parse(InputStream, ContentCreator) to parse(URL, ContentCreator). This would mean making ContentReaders responsible for opening and closing the InputStream from the URL. It seems that every caller of ContentReader.parse knows the URL of the inputstream it is passing to the ContentReader, so that should not be too much work. Another option would be to only support absolute URLs when refering to the XSL file. This works in my current implementation, as long as the XSL is not located in a bundle. But in many cases the XSL *would* be supplied in a bundle, I believe bundle resources can be addressed by bundle://bundle-id/etc, but I don't know the bundle ID before the bundle is installed, right? Any suggestions? -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Proposal: Extend o.a.s.j.c.i.r.XmlReader to support XSL transformations
On Fri, Feb 13, 2009 at 7:30 PM, Felix Meschberger wrote: > Hi, > > Sounds like an interesting idea, we could even provide some default > transformations... > > The only fear I have is, that this might introduce a huge pile of > dependencies ? I think we should be fine by just depending on Xalan, which again depends on Xerces. I'll have a look at it over the weekend. -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Proposal: Extend o.a.s.j.c.i.r.XmlReader to support XSL transformations
I have a couple of cases where I want to import initial content from a bundle. In my cases, it makes most sense to store the data as XML files, and let XmlReader install it. However, the XML format supported by XmlReader is a bit too verbose to be practical in many cases. At [1] Felix Meschberger writes: > (1) Initial Content Loading > ... > The format support is currently hardcoded and only > extensible by extending the bundle itself. Yet, there > have been discussions on making this support extensible. One easy way to get extensible format support, at least when speaking of XML formats, is to let XmlReader look for a reference to an XSL stylesheet in the XML file (). Alternatively, the XSL reference could be specified in the Sling-Initial-Content manifest field. stylesheet.xsl would then be responsible of translating the contents of the XML file into the XML format supported by XmlReader. XmlReader would then transform the XML file according to the XSL, and process the resulting output as it would usually. This would greatly simplify the task of working with initial-content, as you could make up my own XML format that suits the content you're writing, as long as you also write the XSL file. So, what do you think? If you believe this is a good idea, I could take a shot at implementing it. [1] http://markmail.org/message/pedlbv6x6zyq5no6 -- Vidar S. Ramdal - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [jira] Commented: (SLING-249) Allow mapping nodes to internet domains
>>> * absolute uri: starts with scheme:// >> >> Is the value of scheme important, or is it just to signal that this is >> an absolute uri? >> If the value is to be used in the resolution, then we should take into >> account that requests can be both http:// and https:// On Sun, Nov 23, 2008 at 7:30 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > Basically, I would say, the scheme is important, too: For example you > might want to force https on certain content locations. Hmmm. I'm not sure I agree. I think a resource should be the same regardless of what protocol you choose to deliver it. I can see cases where I want to force https, but that would be depending on the use case (e.g. passing a login), not depending on the resource itself. So I think I want to avoid having to map both http and https explicitly. If I want to force https on something, I'll do it with scripts. -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [jira] Commented: (SLING-249) Allow mapping nodes to internet domains
> Vidar Ramdal schrieb: >> I'm not thrilled about the idea of dropping the cache on every change. On Fri, Nov 21, 2008 at 12:47 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > [...] This cache is of course not flushed on each modification in the > repository. Ah, sorry, I misunderstood. In that case, this sounds very good. > * absolute uri: starts with scheme:// Is the value of scheme important, or is it just to signal that this is an absolute uri? If the value is to be used in the resolution, then we should take into account that requests can be both http:// and https:// -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: [jira] Commented: (SLING-249) Allow mapping nodes to internet domains
On Fri, Nov 21, 2008 at 8:16 AM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > [...] > The sling:vanityPath property is multi-valued and contains URLs. These > URLs may be absolute or relative. An absolute URI includes the scheme, > authority and path. A relative omits the scheme and or authority part. > In additiona relative URI may even be a relative path. > > To resolve a request URL with Host: header and path, the resource > resolver would first check whether there is an exact match for the path > in the repository. If not, the resource resolver will then -- from the > top of the resource tree -- look for a resource whose sling:vanityPath > matches the Host: header plus (optionally) any prefix of the path. From > there the path would be traversed down along resource names and relative > sling:vanityPath entries to find the final resource. > > This _is_ expensive and therefore absolutely requires caching. > Therefore, we will introduce a small (something like 1000 entries or > so), which may be used to directly map incoming requests to resources. > The cache is managed very simply: on each change in the resource tree, > the cache is just dropped. I'm not thrilled about the idea of dropping the cache on every change. In our application, there will be changes maybe every minute, effectively leaving the cache unusable. Is there a significant benefit of adding domain resolution to the vanityPath system, as opposed to having a different mechanism for domains? I would think it would be less expensive to a) Restrict the location of domain roots to a specified location (let's say /domains). Then the domainroot cache could just observe /domains for changes, and would not have to be dropped on every change in the tree - or - b) Use a separate mixin nodetype for domainroots, and let the domain cache observe the nodetype (see Bertrands comment at [1]) (I haven't looked much into the vanityPath system, so maybe it would have to be rewritten anyway domainroots are implemented.) [1] https://issues.apache.org/jira/browse/SLING-249?focusedCommentId=12649425#action_12649425 -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Customizing the Sling embedded repository
On Mon, Nov 17, 2008 at 4:44 PM, Juanjo Vázquez <[EMAIL PROTECTED]> wrote: > Last days I have been thinking about to extend the features of Sling > embedded repository. The main reason for this is configuring it with another > persistent manager and customizing with my own login module and access > manager. Hi Juan; I'll probably have to do something similar one day. I'd highly appreciate if you would post your findings to this group, if you get some interesting results. -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: JcrResourceResolverFactoryImpl#getRootProviderEntry()
> Vidar Ramdal schrieb: >> [...] >> So: Can I introduce a protected getRootProviderEntry() in >> JcrResourceResolverFactoryImpl, please? > [...] >> If you're OK with it, I'll create a JIRA task and a patch. On Thu, Nov 13, 2008 at 4:27 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > Would be great. Thanks. Thanks! Patch uploaded to https://issues.apache.org/jira/browse/SLING-730 -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
JcrResourceResolverFactoryImpl#getRootProviderEntry()
Hi all; While waiting for ResourceResolverFactory, I have been trying to write a ResourceProvider for other workspaces [1]. It's not trivial, because I want to use much of the resolution and rendering mechanisms that exist, while getting the content from a non-default JCR source. This has led me to implementing a custom JcrResourceResolverFactory, that creates custom JcrResourceResolvers. I'd like to extend JcrResourceResolverFactoryImpl and overriding getResourceResolver, but I'm unable to do so because rootProviderEntry is private, and has no getter. So: Can I introduce a protected getRootProviderEntry() in JcrResourceResolverFactoryImpl, please? If you're OK with it, I'll create a JIRA task and a patch. [1] http://markmail.org/message/dcho3fsjb526lacm -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Why is JcrNodeResource() not public?
On Wed, Nov 12, 2008 at 11:44 AM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > Hi Vidar, > > Vidar Ramdal schrieb: >> I'd like to use JcrNodeResource and JcrPropertyResource in an extended >> JcrResourceProvider, but I run into trouble because JcrNodeResource's >> constructor is not public. Its sibling JcrPropertyResource, on the >> other hand, *has* a public constructor. >> >> Is there any reason why JcrNodeResource() cannot be public, or can I >> go ahead and create a JIRA task + patch? > [...] > Yes, filing a JIRA with patch would be ok. The patch at SLING-729 is ready for review/commit. -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Why is JcrNodeResource() not public?
I'd like to use JcrNodeResource and JcrPropertyResource in an extended JcrResourceProvider, but I run into trouble because JcrNodeResource's constructor is not public. Its sibling JcrPropertyResource, on the other hand, *has* a public constructor. Is there any reason why JcrNodeResource() cannot be public, or can I go ahead and create a JIRA task + patch? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Connecting to and using multiple workspaces
>>> [...] >>> As an alternative -- short term -- approach, you might want to implement >>> a ResourceProvider - say - for the /apps tree, which just uses >>> SlingRepository.loginAdministrative() to login to the default workspace >>> as an administrative user and which would serve the /apps tree from there. >> >> Hmm, hadn't thought of that solution. But when you say implement a >> ResourceProvider for /apps, would it be possible to implement a >> ResourceProvider for the "draft" workspace instead? On Tue, Nov 11, 2008 at 3:49 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > Sure, the problem is then how to get the credentials into your > ResourceProvider. > > In addition you are faced with another issue with the current definition > of the ResourceProvider interface: This is currently global and does not > know the concept of users etc. To implement your use case, you might > want to go for a Facade Implementation, where the Facade is registered > and hands over the method call to a real instance, which might be thread > (or request) -bound to support per-user differences. >> In either case, what (in your opinion) would be the easiest approach >> to implement the ResourceProvider? Extending JcrResourceProvider, or >> creating one from scratch, or something completely different? > I would assume that starting from the existing JcrResourceProvider is > probably a good idea because this one already contains most of the core > code required. You just need some integration glue to get it running, > probably. > > Hope this helps Thanks a lot. I think we will hack up something for now, using a fake login to the draft workspace, and wait for ResourceResolverFactory :) -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Connecting to and using multiple workspaces
> Vidar Ramdal schrieb: >> We want to render content in the "draft" workspace with scripts stored >> in the default workspace. Since only one JCR session is created per >> HTTP request, we're unable to access both a node in "draft" and the >> scripts stored under /apps in the default workspace. On Tue, Nov 11, 2008 at 2:49 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote: > Hi Vidar, > > Interestingly, your request seems to be supported by my proposal for the > ResourceResolverFactory [3]. In such a case, you would probably have two > ResourceProviderFactory services registered: One would support the > default workspace at "/" and the second one would support the draft > workspace at "/content". Exactly, that would be what I want. (Or even better, the draft workspace would be mapped to requests with extension/selector = ".draft", but I guess that's more complicated). So you can consider this a vote (+1) for your proposal, if I'm allowed to vote :) > [...] > As an alternative -- short term -- approach, you might want to implement > a ResourceProvider - say - for the /apps tree, which just uses > SlingRepository.loginAdministrative() to login to the default workspace > as an administrative user and which would serve the /apps tree from there. Hmm, hadn't thought of that solution. But when you say implement a ResourceProvider for /apps, would it be possible to implement a ResourceProvider for the "draft" workspace instead? In either case, what (in your opinion) would be the easiest approach to implement the ResourceProvider? Extending JcrResourceProvider, or creating one from scratch, or something completely different? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Connecting to and using multiple workspaces
Hello Slingers, We are developing an application which will feature a staging concept. That is, the user should be able to save and preview changes before publishing them to the world. We have read some previous posts with great interest, in particular [1]. In that thread, Felix Meschberger suggests [2] using multiple workspaces to achieve this. In our case, that would be a "draft" workspace in addition to the default workspace. (The proposition at [3] also seems interesting in this respect). As a temporary proof-of-concept, we've hacked SlingAuthenticationHandler to look for a "workspace" parameter in the URL, to decide which workspace to connect to: SlingAuthenticator#218: String workspace = req.getParameter("workspace"); log.debug("authenticate: credentials, trying to get a session"); Session session = getRepository().login( authInfo.getCredentials(), workspace /* was: null */); This way, we're able to access content in the "draft" workspace by http://localhost:/path/to/node?workspace=draft But having content stored in different workspaces introduces a number of difficulties. The first roadblock we've hit, is this: We want to render content in the "draft" workspace with scripts stored in the default workspace. Since only one JCR session is created per HTTP request, we're unable to access both a node in "draft" and the scripts stored under /apps in the default workspace. (Of course, we could duplicate all content under /apps to both workspaces, but that seems just ... wrong). Looking at the different interfaces in Sling, it seems it should be possible to implement a custom JcrResourceResolver. The Resolver would examine the HttpRequest, and create a connection to the desired workspace and fetch the content. Given that this is a possible solution, how do we register our JcrResourceResolver so that it can respond to certain requests? Or is this not a good solution at all? [1] http://markmail.org/message/4eh45utq72qf4eqo [2] http://markmail.org/message/utwgtv7z7rfx6jgl [3] http://markmail.org/message/fslkzj3dlkbn4lxo -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: JsonQueryServlet and the 'name' property
On Thu, Oct 30, 2008 at 10:53 AM, Vidar Ramdal <[EMAIL PROTECTED]> wrote: > Hi all; > > I have been playing with JsonQueryServlet, trying to make a dojo.data > source. The datasource is used by a dojo.form.FilteringSelect, which > looks up its data by calling > /.query.json?statement=/jcr:root//*[jcr:like(name, "searchTerm%")] Oh, and while I'm at it: I'd like to introduce an optional parameter 'numchildren', which will include a property in the returned JSON object stating how many children a node has: [{"name":"searchTermMatch","jcr:score":"1000","jcr:primaryType":"nt:unstructured","jcr:path":"/searchTermMatch","name":"searchTerm and more", numchildren: "2"}] Any opinions on this? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
JsonQueryServlet and the 'name' property
Hi all; I have been playing with JsonQueryServlet, trying to make a dojo.data source. The datasource is used by a dojo.form.FilteringSelect, which looks up its data by calling /.query.json?statement=/jcr:root//*[jcr:like(name, "searchTerm%")] The JsonQueryServlet then returns a JSON object like this: [{"name":"searchTermMatch","jcr:score":"1000","jcr:primaryType":"nt:unstructured","jcr:path":"/searchTermMatch"}] Most of the nodes in our repository have a 'name' attribute. The problem is that it is NOT the 'name' attribute that is returned in the JSON object, but the value of node.getName(). But the search jcr:like(name, "searchTerm%") searches the name attribute, not the node name. In most cases, I will be interested in the 'name' attribute, not node.getName(). I know that I can make JsonQueryServlet return the 'name' attribute by appending "property=name" to the URL, but this gives me a JSON object like this: [{"name":"searchTermMatch","jcr:score":"1000","jcr:primaryType":"nt:unstructured","jcr:path":"/searchTermMatch","name":"searchTerm and more"}] That is, the JSON object has 2 'name' properties, which doesn't work well in javascript. I cannot find a way around this. Could we make JsonQueryServlet return node.getName() as something other than 'name'? For instance, 'jcr:name'? I'd be happy to create a patch for this, if you agree. -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Sling-dojo-extension status
What exactly is the status of the dojo-sling extension - more specifically, extensions/dojo-sling/src/main/resources/dojox/data/SlingNodeStore.js and SlingPropertyStore.js? The accompanying demo files (in extensions/dojo-sling/src/main/resources/SLING-INF/content/dojox/data/demo) does not seem to work at the moment, and there seem to be a lot of unimplemented stuff in the .js files. Has the sling-dojo extension been abandoned? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Build failure: Unable to download artifact org.apache.felix:maven-scr-plugin:pom:1.0.7 (rev. 688021)
2008/8/22 Felix Meschberger <[EMAIL PROTECTED]>: > Hi Vidar, > > The plugin has just been released to the Apache Mirror of the central > repository. As such it has not reached central yet. This generally takes a > few hours. > > To get a build quickly, just switch back to version 1.0.6 in parent/pom.xml. > > Hope this helps. OK, thanks! (Btw, this also means that the Sling-in-15-minutes guide is broken right now) -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Build failure: Unable to download artifact org.apache.felix:maven-scr-plugin:pom:1.0.7 (rev. 688021)
Trying to build after a fresh checkout, I get this error: : mvn -s /dev/null clean install [...] [INFO] Building Sling - Scripting Implementation API [INFO]task-segment: [clean, install] [INFO] Downloading: http://people.apache.org/repo/m2-incubating-repository/org/apache/felix/maven-scr-plugin/1.0.7/maven-scr-plugin-1.0.7.pom Downloading: http://repo1.maven.org/maven2/org/apache/felix/maven-scr-plugin/1.0.7/maven-scr-plugin-1.0.7.pom Downloading: http://people.apache.org/repo/m2-incubating-repository/org/apache/felix/maven-scr-plugin/1.0.7/maven-scr-plugin-1.0.7.pom Downloading: http://repo1.maven.org/maven2/org/apache/felix/maven-scr-plugin/1.0.7/maven-scr-plugin-1.0.7.pom [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Failed to resolve artifact. GroupId: org.apache.felix ArtifactId: maven-scr-plugin Version: 1.0.7 Reason: Unable to download the artifact from any repository org.apache.felix:maven-scr-plugin:pom:1.0.7 from the specified remote repositories: central (http://repo1.maven.org/maven2), apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository), apache Snapshots (http://people.apache.org/repo/m2-snapshot-repository), apache.incubating (http://people.apache.org/repo/m2-incubating-repository) Anything going on with the Maven repository right now? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
dojo.data.api.Write support
According to https://issues.apache.org/jira/browse/SLING-301?focusedCommentId=12578395#action_12578395 : ... write support for dojo should be implemented. I have set up a sample page, with a dojo tree widget. I want to be able to reorder nodes with drag-and-drop, using standard dojo functionality. The code for the sample page: This standard dojo stuff, grabbed from the dojo docs. When dragging a node to a new location, I get this error message: "Unimplemented API: dojo.data.api.Write.setValues". So how, exactly, is the write stuff implemented, and how is it supposed to be used? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Unknown protocol: bundle
Continuing the discussion from [EMAIL PROTECTED]: http://markmail.org/message/c7ktqlx3erualv2p >> Vidar S. Ramdal wrote: >>> [...] >>> Is there a way to register a URL handler for bundle? >Karl Pauls wrote: >> Yes there is (however there are a few corner cases I'm working on atm >> where it isn't). URLHandlers should be enabled by default - could you >> post your conf/config.properties and describe your setting a bit more? >> Alternatively, make sure that felix.service.urlhandlers is not set to >> false in your config. 2008/7/7 Carsten Ziegeler <[EMAIL PROTECTED]>: > We turn of the urlhandlers by default in Sling - you can enable them > in the sling.properties file. OK, is that safe? I guess there's a reason for disabling URL handlers in Sling, so are there any side effects by enabling them? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Bundling a custom repository
2008/6/9 Felix Meschberger <[EMAIL PROTECTED]>: > Hi Vidar, > > Am Montag, den 09.06.2008, 15:31 +0200 schrieb Vidar Ramdal: >> Hi all; >> >> I'd like to use Sling with a custom repository - that's a Jackrabbit >> 1.5 with some additions, like a LoginModule and some other stuff. >> >> I'd like to avoid using RMI or JNDI to connect to the repository, but >> instead replace the Jackrabbit bundles that come with Sling, for >> efficiency. >> There are a few JCR-related bundles in the default Sling installation: >> Jackrabbit API bundle, Jackrabbit Embedded Repository, JCR Base >> Bundle, Repository API bundle, Jackrabbit JCR commons and possibly >> others that I don't know about. >> >> Which bundle(s) do I need to replace? Or would this approach be too >> complicated? > > There's just a single bundle to be replaced: "Jackrabbit Embedded > Repository". > > For simplicity I would say, that you actually take the existing > jcr/jackrabbit-server project and fix the jackrabbit references to be > 1.5-SNAPSHOT instead of 1.4.x. You may then add your additional code > just to that bundle. Great, I will give it a try! -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Bundling a custom repository
Hi all; I'd like to use Sling with a custom repository - that's a Jackrabbit 1.5 with some additions, like a LoginModule and some other stuff. I'd like to avoid using RMI or JNDI to connect to the repository, but instead replace the Jackrabbit bundles that come with Sling, for efficiency. There are a few JCR-related bundles in the default Sling installation: Jackrabbit API bundle, Jackrabbit Embedded Repository, JCR Base Bundle, Repository API bundle, Jackrabbit JCR commons and possibly others that I don't know about. Which bundle(s) do I need to replace? Or would this approach be too complicated? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: JCR browser
2008/6/5 Craig L. Ching <[EMAIL PROTECTED]>: > [...] > Anyway, let me know what you think. I think this looks really, really good. Just one question, out of curiosity: Is the explorer "standalone", in that it only uses client side calls? For example, could I take the HTML and JS and run it locally on my computer, and have it connect to and browse a remote Sling instance? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Welcome Janandith, let's make Scala happen for Sling during GSoc!
On Tue, Apr 22, 2008 at 8:19 AM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote: > Please join me in welcoming Janandith, who just got accepted for the > GSoC program, to make the Scala language usable in Sling! Congratulations to Janandith! We're really looking forward to Scala support in Sling. > We had two other students apply for Sling-related GSoC projects, but > competition was fierce between students and between hosting > organizations (as some students applied to several organizations), so > I'm very happy that one out of those three applications got through. I guess this means that the JCR Explorer project was declined? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Too many open files
On Tue, Apr 15, 2008 at 10:11 AM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote: > On Tue, Apr 15, 2008 at 10:03 AM, Vidar Ramdal <[EMAIL PROTECTED]> wrote: > > ... OK, I get just about 850 rows of this: > > > java31685 root 175r REG 104,1 16 829481 > > > > > /usr/local/resin-3.1.1/sling/jackrabbit/workspaces/default/blobs/dc/8e/9c1ccf814774bb9c44ba49453cdc/%7bhttp%3a%2f%2fwww.jcp.org%2fjcr%2f1.0%7ddata.0.bin > > > > So it's something from the repository that is being opened and not > closed?... > > Yes, does that filename map to something that you're manipulating in > your Sling test? Maybe Sling is not closing something properly, if you > could find out exactly which part of your test code uses that file > that would help. I'm not sure how I could identify what JCR content is contained in that particular file. But, as it is within the "blobs" directory, I would guess it contains a file that I've uploaded. My test code shouldn't be using any JCR content except for the simple rendering script in my first message, which is a .esp file. I've done some investigating in the Sling source code, based on the stacktrace. RhinoJavaScriptEngine lines 63-65: if (scriptName.endsWith(RhinoJavaScriptEngineFactory.ESP_SCRIPT_EXTENSION)) { scriptReader = new EspReader(scriptReader); } EspReader has a close() method, but RhinoJavaScriptEngine never calls scriptReader.close(). Could this be the culprit? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway
Re: Too many open files
On Mon, Apr 14, 2008 at 5:32 PM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 5:28 PM, Vidar Ramdal <[EMAIL PROTECTED]> wrote: > > > ...I've done some stress testing on Sling, and I consistently get a Too > > > many open files error after about 850 requests, when I run an ESP > > script > > Looks like you're running a unixish box, could you try using the lsof > command to see what these files are? > > lsof -p should do it OK, I get just about 850 rows of this: java31685 root 175r REG 104,1 16 829481 /usr/local/resin-3.1.1/sling/jackrabbit/workspaces/default/blobs/dc/8e/9c1ccf814774bb9c44ba49453cdc/%7bhttp%3a%2f%2fwww.jcp.org%2fjcr%2f1.0%7ddata.0.bin So it's something from the repository that is being opened and not closed? -- Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway