[jira] Created: (SLING-130) microjax: @ValueFrom, mapping from form field names to JCR properties in forms

2007-12-11 Thread Bertrand Delacretaz (JIRA)
microjax: @ValueFrom, mapping from form field names to JCR properties in forms
--

 Key: SLING-130
 URL: https://issues.apache.org/jira/browse/SLING-130
 Project: Sling
  Issue Type: Improvement
Reporter: Bertrand Delacretaz
Priority: Minor


We had this in our r-jax prototype, and it can be useful when "porting" 
existing forms to microjax so I'll add it to the MicrojaxPostServlet.

A @ValueFrom suffix in a form field can be used to define mappings between form 
fields and JCR properties, for example to keep an existing field name in a form.

Adding a hidden field like

  

causes the JCR Text property to be set to the value of the fulltext form field.


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



[jira] Resolved: (SLING-130) microjax: @ValueFrom, mapping from form field names to JCR properties in forms

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz resolved SLING-130.
---

Resolution: Fixed

Implemented in revision 603193, see ValueFromTest class for examples.

> microjax: @ValueFrom, mapping from form field names to JCR properties in forms
> --
>
> Key: SLING-130
> URL: https://issues.apache.org/jira/browse/SLING-130
> Project: Sling
>  Issue Type: Improvement
>Reporter: Bertrand Delacretaz
>Priority: Minor
>
> We had this in our r-jax prototype, and it can be useful when "porting" 
> existing forms to microjax so I'll add it to the MicrojaxPostServlet.
> A @ValueFrom suffix in a form field can be used to define mappings between 
> form fields and JCR properties, for example to keep an existing field name in 
> a form.
> Adding a hidden field like
>   
> causes the JCR Text property to be set to the value of the fulltext form 
> field.

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



[jira] Updated: (SLING-114) Sling Javascript Client Templates (was: Ecmascript Client Templates)

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz updated SLING-114:
--

Summary: Sling Javascript Client Templates (was: Ecmascript Client 
Templates)  (was: ECT - Ecmascript Client Templates)

Renaming this issue to "Sling Javascript Client Templates" as discussed, 
suggest using that as the official name.

I'll rename things in code as well, and change to use the jst extension - (as 
in "jst do it" maybe ;-)

> Sling Javascript Client Templates (was: Ecmascript Client Templates)
> 
>
> Key: SLING-114
> URL: https://issues.apache.org/jira/browse/SLING-114
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
> Attachments: SLING-114.patch, SLING-114.patch
>
>
> To complete the javascript scripting features for microsling, I'd like to 
> implement a client-side version of the ESP templates.
> A template such as
>   <%= item.text %>
> Will be processed server-side to generate javascript client code such as
>   document.write("");
>   document.write(item.text);
>   document.write("\n");
> which executes on the client to render the content.
> Combined with a richer XHTML default rendering of data than what we have now, 
> this creates interesting possibilities for ajaxish apps based on 
> microsling/microjax (SLING-92).

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



