Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7.2 - What is classNameId in DDMStructureLocalServiceUtil
Hi,
I am trying to add DDMStructures programmatically. For this I am using the following method:
But I have no clue on how to get the classNameId. What is supossed to pass there? Is this some constant that I can't find?
I am trying to add DDMStructures programmatically. For this I am using the following method:
DDMStructureLocalServiceUtil.addStructure(
theme.getUserId(),
theme.getScopeGroupId(),
DDMStructureConstants.DEFAULT_PARENT_STRUCTURE_ID,
classNameId, //What is this?
null,
nameMap,
descriptionMap,
ddmForm,
ddmFormLayout,
StorageType.JSON.getValue(),
DDMStructureConstants.TYPE_DEFAULT,
context
);But I have no clue on how to get the classNameId. What is supossed to pass there? Is this some constant that I can't find?
Hi,
You can pass classnameId of those class for which you want to add ddmstructure ,
Ex
If you want to add DDMStructure for JournalAritcle then you will pass classnameId of Journal article
If you want to add DDMStructure for DDMFormInstance then you can pass classnameId of DDMFormInstance
Now to get classnameId you can either use
You can pass classnameId of those class for which you want to add ddmstructure ,
Ex
If you want to add DDMStructure for JournalAritcle then you will pass classnameId of Journal article
If you want to add DDMStructure for DDMFormInstance then you can pass classnameId of DDMFormInstance
Now to get classnameId you can either use
ClassNameLocalServiceUtil.getClassNameId(DDMFormInstance.class) or
PortalUtil.getClassNameId(DDMFormInstance.class);You can refer this for more understanding
Thanks Mohammed,
I was trying to add a structure to DDMRecordSet, so I ended up with:
I was trying to add a structure to DDMRecordSet, so I ended up with:
ClassNameLocalServiceUtil.getClassNameId(DDLRecordSet.class)