Forums de discussion

User data in portlet

ingvar sjöö, modifié il y a 10 années.

User data in portlet

New Member Envoyer: 1 Date d'inscription: 17/02/11 Publications récentes
Hi!

I am integrating a zk spreadsheet app in Liferay and want to set the data source (src=) in the portlet depending on the users group or organization belongings in Liferay. How can I accomplish this?

I am a beginner in this fiels so please exampels and snippets.

Regards

Ingvar
thumbnail
Pankaj Kathiriya, modifié il y a 10 années.

RE: User data in portlet

Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
You can fetch zkSession object from Executions.getCurrent().getSession(), and from it get themeDisplay object by zkSession.getAttribute("THEME_DISPLAY").

For Example: Executions.getCurrent().getSession().getAttribute("THEME_DISPLAY")

You could get userId/user object from themeDisplay and can get to know which Organizations/User groups user belongs .

Hope this would help.


Regards,
Pankaj
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: User data in portlet

Expert Publications: 315 Date d'inscription: 14/01/13 Publications récentes
ingvar sjöö:
I am integrating a zk spreadsheet app in Liferay and want to set the data source (src=) in the portlet depending on the users group or organization belongings in Liferay. How can I accomplish this?


Hi ingvar,

You posted in the Liferay Faces forum.
Are you using JSF for your application?
If you are, you can just use the Liferay Faces portal jar and then use:

LiferayFacesContext.getInstance().getThemeDisplay()

in your backing bean. Or you can simply use expressions such as:

<c:if test="#{liferay.themeDisplay.signedIn}"></c:if>

in your views.

There are quite a few of the kinds of things you are looking for that you can get off of the ThemeDisplay:

isAddSessionIdToURL
isAjax
isFacebook
isFreeformLayout
isI18n
isImpersonated
isIncludedJs
isIncludePortletCssJs
isIsolated
isLifecycleAction
isLifecycleEvent
isLifecycleRender
isLifecycleResource
isSecure
isShowAddContentIcon
isShowAddContentIconPermission
isShowControlPanelIcon
isShowHomeIcon
isShowLayoutTemplatesIcon
isShowManageSiteMembershipsIcon
isShowMyAccountIcon
isShowPageCustomizationIcon
isShowPageSettingsIcon
isShowPortalIcon
isShowSignInIcon
isShowSignOutIcon
isShowSiteAdministrationIcon
isShowSiteContentIcon
isShowSiteMapSettingsIcon
isShowSiteSettingsIcon
isShowStagingIcon
isSignedIn
isStateExclusive
isStateMaximized
isStatePopUp
isThemeCssFastLoad
isThemeImagesFastLoad
isThemeJsBarebone
isThemeJsFastLoad
isTilesSelectable
isWapTheme
isWidget
Account
CDNBaseURL
CDNDynamicResourcesHost
CDNHost
ColorScheme
ColorSchemeId
Company
CompanyGroupId
CompanyId
CompanyLogo
CompanyLogoHeight
CompanyLogoWidth
Contact
ControlPanelCategory
DefaultUser
DefaultUserId
Device
DoAsGroupId
DoAsUserId
DoAsUserLanguageId
FacebookCanvasPageURL
I18nLanguageId
I18nPath
LanguageId
Layout
Layouts
LayoutSet
LayoutSetLogo
LayoutTypePortlet
Lifecycle
Locale
MDRRuleGroupInstance
ParentGroup
ParentGroupId
ParentGroupName
PathApplet
PathCms
PathColorSchemeImages
PathContext
PathFlash
PathFriendlyURLPrivateGroup
PathFriendlyURLPrivateUser
PathFriendlyURLPublic
PathImage
PathJavaScript
PathMain
PathSound
PathThemeCss
PathThemeImage
PathThemeImages
PathThemeJavaScript
PathThemeRoot
PathThemeTemplates
PermissionChecker
Plid
PortalURL
PortletDisplay
PortletGroupId
Ppid
RealCompanyLogo
RealCompanyLogoHeight
RealCompanyLogoWidth
RealUser
RealUserId
RefererGroupId
RefererPlid
Request
ScopeGroup
ScopeGroupId
ScopeGroupIdOrLiveGroupId
ScopeGroupName
ScopeLayout
ServerName
ServerPort
SessionId
SiteDefaultLocale
SiteGroup
SiteGroupId
SiteGroupIdOrLiveGroupId
SiteGroupName
Theme
ThemeId
ThemeSetting
ThemeSettings
TilesContent
TilesTitle
TimeZone
UnfilteredLayouts
URLAddContent
URLControlPanel
URLCurrent
URLHome
URLLayoutTemplates
URLManageSiteMemberships
URLMyAccount
URLPageSettings
URLPortal
URLPublishToLive
URLSignIn
URLSignOut
URLSiteAdministration
URLSiteContent
URLSiteMapSettings
URLSiteSettings
URLUpdateManager
User
UserId