Hi all,

I have tried to insert new content into MarkLogic.
This code should work:

                session = getMlSession();
                ContentCreateOptions opts = new ContentCreateOptions();
                opts.setLocale(Locale.US);
                opts.setLanguage("en");
                Content content = ContentFactory.newContent(uri, out.toByteArray(), opts);
                session.insertContent(content);

But it generates the following error:

com.marklogic.xcc.exceptions.XQueryException: XDMP-LANG: Unsupported language ru in /insert
        at com.marklogic.xcc.impl.handlers.ServerExceptionHandler.handleResponse(ServerExceptionHandler.java:31)
        at com.marklogic.xcc.impl.handlers.ContentInsertController.serverDialog(ContentInsertController.java:118)
        at com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:72)
        at com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:189)
        at com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:209)

When I change the client locale settings to United States, everything works fine. What is wrong in the code and how to change the default language for content?

Regards,
Andrey
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to