📄 persistantservletrequest.java
字号:
package org.jahia.services.applications;import java.util.*;import org.jahia.data.applications.*;import org.jahia.registries.*;import org.jahia.services.usermanager.*;/** * This class is used by the dispatching system to store in this information * in a hashtable. Was not made an innerclass because these can cause problems, * and this information might be interesting to store elsewhere. */public class PersistantServletRequest extends ServletBean { private String appUniqueIDStr; private String appURL; private String appMethod; private String appContextID; private String servletMappingPattern; private ApplicationBean appBean; public PersistantServletRequest( ApplicationBean stdAppBean, ServletBean servletBean, String appUniqueIDStr, String applicationURL, String applicationMethod, String applicationContextID) { super( servletBean.getWebAppType(), servletBean.getName(), servletBean.getServletName(), servletBean.getservletsrc(), servletBean.getContext(), servletBean.getdesc() ); this.appUniqueIDStr = appUniqueIDStr; this.appURL = applicationURL; this.appMethod = applicationMethod; this.appContextID = applicationContextID; this.appBean = stdAppBean; this.servletMappingPattern = servletBean.getUrlMappingPattern(); } public String getUniqueIDStr () { return appUniqueIDStr; } public String getURL () { return appURL; } public String getMethod() { return appMethod; } public String getContextID() { return appContextID; } public String getServletMappingPattern () { return servletMappingPattern; } public int getVisibleStatus() { return appBean.getVisibleStatus(); } public ApplicationBean getApplicationBean() { return appBean; } /** * return a list of user names having a role with this application * only on this context * * @author NK * * @todo FIXME it would be best if we returned a Set rather than a * vector, but unfortunately existing applications use this method's * result as a vector... */ public Vector getAppContextUsers(){ Vector users = new Vector(); Set addedUsers = new HashSet(); if ( appBean == null ){ return users; } Enumeration appRoles = null; try { ApplicationContext appContext = ServicesRegistry.getInstance() .getJahiaApplicationContextService() .getApplicationContext(appBean.getID()); appRoles = appContext.getRoles().elements(); } catch ( Throwable t ){ t.printStackTrace(); return users; } if ( appRoles == null ){ return users; } JahiaGroup roleGroup = null; String role = null; while ( appRoles.hasMoreElements() ){ role = (String)appRoles.nextElement(); // Roles are mapped to Jahia groups. StringBuffer buff = new StringBuffer(Integer.toString(appBean.getID())); buff.append("_"); buff.append(this.appContextID); buff.append("_"); buff.append(role); roleGroup = ServicesRegistry.getInstance() .getJahiaGroupManagerService() .lookupGroup(0,buff.toString()); // Hollis all app group roles are in site 0 if ( roleGroup != null ){ Set userMembers = roleGroup.getRecursiveUserMembers(); Iterator userIterator = userMembers.iterator(); while (userIterator.hasNext()) { JahiaUser curUser = (JahiaUser) userIterator.next(); if (!addedUsers.contains(curUser.getUserKey())) { addedUsers.add(curUser.getUserKey()); users.add(curUser.getUsername()); } } } } return users; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -