/** * Returns the ID of the class from its class object. * * @param clazz the class object * @return the ID of the class */ public static long getClassNameId(Class<?> clazz) { return getPortal().getClassNameId(clazz); }
/** * Returns the fully qualified name of the class from its ID. * * @param classNameId the ID of the class * @return the fully qualified name of the class */ public static String getClassName(long classNameId) { return getPortal().getClassName(classNameId); }
public static ResourceBundle getResourceBundle(Locale locale) { return getPortal().getResourceBundle(locale); }
protected String extractDDMContent( JournalArticle article, String languageId) throws Exception { DDMStructure ddmStructure = _ddmStructureLocalService.fetchStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (ddmStructure == null) { return StringPool.BLANK; } DDMFormValues ddmFormValues = null; try { Fields fields = _journalConverter.getDDMFields( ddmStructure, article.getDocument()); ddmFormValues = _fieldsToDDMFormValuesConverter.convert( ddmStructure, fields); } catch (Exception e) { return StringPool.BLANK; } if (ddmFormValues == null) { return StringPool.BLANK; } return _ddmIndexer.extractIndexableAttributes( ddmStructure, ddmFormValues, LocaleUtil.fromLanguageId(languageId)); }
protected void checkValidContainer(long classPK, long containerModelId) throws PortalException { JournalArticle article = _journalArticleLocalService.getLatestArticle( classPK); DDMStructure ddmStructure = _ddmStructureLocalService.getStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (containerModelId == TrashEntryConstants.DEFAULT_CONTAINER_ID) { containerModelId = article.getFolderId(); } int restrictionType = _journalHelper.getRestrictionType( containerModelId); List<DDMStructure> folderDDMStructures = _journalFolderLocalService.getDDMStructures( _portal.getCurrentAndAncestorSiteGroupIds(article.getGroupId()), containerModelId, restrictionType); for (DDMStructure folderDDMStructure : folderDDMStructures) { if (folderDDMStructure.getStructureId() == ddmStructure.getStructureId()) { return; } } throw new RestoreEntryException( RestoreEntryException.INVALID_CONTAINER); }
groupId, privateLayout, friendlyURL); String layoutActualURL = _portal.getLayoutActualURL(layout, mainPath); "p_j_a_id", new String[] {String.valueOf(journalArticle.getId())}); String namespace = _portal.getPortletNamespace( defaultAssetPublisherPortletId); new String[] {journalArticle.getUrlTitle()}); Locale locale = _portal.getLocale(request); _portal.addPageSubtitle(journalArticle.getTitle(locale), request); _portal.addPageDescription( journalArticle.getDescription(locale), request); _portal.addPageKeywords( ListUtil.toString(assetTags, AssetTag.NAME_ACCESSOR), request);
@Override public String getURL( PortletRequest portletRequest, PortletResponse portletResponse) { PortletURL portletURL = _portal.getControlPanelPortletURL( portletRequest, MBPortletKeys.MESSAGE_BOARDS_ADMIN, PortletRequest.RENDER_PHASE); portletURL.setParameter( "mvcRenderCommandName", "/message_boards/move_category"); portletURL.setParameter( "redirect", _portal.getCurrentURL(portletRequest)); MBCategory category = null; try { category = ActionUtil.getCategory(portletRequest); } catch (Exception e) { return null; } portletURL.setParameter( "mbCategoryId", String.valueOf(getCategoryId(category))); return portletURL.toString(); }
public static long getSiteGroupId(long scopeGroupId) { return getPortal().getSiteGroupId(scopeGroupId); }
private String _getDisplayPageURL( AssetEntry assetEntry, String mainPath, Map<String, Object> requestContext) throws PortalException { AssetDisplayContributor assetDisplayContributor = _assetDisplayContributorTracker.getAssetDisplayContributor( assetEntry.getClassName()); if (assetDisplayContributor == null) { throw new PortalException(); } HttpServletRequest request = (HttpServletRequest)requestContext.get( "request"); request.setAttribute( AssetDisplayWebKeys.ASSET_DISPLAY_CONTRIBUTOR, assetDisplayContributor); request.setAttribute(AssetDisplayWebKeys.ASSET_ENTRY, assetEntry); Locale locale = _portal.getLocale(request); _portal.addPageSubtitle(assetEntry.getTitle(locale), request); _portal.addPageDescription(assetEntry.getDescription(locale), request); Layout layout = _getAssetDisplayPageEntryLayout(assetEntry); return _portal.getLayoutActualURL(layout, mainPath); }
throws Exception { Locale locale = _portal.getSiteDefaultLocale(groupId); userId, groupId, _portal.getClassNameId(DDMStructure.class), ddmStructure.getStructureId(), ddmStructure.getClassNameId(), name, nameMap, null, DDMTemplateConstants.TEMPLATE_TYPE_DISPLAY,
public static String getPortalURL( String serverName, int serverPort, boolean secure) { return getPortal().getPortalURL(serverName, serverPort, secure); }
HttpServletRequest request = portal.getHttpServletRequest( actionRequest); portal.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_REFRESH_PORTLET, portletResource); portal.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_UPDATED_CONFIGURATION); String redirect = portal.escapeRedirect( ParamUtil.getString(actionRequest, "redirect"));
protected String getViewFormEntriesURL( DDMFormInstance ddmFormInstance, ThemeDisplay themeDisplay) throws PortalException { Map<String, String[]> params = new HashMap<>(); String portletNamespace = _portal.getPortletNamespace( DDMPortletKeys.DYNAMIC_DATA_MAPPING_FORM_ADMIN); params.put( portletNamespace.concat("mvcPath"), new String[] {"/admin/view_form_instance_record.jsp"}); params.put( portletNamespace.concat("formInstanceId"), new String[] {String.valueOf(ddmFormInstance.getFormInstanceId())}); return _portal.getSiteAdminURL( themeDisplay, DDMPortletKeys.DYNAMIC_DATA_MAPPING_FORM_ADMIN, params); }
@Override public long publishToLive(PortletRequest portletRequest, Portlet portlet) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); long scopeGroupId = _portal.getScopeGroupId( _portal.getHttpServletRequest(portletRequest), portlet.getPortletId()); long plid = ParamUtil.getLong(portletRequest, "plid"); Map<String, String[]> parameterMap = _exportImportConfigurationParameterMapFactory.buildParameterMap( portletRequest); return publishPortlet( themeDisplay.getUserId(), scopeGroupId, plid, portlet.getPortletId(), parameterMap, false); }
String portalURL = _portal.getPortalURL(layoutSet, themeDisplay); String groupFriendlyURL = _portal.getGroupFriendlyURL( _layoutSetLocalService.getLayoutSet( journalArticle.getGroupId(), false), sb.append(journalArticle.getUrlTitle()); String articleURL = _portal.getCanonicalURL( sb.toString(), themeDisplay, layout);
int serverPort = _portal.getPortalServerPort(false); companyPortalURL = _portal.getPortalURL( company.getVirtualHostname(), serverPort, false); privateLayoutSetPortalURL = _portal.getPortalURL( privateLayoutSet.getVirtualHostname(), serverPort, false); publicLayoutSetPortalURL = _portal.getPortalURL( publicLayoutSet.getVirtualHostname(), serverPort, false); int secureSecurePort = _portal.getPortalServerPort(true); companySecurePortalURL = _portal.getPortalURL( company.getVirtualHostname(), secureSecurePort, true); privateLayoutSetSecurePortalURL = _portal.getPortalURL( privateLayoutSet.getVirtualHostname(), secureSecurePort, true); publicLayoutSetSecurePortalURL = _portal.getPortalURL( publicLayoutSet.getVirtualHostname(), secureSecurePort, true); content, _DATA_HANDLER_PATH_CONTEXT, _portal.getPathContext()); content = StringUtil.replace( content, _DATA_HANDLER_PRIVATE_GROUP_SERVLET_MAPPING,
public void validateDDMStructureId( long groupId, long folderId, String ddmStructureKey) throws PortalException { int restrictionType = _journalHelper.getRestrictionType(folderId); DDMStructure ddmStructure = _ddmStructureLocalService.getStructure( _portal.getSiteGroupId(groupId), _classNameLocalService.getClassNameId(JournalArticle.class), ddmStructureKey, true); List<DDMStructure> folderDDMStructures = _journalFolderLocalService.getDDMStructures( _portal.getCurrentAndAncestorSiteGroupIds(groupId), folderId, restrictionType); for (DDMStructure folderDDMStructure : folderDDMStructures) { if (folderDDMStructure.getStructureId() == ddmStructure.getStructureId()) { return; } } throw new InvalidDDMStructureException( StringBundler.concat( "Invalid structure ", ddmStructure.getStructureId(), " for folder ", folderId)); }
public static HttpServletRequest getHttpServletRequest( PortletRequest portletRequest) { return getPortal().getHttpServletRequest(portletRequest); }
public static Locale getLocale( HttpServletRequest request, HttpServletResponse response, boolean initialize) { return getPortal().getLocale(request, response, initialize); }
/** * Escapes the URL for use in a redirect and checks that security settings * allow the URL is allowed for redirects. * * @param url the URL to escape * @return the escaped URL, or <code>null</code> if the URL is not allowed * for redirects */ public static String escapeRedirect(String url) { return getPortal().escapeRedirect(url); }