[jira] Created: (SLING-131) Use "ujax" (as the short name for microjax in filenames, parameter names, etc.

2007-12-11 Thread Bertrand Delacretaz (JIRA)
Use "ujax" (as the short name for microjax in filenames, parameter names, etc.
--

 Key: SLING-131
 URL: https://issues.apache.org/jira/browse/SLING-131
 Project: Sling
  Issue Type: Improvement
  Components: microsling
Reporter: Bertrand Delacretaz
Priority: Minor


Currently we have a mix of "microjax" in some places, and "ujax" in some 
others, we should make that more consistent and use "ujax" throughout.

That should really be μjax with an initial "mu" (and microsling should be 
μsling maybe), but we don't want to fight with filename encodings problems...

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



[jira] Updated: (SLING-131) Use "ujax" as the short name for microjax in filenames, parameter names, etc.

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz updated SLING-131:
--

Summary: Use "ujax" as the short name for microjax in filenames, parameter 
names, etc.  (was: Use "ujax" (as the short name for microjax in filenames, 
parameter names, etc.)

> Use "ujax" as the short name for microjax in filenames, parameter names, etc.
> -
>
> Key: SLING-131
> URL: https://issues.apache.org/jira/browse/SLING-131
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Priority: Minor
>
> Currently we have a mix of "microjax" in some places, and "ujax" in some 
> others, we should make that more consistent and use "ujax" throughout.
> That should really be μjax with an initial "mu" (and microsling should be 
> μsling maybe), but we don't want to fight with filename encodings problems...

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



[jira] Assigned: (SLING-110) Update Script System to be JSR-223 Compatible

2007-12-11 Thread Felix Meschberger (JIRA)

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

Felix Meschberger reassigned SLING-110:
---

Assignee: Felix Meschberger

> Update Script System to be JSR-223 Compatible 
> --
>
> Key: SLING-110
> URL: https://issues.apache.org/jira/browse/SLING-110
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling, Scripting
>Affects Versions: 2.0.0
>Reporter: Padraic Hannon
>Assignee: Felix Meschberger
> Attachments: bsf.patch, SLING-110_api.patch
>
>
> Currently sling and microsling use a custom scripting framework. This 
> framework should be updated to be jsr-223 compatible.

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



Re: svn commit: r603212 - in /incubator/sling/trunk: commons/json/src/main/java/org/apache/sling/commons/json/ commons/json/src/main/java/org/apache/sling/commons/json/http/ commons/json/src/main/java

2007-12-11 Thread Felix Meschberger
Hi Carsten,

Good thing.

How about replacing the HashMap of the JSONObject by a LinkedHashMap
such that David gets his properties in the order they were added ?

Thanks and Regards
Felix

Am Dienstag, den 11.12.2007, 11:33 + schrieb [EMAIL PROTECTED]:
> Author: cziegeler
> Date: Tue Dec 11 03:32:51 2007
> New Revision: 603212
> 
> URL: http://svn.apache.org/viewvc?rev=603212&view=rev
> Log:
> Use java5 features.
> 
> Modified:
> 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/JSONObject.java
> 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/http/CookieList.java
> 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/http/HTTP.java
> 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/xml/XML.java
> 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/xml/XMLTokener.java
> 
> incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/JsonReader.java
> 
> Modified: 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/JSONObject.java
> URL: 
> http://svn.apache.org/viewvc/incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/JSONObject.java?rev=603212&r1=603211&r2=603212&view=diff
> ==
> --- 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/JSONObject.java
>  (original)
> +++ 
> incubator/sling/trunk/commons/json/src/main/java/org/apache/sling/commons/json/JSONObject.java
>  Tue Dec 11 03:32:51 2007
> @@ -128,7 +128,7 @@
>  /**
>   * The hash map where the JSONObject's properties are kept.
>   */
> -private HashMap myHashMap;
> +private HashMap myHashMap;
>  
> 
>  /**
> @@ -144,7 +144,7 @@
>   * Construct an empty JSONObject.
>   */
>  public JSONObject() {
> -this.myHashMap = new HashMap();
> +this.myHashMap = new HashMap();
>  }
>  
> 
> @@ -229,10 +229,10 @@
>   * @param map A map object that can be used to initialize the contents of
>   *  the JSONObject.
>   */
> -public JSONObject(Map map) {
> +public JSONObject(Map map) {
>  this.myHashMap = (map == null) ?
> - new HashMap() :
> - new HashMap(map);
> + new HashMap() :
> + new HashMap(map);
>  }
>  
> 
> @@ -524,7 +524,7 @@
>   *
>   * @return An iterator of the keys.
>   */
> -public Iterator keys() {
> +public Iterator keys() {
>  return this.myHashMap.keySet().iterator();
>  }
>  
> @@ -547,7 +547,7 @@
>   */
>  public JSONArray names() {
>  JSONArray ja = new JSONArray();
> -Iterator  keys = keys();
> +Iterator  keys = keys();
>  while (keys.hasNext()) {
>  ja.put(keys.next());
>  }
> @@ -1036,15 +1036,15 @@
>   */
>  public String toString() {
>  try {
> -Iterator keys = keys();
> +Iterator keys = keys();
>  StringBuffer sb = new StringBuffer("{");
>  
>  while (keys.hasNext()) {
>  if (sb.length() > 1) {
>  sb.append(',');
>  }
> -Object o = keys.next();
> -sb.append(quote(o.toString()));
> +String o = keys.next();
> +sb.append(quote(o));
>  sb.append(':');
>  sb.append(valueToString(this.myHashMap.get(o)));
>  }
> @@ -1092,13 +1092,13 @@
>  if (n == 0) {
>  return "{}";
>  }
> -Iterator keys = keys();
> +Iterator keys = keys();
>  StringBuffer sb = new StringBuffer("{");
>  int  newindent = indent + indentFactor;
> -Object   o;
> +String   o;
>  if (n == 1) {
>  o = keys.next();
> -sb.append(quote(o.toString()));
> +sb.append(quote(o));
>  sb.append(": ");
>  sb.append(valueToString(this.myHashMap.get(o), indentFactor,
>  indent));
> @@ -1230,15 +1230,15 @@
>   public Writer write(Writer writer) throws JSONException {
>  try {
>  boolean  b = false;
> -Iterator keys = keys();
> +Iterator keys = keys();
>  writer.write('{');
>  
>  while (keys.hasNext()) {
>  if (b) {
>  writer.write(',');
>  }
> -Object k = keys.next();
> -writer.write(quote(k.toString()));
> +String k = keys.next();
> +writer.write(quote(k));
>  writer.write(':');
>  Object v = this.myHashMap.get(k);
>  if (v instanceof JSONObject) {
> 

[jira] Assigned: (SLING-131) Use "ujax" as the short name for microjax in filenames, parameter names, etc.

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz reassigned SLING-131:
-

Assignee: Bertrand Delacretaz

> Use "ujax" as the short name for microjax in filenames, parameter names, etc.
> -
>
> Key: SLING-131
> URL: https://issues.apache.org/jira/browse/SLING-131
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
>Priority: Minor
>
> Currently we have a mix of "microjax" in some places, and "ujax" in some 
> others, we should make that more consistent and use "ujax" throughout.
> That should really be μjax with an initial "mu" (and microsling should be 
> μsling maybe), but we don't want to fight with filename encodings problems...

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



[jira] Assigned: (SLING-114) Sling Javascript Client Templates (was: Ecmascript Client Templates)

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz reassigned SLING-114:
-

Assignee: Bertrand Delacretaz

> Sling Javascript Client Templates (was: Ecmascript Client Templates)
> 
>
> Key: SLING-114
> URL: https://issues.apache.org/jira/browse/SLING-114
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
> Attachments: SLING-114.patch, SLING-114.patch
>
>
> To complete the javascript scripting features for microsling, I'd like to 
> implement a client-side version of the ESP templates.
> A template such as
>   <%= item.text %>
> Will be processed server-side to generate javascript client code such as
>   document.write("");
>   document.write(item.text);
>   document.write("\n");
> which executes on the client to render the content.
> Combined with a richer XHTML default rendering of data than what we have now, 
> this creates interesting possibilities for ajaxish apps based on 
> microsling/microjax (SLING-92).

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



[jira] Commented: (SLING-114) Sling Javascript Client Templates (was: Ecmascript Client Templates)

2007-12-11 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550420
 ] 

Bertrand Delacretaz commented on SLING-114:
---

Name change implemented in revision 603221, the ScriptEngine is now 
JstScriptEngine and uses the jst extension.

> Sling Javascript Client Templates (was: Ecmascript Client Templates)
> 
>
> Key: SLING-114
> URL: https://issues.apache.org/jira/browse/SLING-114
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
> Attachments: SLING-114.patch, SLING-114.patch
>
>
> To complete the javascript scripting features for microsling, I'd like to 
> implement a client-side version of the ESP templates.
> A template such as
>   <%= item.text %>
> Will be processed server-side to generate javascript client code such as
>   document.write("");
>   document.write(item.text);
>   document.write("\n");
> which executes on the client to render the content.
> Combined with a richer XHTML default rendering of data than what we have now, 
> this creates interesting possibilities for ajaxish apps based on 
> microsling/microjax (SLING-92).

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



Re: svn commit: r603212 - in /incubator/sling/trunk: commons/json/src/main/java/org/apache/sling/commons/json/ commons/json/src/main/java/org/apache/sling/commons/json/http/ commons/json/src/main/java

2007-12-11 Thread Carsten Ziegeler
Felix Meschberger wrote:
> Hi Carsten,
> 
> Good thing.
> 
> How about replacing the HashMap of the JSONObject by a LinkedHashMap
> such that David gets his properties in the order they were added ?
> 
Yepp, sounds good - I'll change it.

Carsten


-- 
Carsten Ziegeler
[EMAIL PROTECTED]


[jira] Resolved: (SLING-131) Use "ujax" as the short name for microjax in filenames, parameter names, etc.

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz resolved SLING-131.
---

Resolution: Fixed

Name change done in revision 603230, I think I have changed all instances of 
"microjax" as a client-visible filename or parameter to "ujax".

The prefix for μsling-specific request parameters is now "ujax:" instead of 
"ujax_"

I haven't changed the names of packages and classes, that would mean too many 
unnecessary changes, but on the other hand I have used "μsling" instead of 
"microsling" in the default html pages.

> Use "ujax" as the short name for microjax in filenames, parameter names, etc.
> -
>
> Key: SLING-131
> URL: https://issues.apache.org/jira/browse/SLING-131
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
>Priority: Minor
>
> Currently we have a mix of "microjax" in some places, and "ujax" in some 
> others, we should make that more consistent and use "ujax" throughout.
> That should really be μjax with an initial "mu" (and microsling should be 
> μsling maybe), but we don't want to fight with filename encodings problems...

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



[jira] Created: (SLING-132) Auto-reconnect to the JCR Repository if it is not found or lost

2007-12-11 Thread Bertrand Delacretaz (JIRA)
Auto-reconnect to the JCR Repository if it is not found or lost
---

 Key: SLING-132
 URL: https://issues.apache.org/jira/browse/SLING-132
 Project: Sling
  Issue Type: Improvement
  Components: microsling
Reporter: Bertrand Delacretaz
Priority: Minor


Setting the component to "microsling" as I haven't checked how that's handled 
in Sling.

It'd be useful to try to reconnect to the Repository from time to time, if it 
was not found or lost.

At startup, for example, if the Repository is provided by another webapp it 
might not be immediately available, but might come up after a few seconds.

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



Re: svn commit: r603212 - in /incubator/sling/trunk: commons/json/src/main/java/org/apache/sling/commons/json/ commons/json/src/main/java/org/apache/sling/commons/json/http/ commons/json/src/main/java

2007-12-11 Thread Bertrand Delacretaz
On Dec 11, 2007 1:55 PM, Carsten Ziegeler <[EMAIL PROTECTED]> wrote:

> Felix Meschberger wrote:
> > ...How about replacing the HashMap of the JSONObject by a LinkedHashMap
> > such that David gets his properties in the order they were added ?...
> >
> Yepp, sounds good - I'll change it...

Cool, hope that works for everybody, not only for David ;-)

- Bertrand (ducks and runs)


[jira] Closed: (SLING-23) Use correct namespaces (for node types, taglibs etc)

2007-12-11 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler closed SLING-23.
-

Resolution: Fixed

I think we have changed all existing nodetypes accordingly. So I close this bug.

> Use correct namespaces (for node types, taglibs etc)
> 
>
> Key: SLING-23
> URL: https://issues.apache.org/jira/browse/SLING-23
> Project: Sling
>  Issue Type: Bug
>  Components: API
>Reporter: Carsten Ziegeler
>
> As recently discussed, all namespace for sling should start with 
> "http://sling.apache.org/"; (and not use the jackrabbit namespace), followed 
> by an intermediate path denoting the type (like taglib, jcr namespace etc), 
> followed by the version, so we'll have:
> http://sling.apache.org/taglibs/sling/1.0
> http://sling.apache.org/jcr/sling/1.0
> etc.

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



[jira] Created: (SLING-133) microsling Resource resolver and default renderers do not support Properties

2007-12-11 Thread Bertrand Delacretaz (JIRA)
microsling Resource resolver and default renderers do not support Properties


 Key: SLING-133
 URL: https://issues.apache.org/jira/browse/SLING-133
 Project: Sling
  Issue Type: Improvement
  Components: microsling
Reporter: Bertrand Delacretaz
Priority: Minor


Currently, assuming the /content/testing/foo Node exists and has a "text" 
property, requesting /content/testing/foo/text.txt (or any other extension) 
fails with a ClassCastException, as the resolution and rendering chain supports 
Nodes only.

It should be fairly easy to use a JcrPropertyResource when the 
MicroslingResourceResolver finds an Item that is a Property, and let the 
default renderers handle it.

One use case, is, when working with client-side forms, to fill a , 
for example, with the value of a property, based on a relative URL.

I don't think we need to handle POSTs to Properties for now, but GETs are 
useful in the above case, and for testing as well.

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



[jira] Commented: (SLING-133) microsling Resource resolver and default renderers do not support Properties

2007-12-11 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550451
 ] 

Bertrand Delacretaz commented on SLING-133:
---

Simple default rendering of Properties implemented in revision 603249, see the 
PropertyRenderingTest class for examples.

JcrPropertyResource currently uses an empty string for the resourceType, so 
Properties cannot be wired to rendering scripts (which is probably not needed 
either).

Leaving this issue open, as we might want to refine this for other HTTP methods.

> microsling Resource resolver and default renderers do not support Properties
> 
>
> Key: SLING-133
> URL: https://issues.apache.org/jira/browse/SLING-133
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Priority: Minor
>
> Currently, assuming the /content/testing/foo Node exists and has a "text" 
> property, requesting /content/testing/foo/text.txt (or any other extension) 
> fails with a ClassCastException, as the resolution and rendering chain 
> supports Nodes only.
> It should be fairly easy to use a JcrPropertyResource when the 
> MicroslingResourceResolver finds an Item that is a Property, and let the 
> default renderers handle it.
> One use case, is, when working with client-side forms, to fill a , 
> for example, with the value of a property, based on a relative URL.
> I don't think we need to handle POSTs to Properties for now, but GETs are 
> useful in the above case, and for testing as well.

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



[jira] Resolved: (SLING-93) JSON Item renderer for microsling

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz resolved SLING-93.
--

Resolution: Fixed

Tests have been expanded, I think we can mark this issue as resolved

> JSON Item renderer for microsling
> -
>
> Key: SLING-93
> URL: https://issues.apache.org/jira/browse/SLING-93
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Priority: Minor
> Attachments: more_news.json, news.json
>
>
> For SLING-92 we need a JSON renderer, I'll attach some JSON output here, from 
> our r-jax prototype, as examples.

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



[jira] Resolved: (SLING-88) Use the sling-api from SLING-28 in microsling

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz resolved SLING-88.
--

Resolution: Fixed

microsling has been using the sling-api for some time now, resolving this issue

> Use the sling-api from SLING-28 in microsling
> -
>
> Key: SLING-88
> URL: https://issues.apache.org/jira/browse/SLING-88
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>
> Once we agree on SLING-28, microsling can be "ported" to this API, so that 
> both microsling and Sling use it.
> Make sure to tag 
> http://svn.apache.org/repos/asf/incubator/sling/whiteboard/microsling/ before 
> doing this

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



Resource.getURI issue

2007-12-11 Thread Felix Meschberger
Hi all,

Once upon a time while developping the Resource interface we found that
the resource "path" would not necessairily be just a path but may be a
URI. In the meantime the Resource interface evolved into the current
state with the adaptTo method allowing different views of a resource. On
the other hand, the ResourceResolver interface has getter methods for
resources based on just a path.

So, I think, it would probably be better and cleaner to rename the
getURI() method to getPath() because this is what this method actually
returns.

WDYT ?

Regards
Felix



Re: Resource.getURI issue

2007-12-11 Thread Carsten Ziegeler
Felix Meschberger wrote:
> Hi all,
> 
> Once upon a time while developping the Resource interface we found that
> the resource "path" would not necessairily be just a path but may be a
> URI. In the meantime the Resource interface evolved into the current
> state with the adaptTo method allowing different views of a resource. On
> the other hand, the ResourceResolver interface has getter methods for
> resources based on just a path.
> 
> So, I think, it would probably be better and cleaner to rename the
> getURI() method to getPath() because this is what this method actually
> returns.
> 
> WDYT ?
> 
Yes, makes sense: +1

Carsten

-- 
Carsten Ziegeler
[EMAIL PROTECTED]


[jira] Resolved: (SLING-92) microjax - lightweight Ajax client and servlet for microsling

2007-12-11 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz resolved SLING-92.
--

Resolution: Fixed

although this needs to be documented, the implementation and tests look good 
enough for now

> microjax - lightweight Ajax client and servlet for microsling
> -
>
> Key: SLING-92
> URL: https://issues.apache.org/jira/browse/SLING-92
> Project: Sling
>  Issue Type: Improvement
>  Components: microsling
>Reporter: Bertrand Delacretaz
>Priority: Minor
>
> As discussed on the mailing list [1], I'll contribute to microsling the 
> experimental "r-jax" stuff [2] that we wrote together with David Nuescheler.
> The main changes are:
> 1) The default microsling servlet needs to handle POSTs in a more clever way, 
> to provide useful services to the javascript client
> 2) For GETs, the default microsling servlet needs to provide a JSON 
> representation, when the json extension is used. This will be extensible to 
> XML and other output formats.
> [1] http://thread.gmane.org/gmane.comp.apache.sling.devel/721
> [2] http://www.day.com/maven/rjax/

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



Re: Decoupling resource resolver and resource manager

2007-12-11 Thread Felix Meschberger
Hi all,

To summarize this discussion I created a JIRA issue [1] on what I intend
to be done.

Regards
Felix

[1] http://issues.apache.org/jira/browse/SLING-134

Am Freitag, den 07.12.2007, 12:41 +0100 schrieb Carsten Ziegeler:
> Hi,
> 
> I think we should not let the ResourceManager extend the
> ResourceResolver as this complicates its usage.
> If you want to get the ResourceManager you currently have to get it from
> the request via the getResourceResolver() method and then try to down
> cast it.
> 
> If we are in an OSGi environment and you want to implement a service
> depending on the resource manager, you have to depend (bind) the
> resource resolver and test if it is a resource manager. This is a little
> bit ugly as you just want to use a resource manager.
> As the resource manager gets a Resource object via its method I think we
> can decouple the interfaces without any problems.
> 
> I currently see no benefit in extending the resource resolver for the
> resource manager. Therefore I propose to make it a standalone
> interface/service and add a getResourceManager() method to the sling
> request which might return null if no resource manager is available.
> Or, if we don't want to add the getResourceManager() method, one can get
> the resource manager through the service locator (which is fine for me
> as well).
> In addition we should perhaps think of a better name than resource
> manager...
> 
> Carsten



Re: Resource.getURI issue

2007-12-11 Thread Bertrand Delacretaz
On Dec 11, 2007 3:55 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote:

> ...So, I think, it would probably be better and cleaner to rename the
> getURI() method to getPath() because this is what this method actually
> returns

+1, makes sense.

-Bertrand


[jira] Created: (SLING-134) Decoupling resource resolver and resource manager

2007-12-11 Thread Felix Meschberger (JIRA)
Decoupling resource resolver and resource manager
-

 Key: SLING-134
 URL: https://issues.apache.org/jira/browse/SLING-134
 Project: Sling
  Issue Type: Bug
  Components: API
Reporter: Felix Meschberger


On the dev list in the "Decoupling resource resolver and resource manager" 
thread [1], Carsten raises the question on whether the ResourceManager 
interface should actually extend the ResourceResolver interface. In fact, just 
as we have "removed" the JCR API dependency from the Sling API, we should 
probably also removed the Object Mapping "dependency" from the API and make 
this an implementation detail.

So to summarize the findings of the discussion, we the SLING API shold be 
modified as follows:

   * Drop the ResourceManager interface alltogether
   * Add a new method to the ResourceResolver interface :

Type adaptTo(Class type);

Using this method and depending on the implementation, various views of the 
ResourceResolver may be obtained. For microsling an adaptor a JCR Session is 
conceivable, while for Sling an adaptor to both a JCR Session and an 
ObjectContentManager (from the Jackrabbit OCM project) would make sense.

Please note, that dropping the ResourceManager interface has absolutely no 
impact on the jcr/resource project supporting object mapping through the 
Resource.adaptTo method. This change only make access to the object content 
mapping cleaner and the Sling API simpler.

If there is no objection, I will implement this change sometime next week.


[1] http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01211.html

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



Re: svn commit: r603302 - /incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/scripting/MicroslingScriptResolver.java

2007-12-11 Thread Felix Meschberger
Hi,

Am Dienstag, den 11.12.2007, 17:03 + schrieb [EMAIL PROTECTED]:
> +
> +// SLING-133: do not resolve scripts for Properties, we want to use 
> our default
> +// renderers for them (TODO: having that test here is really a temp 
> fix)
> +if(r.adaptTo(Property.class) != null) {
> +return null;
> +}

While I honestly do not have a good solution, I am always weary of such
special case handling.

But then: Why should such resources not be handled by any script (or
servlet) ?

Regards
Felix




Re: Searching resources

2007-12-11 Thread Christophe Lombart
Sorry for the delay. I was very busy.
thanks a lot to added this.


On Dec 10, 2007 4:21 PM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:

> On Dec 5, 2007 10:45 PM, Christophe Lombart
> <[EMAIL PROTECTED]> wrote:
>
> > > Felix said:
> > > There is no SyntheticResource in microsling at the moment. But if you
> > > need it, you can simply copy it over from the Sling jcr/resource
> > > project. It is in fact rather a simple class.
> >
> > ...Ok. In the first time I will make a copy but you are right. this is
> > important to solve this issue
>
> I needed SyntheticResource for a demo that I'm working on, so I have
> added it to microsling, see
> https://issues.apache.org/jira/browse/SLING-129
>
> Currently it's duplicated between sling/jcr and microsling, I've put
> TODOs to remind us from merging that at some point.
>
> -Bertrand
>