Example usage for com.liferay.portal.kernel.theme ThemeDisplay getServerPort

List of usage examples for com.liferay.portal.kernel.theme ThemeDisplay getServerPort

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.theme ThemeDisplay getServerPort.

Prototype

public int getServerPort() 

Source Link

Document

Returns the server port, which can be configured by setting the <code>web.server.http.port</code> or <code>web.server.https.port</code> property in a <code>portal-ext.properties</code> file.

Usage

From source file:com.liferay.dynamic.data.mapping.model.impl.DDMStructureImpl.java

License:Open Source License

/**
 * Returns the WebDAV URL to access the structure.
 *
 * @param  themeDisplay the theme display needed to build the URL. It can
 *         set HTTPS access, the server name, the server port, the path
 *         context, and the scope group.
 * @param  webDAVToken the WebDAV token for the URL
 * @return the WebDAV URL/*from   www .ja va2 s .c  o  m*/
 */
@Override
public String getWebDavURL(ThemeDisplay themeDisplay, String webDAVToken) {
    StringBundler sb = new StringBundler(11);

    boolean secure = false;

    if (themeDisplay.isSecure() || PropsValues.WEBDAV_SERVLET_HTTPS_REQUIRED) {

        secure = true;
    }

    String portalURL = PortalUtil.getPortalURL(themeDisplay.getServerName(), themeDisplay.getServerPort(),
            secure);

    sb.append(portalURL);

    sb.append(themeDisplay.getPathContext());
    sb.append(StringPool.SLASH);
    sb.append("webdav");

    Group group = themeDisplay.getScopeGroup();

    sb.append(group.getFriendlyURL());

    sb.append(StringPool.SLASH);
    sb.append(webDAVToken);
    sb.append(StringPool.SLASH);
    sb.append("Structures");
    sb.append(StringPool.SLASH);
    sb.append(getStructureId());

    return sb.toString();
}

From source file:com.liferay.dynamic.data.mapping.model.impl.DDMTemplateImpl.java

License:Open Source License

/**
 * Returns the WebDAV URL to access the template.
 *
 * @param  themeDisplay the theme display needed to build the URL. It can
 *         set HTTPS access, the server name, the server port, the path
 *         context, and the scope group.
 * @param  webDAVToken the WebDAV token for the URL
 * @return the WebDAV URL/*from  w  w  w  .  j  a  v  a  2 s .c o m*/
 */
@Override
public String getWebDavURL(ThemeDisplay themeDisplay, String webDAVToken) {
    StringBundler sb = new StringBundler(11);

    boolean secure = false;

    if (themeDisplay.isSecure() || PropsValues.WEBDAV_SERVLET_HTTPS_REQUIRED) {

        secure = true;
    }

    String portalURL = PortalUtil.getPortalURL(themeDisplay.getServerName(), themeDisplay.getServerPort(),
            secure);

    sb.append(portalURL);

    sb.append(themeDisplay.getPathContext());
    sb.append(StringPool.SLASH);
    sb.append("webdav");

    Group group = themeDisplay.getScopeGroup();

    sb.append(group.getFriendlyURL());

    sb.append(StringPool.SLASH);
    sb.append(webDAVToken);
    sb.append(StringPool.SLASH);
    sb.append("Templates");
    sb.append(StringPool.SLASH);
    sb.append(getTemplateId());

    return sb.toString();
}