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.开发者_Python百科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.
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?
精彩评论