02-08-2012 05:58 AM
if(userid.containsProject("xyz"))
{
response.sendRedirect(request.getContextPath() + "/page/site/xyz");
}
else
{
response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
}
02-08-2012 09:46 AM
02-08-2012 01:34 PM
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
B) Du passt die SlinghotUserFactory an um die Infos direkt an das User-Objekt in Share zu hängen
VG, jan
02-10-2012 12:57 PM
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-index
Please notify your system administrator.
An error occurred at line: 35 in the jsp file: /site-index.jsp
The method isMember(String) is undefined for the type String
34: String siteName = "gon";
35: if (siteName.isMember(URLEncoder.encode(userid)))
36: response.sendRedirect(request.getContextPath() + "/page/site/gon/dashboard");
37: else
38: response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
02-12-2012 07:04 AM
02-17-2012 01:30 PM
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"));
A problem has occurred.
This page could not be rendered:
site-index
Please notify your system administrator.
An error occurred at line: 27 in the jsp file: /site-index.jsp
Response cannot be resolved to a type
27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);
28: JSONObject result = new JSONObject(response.getContentAsString());
29: // Check the result
30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));
An error occurred at line: 27 in the jsp file: /site-index.jsp
Duplicate local variable response
27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);
28: JSONObject result = new JSONObject(response.getContentAsString());
29: // Check the result
30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));
An error occurred at line: 27 in the jsp file: /site-index.jsp
GetRequest cannot be resolved to a type
27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);
28: JSONObject result = new JSONObject(response.getContentAsString());
29: // Check the result
30: assertEquals(SiteModel.SITE_MANAGER, result.get("role"));
An error occurred at line: 28 in the jsp file: /site-index.jsp
JSONObject cannot be resolved to a type
27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);
28: JSONObject result = new JSONObject(response.getContentAsString());
29: // Check the result
30: 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.jsp
JSONObject cannot be resolved to a type
27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);
28: JSONObject result = new JSONObject(response.getContentAsString());
29: // Check the result
30: 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.jsp
SiteModel.SITE_MANAGER cannot be resolved to a type
27: Response response = sendRequest(new GetRequest("/api/sites/gon/memberships/" + URLEncoder.encode(userid)), 200);
28: JSONObject result = new JSONObject(response.getContentAsString());
29: // Check the result
30: 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
02-19-2012 11:35 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.