Example usage for com.liferay.portal.kernel.util PropsKeys JAVASCRIPT_EVERYTHING_FILES

List of usage examples for com.liferay.portal.kernel.util PropsKeys JAVASCRIPT_EVERYTHING_FILES

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys JAVASCRIPT_EVERYTHING_FILES.

Prototype

String JAVASCRIPT_EVERYTHING_FILES

To view the source code for com.liferay.portal.kernel.util PropsKeys JAVASCRIPT_EVERYTHING_FILES.

Click Source Link

Usage

From source file:com.liferay.frontend.js.top.head.extender.internal.servlet.taglib.TopHeadDynamicInclude.java

License:Open Source License

private synchronized void _rebuild() {
    if ((_portal == null) || (_portalWebResources == null)) {
        return;/*from w  w  w  .  j  av a2s .co  m*/
    }

    _jsContextPath = _portal.getPathProxy();

    _jsContextPath = _jsContextPath.concat(_portalWebResources.getContextPath());

    _allJsResourceURLs.clear();

    _addPortalBundles(_allJsResourceURLs, PropsKeys.JAVASCRIPT_EVERYTHING_FILES);

    _jsResourceURLs.clear();

    _addPortalBundles(_jsResourceURLs, PropsKeys.JAVASCRIPT_BAREBONE_FILES);

    synchronized (_topHeadResourcesServiceReferences) {
        for (ServiceReference<TopHeadResources> topHeadResourcesServiceReference : _topHeadResourcesServiceReferences) {

            TopHeadResources topHeadResources = _bundleContext.getService(topHeadResourcesServiceReference);

            try {
                String proxyPath = _portal.getPathProxy();

                String servletContextPath = proxyPath.concat(topHeadResources.getServletContextPath());

                for (String jsResourcePath : topHeadResources.getJsResourcePaths()) {

                    String url = servletContextPath.concat(jsResourcePath);

                    _allJsResourceURLs.add(url);
                    _jsResourceURLs.add(url);
                }

                for (String jsResourcePath : topHeadResources.getAuthenticatedJsResourcePaths()) {

                    _allJsResourceURLs.add(servletContextPath.concat(jsResourcePath));
                }
            } finally {
                _bundleContext.ungetService(topHeadResourcesServiceReference);
            }
        }
    }
}