protected Map<Locale, String> getCategoryTitleMap(
      long groupId, AssetCategory category, String name) throws PortalException, SystemException {

    Map<Locale, String> titleMap = category.getTitleMap();

    if (titleMap == null) {
      titleMap = new HashMap<Locale, String>();
    }

    titleMap.put(PortalUtil.getSiteDefaultLocale(groupId), name);

    return titleMap;
  }
Esempio n. 2
0
  protected Map<Locale, String> getAssetCategoryTitleMap(AssetCategory assetCategory) {

    Map<Locale, String> titleMap = assetCategory.getTitleMap();

    if (titleMap == null) {
      titleMap = new HashMap<Locale, String>();
    }

    Locale locale = LocaleUtil.getDefault();

    String title = titleMap.get(locale);

    if (Validator.isNull(title)) {
      titleMap.put(locale, assetCategory.getName());
    }

    return titleMap;
  }
  @Override
  protected Document doGetDocument(Object obj) throws Exception {
    AssetCategory category = (AssetCategory) obj;

    if (_log.isDebugEnabled()) {
      _log.debug("Indexing category " + category);
    }

    Document document = getBaseModelDocument(PORTLET_ID, category);

    document.addKeyword(Field.ASSET_CATEGORY_ID, category.getCategoryId());
    document.addKeyword(Field.ASSET_VOCABULARY_ID, category.getVocabularyId());
    document.addLocalizedText(Field.DESCRIPTION, category.getDescriptionMap());
    document.addText(Field.NAME, category.getName());
    document.addLocalizedText(Field.TITLE, category.getTitleMap());

    if (_log.isDebugEnabled()) {
      _log.debug("Document " + category + " indexed successfully");
    }

    return document;
  }