Re: Script Naming Convention

2009-01-16 Thread Carsten Ziegeler
Felix Meschberger wrote:
 
 So the request GET /some/path.print.html could be handled by any of
 the following scripts
 
path.GET.jsp
GET.jsp
PathGET.java
path.html.esp
html.esp
PathHtml.vlt
path.gsp
Path.groovy
 
 This would of course extend the list of checks to apply for finding
 scripts, but would certainly gelp Java developers.
 
 The drawback of this is, that the request GET /path.PrintA4.html might
 be handled by the same script as GET /path.Print.A4.html. But this may
 be a hypothetical collision and problem.
 
 WDYT ?
 
Hmm, I'm not sure if I want to go down this road. If you provide real
servlets through bundles, you can register them properly. So you end up
with the problem above only if you use the Java Servlet script support
and store the source of the servlet in your repository. I think this is
an edge case where we can live with the reduced usability.
Either use a real scripting language (if you prefer java, use jsp) or
use Java as it is intended to be used in Sling through OSGi bundles.

Carsten
-- 
Carsten Ziegeler
cziege...@apache.org


[jira] Created: (SLING-832) ValueMapDecorator does not support arrays.

2009-01-16 Thread Tobias Bocanegra (JIRA)
ValueMapDecorator does not support arrays.
--

 Key: SLING-832
 URL: https://issues.apache.org/jira/browse/SLING-832
 Project: Sling
  Issue Type: Improvement
  Components: API
Affects Versions: Scripting API 2.0.2
Reporter: Tobias Bocanegra


albeit the JcrPropertyMap supports arrays, the wrapper does not and yields to 
unexpected problems when using it.

eg: i use the following code, to get a detached copy of a jcr property map:

Node content = node.getNode(jcr:content);
ValueMap props = new JcrPropertyMap(content);

// create detached copy
ValueMap properties = new ValueMapDecorator(new HashMapString, 
Object(props));

and the following does not work:

   String[] values = properties.get(myProp, new String[0]);

although it works on the JcrPropertyMap


ps: will provide a patch




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



[jira] Updated: (SLING-832) ValueMapDecorator does not support arrays.

