script groovy java system names encoding

generate systemname in java code or in a script


Content is generated in java code or in a script, but the title isn't synchronized to the systemname. Is it possible to activate an automatic synchronization?


No, an automatic synchronization is not possible. This is implemented in the UI of jahia. But you can encode and set the title as systemname. For instance add a mainContent in the contents directory of the digtiall webproject:

    JCRNodeWrapper node = session.getNode("/sites/digitall/contents");
    String title = "My title";
    String systemName =;
    JCRNodeWrapper subNode = node.addNode(systemName, "jnt:mainContent");
    subNode.setProperty("jcr:title", title);
    subNode.setProperty("body", "My body"); 


To get the right encoded systemname the method; can be used. This encodes the string to only lowercase and spaces are replaced with dashes, etc.