Search code examples
javanuxeo

Nuxeo - Create Domain


I am newer to nuxeo. I had integrated my Java Application with Nuxeo. But now I want to perform the operations using Java in Nuxeo. I am not able to find any way to create a Domain in Nuxeo using Java Code. Can anyone help me on this?


Solution

  • Hi After all research from my side, I got the below code to Create a Domain in Nuxeo using Java Automation Client :

    Document companyDomain = null;
            try {
                companyDomain = (Document) session.newRequest(DocumentService.CreateDocument)
                        .setInput(NuxeoUtil.getRootDocument(session))
                        .set(NuxeoConstants.NUXEO_TYPE, NuxeoConstants.NUXEO_DOMAIN)
                        .set(NuxeoConstants.NUXEO_NAME, domainName)
                        .set(NuxeoConstants.NUXEO_PROPERTIES,
                                NuxeoConstants.NUXEO_TITLE + domainName + NuxeoConstants.NUXEO_DESCRIPTION + domainName)
                        .execute();
            } catch (Exception e) {
                _log.error(e);
            }