Example usage for com.liferay.portal.kernel.template TemplateVariableGroup empty

List of usage examples for com.liferay.portal.kernel.template TemplateVariableGroup empty

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.template TemplateVariableGroup empty.

Prototype

public void empty() 

Source Link

Usage

From source file:com.liferay.asset.categories.navigation.web.internal.portlet.template.AssetCategoriesNavigationPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);//from ww  w  .  jav a 2  s  .com

    TemplateVariableGroup templateVariableGroup = templateVariableGroups.get("fields");

    templateVariableGroup.empty();

    templateVariableGroup.addVariable("asset-categories-navigation-display-context",
            AssetCategoriesNavigationDisplayContext.class, "assetCategoriesNavigationDisplayContext");
    templateVariableGroup.addCollectionVariable("vocabularies", List.class,
            PortletDisplayTemplateConstants.ENTRIES, "vocabulary", AssetVocabulary.class, "curVocabulary",
            "name");

    String[] restrictedVariables = getRestrictedVariables(language);

    TemplateVariableGroup categoriesServicesTemplateVariableGroup = new TemplateVariableGroup(
            "category-services", restrictedVariables);

    categoriesServicesTemplateVariableGroup.setAutocompleteEnabled(false);

    categoriesServicesTemplateVariableGroup.addServiceLocatorVariables(AssetVocabularyLocalService.class,
            AssetVocabularyService.class, AssetCategoryLocalService.class, AssetCategoryService.class);

    templateVariableGroups.put(categoriesServicesTemplateVariableGroup.getLabel(),
            categoriesServicesTemplateVariableGroup);

    return templateVariableGroups;
}

From source file:com.liferay.asset.display.template.web.internal.portlet.template.AssetDisplayTemplatePortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);// w w  w .j a va 2 s . c om

    String[] restrictedVariables = getRestrictedVariables(language);

    TemplateVariableGroup fieldsTemplateVariableGroup = templateVariableGroups.get("fields");

    fieldsTemplateVariableGroup.empty();

    fieldsTemplateVariableGroup.addVariable("asset-entry", AssetEntry.class,
            PortletDisplayTemplateConstants.ENTRY, "getTitle(locale)");

    TemplateVariableGroup assetServicesTemplateVariableGroup = new TemplateVariableGroup("asset-services",
            restrictedVariables);

    assetServicesTemplateVariableGroup.setAutocompleteEnabled(false);

    assetServicesTemplateVariableGroup.addServiceLocatorVariables(AssetEntryLocalService.class,
            AssetEntryService.class, AssetVocabularyLocalService.class, AssetVocabularyService.class,
            AssetCategoryLocalService.class, AssetCategoryService.class, AssetTagLocalService.class,
            AssetTagService.class, AssetTagStatsLocalService.class);

    templateVariableGroups.put(assetServicesTemplateVariableGroup.getLabel(),
            assetServicesTemplateVariableGroup);

    return templateVariableGroups;
}

From source file:com.liferay.asset.publisher.web.internal.portlet.template.AssetPublisherPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);//from   www . ja  v  a 2  s  . co m

    String[] restrictedVariables = getRestrictedVariables(language);

    TemplateVariableGroup assetPublisherUtilTemplateVariableGroup = new TemplateVariableGroup(
            "asset-publisher-util", restrictedVariables);

    assetPublisherUtilTemplateVariableGroup.addVariable("asset-publisher-helper", AssetPublisherHelper.class,
            "assetPublisherHelper");

    templateVariableGroups.put("asset-publisher-util", assetPublisherUtilTemplateVariableGroup);

    TemplateVariableGroup fieldsTemplateVariableGroup = templateVariableGroups.get("fields");

    fieldsTemplateVariableGroup.empty();

    fieldsTemplateVariableGroup.addCollectionVariable("asset-entries", List.class,
            PortletDisplayTemplateConstants.ENTRIES, "asset-entry", AssetEntry.class, "curEntry",
            "getTitle(locale)");
    fieldsTemplateVariableGroup.addVariable("asset-entry", AssetEntry.class,
            PortletDisplayTemplateConstants.ENTRY, "getTitle(locale)");

    TemplateVariableGroup assetServicesTemplateVariableGroup = new TemplateVariableGroup("asset-services",
            restrictedVariables);

    assetServicesTemplateVariableGroup.setAutocompleteEnabled(false);

    assetServicesTemplateVariableGroup.addServiceLocatorVariables(AssetEntryLocalService.class,
            AssetEntryService.class, AssetVocabularyLocalService.class, AssetVocabularyService.class,
            AssetCategoryLocalService.class, AssetCategoryService.class, AssetTagLocalService.class,
            AssetTagService.class, AssetTagStatsLocalService.class);

    templateVariableGroups.put(assetServicesTemplateVariableGroup.getLabel(),
            assetServicesTemplateVariableGroup);

    return templateVariableGroups;
}

