Re: easy way to dump JSON from JCR Node or Resource?

2014-08-15 Thread Sam Lee
2014-08-14 23:45 GMT+02:00 Sam Lee skyn...@gmail.com: Hi, I want to dump all JCR content to mongodb for analysis. I see there is https://issues.apache.org/jira/browse/SLING-3485 . And org.apache.sling.servlets.get.impl.helpers.ResourceTraversor does what I want to do. But I am

easy way to dump JSON from JCR Node or Resource?

2014-08-14 Thread Sam Lee
Hi, I want to dump all JCR content to mongodb for analysis. I see there is https://issues.apache.org/jira/browse/SLING-3485 . And org.apache.sling.servlets.get.impl.helpers.ResourceTraversor does what I want to do. But I am stuck with older version of Sling. Are there other ways to dump JSON

Re: How to start with a Sling-based app

2013-03-06 Thread Sam Lee
I personally provide OSGi bundles. On Wed, Mar 6, 2013 at 9:12 AM, Fabian Christ christ.fab...@googlemail.comwrote: Hi, I am evaluating the use of Sling for a new project. I have been studying the documentation of Sling and Jackrabbit for a while now. I really like the design and the idea

Re: How to start with a Sling-based app

2013-03-06 Thread Sam Lee
An example OSGi bundle project: https://github.com/saml/rosling I don't use scriptlets much (jsp, ecma under /apps). I use repository to store data only, not code. If you want to use scriptlets, you can use scripts like this to upload the scriptlets when modified:

AdapterFactory hierarchy and super.adaptTo() ?

