Re: Beginners question with Sling.

2011-07-08 Thread Phil Rice
I appreciate the feedback on suitability, as I don't know this area of programming very well. I suspect I will be two or three years on this project, so any mistakes will be biting me for quite some time. The built in sling explorer works well and gives me quite a lot of confidence that the program

Re: Beginners question with Sling.

2011-07-08 Thread Bertrand Delacretaz
On Fri, Jul 8, 2011 at 4:51 PM, Mark Herman wrote: > I agree, it sounds like Sling will work for what you need.  Personally I > first was interested in using the JCR, and after learning that, Sling was > very easy to pick up.  I would definitely recommend getting some sort of JCR > explorer so you

RE: Beginners question with Sling.

2011-07-08 Thread Mark Herman
I agree, it sounds like Sling will work for what you need. Personally I first was interested in using the JCR, and after learning that, Sling was very easy to pick up. I would definitely recommend getting some sort of JCR explorer so you can get a feel of how a jcr repository works, looks and fee

Re: Beginners question with Sling.

2011-07-08 Thread Bertrand Delacretaz
Hi Phil, On Fri, Jul 8, 2011 at 4:15 PM, Phil Rice wrote: > ...Although I came to Sling for the Restful interface, there are a few of > features that Sling adds to Jackrabbit that I like: > 1: It looks as though Sling would deal with the schema changing across > time issue: The support for multip

Re: Beginners question with Sling.

2011-07-08 Thread Phil Rice
> "Why don't  you use Jackrabbit via DavEx or RMI?" Good question. I was looking for a REST interface to Jackrabbit. I don't like RMI. I don't like it a lot. IMHO Remote Procedure Calls come into the category of a Very Bad Idea (TM), but that discussion has been done to death. I'm not actually fami

Re: Beginners question with Sling.

2011-07-08 Thread Justin Edelson
On Fri, Jul 8, 2011 at 7:31 AM, Julian Sedding wrote: > Hi Phil > > Typically when working with Sling you don't access it via HTTP a lot. How do you figure? Seem to me that Sling applications are almost always accessed via HTTP. Justin > Rather you work "within" Sling. I.e. you write scripts t

Re: Beginners question with Sling.

2011-07-08 Thread Justin Edelson
On Fri, Jul 8, 2011 at 8:51 AM, sam lee wrote: > Why don't  you use Jackrabbit via DavEx or RMI? > http://wiki.apache.org/jackrabbit/RemoteAccess DavEX and RMI are both fairly heavyweight. IIUC, the use case is similar to remote logging where simple data is posted from lots of clients to a centra

Re: Beginners question with Sling.

2011-07-08 Thread sam lee
Why don't you use Jackrabbit via DavEx or RMI? http://wiki.apache.org/jackrabbit/RemoteAccess I don't think Sling is a remote repository. I'm not sure what you meant by "a mixture of structured and unstructured data". Have you looked at other databases such as CouchDB or MongoDB? On Fri, Jul

Re: Beginners question with Sling.

2011-07-08 Thread Phil Rice
@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 think Sling looks like an excellent remote repository for a mixture of str

Re: Beginners question with Sling.

2011-07-08 Thread Bertrand Delacretaz
On Fri, Jul 8, 2011 at 1:31 PM, Julian Sedding wrote: > ...Typically when working with Sling you don't access it via HTTP a lot. > Rather you work "within" Sling. I.e. you write scripts that run within > an authenticated request (which typically originates from a browser). > I believe that getting

Re: Beginners question with Sling.

2011-07-08 Thread Julian Sedding
Hi Phil Typically when working with Sling you don't access it via HTTP a lot. Rather you work "within" Sling. I.e. you write scripts that run within an authenticated request (which typically originates from a browser). I believe that getting "inside" Sling can be a little tricky at the beginning a

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 withou

Re: Beginners question with Sling.

2011-07-08 Thread Phil Rice
Also thanks Julain/Bertand. I now have about the simplest hello world program working. I suspect as I get further into the project, I will need to look at the authentication system a lot more thoroughly, but for now I am happy with just being able to POST and GET data! public class PopulateReposit

Re: Beginners question with Sling.

2011-07-08 Thread Phil Rice
Thanks for the help Alex. Unfortunately that is one of the things that has changed in the new API. Its no longer a method available from the parameters. However the advice to follow the test framework was very good and the following now works. I can rip this apart and reduce to to the minimum worki

Re: Beginners question with Sling.

2011-07-08 Thread Julian Sedding
Hi Phil Check out the integration tests, as Bertrand suggested. In the class AbstractAuthenticatedTest[0] there is pretty much the same code you're trying to write. I think that should get you going. Regards Julian [0] http://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/

Re: Beginners question with Sling.

2011-07-08 Thread Alexander Klimetschek
On 08.07.11 10:39, "Phil Rice" wrote: >DefaultHttpClient client = new DefaultHttpClient(); >client.getCredentialsProvider().setCredentials(new AuthScope("localhost", >8080), new UsernamePasswordCredentials("admin", "admin")); I guess you need to use preemptive auth: client.getParams().setAuthent

Re: Beginners question with Sling.

2011-07-08 Thread Phil Rice
Thank you all for you help and advice I have to say that I am struggling with Apache Sling. I am an experienced developer, and have put the time in: I think I am on day 5 now, and while I am running launchpad, I am getting nowhere flat with using it from the Java Code. To be honest am getting quit