Node Browser does not work properly

♀尐吖头ヾ 提交于 2020-01-26 03:58:05

问题


I have a new content model and by it i create a new node called "organization" and that node will be saved under organizations folder.

After create a node i noticed that Node Browser and search Service will not be able to find my organization(s) nodes which are located in the organizations folder until i navigate to the organizations folder node.

Can any on help me ?

All of your replies are highly appreciated.

My Code Is:

                // Acquire organization folder
            Node organizationsFolder = new Node(NodeUtil
                    .acquireOrganizationsFolder(searchService));
            // current organization created
            currentOrganization = new Node(
                    nodeService.createNode(
                                    organizationsFolder.getNodeRef(),
                                    ContentModel.ASSOC_CONTAINS,
                                    QName.createQName(
                                                    Constants.DIGITAL_SERIES_SECURITY_MODEL_NAMEPSACE_PREFIX_STRING,
                                                    Constants.TYPE_SEC_ORGANIZATION_STRING),
                                    Constants.SecurityModelQNames.TYPE_SEC_ORGANIZATION,
                                    new HashMap<QName,Serializable>()).getChildRef());

            // PREPARE ORGANIZATION SEQUENCE ID
            Node organizationSeq = new Node(SequenceUtil.prepareSequence(
                    SequenceUtil.ORGANIZATION_SEQUENCE_NODE_NAME_STRING,
                    nodeService, searchService));

            // LOCK ORGANIZATION SEQUENCE
            if(!organizationSeq.isLocked()){
                lockService.lock(organizationSeq.getNodeRef(), LockType.NODE_LOCK);
                // GET THE NEXT SEQUENCE
                SequenceUtil.addCurrentSequence(organizationSeq.getNodeRef(), nodeService);
            }

            // PREPARE ORGANIZATION PROPERTIES
            Map<QName, Serializable> orgProps = new HashMap<QName, Serializable>();

            // UPDATE ORGANIZATION SEQUENCE ID
            orgProps.put(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_ID,
                            SequenceUtil.getCurrentSequence(
                                    organizationSeq.getNodeRef(), nodeService));
            // UPDATE ORGANIZATION/CONTENT NAME PROPERTY
            orgProps.put(ContentModel.PROP_NAME, 
                    NodeUtil.extractNodeProperty(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_NAME, 
                            currentOrganization).toString() + 
                    "_"+orgProps.get(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_ID)); 
            // UPDATE ORGANIZATION NAME PROPERTY
            orgProps.put(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_NAME, 
                    NodeUtil.extractNodeProperty(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_NAME, 
                            currentOrganization).toString());
            // UPDATE ORGANIZATION DESCRIPTION
            orgProps.put(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_DESCRIPTION, 
                    NodeUtil.extractNodeProperty(Constants.SecurityModelQNames.PROP_SEC_ORGANIZATION_ORGANIZATION_DESCRIPTION, 
                            currentOrganization).toString());
            // UPDATE THE PROPERTIES TO AN ORGANIZATION NODE
            nodeService.setProperties(currentOrganization.getNodeRef(), orgProps);
            // UNLOCK 
            lockService.unlock(organizationSeq.getNodeRef());

Thanks Mohammed Amr Senior System Developer Digital Series Co.


回答1:


Strange, normally it should work.

The indexing process could be still active if you directly try to search the created content.

Can you post your code how you create the node?



来源:https://stackoverflow.com/questions/6889886/node-browser-does-not-work-properly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!