From source file:com.liferay.asset.tags.navigation.web.internal.portlet.template.AssetTagsNavigationPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);//  w  ww.ja v a  2s . c o  m

    TemplateVariableGroup templateVariableGroup = templateVariableGroups.get("fields");

    templateVariableGroup.empty();

    templateVariableGroup.addCollectionVariable("tags", List.class, PortletDisplayTemplateConstants.ENTRIES,
            "tag", AssetTag.class, "curTag", "name");

    String[] restrictedVariables = getRestrictedVariables(language);

    TemplateVariableGroup assetServicesTemplateVariableGroup = new TemplateVariableGroup("tag-services",
            restrictedVariables);

    assetServicesTemplateVariableGroup.setAutocompleteEnabled(false);

    assetServicesTemplateVariableGroup.addServiceLocatorVariables(AssetTagLocalService.class,
            AssetTagService.class, AssetTagStatsLocalService.class);

    templateVariableGroups.put(assetServicesTemplateVariableGroup.getLabel(),
            assetServicesTemplateVariableGroup);

    return templateVariableGroups;
}

From source file:com.liferay.blogs.web.internal.template.BlogsPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);//from   ww  w  .  j  a  va  2  s. co m

    String[] restrictedVariables = getRestrictedVariables(language);

    TemplateVariableGroup blogsUtilTemplateVariableGroup = new TemplateVariableGroup("blogs-util",
            restrictedVariables);

    blogsUtilTemplateVariableGroup.addVariable("blogs-util", BlogsUtil.class, "blogsUtil");

    templateVariableGroups.put("blogs-util", blogsUtilTemplateVariableGroup);

    TemplateVariableGroup blogServicesTemplateVariableGroup = new TemplateVariableGroup("blog-services",
            restrictedVariables);

    blogServicesTemplateVariableGroup.setAutocompleteEnabled(false);

    blogServicesTemplateVariableGroup.addServiceLocatorVariables(BlogsEntryLocalService.class,
            BlogsEntryService.class);

    templateVariableGroups.put(blogServicesTemplateVariableGroup.getLabel(), blogServicesTemplateVariableGroup);

    TemplateVariableGroup fieldsTemplateVariableGroup = templateVariableGroups.get("fields");

    fieldsTemplateVariableGroup.empty();

    fieldsTemplateVariableGroup.addCollectionVariable("blog-entries", List.class,
            PortletDisplayTemplateManager.ENTRIES, "blog-entry", BlogsEntry.class, "curBlogEntry", "title");

    return templateVariableGroups;
}

