Re: documentation for server-side ECMAscript

2009-02-16 Thread Valentin Jacquemin
Something that helped me a lot was to have a look at the unit tests
particularly under
/sling_src_home/scripting/javascript/src/test/java/org/apache/sling/scripting
(it seems that the Sling svn is not alive anymore.. )

My 0.5 cents ;)

On Mon, Feb 16, 2009 at 8:19 PM, Felix Meschberger fmesc...@gmail.comwrote:

 Hi,

 There are a few server side scripts in the sample modules as well as the
 integration tests (look for .esp files).

 Additionally [1] might also help.

 Regards
 Felix

 [1] http://cwiki.apache.org/SLING/scripting-variables.html

 vkrejcirik schrieb:
  Hi, can I ask you, if it exists any documentation or examples of
  server-side ECMAscript which is uses for rendering of content?
 




-- 
Valentin Jacquemin


Sling Repository Explorer

2009-03-07 Thread Valentin Jacquemin
Dear all,

I don't know if there are some dev about the Sling-based JCR explorer[1] but
I started a small prototype about it.

I hope it could be usefull for the newcomers on Sling as a sample app for
example. At least, to me it helped to learn some basic functionalities about
Sling.
So enough words, my prototype is here (I don't know the usual process to
propose a contribution, are there any repository available for the
non-comitters?):

html
head
script src=/system/sling.js/script
style
ul li{
list-style-type: disc;
}
/style
/head
body
h1Sling Repository Explorer/h1
div id=nodesTree style=width: 250px; float:left; padding-right: 10px;
border-right: solid 1px black; margin-right: 5px; overflow: auto;
ul
%
  function prt(nodePath, nodeName) { out.println(li
id='+nodePath+'a
href=\javascript:Sling.Explorer.getProperties('+nodePath+')\ +
nodeName + /a/li); }
var root = currentNode.session.getRootNode();
var nodes = root.getNodes(*);
for(n in nodes)
{
prt(nodes[n].getPath(), nodes[n].getName());
}
%
/ul
/div
div style=float:left; padding-left: 5px; id=properties
/div

script type=text/javascript
(function(){
var folderTypes = ['SLING:FOLDER','NT:FOLDER', 'REP:SYSTEM'];
var isFolder = function(str){
for(var x in folderTypes)
{
if(str.toUpperCase() === folderTypes[x])
return true;
}
return false;
};
var loadChildren = function(path){
var query = new String(path);
  query = query.toString();
   var props = Sling.getContent(query,1,true);
   var str = '';
   var parent = document.getElementById(path);
   var hide = parent.childNodes.length != 1;
   for(p in props)
   {
   if(props[p] instanceof Object)
   {
   if(hide === true)
   {
   while(parent.childNodes.length != 1)
   {
   parent.removeChild(parent.lastChild);
   }
   }
   else
   {
  var ulEl = document.createElement('ul');
  var liEl = document.createElement('li');
  liEl.setAttribute('id', query + / + p);
  var t = document.createElement('a');
  t.setAttribute('href',
javascript:Sling.Explorer.getProperties('+path+/+p+'));
  t.appendChild(document.createTextNode(p));
  liEl.appendChild(t);
  ulEl.appendChild(liEl);
  parent.appendChild(ulEl);
   }
   }
   str += p + ' : ' + props[p];
   }
};

Sling.Explorer = {
  getProperties: function(path){
var query = new String(path);
 var props = Sling.getContent(query.toString(),0,true);
 var str = '';
 for(p in props)
 {
 str += p + ' : ' + props[p];
 str += 'br/';
 if(p == 'jcr:primaryType'   isFolder(props[p]))
 {
 loadChildren(path);
 }
 }
 var domProps = document.getElementById('properties');
 domProps.innerHTML = str;
  }
}
})();
/script
/body
/html

Any advices? Am I in the right direction
With my best regards,
Valentin Jacquemin

