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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…