All blog posts, code samples and downloads licensed under Apache License 2.0.
Close

Sample implementation of the UserBean

Oliver Busse on 17.04.2013 17:59:45 GMT, filed under XSP Java 

This shows how to implement the bean data in your XPage.

<h3>UserBean data</h3>
				<xp:div>
					<xp:label value="Common name:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.userNameCommon}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="Abbreviated name:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.userNameAbbreviated}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="Canonical name:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.userNameCanonical}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="EMail adress:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.emailAdress}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="Mail file path:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.mailFilePath}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="ACL level:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.aclLevel}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="ACL level name:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.aclLevelName}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="User roles:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.userRoles}"></xp:label>
				</xp:div>
				<xp:div>
					<xp:label value="Has role [Admin]:"></xp:label>&#160;
					<xp:label value="#{javascript:UserBean.hasRole('[Admin]')}"></xp:label>
				</xp:div>

Please add

UserBean.init() to the XPage event "beforePageLoad" to init the bean correctly.

A live demo can be viewed here.


Tagged with bean acl user