2 Replies Latest reply on Oct 14, 2009 5:08 PM by mbucknam1

    Rest Interface path examples

    mbucknam1

      I was wondering if anyone could post examples of pulling items out of the example repository using the Rest interface? I rebuilt the Rest war using the repository and workspace, and data from the examples (Aircraft, Cars, Vehicles, etc) and can query it fine out to http://.../items but I can't seem to figure out what the path should be like. For example to retrieve an aircraft or a car and/or some or all of the properties of each?

      Some examples that work for me:

      http://localhost:8080/resources
      http://localhost:8080/resources/Vehicles/virtual/items
      http://localhost:8080/resources/Cars/workspace1/items
      http://localhost:8080/resources/Aircraft/workspace2/items

      Can't seem to add a {path} element to the end of the uri which I know is because I don't know what I'm doing. Help...

        • 1. Re: Rest Interface path examples
          elvisisking

          I don't have a URL for the "example" repository but here's one from a repository I use to test the DNA Eclipse plugin:

          http://localhost:8080/resources/dna:repository/default/items/myproject/myfolder/picture.jpg/jcr:content/jcr:lastModified

          The repository is "dna:repository" and the workspace is "default".

          The "picture.jpg" is a node representing a file. It's parent node represents a folder and has a name of "myfolder". That parent node has a parent that also represents a folder and has a name of "myproject".

          This "picture.jpg" node has a child node called "jcr:content" that has a property called "jcr:lastModified".

          That URL gives me the value of the "jcr:lastModified" property back as a JSON object string that looks like this:

          {"jcr:lastModified":"2009-10-05T13:55:40.000-05:00"}

          Hope that helps.

          • 2. Re: Rest Interface path examples
            mbucknam1

            Thanks elvis! It turns out to have been a user error. I copied the files for the example over to the war and rebuilt it but I did not notice that code changes were also necessary to actually load the cnd and xml data files into the engine. Once I created my own implementation of the repository provider that actually loaded the files, the searches started working.