[1] http://cwiki.apache.org/SLING/sling-based-jcr-explorer.html


Re: Summer of Code is upon us

2009-03-19 Thread Valentin Jacquemin
I proposed a prototype for the JCR browser sometime ago on the mailing list
but just to know, will it be a project assigned to a GSoc student? In that
case I'll just move my effort on some other area of Sling... Even if at that
time I have to finish some other project that is consuming lots of my spare
time.

Valentin Jacquemin


On Thu, Mar 19, 2009 at 10:56 AM, Bertrand Delacretaz 
bdelacre...@apache.org wrote:

 On Thu, Mar 19, 2009 at 10:42 AM, Christophe Lombart
  More project ideas and mentors are welcome!...


  ...What about a JCR browser and some admin tools for Sling (user/group
  management, ...) ?...

 Sure - a JCR browser with OSGi-based plugins selected based on node
 type/path/properties/phase of moon (well maybe not) sounds cool.

 ... What about a set of small classic web apps like forum, news
 management,...

 Also good of course.

 Feel free to suggest a project at [1] and step in as a mentor, all
 committers are welcome to do that!

 -Bertrand

 [1] http://wiki.apache.org/general/SummerOfCode2009#sling-wikipedia



Re: Summer of Code is upon us

2009-03-19 Thread Valentin Jacquemin
On Thu, Mar 19, 2009 at 12:08 PM, Bertrand Delacretaz 
bdelacre...@apache.org wrote:

 Hi Valentin,

 On Thu, Mar 19, 2009 at 12:01 PM, Valentin Jacquemin
 jacquem...@gmail.com wrote:
  I proposed a prototype for the JCR browser sometime ago on the mailing
 list
  but just to know, will it be a project assigned to a GSoc student?...

 Yes, sorry I didn't reply to your proposal. Totally swamped at the
 moment, probably won't find time to really look at it before a week or
 so.


No problem it was just to be aware of the current situation.



 Anyway. such a project will only be assigned to a GSoC student if a
 committer proposes it and signs up as a mentor at [1]. For now it's
 just an idea floating around.

 ... In that
  case I'll just move my effort on some other area of Sling... Even if at
 that
  time I have to finish some other project that is consuming lots of my
 spare
  time

 Ok - a good JCR explorer is something that many of us are looking
 forward to, and it's not a trivial task, and Sling's OSGi plugins open
 some very interesting possibilities.

 So it's certainly possible for several people to collaborate on that
 anyway. But someone has to lead I guess, and at the moment it seems
 like none of the Sling contributors have enough free cycles for that.


Fine! As I am a newcomer in Sling/OSGi, i am here to collaborate and learn
from all of other participants.



 -Bertrand

 [1] http://wiki.apache.org/general/SummerOfCode2009



Re: JCR Explorer (was: Summer of Code is upon us)

2009-03-19 Thread Valentin Jacquemin

  ...jquery is a little bit young in term of widgets like treeview, grid.
  I'm just wondering if working with GWT will not be more productive for
 this
  kind of application

 Why not - I'm not familiar with it (nor with any other UI framework
 anyway), but the concept looks cool.


I'm not familiar with GWT either but if could add my 50 cents I'd propose
the use of YUI that is powerful and that has a wide range of widgets.



 -Bertrand


--
Valentin Jacquemin


Re: Sling graduates from the Apache Incubator!

2009-06-18 Thread Valentin Jacquemin
Congratulations!!
Valentin Jacquemin


On Thu, Jun 18, 2009 at 10:49 AM, Paul Noden nod...@nodster.co.uk wrote:

 2009/6/18 Bertrand Delacretaz bdelacre...@apache.org

  I'm pleased to announce that our Board of Directors, at yesterday's
  meeting, approved the graduation of Sling as a top-level project.
 

 Congratulations to all involved, tremendous effort  now things can only
 accelerate in terms of both use and contribution!

 Many Thanks!

 Paul Noden