%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %> <%@ page import="com.ecyrd.jspwiki.*" %> <%@ page import="com.ecyrd.jspwiki.auth.AuthenticationManager" %> <%@ page import="com.ecyrd.jspwiki.ui.Installer" %> <%@ page import="org.apache.log4j.*" %> <%! Logger log = Logger.getLogger("JSPWiki"); %> <% WikiEngine wiki = WikiEngine.getInstance( getServletConfig() ); // Create wiki context and check for authorization WikiContext wikiContext = wiki.createContext( request, WikiContext.INSTALL ); if(!wikiContext.hasAccess( response )) return; Installer installer = new Installer( request, config ); WikiSession wikiSession = wikiContext.getWikiSession(); // Parse the existing properties installer.parseProperties(); boolean validated = false; String password = null; // If user hit "submit" button, validate and install them if( request.getParameter("submit") != null ) { validated = installer.validateProperties(); if ( validated ) { installer.saveProperties(); password = installer.createAdministrator(); if ( password != null ) { wikiSession.addMessage( Installer.INSTALL_INFO, "Because no administrator account " + "exists yet, JSPWiki created one for you, with a random password. You can change " + "this password later, of course. The account's id is " + Installer.ADMIN_ID + " and the password is " + password + ". " + "Please write this information down and keep it in a safe place. " + "JSPWiki also created a wiki group called " + Installer.ADMIN_GROUP + " that contains this user." ); } } } if ( !installer.adminExists() ) { wikiSession.addMessage( Installer.INSTALL_WARNING, "Is this the first time you've run the " + " Installer? If it is, you should know that after JSPWiki validates and saves your " + "configuration for the first time, you will need administrative privileges to access " + "this page again. We do this to prevent random people on the Internet from doing bad " + "things to your wiki." ); } // Make this HTTP response non-cached, and never-expiring response.addHeader("Pragma", "no-cache"); response.setHeader( "Expires", "-1" ); response.setHeader("Cache-Control", "no-cache" ); response.setContentType("text/html; charset=UTF-8"); %>
Welcome! This little JSP page is here to help you do the first difficult stage of JSPWiki installation. If you're seeing this page, you have already installed JSPWiki correctly inside your container.
There are now some things that you should configure. When you press submit, the
jspwiki.properties
file from the distribution will be modified, or if it
can't be found, a new one will be created.
This setup system is really meant for people who just want to be up and running really quickly.
If you want to integrate JSPWiki with an existing system, I would recommend that you go and edit
the jspwiki.properties
file directly. You can find a sample config file from
yourwiki/WEB-INF/
.
<%=installer.getProperties()%><% } %>