Example usage for com.liferay.portal.kernel.util HtmlUtil unescape

List of usage examples for com.liferay.portal.kernel.util HtmlUtil unescape

Introduction

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

Prototype

public static String unescape(String text) 

Source Link

Usage

From source file:com.liferay.brokenurlfinder.portlet.BrokenUrlFinderPortlet.java

License:Open Source License

protected JSONObject getFileJSONObject(ThemeDisplay themeDisplay, DLFileEntry dlFileEntry) throws Exception {
    JSONObject JSONObject = JSONFactoryUtil.createJSONObject();
    StringBundler sb = new StringBundler(10);
    String url = "";

    sb.append(themeDisplay.getPortalURL());
    sb.append(themeDisplay.getPathContext());
    sb.append("/documents/");
    sb.append(dlFileEntry.getRepositoryId());
    sb.append(StringPool.SLASH);// w  w w  . j  a va 2  s  .co  m
    sb.append(dlFileEntry.getFolderId());
    sb.append(StringPool.SLASH);
    sb.append(HttpUtil.encodeURL(HtmlUtil.unescape(dlFileEntry.getTitle())));
    sb.append(StringPool.SLASH);
    sb.append(dlFileEntry.getUuid());
    sb.append("?version=");
    sb.append(dlFileEntry.getVersion());

    url = sb.toString();
    JSONObject.put("url", url);
    JSONObject.put("folder", dlFileEntry.getFolder().getName());
    JSONObject.put("title", dlFileEntry.getTitle());

    return JSONObject;
}

From source file:com.liferay.document.library.web.internal.display.context.logic.UIItemsBuilder.java

License:Open Source License

public void addPermissionsMenuItem(List<MenuItem> menuItems) throws PortalException {

    if (!_fileEntryDisplayContextHelper.isPermissionsButtonVisible()) {
        return;//from   w  w w . jav a2 s  .  c  o m
    }

    String url = null;

    try {
        url = PermissionsURLTag.doTag(null, DLFileEntryConstants.getClassName(),
                HtmlUtil.unescape(_fileEntry.getTitle()), null, String.valueOf(_fileEntry.getFileEntryId()),
                LiferayWindowState.POP_UP.toString(), null, _request);
    } catch (Exception e) {
        throw new SystemException("Unable to create permissions URL", e);
    }

    URLMenuItem urlMenuItem = _addURLUIItem(new URLMenuItem(), menuItems, DLUIItemKeys.PERMISSIONS,
            "permissions", url);

    urlMenuItem.setMethod("get");
    urlMenuItem.setUseDialog(true);
}

From source file:com.liferay.document.library.web.internal.display.context.logic.UIItemsBuilder.java

License:Open Source License

public void addPermissionsToolbarItem(List<ToolbarItem> toolbarItems) throws PortalException {

    if (!_fileEntryDisplayContextHelper.isPermissionsButtonVisible()) {
        return;//from w  ww.jav a2s. c  om
    }

    String permissionsURL = null;

    try {
        permissionsURL = PermissionsURLTag.doTag(null, DLFileEntryConstants.getClassName(),
                HtmlUtil.unescape(_fileEntry.getTitle()), null, String.valueOf(_fileEntry.getFileEntryId()),
                LiferayWindowState.POP_UP.toString(), null, _request);
    } catch (Exception e) {
        throw new SystemException("Unable to create permissions URL", e);
    }

    StringBundler sb = new StringBundler(5);

    sb.append("Liferay.Util.openWindow({title: '");
    sb.append(UnicodeLanguageUtil.get(_resourceBundle, "permissions"));
    sb.append("', uri: '");
    sb.append(permissionsURL);
    sb.append("'});");

    _addJavaScriptUIItem(new JavaScriptToolbarItem(), toolbarItems, DLUIItemKeys.PERMISSIONS,
            LanguageUtil.get(_resourceBundle, "permissions"), sb.toString());
}

