@Override public DDMTemplate getTemplate() throws PortalException { return DDMTemplateLocalServiceUtil.getTemplate(getTemplateId()); }
@Override public void persist() { if (this.isNew()) { DDMTemplateLocalServiceUtil.addDDMTemplate(this); } else { DDMTemplateLocalServiceUtil.updateDDMTemplate(this); } } }
/** * Deletes the ddm template from the database. Also notifies the appropriate model listeners. * * @param ddmTemplate the ddm template * @return the ddm template that was removed */ public static com.liferay.dynamic.data.mapping.model.DDMTemplate deleteDDMTemplate( com.liferay.dynamic.data.mapping.model.DDMTemplate ddmTemplate) { return getService().deleteDDMTemplate(ddmTemplate); }
@Override public List<DDMTemplate> getTemplates() { return DDMTemplateLocalServiceUtil.getTemplates(getStructureId()); }
@Override public DDMTemplate getDDMTemplate() { return DDMTemplateLocalServiceUtil.fetchTemplate( PortalUtil.getSiteGroupId(getGroupId()), ClassNameLocalServiceUtil.getClassNameId(JournalArticle.class), getDDMTemplateKey(), true); }
protected DDMStructure getDDMStructure( long ddmStructureId, long ddmTemplateId) throws PortalException { DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure( ddmStructureId); DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.fetchDDMTemplate( ddmTemplateId); if (ddmTemplate != null) { // Clone ddmStructure to make sure changes are never persisted ddmStructure = (DDMStructure)ddmStructure.clone(); ddmStructure.setDefinition(ddmTemplate.getScript()); } return ddmStructure; }
/** * @throws PortalException */ public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException { return getService().deletePersistedModel(persistedModel); }
@Override public DDMTemplate getTemplate() throws PortalException { return DDMTemplateLocalServiceUtil.getTemplate(getTemplateId()); }
/** * Returns all the templates with the class PK. * * @param classPK the primary key of the template's related entity * @return the templates with the class PK */ public static java.util.List<com.liferay.dynamic.data.mapping.model.DDMTemplate> getTemplates( long classPK) { return getService().getTemplates(classPK); }
private static String _getTemplateScript( long groupId, String ddmTemplateKey, Map<String, String> tokens, String languageId, boolean transform) throws PortalException { DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.getTemplate( groupId, PortalUtil.getClassNameId(DDMStructure.class), ddmTemplateKey, true); return _getTemplateScript(ddmTemplate, tokens, languageId, transform); }
public static java.util.List<com.liferay.dynamic.data.mapping.model.DDMTemplate> getTemplates( long groupId, long classNameId, long classPK, boolean includeAncestorTemplates) throws com.liferay.portal.kernel.exception.PortalException { return getService() .getTemplates(groupId, classNameId, classPK, includeAncestorTemplates); }
@Override public DDMForm getDDMForm(long classNameId, long classPK) throws PortalException { if ((classNameId <= 0) || (classPK <= 0)) { return null; } long ddmStructureClassNameId = _portal.getClassNameId( DDMStructure.class); long ddmTemplateClassNameId = _portal.getClassNameId(DDMTemplate.class); if (classNameId == ddmStructureClassNameId) { DDMStructure structure = DDMStructureLocalServiceUtil.getStructure( classPK); DDMForm ddmForm = structure.getFullHierarchyDDMForm(); return ddmForm; } else if (classNameId == ddmTemplateClassNameId) { DDMTemplate template = DDMTemplateLocalServiceUtil.getTemplate( classPK); return _ddmFormJSONDeserializer.deserialize(template.getScript()); } return null; }
/** * Returns the number of templates belonging to the group. * * @param groupId the primary key of the group * @return the number of templates belonging to the group */ public static int getTemplatesCount(long groupId) { return getService().getTemplatesCount(groupId); }
/** * Returns the number of templates matching the group and class name ID. * * @param groupId the primary key of the group * @param classNameId the primary key of the class name for the template's related model * @return the number of matching templates */ public static int getTemplatesCount(long groupId, long classNameId) { return getService().getTemplatesCount(groupId, classNameId); }
public static void revertTemplate(long userId, long templateId, String version, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException { getService().revertTemplate(userId, templateId, version, serviceContext); }
/** * Creates a new ddm template with the primary key. Does not add the ddm template to the database. * * @param templateId the primary key for the new ddm template * @return the new ddm template */ public static com.liferay.dynamic.data.mapping.model.DDMTemplate createDDMTemplate( long templateId) { return getService().createDDMTemplate(templateId); }
/** * Deletes the ddm template with the primary key from the database. Also notifies the appropriate model listeners. * * @param templateId the primary key of the ddm template * @return the ddm template that was removed * @throws PortalException if a ddm template with the primary key could not be found */ public static com.liferay.dynamic.data.mapping.model.DDMTemplate deleteDDMTemplate( long templateId) throws com.liferay.portal.kernel.exception.PortalException { return getService().deleteDDMTemplate(templateId); }
/** * Deletes the template and its resources. * * @param templateId the primary key of the template to be deleted * @throws PortalException if a portal exception occurred */ public static void deleteTemplate(long templateId) throws com.liferay.portal.kernel.exception.PortalException { getService().deleteTemplate(templateId); }
/** * Deletes all the templates of the group. * * @param groupId the primary key of the group * @throws PortalException if a portal exception occurred */ public static void deleteTemplates(long groupId) throws com.liferay.portal.kernel.exception.PortalException { getService().deleteTemplates(groupId); }
/** * Returns the template with the primary key. * * @param templateId the primary key of the template * @return the matching template, or <code>null</code> if a matching template could not be found */ public static com.liferay.dynamic.data.mapping.model.DDMTemplate fetchTemplate( long templateId) { return getService().fetchTemplate(templateId); }