3 Replies Latest reply on Mar 10, 2016 7:16 AM by hchiorean

    nodeTypeManager.unregisterNodeType not persisting the changes

    nimit.agrawal

      Hi

       

      My config file.

      {
          "name": "Nimit",
          "jndiName": "",
          "workspaces": {
              "predefined": ["workspace", System],
              "default": "default",
              "allowCreation": true
          },
          "storage": {
              "cacheName": "Content",
              "binaryStorage": {
                  "type": "database",
                  "dataSourceJndiName": "java:/abcDS"
              }
          },
          "security": {
              "anonymous": {
                  "roles": ["readonly", "readwrite", "admin"],
                  "useOnFailedLogin": false
              }
          },
          "query": {
              "enabled": false
          }
      }
      

       

       

      Code causing problem :

      session.getWorkspace().getNamespaceRegistry().registerNamespace("nimit", "nimit.com");
      NodeTypeManager nodeTypeManager = session.getWorkspace().getNodeTypeManager();
      NodeTypeTemplate type =  //defining all properties and childs inside template and getting it.
      nodeTypeManager.unregisterNodeType(typeName);
      nodeTypeManager.registerNodeType(type, false);
      session.save();
      

       

       

       

      Now the problem is even after saving the session the nodeType changes are not persisting in the database.

      I am using Modeshape-3.7.1-FINAL

      Please let me know what wrong I am doing.

       

       

      Thanks