From source file:com.liferay.document.library.web.internal.portlet.configuration.icon.FileEntryPermissionPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    String url = StringPool.BLANK;

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    try {/*from w w w  . j a  v a 2s.  c o m*/
        FileEntry fileEntry = ActionUtil.getFileEntry(portletRequest);

        url = PermissionsURLTag.doTag(null, DLFileEntryConstants.getClassName(),
                HtmlUtil.unescape(fileEntry.getTitle()), null, String.valueOf(fileEntry.getFileEntryId()),
                LiferayWindowState.POP_UP.toString(), null, themeDisplay.getRequest());
    } catch (Exception e) {
    }

    return url;
}

From source file:com.liferay.document.library.web.internal.portlet.configuration.icon.FolderPermissionPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    String url = StringPool.BLANK;

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    try {//from   w w  w .  j  a v  a  2s  . c  o m
        Folder folder = ActionUtil.getFolder(portletRequest);

        if (folder != null) {
            url = PermissionsURLTag.doTag(null, DLFolderConstants.getClassName(),
                    HtmlUtil.unescape(folder.getName()), null, String.valueOf(folder.getFolderId()),
                    LiferayWindowState.POP_UP.toString(), null, themeDisplay.getRequest());
        } else {
            url = PermissionsURLTag.doTag(null, "com.liferay.document.library",
                    HtmlUtil.unescape(themeDisplay.getScopeGroupName()), null,
                    String.valueOf(themeDisplay.getScopeGroupId()), LiferayWindowState.POP_UP.toString(), null,
                    themeDisplay.getRequest());
        }
    } catch (Exception e) {
    }

    return url;
}

From source file:com.liferay.document.library.web.internal.portlet.configuration.icon.RepositoryPermissionPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    String url = StringPool.BLANK;

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    try {//from ww w  .  jav  a  2s .  c om
        Repository repository = ActionUtil.getRepository(portletRequest);

        url = PermissionsURLTag.doTag(null, DLFolderConstants.getClassName(),
                HtmlUtil.unescape(repository.getName()), null, String.valueOf(repository.getDlFolderId()),
                LiferayWindowState.POP_UP.toString(), null, themeDisplay.getRequest());
    } catch (Exception e) {
    }

    return url;
}

From source file:com.liferay.dynamic.data.mapping.form.web.internal.notification.DDMFormEmailNotificationSender.java

License:Open Source License

protected String renderDDMFormFieldValue(DDMFormFieldValue ddmFormFieldValue, Locale locale) {

    if (ddmFormFieldValue.getValue() == null) {
        return StringPool.BLANK;
    }//from w w  w . j av a2s . co m

    DDMFormFieldValueRenderer ddmFormFieldValueRenderer = _ddmFormFieldTypeServicesTracker
            .getDDMFormFieldValueRenderer(ddmFormFieldValue.getType());

    return HtmlUtil.unescape(ddmFormFieldValueRenderer.render(ddmFormFieldValue, locale));
}

From source file:com.liferay.faces.demos.list.DocLibFileEntry.java

License:Open Source License

public DocLibFileEntry(DLFileEntry dlFileEntry, String portalURL, String pathContext, long scopeGroupId,
        boolean permittedToView) {
    super(dlFileEntry);
    this.kilobytes = Long.toString(dlFileEntry.getSize() / 1024L) + " KB";
    this.permittedToView = permittedToView;
    this.url = portalURL + pathContext + "/documents/" + Long.toString(scopeGroupId) + StringPool.SLASH
            + dlFileEntry.getFolderId() + StringPool.SLASH
            + HttpUtil.encodeURL(HtmlUtil.unescape(dlFileEntry.getTitle()));
    this.userName = dlFileEntry.getUserName();

    // this.url = portalURL + pathContext + "/documents/" + Long.toString(scopeGroupId) + StringPool.SLASH +
    // dlFileEntry.getUuid();
}

From source file:com.liferay.frontend.taglib.servlet.taglib.VerticalCardTag.java

License:Open Source License

public void setSubtitle(String subtitle) {
    _subtitle = HtmlUtil.unescape(subtitle);
}

From source file:com.liferay.frontend.taglib.servlet.taglib.VerticalCardTag.java

License:Open Source License

public void setTitle(String title) {
    _title = HtmlUtil.unescape(title);
}