public static int searchCount(
      long companyId,
      long[] groupIds,
      java.lang.String templateId,
      java.lang.String structureId,
      java.lang.String structureIdComparator,
      java.lang.String name,
      java.lang.String description,
      boolean andOperator)
      throws RemoteException {
    try {
      int returnValue =
          JournalTemplateServiceUtil.searchCount(
              companyId,
              groupIds,
              templateId,
              structureId,
              structureIdComparator,
              name,
              description,
              andOperator);

      return returnValue;
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static com.liferay.portlet.journal.model.JournalTemplateSoap[] search(
      long companyId,
      long[] groupIds,
      java.lang.String templateId,
      java.lang.String structureId,
      java.lang.String structureIdComparator,
      java.lang.String name,
      java.lang.String description,
      boolean andOperator,
      int start,
      int end,
      com.liferay.portal.kernel.util.OrderByComparator obc)
      throws RemoteException {
    try {
      java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
          JournalTemplateServiceUtil.search(
              companyId,
              groupIds,
              templateId,
              structureId,
              structureIdComparator,
              name,
              description,
              andOperator,
              start,
              end,
              obc);

      return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static void deleteTemplate(long groupId, java.lang.String templateId)
      throws RemoteException {
    try {
      JournalTemplateServiceUtil.deleteTemplate(groupId, templateId);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static com.liferay.portlet.journal.model.JournalTemplateSoap getTemplate(
      long groupId, java.lang.String templateId) throws RemoteException {
    try {
      com.liferay.portlet.journal.model.JournalTemplate returnValue =
          JournalTemplateServiceUtil.getTemplate(groupId, templateId);

      return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static com.liferay.portlet.journal.model.JournalTemplateSoap[] getStructureTemplates(
      long groupId, java.lang.String structureId) throws RemoteException {
    try {
      java.util.List<com.liferay.portlet.journal.model.JournalTemplate> returnValue =
          JournalTemplateServiceUtil.getStructureTemplates(groupId, structureId);

      return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModels(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static void getTemplate(HttpServletRequest request) throws Exception {

    long groupId = ParamUtil.getLong(request, "groupId");
    String templateId = ParamUtil.getString(request, "templateId");

    JournalTemplate template = null;

    if (Validator.isNotNull(templateId)) {
      template = JournalTemplateServiceUtil.getTemplate(groupId, templateId);
    }

    request.setAttribute(WebKeys.JOURNAL_TEMPLATE, template);
  }
  public static com.liferay.portlet.journal.model.JournalTemplateSoap addTemplate(
      long groupId,
      java.lang.String templateId,
      boolean autoTemplateId,
      java.lang.String structureId,
      java.lang.String[] nameMapLanguageIds,
      java.lang.String[] nameMapValues,
      java.lang.String[] descriptionMapLanguageIds,
      java.lang.String[] descriptionMapValues,
      java.lang.String xsl,
      boolean formatXsl,
      java.lang.String langType,
      boolean cacheable,
      com.liferay.portal.service.ServiceContext serviceContext)
      throws RemoteException {
    try {
      Map<Locale, String> nameMap =
          LocalizationUtil.getLocalizationMap(nameMapLanguageIds, nameMapValues);
      Map<Locale, String> descriptionMap =
          LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, descriptionMapValues);

      com.liferay.portlet.journal.model.JournalTemplate returnValue =
          JournalTemplateServiceUtil.addTemplate(
              groupId,
              templateId,
              autoTemplateId,
              structureId,
              nameMap,
              descriptionMap,
              xsl,
              formatXsl,
              langType,
              cacheable,
              serviceContext);

      return com.liferay.portlet.journal.model.JournalTemplateSoap.toSoapModel(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }