Hello, Dilipkumar Jadhav wrote: > Hello everyone, > I just finished updating an application 'mktree' and have created the > application page in the codes section. > This is just a simple script borrowed from the work of Matt Kruse and > converts basic ul-li list to collapsible tree. > I had to devise this since we are using this tree to "drill-down" to > possible resolutions based on error symptoms. > The helpdesk support has to chose between various nodes of the tree to reach > a possible resolution. > Of all the trees I saw, this was by far the simplest of all & easiest to > implement. With a size of 4kb it was definitely not going to affect > performance of the pages. > This is my first ever contribution to the XWiki project. It is a very small > contribution but I hope someone somewhere will find it useful. > A big thanks to Jerome for his hint which helped me finish this application. > > Also, I have some questions about developing applications. > 1. What is the recommended size of the application .xar file? Is there a > upper limit / benchmark beyond which the performance of the page in a wiki > will be affected?
No there's not really an upper limit. Just the import of the XAR can be limiting, since XWiki right now has to load the whole XAR in memory. Even this should not be a problem if you stay reasonable (for example, the skin editor application http://code.xwiki.org/xwiki/bin/view/Applications/SkinEditorApplication embeds the dojo library + bespin code). Couples of mega bytes is definitely not an issue. > 2. What is the general opinion about plugins/applications developed in > JQuery or some other javascript library? I've been through a page on > XWiki.org which rationalizes the use of javascript libraries. However, is > JQuery completely off the list? Will this javascript library cause conflict > with prototype & script.aculo.us? I've implemented a tooltip plugin based on > the updated jTip library. I was really interested in contributing the > tooltip application to XWiki. Applications (or front-end extensions/plugins), are free to use any library they need. The good practice is to use the bundled libraries (prototype, scriptaculous, etc) versus non-bundled libraries (jquery, dojo or other) as much as possible, since it makes the pages smaller and it does not force the client to load a new file. Of course, this is not always possible, for example when you want to use a tiers library which itself is based on a non-bundled library like jquery (like in your case). If you have to do this, right now there are too approaches : either you include the library as a JSX (so paste the code in a JSX object in a wiki document), or you attach the .js file to the document and inject the needed <script> tag from a JSX extension that makes use of this library (something like : document.write('<script src=$doc.getAttachmentURL("mylib.js") ...') ; which is the preferred way for big libraries, since JSX objects have a limit in terms of content size. In the future we will probably makes it easier for extensions to require external libraries from attachments, with a new SX plugin for example. The conclusion is that it's better to use prototype if your need is a framework for DOM manipulations, AJAX, OOP-style javascript, etc; because it's bundled already in every page XWiki renders ; and use other libraries only when you really need it, of course taking care they are compatible with the ones bundled by default (there should be no problem with jQuery as far as I know, and there is non for sure using dojo). Hope this helps. Jerome > > Thank you all. > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users