From source file:com.liferay.document.library.web.internal.template.DocumentLibraryPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);/*from   ww  w  .  j a v a2 s  . c  o  m*/

    String[] restrictedVariables = getRestrictedVariables(language);

    TemplateVariableGroup documentUtilTemplateVariableGroup = new TemplateVariableGroup("document-util",
            restrictedVariables);

    documentUtilTemplateVariableGroup.addVariable("dl-util", DLUtil.class, "dlUtil");

    templateVariableGroups.put("document-util", documentUtilTemplateVariableGroup);

    TemplateVariableGroup documentServicesTemplateVariableGroup = new TemplateVariableGroup("document-services",
            restrictedVariables);

    documentServicesTemplateVariableGroup.setAutocompleteEnabled(false);

    documentServicesTemplateVariableGroup.addServiceLocatorVariables(DLAppLocalService.class,
            DLAppService.class, DLFileEntryTypeLocalService.class, DLFileEntryTypeService.class);

    templateVariableGroups.put(documentServicesTemplateVariableGroup.getLabel(),
            documentServicesTemplateVariableGroup);

    TemplateVariableGroup fieldsTemplateVariableGroup = templateVariableGroups.get("fields");

    fieldsTemplateVariableGroup.empty();

    fieldsTemplateVariableGroup.addCollectionVariable("documents", List.class,
            PortletDisplayTemplateManager.ENTRIES, "document", FileEntry.class, "curFileEntry", "title");

    return templateVariableGroups;
}

From source file:com.liferay.rss.web.internal.portlet.template.RSSPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);/*from   w  w  w  .  j av  a 2s  .c o  m*/

    TemplateVariableGroup templateVariableGroup = templateVariableGroups.get("fields");

    templateVariableGroup.empty();

    templateVariableGroup.addVariable("rss-display-context", RSSDisplayContext.class, "rssDisplayContext");
    templateVariableGroup.addCollectionVariable("rss-feeds", List.class,
            PortletDisplayTemplateConstants.ENTRIES, "rss-feed", RSSFeed.class, "curEntry",
            "getSyndFeed().getTitle()");

    return templateVariableGroups;
}

From source file:com.liferay.site.navigation.language.web.internal.portlet.template.SiteNavigationLanguagePortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);/*from   ww w  . ja v  a  2 s  . c o m*/

    TemplateVariableGroup templateVariableGroup = templateVariableGroups.get("fields");

    templateVariableGroup.empty();

    templateVariableGroup.addCollectionVariable("languages", List.class,
            PortletDisplayTemplateConstants.ENTRIES, "language", LanguageEntry.class, "curLanguage",
            "longDisplayName");

    return templateVariableGroups;
}

From source file:com.liferay.site.navigation.menu.web.internal.portlet.template.SiteNavigationMenuPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);/*from w w  w. jav  a2s .c o m*/

    TemplateVariableGroup templateVariableGroup = templateVariableGroups.get("fields");

    templateVariableGroup.empty();

    templateVariableGroup.addVariable("header-type", String.class, "headerType");
    templateVariableGroup.addVariable("included-layouts", String.class, "includedLayouts");
    templateVariableGroup.addVariable("nested-children", String.class, "nestedChildren");
    templateVariableGroup.addVariable("root-layout-level", Integer.class, "rootLayoutLevel");
    templateVariableGroup.addVariable("root-layout-type", String.class, "rootLayoutType");
    templateVariableGroup.addCollectionVariable("navigation-items", List.class,
            PortletDisplayTemplateConstants.ENTRIES, "navigation-item", NavItem.class, "navigationEntry",
            "getName()");

    templateVariableGroups.put("navigation-util", getUtilTemplateVariableGroup());

    return templateVariableGroups;
}

From source file:com.liferay.site.navigation.site.map.web.internal.portlet.template.SiteNavigationSiteMapPortletDisplayTemplateHandler.java

License:Open Source License

@Override
public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language,
        Locale locale) throws Exception {

    Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK,
            language, locale);//from w w w. j  a  va 2  s.  com

    TemplateVariableGroup templateVariableGroup = templateVariableGroups.get("fields");

    templateVariableGroup.empty();

    templateVariableGroup.addCollectionVariable("pages", List.class, PortletDisplayTemplateConstants.ENTRIES,
            "page", Layout.class, "curPage", "getName(locale)");
    templateVariableGroup.addVariable("site-map-display-context", SiteNavigationSiteMapDisplayContext.class,
            "siteMapDisplayContext");

    return templateVariableGroups;
}