projects.jspf revision 1143
58N/ASee LICENSE.txt included in this distribution for the specific
58N/Afile and include the License file at LICENSE.txt.
58N/A--%><%@ page import="org.opensolaris.opengrok.configuration.*,
1143N/Aif (request.getCharacterEncoding() == null) {
1143N/A request.setCharacterEncoding("UTF-8");
128N/AString context = request.getContextPath();
58N/ARuntimeEnvironment env = RuntimeEnvironment.getInstance();
128N/Aenv.setUrlPrefix(context + "/s?");
58N/Aif (env.hasProjects()) {
58N/A projects = env.getProjects();
850N/A String pr[] = request.getParameterValues("project");
896N/A // code bellow will accept more parameters project= and their format is either one by one, or separated by "," in one parameter
850N/A if (Project.getByDescription(p[idx]) != null) {
850N/A project.add(p[idx]);
850N/A Cookie[] cookies = request.getCookies();
1141N/A if (cookie.getName().equals("OpenGrokProject")) {
850N/A for (String proj : cookie.getValue().split(",")) {
866N/A if (Project.getByDescription(proj) != null) {
850N/A project.add(proj);
892N/A Project defaultProject = env.getDefaultProject();
904N/A if (defaultProject != null && project.isEmpty()) {
1141N/A Cookie cookie = new Cookie("OpenGrokProject", sproject.toString());
874N/A response.addCookie(cookie);