|
Core Development Guide |
This chapter provides reference information about the framework tags (FrameworkTag.jar).
For background information, see
Using the Director Tag Libraries.
Adds a specified user to a group.
This tag wraps the addMember() method on the EbiRealmGroupDelegate interface.
Syntax
<prefix:addUserToGroup id="ID" userid="userid" groupid="groupid" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:addUserToGroup id="result" userid="User1" groupid="Group1" />
<%=pageContext.getAttribute("result")%>
This tag wraps the addGroup() method on the EboDirectoryManager interface.
Syntax
<prefix:createGroup id="ID" groupid="groupid" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:createGroup id="result" groupid="Group1" />
<%=pageContext.getAttribute("result")%>
Creates a new user and a new default profile for that user. The createUser tag creates the new user in the realm that was specified in the configuration for the Directory subsystem.
This tag wraps the createUser() method on the EbiUserDelegate interface.
Syntax
<prefix:createUser id="ID" userid="userid" password="password" firstname="firstname" lastname="lastname" emailaddress="emailaddress"/>
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:createUser id="result" userid="User1" password="MyPassword" firstname="John" lastname="Smith"/>
<%=pageContext.getAttribute("result")%>
Returns a list of groups for the framework. The objects returned are of type java.security.acl.Group. They can be cast to Group objects, or a more specific subclass if necessary.
This tag wraps the getGroups() method on the EbiDirectoryManager interface.
Syntax
<prefix:getGroupList id="ID" iterate="iterate" />
Example 1
This example shows how to use the getGroupList tag with the iterate attribute set to true:
<%@ taglib uri="/fw" prefix="fw" %>
<html>
<head>
</head>
<body>
<fw:login userid="admin" password="admin"/>
<fw:getGroupList iterate="true">
Group Name = <%=groupid%><br/>
<p/>
</fw:getGroupList>
<fw:logoff />
</body>
</html>
Example 2
This example shows how to use the getGroupList tag with the iterate attribute set to false:
<%@ taglib uri="/fw" prefix="fw" %>
<html>
<head>
</head>
<body>
<fw:login userid="admin" password="admin"/>
<fw:getGroupList iterate="false"/>
<%= ((java.util.List)pageContext.getAttribute("grouplist")).size() %> = the size of the list...
<fw:logoff />
</body>
</html>
Retrieves resource set objects by string path. If the id attribute is not set the resource will be assumed to be a string and returned in-line. If the id attribute is set the returned object will be returned via the variable named in the id attribute.
Syntax
<prefix:getResource resourcePath="resourcePath" returnType="returnType" id="ID" />
Retrieves the user ID for the current user. If the current user is not logged in, the tag returns anonymous.
This tag wraps the getUserID() method on the EboDirectoryHelper class.
Syntax
<prefix:getUserID id="ID" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:getUserID id="user" />
<%=pageContext.getAttribute("user")%>
Retrieves information about a particular user. The object returned is of type EbiUserInfo.
This tag wraps the getUserInfoByUserID() method on the EbiUserDelegate interface.
Syntax
<prefix:getUserID id="ID" userid="userid" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:getUserInfo userid="User1" />
<%=pageContext.getAttribute("userinfo")%>
Hello, <%= ((com.sssw.fw.usermgr.api.EbiUserInfo)pageContext.getAttribute("userinfo")).getUserFirstName() %>
Returns a list of users for the framework. The objects returned are of type EbiUserInfo.
This tag wraps the getUsers() method on the EbiDirectoryDelegate interface.
Syntax
<prefix:getUserList id="ID" iterate="iterate" />
Example 1
This example shows how to use the getUserList tag with the iterate attribute set to true:
<%@ taglib uri="/fw" prefix="fw" %>
<html>
<head>
</head>
<body>
<fw:login userid="admin" password="admin"/>
<fw:getUserList iterate="true">
UserID = <%=userid%><br/>
UUID = <%=uuid%><br/>
<p/>
</fw:getUserList>
<fw:logoff />
</body>
</html>
Example 2
This example shows how to use the getUserList tag with the iterate attribute set to false:
<%@ taglib uri="/fw" prefix="fw" %>
<html>
<head>
</head>
<body>
<fw:login userid="admin" password="admin"/>
<fw:getUserList iterate="false"/>
<%= ((java.util.List)pageContext.getAttribute("userlist")).size() %> = the size of the list...
<fw:logoff />
</body>
</html>
Retrieves the user preference object for the id passed in or the current user if no id is provided. This tag is for getting and setting custom preferences. Preferences for portal objects should be done through the portal manager and the tags that support those functions such as getUserComponentInfoTag.
This tag wraps the getUserPreference() method on the EbiUserPreferenceDelegate interface.
Syntax
<prefix:getUserProfile profilename="profilename" userid="userid" id="ID" />
This tag wraps the authUserPassword() method on the EbiDirectoryDelegate interface.
Syntax
<prefix:login userid="userid" password="password" id="ID" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:login userid="admin" password="admin" id="result" />
<%=pageContext.getAttribute("result")%> = the result of the login...
Logs off the current Director user.
This tag wraps the logoff() method on the EbiSession interface.
Syntax
<prefix:logoff id="ID" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:logoff id="result" />
<%=pageContext.getAttribute("result")%> = the result of the logoff...
This tag wraps the removeGroup() method on the EbiDirectoryManager interface.
Syntax
<prefix:removeGroup groupid="groupid" id="ID" />
Example
This example shows how to use the removeGroup tag:
<%@ taglib uri="/fw" prefix="fw" %>
<html>
<head>
</head>
<body>
<fw:login userid="admin" password="admin"/>
<fw:removeGroup groupid="Group1"/>
<fw:logoff />
</body>
</html>
Removes a specified user from a group.
This tag wraps the removeMember() method on the EbiRealmGroupDelegate interface.
Syntax
<prefix:removeUserFromGroup id="ID" userid="userid" groupid="groupid" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:removeUserFromGroup id="result" userid="User1" groupid="Group1" />
<%=pageContext.getAttribute("result")%>
Changes the password for a specified user.
This tag wraps the modifyUser() method on the EbiUserDelegate interface.
Syntax
<prefix:setUserPassword id="ID" userid="userid" passowrd="password" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
<fw:setUserPassword id="result" userid="User1" password="MyPassword" />
<%=pageContext.getAttribute("result")%>
Determines whether a specified user is in a particular group.
This tag wraps the isMember() method on the EbiRealmGroupDelegate interface.
Syntax
<prefix:userInGroup groupid="groupid" userid="userid" id="ID" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
Is in group...
<fw:userInGroup groupid="ContentAdmins" userid="JSmith" id="result" />
<%=pageContext.getAttribute("result")%>
Determines whether the current user is logged in to the session.
This tag wraps the isAnonymous() method on the EboDirectoryHelper class.
Syntax
<prefix:userLoggedIn id="ID" />
Example
<% taglib uri="/fw" prefix="fw" %>
...
Is logged in...
<fw:userLoggedIn />
<%=pageContext.getAttribute("loggedin")%>
|
Core Development Guide |
Copyright © 2000, 2001, 2002, 2003 SilverStream Software, LLC, a wholly owned subsidiary of Novell, Inc. All rights reserved.