SHARE
TWEET

Untitled

a guest Mar 23rd, 2017 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             NodeRef dataListContainer = SiteServiceImpl.getSiteContainer(
  2.                     siteName, DATALIST_CONTAINER_ID, true,
  3.                     getServiceRegistry().getSiteService(),
  4.                     getServiceRegistry().getTransactionService(),
  5.                     getServiceRegistry().getTaggingService());
  6.            
  7.             NodeService nodeService = getServiceRegistry().getNodeService();
  8.             List<ChildAssociationRef> dataListsNodes = nodeService.getChildAssocs(dataListContainer);
  9.            
  10.             for (ChildAssociationRef dataList : dataListsNodes) {
  11.                 if (dataList.getTypeQName().isMatch(ContentModel.ASSOC_CONTAINS)) {
  12.                     String titDatalist = nodeService.getProperty(dataList.getChildRef(), QName.createQName("http://www.alfresco.org/model/content/1.0", "title")).toString();
  13.                     if (titDatalist.equals(approvalGroupListId)) {
  14.                         List<ChildAssociationRef> itemsNodes = nodeService.getChildAssocs(dataList.getChildRef(), ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
  15.                         for (ChildAssociationRef item : itemsNodes) {
  16.                             if (nodeService.getType(item.getChildRef()).isMatch(DATALIST_MODEL_ITEM_TYPE)) {
  17.                                 values.add(nodeService.getProperty(item.getChildRef(), DATALIST_MODEL_ITEM_PROPERTY).toString());
  18.                             }
  19.                         }
  20.                     }
  21.                 }
  22.             }
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top