Re: Unified system for tags
Hi VIdar, 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? That is a nice feature but IMHO is more suitable for specific use cases, such as CMS systems, than for Sling itself. BR, Juanjo.
Re: Unified system for tags
2009/4/24 Juan José Vázquez Delgado juanjo.vazq...@gmail.com: ...That is a nice feature but IMHO is more suitable for specific use cases, such as CMS systems, than for Sling itself 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. -Bertrand
Re: Unified system for tags
Hi Vidar, On Thu, Apr 23, 2009 at 10:16 PM, Vidar Ramdal vi...@idium.no wrote: These are just some loose thoughts that have been brewing in my mind lately, after reading Richardson/Ruby: RESTful Web Services [1]. Good choice ;-) ... 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/tagname). (The concept of tags as resources is very much present in [1]). Sounds good, and as Felix says I just wrote a blog entry about this yesterday [2]. From that you can see that in Day's cq5 the tags are a hierarchy of nodes under /etc/tags, with a specific node type, so a tag is indeed a separate resource. ...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? You can argue that accessing a tag directly should return it, for example /etc/tags/mynamespace/mycategory/mytag.tidy.json would return info about the tag itself, whereas /etc/tags/mynamespace/mycategory/mytag.items.json would return links to items tagged with mytag. 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). Sounds good. In cq5 this is also used to manage the tags, change their titles or descriptions, 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 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. -Bertrand [1] http://oreilly.com/catalog/9780596529260/ [2] http://dev.day.com/microsling/content/blogs/main/cq5tags.html
Re: AccessControlManager question.
-- snip -- 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, Thank you, I will take a look and no doubt learn some more. Ian -- Vidar S. Ramdal vi...@idium.no - 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 vi...@idium.no wrote: ... In order to make Sling (even) more buzzword compliant, I have been thinking about a system for tags. [...] 2009/4/24 Bertrand Delacretaz bdelacre...@apache.org: 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 vi...@idium.no - 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 i...@tfd.co.uk: 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 vi...@idium.no - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: AccessControlManager question.
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) eg public boolean isGranted(Path absPath, int permissions) throws RepositoryException { if (this.sanityCheck()) { -return this .accessManagerPlugin.isGranted(namePathResolver.getJCRPath(absPath), permissions); +return this .accessManagerPlugin.isGranted(namePathResolver.getJCRPath(absPath), permissions,super.isGranted(absPath, permissions)); } else { return super.isGranted(absPath, permissions); } } ? also 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 ? Ian On 24 Apr 2009, at 08:45, Vidar Ramdal wrote: I applied the patch yesterday, so the feature is now available in the trunk. Let me know if something is unclear.
Re: AccessControlManager question.
2009/4/24 Ian Boston i...@tfd.co.uk: 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 vi...@idium.no - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
[jira] Commented: (SLING-922) Load modules on startup from an external directory
[ https://issues.apache.org/jira/browse/SLING-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12702314#action_12702314 ] Aaron Zeckoski commented on SLING-922: -- A few notes as I am going through this: 1) It is possible to check the bundles which are being copied from the war/jar against the installed bundles but I am not sure if this is what we want. If I check them as they are being copied then I can avoid copying over any bundles which are already installed (maybe good?) so the startup will contain a more accurate set of installed bundles. If I wait and check them later then the startup could contain bundles that were not installed. Currently I am checking before copying and not copying if the bundle is installed already. 2) the if (!isAlreadyInstalled(context)) check keeps any new bundles which are added to the jar/war or in the new case, to the startup directory from being installed normally. I would prefer this allow any new bundles in the startup to be installed after the initial startup so I am making it so the check only keeps the DeploymentPackageInstaller from running more than once (for now). Maybe this could be a sling property. 3) Invalid or duplicate bundles in the startup are currently just causing warnings in the logs. I think this is consistent with current behavior but perhaps there should be a strict mode that dies when bundles are invalid or duplicated? Thoughts? Load modules on startup from an external directory -- Key: SLING-922 URL: https://issues.apache.org/jira/browse/SLING-922 Project: Sling Issue Type: New Feature Components: Launchpad, Launchpad Launcher Reporter: Aaron Zeckoski Assignee: Felix Meschberger Original Estimate: 72h Remaining Estimate: 72h Need a way to install and start bundles automatically from an external directory (sling home) on startup. The ideas below are from the list. -- I would like to be able to setup sling to start with a bunch of installed bundles when it first is started. It seems like there are a couple way to do this that I have found but neither is ideal: 1) Rebuild sling from source with the extra bundles in the launcher pom (this seems to create a bunch of resources/# folders with bundles in them) 2) Configure all bundles in the sling.properties file (this requires the bundles to be in an accessible obr) http://incubator.apache.org/sling/site/provisioning-and-startup.html I would like to ideally do something in between like so: Get a binary copy of the sling jar Create a folder with sub-folders like /1 /10 /15 Put my bundles in the various subfolders Configure sling.properties to point to the folder Start sling and have all bundles in the sub-folders installed and started - Aaron Zeckoski === Currently, as you say in (1), the BootstrapInstaller of the Sling launchpad looks into its own resources enclosed in the JAR or WAR file for bundles to install on startup. How about extending this mechanism like this: - Copy all bundles from enclosed resources to ${sling.home}/startup. This gives something like ${sling.home}/startup/0, /1, /10, /15, ... Existing files are only replaced if the files enclosed in the Sling launchpad jar/war file are newer. - Scan ${sling.home}/startup for bundles to install in the same way as today the enclosed resources are scanned directly. So you could place your bundles in that structure and get them installed at the requested start level (0 being default bundle start level). A nice side effect of this is, that you can quickly see, which bundles have been installed at all. - Felix = I like this, and agree that this should replace the current mechanism. How about adding a sling.properties option to completely ignore the bundles that come from the Sling jar/war file? Might make it easier to have precise control on what's installed. -Bertrand = Maybe worth it to make this optional or controllable via a property in the sling properties. - Aaron Zeckoski -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Getting the sling home?
In fact, I only need it as part of the lauchpad (the BootstrapInstaller) so maybe it is still fine. It is for this issue: https://issues.apache.org/jira/browse/SLING-922 -AZ On Fri, Apr 24, 2009 at 11:16 AM, Carsten Ziegeler cziege...@apache.org wrote: Aaron Zeckoski wrote: String home = bundleContext.getProperty(sling.home); This property is only available when you're using the Sling launchpad. Once you deploy Sling into another OSGi container or use a different startup method for the container, it's not availabel! So, maybe there is a better way to solve your problem. If you can tell us why you need this property we might come up with a suggestion. Regards Carsten -- Carsten Ziegeler cziege...@apache.org -- Aaron Zeckoski (aar...@vt.edu) Senior Research Engineer - CARET - Cambridge University [http://bugs.sakaiproject.org/confluence/display/~aaronz/] Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
[jira] Commented: (SLING-922) Load modules on startup from an external directory
[ https://issues.apache.org/jira/browse/SLING-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12702317#action_12702317 ] Felix Meschberger commented on SLING-922: - ad 1): With respect to copying bundles out of the enclosing into the startup folder, I would check the bundle contents before actually copying it. The problem of having out-of-sync situation with the actually installed bundles is acceptable and actually even an expected situation frm the POV of OSGi: You may install, update or remove bundles at any time. ad 2): IIRC the isAlreadyInstalled method compares a timestamp stored in the filesystem with the timestamp of the launchpad jar file. So whenever this file is updated that modification time is changed (it changes when you modify embedded bundles), the isAlreadyInstalled method returns false. So changing embedded bundles has the side-effect of causing the BootstrapInstaller to inspect all enclosed bundles. ad 3): I am not sure, what warn message you mean. There is a info logged when a bundle is enclosed whose version is lower than (or equal to) the version of a bundle of the same symbolic name which is already installed. I think, this is a valid situation, since someone might already have updated the bundle through other means. Other than that I cannot remember any duplicity checks in the BootstrapInstaller Load modules on startup from an external directory -- Key: SLING-922 URL: https://issues.apache.org/jira/browse/SLING-922 Project: Sling Issue Type: New Feature Components: Launchpad, Launchpad Launcher Reporter: Aaron Zeckoski Assignee: Felix Meschberger Original Estimate: 72h Remaining Estimate: 72h Need a way to install and start bundles automatically from an external directory (sling home) on startup. The ideas below are from the list. -- I would like to be able to setup sling to start with a bunch of installed bundles when it first is started. It seems like there are a couple way to do this that I have found but neither is ideal: 1) Rebuild sling from source with the extra bundles in the launcher pom (this seems to create a bunch of resources/# folders with bundles in them) 2) Configure all bundles in the sling.properties file (this requires the bundles to be in an accessible obr) http://incubator.apache.org/sling/site/provisioning-and-startup.html I would like to ideally do something in between like so: Get a binary copy of the sling jar Create a folder with sub-folders like /1 /10 /15 Put my bundles in the various subfolders Configure sling.properties to point to the folder Start sling and have all bundles in the sub-folders installed and started - Aaron Zeckoski === Currently, as you say in (1), the BootstrapInstaller of the Sling launchpad looks into its own resources enclosed in the JAR or WAR file for bundles to install on startup. How about extending this mechanism like this: - Copy all bundles from enclosed resources to ${sling.home}/startup. This gives something like ${sling.home}/startup/0, /1, /10, /15, ... Existing files are only replaced if the files enclosed in the Sling launchpad jar/war file are newer. - Scan ${sling.home}/startup for bundles to install in the same way as today the enclosed resources are scanned directly. So you could place your bundles in that structure and get them installed at the requested start level (0 being default bundle start level). A nice side effect of this is, that you can quickly see, which bundles have been installed at all. - Felix = I like this, and agree that this should replace the current mechanism. How about adding a sling.properties option to completely ignore the bundles that come from the Sling jar/war file? Might make it easier to have precise control on what's installed. -Bertrand = Maybe worth it to make this optional or controllable via a property in the sling properties. - Aaron Zeckoski -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Getting the sling home?
String home = bundleContext.getProperty(sling.home); Excellent! Thanks! :-) -AZ On Fri, Apr 24, 2009 at 10:48 AM, Bertrand Delacretaz bdelacre...@apache.org wrote: Hi Aaron, On Fri, Apr 24, 2009 at 11:37 AM, Aaron Zeckoski aar...@vt.edu wrote: I have been searching through the code to try to find a way to get the sling home but not having much luck See this thread: http://markmail.org/thread/jmxqjwqq5od65qvr -Bertrand -- Aaron Zeckoski (aar...@vt.edu) Senior Research Engineer - CARET - Cambridge University [http://bugs.sakaiproject.org/confluence/display/~aaronz/] Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
[jira] Commented: (SLING-922) Load modules on startup from an external directory
[ https://issues.apache.org/jira/browse/SLING-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12702321#action_12702321 ] Aaron Zeckoski commented on SLING-922: -- 1) OK, so no checking before copying then? 2) So only copy if this trips then (that makes sense to me) 3) Sorry, poor choice of words. I mean currently in the code I am working on, not in the sling trunk. They are info level like below (this is one from trunk which checks to see if the bundle is already installed and newer and skips it if so). That is similar to a duplicate check in my mind: logger.log(Logger.LOG_INFO, Ignoring + path + : More recent version already installed); I was mosting thinking of the situation where there is a bundle in startup/0 and startup/1 which are the same. I could just have the first loaded or last loaded win but I am not sure what the best way to handle it is. I was thinking I would just use the ignore(installedBundle, manifest) check in this case. Am I making sense? :-) Load modules on startup from an external directory -- Key: SLING-922 URL: https://issues.apache.org/jira/browse/SLING-922 Project: Sling Issue Type: New Feature Components: Launchpad, Launchpad Launcher Reporter: Aaron Zeckoski Assignee: Felix Meschberger Original Estimate: 72h Remaining Estimate: 72h Need a way to install and start bundles automatically from an external directory (sling home) on startup. The ideas below are from the list. -- I would like to be able to setup sling to start with a bunch of installed bundles when it first is started. It seems like there are a couple way to do this that I have found but neither is ideal: 1) Rebuild sling from source with the extra bundles in the launcher pom (this seems to create a bunch of resources/# folders with bundles in them) 2) Configure all bundles in the sling.properties file (this requires the bundles to be in an accessible obr) http://incubator.apache.org/sling/site/provisioning-and-startup.html I would like to ideally do something in between like so: Get a binary copy of the sling jar Create a folder with sub-folders like /1 /10 /15 Put my bundles in the various subfolders Configure sling.properties to point to the folder Start sling and have all bundles in the sub-folders installed and started - Aaron Zeckoski === Currently, as you say in (1), the BootstrapInstaller of the Sling launchpad looks into its own resources enclosed in the JAR or WAR file for bundles to install on startup. How about extending this mechanism like this: - Copy all bundles from enclosed resources to ${sling.home}/startup. This gives something like ${sling.home}/startup/0, /1, /10, /15, ... Existing files are only replaced if the files enclosed in the Sling launchpad jar/war file are newer. - Scan ${sling.home}/startup for bundles to install in the same way as today the enclosed resources are scanned directly. So you could place your bundles in that structure and get them installed at the requested start level (0 being default bundle start level). A nice side effect of this is, that you can quickly see, which bundles have been installed at all. - Felix = I like this, and agree that this should replace the current mechanism. How about adding a sling.properties option to completely ignore the bundles that come from the Sling jar/war file? Might make it easier to have precise control on what's installed. -Bertrand = Maybe worth it to make this optional or controllable via a property in the sling properties. - Aaron Zeckoski -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-922) Load modules on startup from an external directory
[ https://issues.apache.org/jira/browse/SLING-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12702324#action_12702324 ] Felix Meschberger commented on SLING-922: - ad 1) To the contrary: I would check before actually copying ad 3) I see. That would be a new check, since currently this is not checked. But it might make sense to check this (if easly feasible) and at least WARN or ERROR about it. Whether we should die ? I am not so sure, really. Load modules on startup from an external directory -- Key: SLING-922 URL: https://issues.apache.org/jira/browse/SLING-922 Project: Sling Issue Type: New Feature Components: Launchpad, Launchpad Launcher Reporter: Aaron Zeckoski Assignee: Felix Meschberger Original Estimate: 72h Remaining Estimate: 72h Need a way to install and start bundles automatically from an external directory (sling home) on startup. The ideas below are from the list. -- I would like to be able to setup sling to start with a bunch of installed bundles when it first is started. It seems like there are a couple way to do this that I have found but neither is ideal: 1) Rebuild sling from source with the extra bundles in the launcher pom (this seems to create a bunch of resources/# folders with bundles in them) 2) Configure all bundles in the sling.properties file (this requires the bundles to be in an accessible obr) http://incubator.apache.org/sling/site/provisioning-and-startup.html I would like to ideally do something in between like so: Get a binary copy of the sling jar Create a folder with sub-folders like /1 /10 /15 Put my bundles in the various subfolders Configure sling.properties to point to the folder Start sling and have all bundles in the sub-folders installed and started - Aaron Zeckoski === Currently, as you say in (1), the BootstrapInstaller of the Sling launchpad looks into its own resources enclosed in the JAR or WAR file for bundles to install on startup. How about extending this mechanism like this: - Copy all bundles from enclosed resources to ${sling.home}/startup. This gives something like ${sling.home}/startup/0, /1, /10, /15, ... Existing files are only replaced if the files enclosed in the Sling launchpad jar/war file are newer. - Scan ${sling.home}/startup for bundles to install in the same way as today the enclosed resources are scanned directly. So you could place your bundles in that structure and get them installed at the requested start level (0 being default bundle start level). A nice side effect of this is, that you can quickly see, which bundles have been installed at all. - Felix = I like this, and agree that this should replace the current mechanism. How about adding a sling.properties option to completely ignore the bundles that come from the Sling jar/war file? Might make it easier to have precise control on what's installed. -Bertrand = Maybe worth it to make this optional or controllable via a property in the sling properties. - Aaron Zeckoski -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Getting the sling home?
Aaron Zeckoski wrote: In fact, I only need it as part of the lauchpad (the BootstrapInstaller) so maybe it is still fine. It is for this issue: https://issues.apache.org/jira/browse/SLING-922 Ah, ok, it should be fine then :) Carsten -- Carsten Ziegeler cziege...@apache.org
Re: Unified system for tags
On Fri, Apr 24, 2009 at 9:37 AM, Vidar Ramdal vi...@idium.no wrote: 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? You can configure the tag editing field, where you assign tags to a page, to only allow the use of a certain tag namespace (eg. /etc/tags/mysitenamespace). We found it overkill to put such specific constraints (they'll change from one customer to the other) directly into the content model. Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com
[jira] Created: (SLING-941) Lots of svn:eol-style settings missing
Lots of svn:eol-style settings missing -- Key: SLING-941 URL: https://issues.apache.org/jira/browse/SLING-941 Project: Sling Issue Type: Improvement Components: General Reporter: Jukka Zitting The Sling trunk has lots of files with missing svn:eol-style settings. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Getting the sling home?
Hi Aaron, On Fri, Apr 24, 2009 at 11:37 AM, Aaron Zeckoski aar...@vt.edu wrote: I have been searching through the code to try to find a way to get the sling home but not having much luck See this thread: http://markmail.org/thread/jmxqjwqq5od65qvr -Bertrand
Re: Unified system for tags
2009/4/23 Vidar Ramdal vi...@idium.no: 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 juanjo.vazq...@gmail.com: ...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 bdelacre...@apache.org: 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 vi...@idium.no - http://www.idium.no Akersgata 16, N-0158 Oslo, Norway +47 21 531941, ext 2070
Re: Unified system for tags
On Fri, Apr 24, 2009 at 3:03 PM, Vidar Ramdal vi...@idium.no wrote: 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. You can also do this as a JCR observation listener. This will then ensure consistency of the tags property for JCR API clients as well, not only Sling HTTP clients. You have to think about duplicates and deleted tags as well. Regarding creation: it is also necessary to check write permissions before creating a tag, this might require two requests for a smooth user interface (no exceptions on write). This is the drawback of the implicit relation between content and the tag tree. Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com
[jira] Resolved: (SLING-941) Lots of svn:eol-style settings missing
[ https://issues.apache.org/jira/browse/SLING-941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jukka Zitting resolved SLING-941. - Resolution: Fixed Assignee: Jukka Zitting I fixed all the missing svn:eol-styles I could find. Lots of svn:eol-style settings missing -- Key: SLING-941 URL: https://issues.apache.org/jira/browse/SLING-941 Project: Sling Issue Type: Improvement Components: General Reporter: Jukka Zitting Assignee: Jukka Zitting The Sling trunk has lots of files with missing svn:eol-style settings. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (SLING-942) Have JSONArray.getJSONObject(int) construct JSONObject if value is String
Have JSONArray.getJSONObject(int) construct JSONObject if value is String - Key: SLING-942 URL: https://issues.apache.org/jira/browse/SLING-942 Project: Sling Issue Type: Improvement Components: Commons JSON Affects Versions: Commons JSON 2.0.2, Commons JSON 2.0.4 Reporter: Carl Hall Attachments: sling-942.diff JSONArray.getJSONObject(int) current checks for JSONObject and throws an exception if instanceof fails. I discovered this after excepting to get back a JSONObject from this but debugging showed that the value was a JSON String. This functionality could be enhanced by checking for String and converting to a JSONObject if possible. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Unified system for tags
...That is a nice feature but IMHO is more suitable for specific use cases, such as CMS systems, than for Sling itself 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. Yep, you´re right. Contrib can be a good place for that kind of stuff. Anyway, tagging is a cool feature. +1 then. Juanjo.
Re: Unified system for tags
Sounds good, and as Felix says I just wrote a blog entry about this yesterday [2]. From that you can see that in Day's cq5 the tags are a hierarchy of nodes under /etc/tags, with a specific node type, so a tag is indeed a separate resource. Bertrand, just a question. You decided not to use references pointing to tags. Why?. I say this because, in principle, using references looks a good design. Juanjo. [2] http://dev.day.com/microsling/content/blogs/main/cq5tags.html
Re: Unified system for tags
Because references a) don't scale at the moment with Jackrabbit Is this a core design constraint or intended to be improved in future Jackrabbit releases?. and b) hard references make your content very unflexible regarding partial copying etc. As Bertrand explains it in his post [1]: snip We don't use JCR references, but simply store paths in properties, as this gives us more flexibility when restructuring things. It's hard to say what will happen to those tags, and to the very concept of tagging, over the expected lifetime of our product, so we accept potentially dangling references (and cope with them at the application level) to gain content agility. /snip See also rule 5 of David's model [2]. Right, but if tags are deleted or their names modified you´re forced to search the path tag properties over all the repository and fix the affected nodes. It seems an important drawback. WDYT? [1] http://dev.day.com/microsling/content/blogs/main/cq5tags.html [2] http://wiki.apache.org/jackrabbit/DavidsModel
Re: Unified system for tags
2009/4/24 Juan José Vázquez Delgado juanjo.vazq...@gmail.com: ...See also rule 5 of David's model [2]. Right, but if tags are deleted or their names modified you´re forced to search the path tag properties over all the repository and fix the affected nodes. It seems an important drawback. WDYT?... It's a drawback, but we feel the advantages (content agility) outweigh the drawbacks (need to handle some rare stuff at the application level). -Bertrand
Re: Unified system for tags
It's a drawback, but we feel the advantages (content agility) outweigh the drawbacks (need to handle some rare stuff at the application level). Pros vs cons. Ok, good!. Juanjo.
Re: Unified system for tags
2009/4/24 Juan José Vázquez Delgado juanjo.vazq...@gmail.com: Sounds good, and as Felix says I just wrote a blog entry about this yesterday [2]. From that you can see that in Day's cq5 the tags are a hierarchy of nodes under /etc/tags, with a specific node type, so a tag is indeed a separate resource. Bertrand, just a question. You decided not to use references pointing to tags. Why?. I say this because, in principle, using references looks a good design. Because references a) don't scale at the moment with Jackrabbit and b) hard references make your content very unflexible regarding partial copying etc. As Bertrand explains it in his post [1]: snip We don't use JCR references, but simply store paths in properties, as this gives us more flexibility when restructuring things. It's hard to say what will happen to those tags, and to the very concept of tagging, over the expected lifetime of our product, so we accept potentially dangling references (and cope with them at the application level) to gain content agility. /snip See also rule 5 of David's model [2]. [1] http://dev.day.com/microsling/content/blogs/main/cq5tags.html [2] http://wiki.apache.org/jackrabbit/DavidsModel Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com
Re: Unified system for tags
On Fri, Apr 24, 2009 at 6:32 PM, Bertrand Delacretaz bdelacre...@apache.org wrote: 2009/4/24 Juan José Vázquez Delgado juanjo.vazq...@gmail.com: ...See also rule 5 of David's model [2]. Right, but if tags are deleted or their names modified you´re forced to search the path tag properties over all the repository and fix the affected nodes. It seems an important drawback. WDYT?... It's a drawback, but we feel the advantages (content agility) outweigh the drawbacks (need to handle some rare stuff at the application level). Right. We are doing this in a lazy way through the use of an observation listener for the tags property on the content. Whenever this is changed, which can happen much later than the modification of the tag tree at /etc/tags, it is validated against the defined tags under /etc/tags. When reading the tags property, there is an application-level utility that filters out non-existing tag. We are also planning to use this lazy approach for restructuration of tags, eg. moving or merging. This also solves the conceptual problem of two very different permission areas: tag administration and content editing. Ok, that's enough of the details ;-) Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com
Re: Unified system for tags
Interesting approach. Good enough from my pont of view. BR, Juanjo. On Fri, Apr 24, 2009 at 7:26 PM, Alexander Klimetschek aklim...@day.com wrote: On Fri, Apr 24, 2009 at 6:32 PM, Bertrand Delacretaz bdelacre...@apache.org wrote: 2009/4/24 Juan José Vázquez Delgado juanjo.vazq...@gmail.com: ...See also rule 5 of David's model [2]. Right, but if tags are deleted or their names modified you´re forced to search the path tag properties over all the repository and fix the affected nodes. It seems an important drawback. WDYT?... It's a drawback, but we feel the advantages (content agility) outweigh the drawbacks (need to handle some rare stuff at the application level). Right. We are doing this in a lazy way through the use of an observation listener for the tags property on the content. Whenever this is changed, which can happen much later than the modification of the tag tree at /etc/tags, it is validated against the defined tags under /etc/tags. When reading the tags property, there is an application-level utility that filters out non-existing tag. We are also planning to use this lazy approach for restructuration of tags, eg. moving or merging. This also solves the conceptual problem of two very different permission areas: tag administration and content editing. Ok, that's enough of the details ;-) Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com
Running tests in eclipse?
I am having trouble getting the tests to run while in eclipse. Does anyone else have this working and if so, can you post the process you might have used for getting the project imported into eclipse. Apologies if this is documented somewhere, RTFM is appropriate if so. :-) -AZ -- Aaron Zeckoski (aar...@vt.edu) Senior Research Engineer - CARET - Cambridge University [http://bugs.sakaiproject.org/confluence/display/~aaronz/] Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
Re: Running tests in eclipse?
Hi Aaron, Aaron Zeckoski schrieb: I am having trouble getting the tests to run while in eclipse. Does anyone else have this working and if so, can you post the process you might have used for getting the project imported into eclipse. Do you mean the integration tests ? You should be able to import the launchpad/testing module just like any module into Eclipse. But to run the tests against Sling, you must run Sling separately. I have setup two external launchers for Sling: One for the web app using mvn jetty:run and one for the standalone Sling, which just runs the executable JAR file. For running integration tests I usually launch the web app based configuration (since this may also be used to on-demand build the web app if required). Hope this helps. Apologies if this is documented somewhere, RTFM is appropriate if so. Most probably it is more like WTFM (Write the F* Manual) ;-) Regards Felix
[jira] Reopened: (SLING-938) Refine initiaition of the authentication process
[ https://issues.apache.org/jira/browse/SLING-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger reopened SLING-938: - Need a slight extension to the login method: There may be the situation that no AuthenticationHandler is registered to actually be able to authenticate a given request. In this situation, the login method can of course not login. So the login method throws a (new) NoAuthenticationHandlerException which indicates, that login failed becauses there was no AuthenticationHandler. The caller of the Authenticator.login method may then act appropriately. For example a 404 handler, which might want to try to login to enable Closed User Group style access, might fall back to sending back the 404/NOT FOUND response if no authentication handler is willing to authenticate, that is if the request is not for a page inside the Closed User Group. Refine initiaition of the authentication process Key: SLING-938 URL: https://issues.apache.org/jira/browse/SLING-938 Project: Sling Issue Type: Improvement Components: Engine Affects Versions: Engine 2.0.2 Reporter: Felix Meschberger Assignee: Felix Meschberger Fix For: Engine 2.0.4 Currently the authentication process can only be initiated by explicitly calling a login page provided by some AuthenticationHandler implementation bundle. There is no way to initiate the authentication process from within a servlet or script (e.g. to have the user log in a 404/NOT FOUND error handler). To support this kind of functionality the existing SlingAuthenticator.requestAuthentcation method should be publicly accessible through Service interface. Servlets or scripts which want to request authentication from the client for the current request may then call this service method. This method applies the same authentication handler selection algorithm for the given HttpServletRequest object as it does for finding the authentication handler in the authenticate process. This ensures, that for a given request, the appropriate authentication handler is called which is then able to initiate authentication appropriately, for example by drawing a form. For full details refer to http://cwiki.apache.org/SLING/authentication-initiation.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Adding non-integration tests for the launchpad code
I would like to add a few unit tests to the launchpad code which I am updating with a patch. It seems like I would need to create a new test folder and package structure so before I do it I wanted to see if this was ok. I am pretty sure the code is being exercised by the integration tests since they are all working but I would be more comfortable if there were unit tests in place as well. It would make the patch much bigger though so it might be something that the community would prefer not happen. What are the options/policies here? -AZ -- Aaron Zeckoski (aar...@vt.edu) Senior Research Engineer - CARET - Cambridge University [http://bugs.sakaiproject.org/confluence/display/~aaronz/] Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
Re: Running tests in eclipse?
I meant any tests but it is possible that the ones I tried were integration tests only. I was trying to run the launchpad tests to figure out what silly thing I had done wrong. I ended up resorting to simply building and running the tests like so: cd launchpad mvn clean install -fbase/pom.xml mvndebug install -ftesting/pom.xml Perhaps not an ideal solution but for developing the launchpad and debugging it works well enough. -AZ On Fri, Apr 24, 2009 at 7:45 PM, Felix Meschberger fmesc...@gmail.com wrote: Hi Aaron, Aaron Zeckoski schrieb: I am having trouble getting the tests to run while in eclipse. Does anyone else have this working and if so, can you post the process you might have used for getting the project imported into eclipse. Do you mean the integration tests ? You should be able to import the launchpad/testing module just like any module into Eclipse. But to run the tests against Sling, you must run Sling separately. I have setup two external launchers for Sling: One for the web app using mvn jetty:run and one for the standalone Sling, which just runs the executable JAR file. For running integration tests I usually launch the web app based configuration (since this may also be used to on-demand build the web app if required). Hope this helps. Apologies if this is documented somewhere, RTFM is appropriate if so. Most probably it is more like WTFM (Write the F* Manual) ;-) Regards Felix -- Aaron Zeckoski (aar...@vt.edu) Senior Research Engineer - CARET - Cambridge University [http://bugs.sakaiproject.org/confluence/display/~aaronz/] Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
Re: Running tests in eclipse?
Hi, Aaron Zeckoski schrieb: I meant any tests but it is possible that the ones I tried were integration tests only. I was trying to run the launchpad tests to Yes, the tests in launchpad/testing are all integration tests. figure out what silly thing I had done wrong. I ended up resorting to simply building and running the tests like so: cd launchpad mvn clean install -fbase/pom.xml mvndebug install -ftesting/pom.xml You could also just run the integration tests without installing: cd launchpad/testing mvn clean integration-test Perhaps not an ideal solution but for developing the launchpad and debugging it works well enough. Yes, true. Regards Felix -AZ On Fri, Apr 24, 2009 at 7:45 PM, Felix Meschberger fmesc...@gmail.com wrote: Hi Aaron, Aaron Zeckoski schrieb: I am having trouble getting the tests to run while in eclipse. Does anyone else have this working and if so, can you post the process you might have used for getting the project imported into eclipse. Do you mean the integration tests ? You should be able to import the launchpad/testing module just like any module into Eclipse. But to run the tests against Sling, you must run Sling separately. I have setup two external launchers for Sling: One for the web app using mvn jetty:run and one for the standalone Sling, which just runs the executable JAR file. For running integration tests I usually launch the web app based configuration (since this may also be used to on-demand build the web app if required). Hope this helps. Apologies if this is documented somewhere, RTFM is appropriate if so. Most probably it is more like WTFM (Write the F* Manual) ;-) Regards Felix
[jira] Commented: (SLING-938) Refine initiaition of the authentication process
[ https://issues.apache.org/jira/browse/SLING-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12702486#action_12702486 ] Felix Meschberger commented on SLING-938: - Added the NoAuthenticationHandlerException as explained above in Rev. 768396. Refine initiaition of the authentication process Key: SLING-938 URL: https://issues.apache.org/jira/browse/SLING-938 Project: Sling Issue Type: Improvement Components: Engine Affects Versions: Engine 2.0.2 Reporter: Felix Meschberger Assignee: Felix Meschberger Fix For: Engine 2.0.4 Currently the authentication process can only be initiated by explicitly calling a login page provided by some AuthenticationHandler implementation bundle. There is no way to initiate the authentication process from within a servlet or script (e.g. to have the user log in a 404/NOT FOUND error handler). To support this kind of functionality the existing SlingAuthenticator.requestAuthentcation method should be publicly accessible through Service interface. Servlets or scripts which want to request authentication from the client for the current request may then call this service method. This method applies the same authentication handler selection algorithm for the given HttpServletRequest object as it does for finding the authentication handler in the authenticate process. This ensures, that for a given request, the appropriate authentication handler is called which is then able to initiate authentication appropriately, for example by drawing a form. For full details refer to http://cwiki.apache.org/SLING/authentication-initiation.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (SLING-939) Adapt the Http Authenticator to the refined authentication process
[ https://issues.apache.org/jira/browse/SLING-939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12702487#action_12702487 ] Felix Meschberger commented on SLING-939: - Adapted LoginServlet to new NoAuthenticationHandlerException to log a message and fall back to returning 403/FORBIDDEN in Rev. 768397. Adapt the Http Authenticator to the refined authentication process -- Key: SLING-939 URL: https://issues.apache.org/jira/browse/SLING-939 Project: Sling Issue Type: Sub-task Components: Extensions Affects Versions: Extensions httpauth 2.0.2 Reporter: Felix Meschberger Assignee: Felix Meschberger Adapt the HTTP Header authentication handler to the new refined authenticaiton initiation processing implemented by SLING-938. Tasks: * The LoginServlet calls the new requestAuthentication service method * requestAuthentication method will now draw the login form -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Adding non-integration tests for the launchpad code
Hi Aaron, Are you referring to SLING-922 ? In this case, I would assume, the unit tests go into the launchpad/base module ? So putting them into src/test/java would be just fine. Im am not sure, whether we should include unit tests for the launchpad/base module in the launchpad/testing module. This would then smell more like integration tests to me. Regards Felix Aaron Zeckoski schrieb: I would like to add a few unit tests to the launchpad code which I am updating with a patch. It seems like I would need to create a new test folder and package structure so before I do it I wanted to see if this was ok. I am pretty sure the code is being exercised by the integration tests since they are all working but I would be more comfortable if there were unit tests in place as well. It would make the patch much bigger though so it might be something that the community would prefer not happen. What are the options/policies here? -AZ
Re: Mixed line endings.
Hi, On Thu, Apr 23, 2009 at 5:08 PM, Ian Boston i...@tfd.co.uk wrote: Isn't that normally put in ~/.subversion/config or does its presence there add it to the file of first commit ? Yes, all committers should have settings like http://www.apache.org/dev/svn-eol-style.txt in their Subversion config file. Then svn will automatically add the correct svn:eol-style properties when new files are added. should I be doing anything in git locally ? My patches contain ^M which doesn't look great :) I just added svn:eol-style settings to quite a few files in Sling. I'm not sure how well those settings are reflected in Git, but you may want to try rebasing your local changes to the latest changes from svn. BR, Jukka Zitting
[jira] Assigned: (SLING-942) Have JSONArray.getJSONObject(int) construct JSONObject if value is String
[ https://issues.apache.org/jira/browse/SLING-942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger reassigned SLING-942: --- Assignee: Felix Meschberger Have JSONArray.getJSONObject(int) construct JSONObject if value is String - Key: SLING-942 URL: https://issues.apache.org/jira/browse/SLING-942 Project: Sling Issue Type: Improvement Components: Commons JSON Affects Versions: Commons JSON 2.0.2, Commons JSON 2.0.4 Reporter: Carl Hall Assignee: Felix Meschberger Attachments: sling-942.diff Original Estimate: 1h Remaining Estimate: 1h JSONArray.getJSONObject(int) current checks for JSONObject and throws an exception if instanceof fails. I discovered this after excepting to get back a JSONObject from this but debugging showed that the value was a JSON String. This functionality could be enhanced by checking for String and converting to a JSONObject if possible. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (SLING-942) Have JSONArray.getJSONObject(int) construct JSONObject if value is String
[ https://issues.apache.org/jira/browse/SLING-942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger updated SLING-942: Attachment: SLING-942-fmeschbe.patch Modified patch, which applies the same logic to the getJSONArray method and also includes adaptions of the optJSONArray and optJSONObject methods to also support on-the-fly parsing and conversion. Finally the patch also catches any problems while parsing the string. WDYT ? Have JSONArray.getJSONObject(int) construct JSONObject if value is String - Key: SLING-942 URL: https://issues.apache.org/jira/browse/SLING-942 Project: Sling Issue Type: Improvement Components: Commons JSON Affects Versions: Commons JSON 2.0.2, Commons JSON 2.0.4 Reporter: Carl Hall Assignee: Felix Meschberger Attachments: SLING-942-fmeschbe.patch, sling-942.diff Original Estimate: 1h Remaining Estimate: 1h JSONArray.getJSONObject(int) current checks for JSONObject and throws an exception if instanceof fails. I discovered this after excepting to get back a JSONObject from this but debugging showed that the value was a JSON String. This functionality could be enhanced by checking for String and converting to a JSONObject if possible. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SLING-942) Have JSONArray.getJSONObject(int) construct JSONObject if value is String
[ https://issues.apache.org/jira/browse/SLING-942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger resolved SLING-942. - Resolution: Fixed Fix Version/s: Commons JSON 2.0.4 Thanks for providing the initial patch. I have applied the modified patch in Rev. 768406. Please close this issue, if this ok for you. Thanks. Have JSONArray.getJSONObject(int) construct JSONObject if value is String - Key: SLING-942 URL: https://issues.apache.org/jira/browse/SLING-942 Project: Sling Issue Type: Improvement Components: Commons JSON Affects Versions: Commons JSON 2.0.2, Commons JSON 2.0.4 Reporter: Carl Hall Assignee: Felix Meschberger Fix For: Commons JSON 2.0.4 Attachments: SLING-942-fmeschbe.patch, sling-942.diff Original Estimate: 1h Remaining Estimate: 1h JSONArray.getJSONObject(int) current checks for JSONObject and throws an exception if instanceof fails. I discovered this after excepting to get back a JSONObject from this but debugging showed that the value was a JSON String. This functionality could be enhanced by checking for String and converting to a JSONObject if possible. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Mixed line endings.
On 24 Apr 2009, at 20:36, Jukka Zitting wrote: I just added svn:eol-style settings to quite a few files in Sling. I'm not sure how well those settings are reflected in Git, but you may want to try rebasing your local changes to the latest changes from svn. yes, looks like everything came through perfectly. big patch :) Thanks. Ian