Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Create Datalist Using Alfresco Java API
WhatsApp
Muralidharan Deenathayalan
5y
14.4k
0
0
100
Article
Step 1:
First create the site using siteService.
Step 2:
Create the datalist container using siteService or SiteServiceImpl.
Step 3:
Create the necessary properties for the datalist.
Step 4:
Create the datalist using nodeService.
String DATALIST_CONTAINER =
"dataLists"
;
SiteInfo siteInfo =
this
.siteService.createSite (TEST_SITE_PRESET, siteName, siteName, DESCRIPTION_TEST_THIS_IS_MY_DESCRIPTION, SiteVisibility.PRIVATE);
//NodeRef dataListContainer = siteService.createContainer(siteName, DATALIST_CONTAINER, ContentModel.TYPE_CONTAINER, null);
//if the datalist container does not exist then it will create a new one based on the create boolean parameter
NodeRef dataListContainer = SiteServiceImpl.getSiteContainer(siteName, DATALIST_CONTAINER,
true
, siteService, transactionService, taggingService);
Map<QName, Serializable> contentProps =
new
HashMap<QName, Serializable>();
contentProps.put(ContentModel.PROP_TITLE,
"Demo"
);
contentProps.put(ContentModel.PROP_DESCRIPTION,
"Demo Datalist"
);
contentProps.put(DataListModel.PROP_DATALIST_ITEM_TYPE,
"YOUR DATALIST ITEM TYPE"
);
nodeService.createNode(dataListContainer, ContentModel.ASSOC_CONTAINS, QName.createQName(DataListModel.DATALIST_MODEL_PREFIX,
"Demo"
), DataListModel.TYPE_DATALIST, contentProps);
Hope this helps someone.
alfresco
alfresco share
datalist
java api
share
Up Next
Ebook Download
View all
Programming in Java
Read by 668 people
Download Now!
Learn
View all
Membership not found