2012-12-17 Thread Sam Lee
Hey, Given public class Bar implements Foo { ... } I want to provide AdapterFactory that returns Bar instance when resource.adaptTo(Foo.class) is called. Here is my attempt: =8= @Component(metatype = false, immediate = true) @Service @Properties({ @Property(name =

Re: shutdown all servlets except felix web console?

2012-08-22 Thread Sam Lee
2012/8/22 Bertrand Delacretaz bdelacre...@apache.org: On Tue, Aug 21, 2012 at 11:02 PM, Sam Lee skyn...@gmail.com wrote: The component gets disabled during deployment :P. Maybe I need to create a separate OSGi bundle for this Yes, if the bundle that contains your filter

shutdown all servlets except felix web console?

2012-08-21 Thread Sam Lee
Hey, When deploying OSGi bundles through Felix Web Console, I want to block all traffic to the sling instance. But, still able to deploy OSGi bundles. The reason is because incoming traffic during deployment freezes instance (have to kill -9). Thanks.

Re: shutdown all servlets except felix web console?

2012-08-21 Thread Sam Lee
Thanks. Do you have an example of such servlet filter? On Tue, Aug 21, 2012 at 11:53 AM, Bertrand Delacretaz bdelacre...@apache.org wrote: Hi, On Tue, Aug 21, 2012 at 5:46 PM, Sam Lee skyn...@gmail.com wrote: When deploying OSGi bundles through Felix Web Console, I want to block all

Re: shutdown all servlets except felix web console?

2012-08-21 Thread Sam Lee
, 2012 at 11:56 AM, Sam Lee skyn...@gmail.com wrote: Thanks. Do you have an example of such servlet filter? On Tue, Aug 21, 2012 at 11:53 AM, Bertrand Delacretaz bdelacre...@apache.org wrote: Hi, On Tue, Aug 21, 2012 at 5:46 PM, Sam Lee skyn...@gmail.com wrote: When deploying OSGi

Re: shutdown all servlets except felix web console?

2012-08-21 Thread Sam Lee
The component gets disabled during deployment :P Maybe I need to create a separate OSGi bundle for this On Tue, Aug 21, 2012 at 4:46 PM, Sam Lee skyn...@gmail.com wrote: @SlingFilter(scope = SlingFilterScope.REQUEST, order = Integer.MAX_VALUE, generateComponent = false) @Component

Re: Best way to store data in Sling

2011-07-10 Thread sam lee
How about: /projects/sling /projects/sling/jcr:content /projects/sling/jcr:content/mailingLists /projects/sling/jcr:content/mailingList/users /projects/sling/jcr:content/mailingList/devs /projects/couchdb ... Then, each project will have json like: GET /projects/sling.tidy.-1.json {

Re: Beginners question with Sling.

2011-07-08 Thread sam lee
Out of curiosity, why are you using Java and access Sling through HTTP? If you really like Java, you can create an OSGi bundle and deploy the bundle to Sling (felix, /system/console). You can put Servlets and other useful utilities in the bundle. And, you can access the repository directly

Re: Beginners question with Sling.

2011-07-08 Thread sam lee
, 2011 at 8:05 AM, Phil Rice phil.rice.erud...@googlemail.comwrote: @Sam Lee Why do you want to access through Java My client is going to be an Eclipse Plugin. In practice I will probably use Scala or Clojure, but I didn't want to pollute my pitiful request for help with language issues. I

Re: Beginners question with Sling.

2011-07-07 Thread sam lee
You can use /system/sling.js It has Sling.removeContent() and Sling.getContent(). You just need to implement Sling.createContent(), Sling.updateContent(), Sling.query() using xhr. Then you have something like couchdb. I don't think sling has RESTful API reference. It would be useful. On Thu,

Re: Sling Resource Visitor?

2011-06-17 Thread sam lee
up (Queue will get large).. Probably proper way would be to spawn a thread and implement proper producer/consumer.. On Thu, Jun 16, 2011 at 12:28 PM, Justin Edelson jus...@justinedelson.comwrote: Sam- Care you supply a patch to include this? On Thu, Jun 16, 2011 at 7:35 AM, sam lee skyn

rewriter example?

2011-05-19 Thread sam lee
Hey, I am trying to insert my transformer to default rewriter pipeline: http://sling.apache.org/site/output-rewriting-pipelines-orgapacheslingrewriter.html Is there an example for that? I want to transform all src attributes of img elements matching some test to my liking. Thanks.

serve static file?

2011-05-12 Thread sam lee
Hey, Is there a way to serve static files from filesystem (not repository)? For example, GET /static/js/jquery.js will be served from /var/www/media/js/jquery.js of filesystem, not repository. (/static/* is served from /var/www/media/*)

Re: serve static file?

2011-05-12 Thread sam lee
at 12:07 PM, sam lee skyn...@gmail.com wrote: Hey, Is there a way to serve static files from filesystem (not repository)? For example, GET /static/js/jquery.js will be served from /var/www/media/js/jquery.js of filesystem, not repository. (/static/* is served from /var/www

how can I synchronize two sling instances?

2011-04-23 Thread sam lee
Hey, I have one sling instance running with lots of content. And, I have a new sling instance without content. Is there rsync-like way of migrating content from older instance to newer one? They run different version of sling. Or, how would you copy a JCR tree /foo/bar/* from one machine to

Re: Inheritance and URL decomposition

2011-03-31 Thread sam lee
Day CQ mailing list is: http://groups.google.com/group/day-communique If the resource, /products/my-first-product , has sling:resourceType = /apps/foo/product, then, to render .html version of the resource, /apps/foo/product/html.jsp will be used. To render simple.html version of the resource,

implicit sling:resourceType?

2011-03-03 Thread sam lee
Hey, I have a node: /content/page whose sling:resourceType = /apps/foo/bar So, GET /content/page.html will be handled by /apps/foo/bar/html.jsp I cannot modify sling:resourceType of /content/page. However, I would like GET /content/page.edit.html to be handled by

crawling html in asynchronous service?

2011-02-24 Thread sam lee
Hey, I am using Scheduler to crawl html files. It runs every minute. And it needs to crawl /content/foo.html If I use Apache commons HttpClient for GET /content/foo.html, I need to set up authentication (Basic Auth?). However, since all html pages that I want to crawl are served within Sling,

Re: Problem with registering a servlet for initial POST / Override SlingPostServlet

2011-02-20 Thread sam lee
For creation of a resource, I would listen to a path or a selector. For example, POST /wcmpp/image with parameters like: resourcePath=/content/wcmpp/image/foo .. etc or, POST /content/wcmpp/image/foo.create.json with other parameters.. For the first case, you can set sling.servlet.paths

Re: registering AdapterFactory

2011-02-11 Thread sam lee
://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/adapterfactory/src/main/java/org/apache/sling/jcr/jackrabbit/adapterfactory/ On Fri, Feb 11, 2011 at 4:24 AM, Felix Meschberger fmesc...@adobe.comwrote: Hi Sam, Am Donnerstag, den 10.02.2011, 20:03 + schrieb sam lee: Hey, I am using Sling

Re: New tutorial about 'Getting Resources and Properties in Sling'

2010-12-15 Thread sam lee
when I do, final ResourceResolver resourceResolver = resolverFactory.getAdministrativeResourceResolver(null); final Session session = resourceResolver.adaptTo(Session.class); do I need to call session.logout();? maybe Session session = null; try { resolver =

how do I set multi-value property with only one value using SlingPostServlet?

2010-12-10 Thread sam lee
I tried: curl -u admin:admin -F'foo=bar' -F'foo=' http://localhost:/some/path but this creates property foo to be {bar,} (second element is empty). I also tried curl -u admin:admin -F'foo=bar' -F'foo=null' http://localhost:/some/path but still it failed to create a multi-value

Re: how do I set multi-value property with only one value using SlingPostServlet?

2010-12-10 Thread sam lee
curl -u admin:admin -F'foo=bar' -F'f...@typehint=string[]' http://localhost:/some/path worked. Thaks./ On Fri, Dec 10, 2010 at 11:34 AM, sam lee skyn...@gmail.com wrote: I tried: curl -u admin:admin -F'foo=bar' -F'foo=' http://localhost:/some/path but this creates property foo

Re: How can I conditionally use Throwable.jsp?

2010-12-06 Thread sam lee
script=/apps/sling/servlet/errorhandler/errorHandler.jsp/ %}% Thanks. Sam On Mon, Dec 6, 2010 at 2:56 AM, Felix Meschberger fmesc...@gmail.comwrote: Hi, Am Freitag, den 03.12.2010, 17:36 -0500 schrieb sam lee: I want to handle uncaught exceptions only some times. According to this page

How can I conditionally use Throwable.jsp?

2010-12-03 Thread sam lee
I want to handle uncaught exceptions only some times. According to this page: http://sling.apache.org/site/errorhandling.html I created /apps/sling/servlet/errorhandler/Throwable.jsp But, only when some conditions are met, I want to use custom Throwable.jsp. Other times, I want sling to use

how can I disable sling json servlet for some nodes?

2010-11-22 Thread sam lee
Is there a way to disable json servlet for some nodes? For example, I can think of DDoS for sling applications: http://www.example.com/content/dam.tidy.-1.json http://www.example.com/content/dam.tidy.-2.json ... http://www.example.com/content/dam.acl.-1.json

Re: alias or reference?

2010-11-05 Thread sam lee
. Justin On Tue, Nov 2, 2010 at 4:07 PM, sam lee skyn...@gmail.com wrote: Hey, I want: GET /some/path/jpeg.tidy.infinity.json to be equivalent to: GET /some/other/path/foo.tidy.infinity.json I tried: /some/path/jpeg/sling:resourceType = /some/other/path/foo and /some/path/jpeg

Re: alias or reference?

2010-11-05 Thread sam lee
of the JCR Resource bundle. Justin On 11/5/10 3:25 PM, sam lee skyn...@gmail.com wrote: Ah, Thank you. I see. I hope sling:alias could be String[]. Even if I set sling:alias = {png, gif, tiff}.. only the first entry, png, is used. For example, /some/path/jpeg (sling:alias = {png, gif, tiff

Re: POST file to upload and set jcr:mixinTypes?

2010-09-17 Thread sam lee
/jcr:mixinTypes value=my:mixin / /form As it is below, you are setting the type of /path/to to nt:file, not /path/to/filename.jpg. Same thing with the mixin declaration. HTH, Justin On 9/16/10 11:24 AM, sam lee wrote: Hey, I am trying to upload a file to /path/to/filename.jpg /path

POST file to upload and set jcr:mixinTypes?

2010-09-16 Thread sam lee
Hey, I am trying to upload a file to /path/to/filename.jpg /path/to/filename.jpg should be nt:file and have jcr:mixinTypes set to my:mixin. I am trying: form method=POST action=/path/to enctype=multipart/form-data input type=file name=./filename.jpg / input type=submit value=upload /