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

Re: Beginners question with Sling.

2011-07-08 Thread Alexander Klimetschek
On 08.07.11 10:39, Phil Rice phil.rice.erud...@googlemail.com wrote: DefaultHttpClient client = new DefaultHttpClient(); client.getCredentialsProvider().setCredentials(new AuthScope(localhost, 8080), new UsernamePasswordCredentials(admin, admin)); I guess you need to use preemptive auth:

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]

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

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

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 Bertrand Delacretaz
On Fri, Jul 8, 2011 at 1:31 PM, Julian Sedding jsedd...@gmail.com 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

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 Justin Edelson
On Fri, Jul 8, 2011 at 8:51 AM, sam lee skyn...@gmail.com 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

Re: Beginners question with Sling.

2011-07-08 Thread Justin Edelson
On Fri, Jul 8, 2011 at 7:31 AM, Julian Sedding jsedd...@gmail.com 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

Re: Beginners question with Sling.

2011-07-08 Thread Bertrand Delacretaz
Hi Phil, On Fri, Jul 8, 2011 at 4:15 PM, Phil Rice phil.rice.erud...@googlemail.com 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

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