/** * Updates the ddm storage link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. * * @param ddmStorageLink the ddm storage link * @return the ddm storage link that was updated */ @Override public com.liferay.dynamic.data.mapping.model.DDMStorageLink updateDDMStorageLink( com.liferay.dynamic.data.mapping.model.DDMStorageLink ddmStorageLink) { return _ddmStorageLinkLocalService.updateDDMStorageLink(ddmStorageLink); }
/** * Updates the ddm storage link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. * * @param ddmStorageLink the ddm storage link * @return the ddm storage link that was updated */ public static com.liferay.dynamic.data.mapping.model.DDMStorageLink updateDDMStorageLink( com.liferay.dynamic.data.mapping.model.DDMStorageLink ddmStorageLink) { return getService().updateDDMStorageLink(ddmStorageLink); }
protected void updateDDMLinks( long id, long groupId, String ddmStructureKey, String ddmTemplateKey, boolean incrementVersion) throws PortalException { DDMStructure ddmStructure = ddmStructureLocalService.getStructure( PortalUtil.getSiteGroupId(groupId), classNameLocalService.getClassNameId(JournalArticle.class), ddmStructureKey, true); DDMTemplate ddmTemplate = ddmTemplateLocalService.getTemplate( PortalUtil.getSiteGroupId(groupId), classNameLocalService.getClassNameId(DDMStructure.class), ddmTemplateKey, true); if (incrementVersion) { ddmStorageLinkLocalService.addStorageLink( ddmStructure.getClassNameId(), id, ddmStructure.getStructureId(), new ServiceContext()); ddmTemplateLinkLocalService.addTemplateLink( classNameLocalService.getClassNameId(JournalArticle.class), id, ddmTemplate.getTemplateId()); } else { DDMStorageLink ddmStorageLink = ddmStorageLinkLocalService.getClassStorageLink(id); ddmStorageLink.setStructureId(ddmStructure.getStructureId()); ddmStorageLinkLocalService.updateDDMStorageLink(ddmStorageLink); ddmTemplateLinkLocalService.updateTemplateLink( classNameLocalService.getClassNameId(JournalArticle.class), id, ddmTemplate.getTemplateId()); } }