As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
if(userid.containsProject("xyz")) { response.sendRedirect(request.getContextPath() + "/page/site/xyz"); } else { response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard"); }
Hi,es gibt zwei Wege:A) du musst einen AJAX-Call auf das Repository machen um dir die Site-Mitgliedschaften des Users zu holen & auszuwerten Du passt die SlinghotUserFactory an um die Infos direkt an das User-Objekt in Share zu hängenVG, jan
public boolean isMember(java.lang.String authorityName) Indicates whether a user is a member of the site. Parameters: authorityName - user name Returns: boolean true if the user is a member of the site, false otherwise
String siteName = "xyz"; if (siteName.isMember(URLEncoder.encode(userid))) response.sendRedirect(request.getContextPath() + "/page/site/xyz/dashboard"); else response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
A problem has occurred.This page could not be rendered:site-indexPlease notify your system administrator.
An error occurred at line: 35 in the jsp file: /site-index.jspThe method isMember(String) is undefined for the type String34: String siteName = "gon";35: if (siteName.isMember(URLEncoder.encode(userid)))36: response.sendRedirect(request.getContextPath() + "/page/site/gon/dashboard");37: else38: response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200); JSONObject result = new JSONObject(response.getContentAsString()); // Check the result assertEquals(SiteModel.SITE_MANAGER, result.get("role")); assertEquals(USER_ONE, result.getJSONObject("person").get("userName"));
An error occurred at line: 27 in the jsp file: /site-index.jspResponse cannot be resolved to a type27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);28: JSONObject result = new JSONObject(response.getContentAsString());29: // Check the result30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));An error occurred at line: 27 in the jsp file: /site-index.jspDuplicate local variable response27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);28: JSONObject result = new JSONObject(response.getContentAsString());29: // Check the result30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));An error occurred at line: 27 in the jsp file: /site-index.jspGetRequest cannot be resolved to a type27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);28: JSONObject result = new JSONObject(response.getContentAsString());29: // Check the result30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));An error occurred at line: 28 in the jsp file: /site-index.jspJSONObject cannot be resolved to a type27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);28: JSONObject result = new JSONObject(response.getContentAsString());29: // Check the result30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));31: assertEquals(URLEncoder.encode(userid), result.getJSONObject("person").get("userName"));An error occurred at line: 28 in the jsp file: /site-index.jspJSONObject cannot be resolved to a type27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);28: JSONObject result = new JSONObject(response.getContentAsString());29: // Check the result30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));31: assertEquals(URLEncoder.encode(userid), result.getJSONObject("person").get("userName"));An error occurred at line: 30 in the jsp file: /site-index.jspSiteModel.SITE_MANAGER cannot be resolved to a type27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);28: JSONObject result = new JSONObject(response.getContentAsString());29: // Check the result30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));31: assertEquals(URLEncoder.encode(userid), result.getJSONObject("person").get("userName"));Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:349) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.springframework.extensions.surf.render.bean.JSPProcessor.doInclude(JSPProcessor.java:237) at org.springframework.extensions.surf.render.bean.JSPProcessor.executeBody(JSPProcessor.java:154) … 38 more