Hi,

OAK-4778 was already created around this topic [0]. The deeper issue here
is that there is no one actively maintaining the module and simply
providing this fix would only allow users to take a very small step forward
and immediately hitting a new wall. For example (even with this fix) the
current api doesn't allow for property types to be specified, or even
setting multiple value properties.

I would step back and look at why someone would need remoting capabilities,
and try to reconsider other available tools (like the console, or the
explorer) and/or possibly provide more tooling to help getting people
started with Oak.

hope this helps,
alex


[0] https://issues.apache.org/jira/browse/OAK-4778


On Thu, Sep 15, 2016 at 11:46 PM, Vikas Saurabh <vikas.saur...@gmail.com>
wrote:

> Hi Joe,
>
> > -> http -j -b localhost:8080/test jcr\\:primaryType=oak:Unstructured
> foo=abc bar:=123
>
> While I'm not completely sure of the whole type validation machinery
> (or auto-generation) etc. But doing this:
> ```
> diff --git a/oak-http/src/main/java/org/apache/jackrabbit/oak/http/
> OakServlet.java
> b/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java
> index c6bcd3b..5947980 100644
> --- a/oak-http/src/main/java/org/apache/jackrabbit/oak/http/
> OakServlet.java
> +++ b/oak-http/src/main/java/org/apache/jackrabbit/oak/http/
> OakServlet.java
> @@ -33,12 +33,15 @@ import com.fasterxml.jackson.core.JsonFactory;
>  import com.fasterxml.jackson.databind.JsonNode;
>  import com.fasterxml.jackson.databind.ObjectMapper;
>  import com.fasterxml.jackson.dataformat.smile.SmileFactory;
> +import org.apache.jackrabbit.JcrConstants;
>  import org.apache.jackrabbit.oak.api.CommitFailedException;
>  import org.apache.jackrabbit.oak.api.ContentRepository;
>  import org.apache.jackrabbit.oak.api.ContentSession;
>  import org.apache.jackrabbit.oak.api.Root;
>  import org.apache.jackrabbit.oak.api.Tree;
> +import org.apache.jackrabbit.oak.api.Type;
>  import org.apache.jackrabbit.oak.commons.PathUtils;
> +import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
>  import org.apache.jackrabbit.util.Base64;
>  import org.apache.tika.mime.MediaType;
>
> @@ -192,6 +195,8 @@ public class OakServlet extends HttpServlet {
>                      tree.setProperty(name, value.asDouble());
>                  } else if (value.isBigDecimal()) {
>                      tree.setProperty(name, value.decimalValue());
> +                } else if (JcrConstants.JCR_PRIMARYTYPE.equals(name)) {
> +                    tree.setProperty(name, value.asText(), Type.NAME);
>                  } else {
>                      tree.setProperty(name, value.asText());
>                  }
> ```
>
> (that is assume jcr:primaryType to always be of type NAME) lets the
> stuff through. May be, that's good enough to un-block you (assuming
> you're compiling your own oak-run jar to play around)
>
> Thanks,
> Vikas
>

Reply via email to