2009-01-16 Thread Tobias Bocanegra (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tobias Bocanegra updated SLING-832:
---

Attachment: ValueMapDecorator.r735030.patch

fixes this issues by supported array types.

 ValueMapDecorator does not support arrays.
 --

 Key: SLING-832
 URL: https://issues.apache.org/jira/browse/SLING-832
 Project: Sling
  Issue Type: Improvement
  Components: API
Affects Versions: Scripting API 2.0.2
Reporter: Tobias Bocanegra
 Attachments: ValueMapDecorator.r735030.patch


 albeit the JcrPropertyMap supports arrays, the wrapper does not and yields to 
 unexpected problems when using it.
 eg: i use the following code, to get a detached copy of a jcr property map:
 Node content = node.getNode(jcr:content);
 ValueMap props = new JcrPropertyMap(content);
 // create detached copy
 ValueMap properties = new ValueMapDecorator(new 
 HashMapString, Object(props));
 and the following does not work:
String[] values = properties.get(myProp, new String[0]);
 although it works on the JcrPropertyMap
 ps: will provide a patch

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



Re: Script Naming Convention

2009-01-16 Thread Jim White

Hi gang!

The way I'd like to provide path mapping for classes is with JAX-RS 
(Jersey) annontations.


That should be pretty straightforward for compiled bundles, but I think 
it can work for scripts too (at least Groovy scripts anyhow).


I just started using Sling and don't my way around at all yet, so this 
comment is probably entirely off the topic of this proposal.


Jim

Felix Meschberger wrote:


Hi all,

Prompted by Shane Johnson's comments on the naming conventions for
servlets in the repository [1], I come to think, that there might be
another solution or way to look at it.

Currently a script must basically be named according to the following
convention:

   [ selector . ] method |
   [ selector . ] extension | // GET only
   selector // GET html only

All matches are done case-sensitive. This works find with general
scripts, which may have as many dots in the file name as we like. For
Servlets (stored in the repository) it is more problematic, since class
files must be named after ther class name and class names are not
allowed to have dots in it.

To workaround this, I could imagine, that we extend the convention for
script file names:

   [ selector . ] method |
   Selector method |
   [ selector . ] extension | // GET only
   Selector Extension | // GET only
   selector |   // GET html only
   Selector // GET html only

(uppercase signifies camelcased name).

So the request GET /some/path.print.html could be handled by any of
the following scripts

   path.GET.jsp
   GET.jsp
   PathGET.java
   path.html.esp
   html.esp
   PathHtml.vlt
   path.gsp
   Path.groovy

This would of course extend the list of checks to apply for finding
scripts, but would certainly gelp Java developers.

The drawback of this is, that the request GET /path.PrintA4.html might
be handled by the same script as GET /path.Print.A4.html. But this may
be a hypothetical collision and problem.

WDYT ?

Regards
Felix

[1] http://blogs.citytechinc.com/sjohnson/?p=47






[jira] Assigned: (SLING-832) ValueMapDecorator does not support arrays.

2009-01-16 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler reassigned SLING-832:
--

Assignee: Carsten Ziegeler

 ValueMapDecorator does not support arrays.
 --

 Key: SLING-832
 URL: https://issues.apache.org/jira/browse/SLING-832
 Project: Sling
  Issue Type: Improvement
  Components: API
Affects Versions: API 2.0.2
Reporter: Tobias Bocanegra
Assignee: Carsten Ziegeler
 Fix For: API 2.0.4

 Attachments: ValueMapDecorator.r735030.patch


 albeit the JcrPropertyMap supports arrays, the wrapper does not and yields to 
 unexpected problems when using it.
 eg: i use the following code, to get a detached copy of a jcr property map:
 Node content = node.getNode(jcr:content);
 ValueMap props = new JcrPropertyMap(content);
 // create detached copy
 ValueMap properties = new ValueMapDecorator(new 
 HashMapString, Object(props));
 and the following does not work:
String[] values = properties.get(myProp, new String[0]);
 although it works on the JcrPropertyMap
 ps: will provide a patch

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



[jira] Updated: (SLING-832) ValueMapDecorator does not support arrays.

2009-01-16 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler updated SLING-832:
---

Affects Version/s: (was: Scripting API 2.0.2)
   API 2.0.2
Fix Version/s: API 2.0.4

Correct version

 ValueMapDecorator does not support arrays.
 --

 Key: SLING-832
 URL: https://issues.apache.org/jira/browse/SLING-832
 Project: Sling
  Issue Type: Improvement
  Components: API
Affects Versions: API 2.0.2
Reporter: Tobias Bocanegra
Assignee: Carsten Ziegeler
 Fix For: API 2.0.4

 Attachments: ValueMapDecorator.r735030.patch


 albeit the JcrPropertyMap supports arrays, the wrapper does not and yields to 
 unexpected problems when using it.
 eg: i use the following code, to get a detached copy of a jcr property map:
 Node content = node.getNode(jcr:content);
 ValueMap props = new JcrPropertyMap(content);
 // create detached copy
 ValueMap properties = new ValueMapDecorator(new 
 HashMapString, Object(props));
 and the following does not work:
String[] values = properties.get(myProp, new String[0]);
 although it works on the JcrPropertyMap
 ps: will provide a patch

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



[jira] Resolved: (SLING-832) ValueMapDecorator does not support arrays.

2009-01-16 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler resolved SLING-832.


Resolution: Fixed

Thanks for your patch. I've applied it in revision: 735083.
Please cross check and close this bug. Thansk

 ValueMapDecorator does not support arrays.
 --

 Key: SLING-832
 URL: https://issues.apache.org/jira/browse/SLING-832
 Project: Sling
  Issue Type: Improvement
  Components: API
Affects Versions: API 2.0.2
Reporter: Tobias Bocanegra
Assignee: Carsten Ziegeler
 Fix For: API 2.0.4

 Attachments: ValueMapDecorator.r735030.patch


 albeit the JcrPropertyMap supports arrays, the wrapper does not and yields to 
 unexpected problems when using it.
 eg: i use the following code, to get a detached copy of a jcr property map:
 Node content = node.getNode(jcr:content);
 ValueMap props = new JcrPropertyMap(content);
 // create detached copy
 ValueMap properties = new ValueMapDecorator(new 
 HashMapString, Object(props));
 and the following does not work:
String[] values = properties.get(myProp, new String[0]);
 although it works on the JcrPropertyMap
 ps: will provide a patch

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



SlingServerRepository configuration change - expected behavior?

2009-01-16 Thread Rory Douglas
If I select the SlingServerRepository configuration in the webconsole ( 
the .2423424etc configuration, not the factory configuration), change a 
property (in this case, max idle sessions) and click Save, I see a 
second configuration gets created ( .44534534etc), and I start seeing 
workspace lock errors from the RepositoryPinger.


I can fix this by just deleting the old configuration, but is this 
expected behavior or a bug? I would expect this kind of behavior when 
clicking Create on a factory config only.


Regards,
Rory


Re: SlingServerRepository configuration change - expected behavior?

2009-01-16 Thread Felix Meschberger
Hi Rory,

Rory Douglas schrieb:
 If I select the SlingServerRepository configuration in the webconsole (
 the .2423424etc configuration, not the factory configuration), change a
 property (in this case, max idle sessions) and click Save, I see a
 second configuration gets created ( .44534534etc), and I start seeing
 workspace lock errors from the RepositoryPinger.
 
 I can fix this by just deleting the old configuration, but is this
 expected behavior or a bug? I would expect this kind of behavior when
 clicking Create on a factory config only.

This really sounds like a bug. Clicking save should really just store
the configuration.

Are you using the SNAPSHOT version of the console or the latest 1.2.2
release ? What browser are you using (I have a problem report with IE7).

Regards
Felix


Re: SlingServerRepository configuration change - expected behavior?

2009-01-16 Thread Rory Douglas
Looks like I'm running 1.2.2 of the console.  I can reproduce this on 
FireFox 3, Google Chrome and IE 6 (all on WinXP).


Regards,
Rory

Felix Meschberger wrote:

Hi Rory,

Rory Douglas schrieb:
  

If I select the SlingServerRepository configuration in the webconsole (
the .2423424etc configuration, not the factory configuration), change a
property (in this case, max idle sessions) and click Save, I see a
second configuration gets created ( .44534534etc), and I start seeing
workspace lock errors from the RepositoryPinger.

I can fix this by just deleting the old configuration, but is this
expected behavior or a bug? I would expect this kind of behavior when
clicking Create on a factory config only.



This really sounds like a bug. Clicking save should really just store
the configuration.

Are you using the SNAPSHOT version of the console or the latest 1.2.2
release ? What browser are you using (I have a problem report with IE7).

Regards
Felix
  


--




Rory Douglas | Senior Principal Consultant
Fax: +1-201-604-6428 | Mobile: +1-917-498-5344
Oracle North America Consulting
ORACLE United States | | San Diego, CA
Please consider your environmental responsibility before printing this 
e-mail