AnsweredAssumed Answered

Why is the Space name being changed?

Question asked by darryl_staflund on Sep 2, 2009
Hi all,

I have an issue that I am hoping someone can help me out with.  If I use the following piece of code to create a new folder:


   protected void createRequestFolder() {
      NodeRef parentNodeRef = navigator.getCurrentNode().getNodeRef();
      getFileFolderService().create(
                    parentNodeRef,
                    _letterOfPermissionId,
                   QName.createQName(MyContentModel.NAMESPACE, "requestFolderType"));
   }

then when:


    _letterOfPermissionId = "LOP0001";

the method will create a folder named "LOP0001".  However, if I then try to add properties to the created folder using the following code:


   protected void createRequestFolder() {
      NodeRef parentNodeRef = navigator.getCurrentNode().getNodeRef();
      NodeRef newNodeRef = getFileFolderService().create(
                    parentNodeRef,
                    _letterOfPermissionId,
                   QName.createQName(MyContentModel.NAMESPACE, "requestFolderType")).getNodeRef();

      HashMap<QName, Serializable> properties = new HashMap<QName, Serializable>();
      properties.put(QName.createQName(MyContentModel.NAMESPACE, "lopId"), _letterOfPermissionId);
      properties.put(QName.createQName(MyContentModel.NAMESPACE, "auStudentId"), _auStudentId);      
      properties.put(QName.createQName(MyContentModel.NAMESPACE, "referenceNumber"), _referenceNumber);
      properties.put(QName.createQName(MyContentModel.NAMESPACE, "sponsoringClientId"), _sponsoringClientId);
               
                getNodeService().setProperties(newNodeRef, properties);
   }

then the node that is created has a GUID as a name instead of "LOP0001" in this example.  It is almost as if the 'setProperties()' method renames the folder.  What is happening here?  What am I doing wrong?

Darryl

Outcomes