import org.cacert.gigi.dbObjects.DomainPingConfiguration;
import org.cacert.gigi.localisation.Language;
import org.cacert.gigi.output.Menu;
+import org.cacert.gigi.output.MenuCollector;
import org.cacert.gigi.output.PageMenuItem;
import org.cacert.gigi.output.SimpleMenuItem;
import org.cacert.gigi.output.template.Form.CSRFException;
import org.cacert.gigi.util.AuthorizationContext;
import org.cacert.gigi.util.ServerConstants;
-public class Gigi extends HttpServlet {
+public final class Gigi extends HttpServlet {
private class MenuBuilder {
private HashMap<String, Page> pages = new HashMap<String, Page>();
- private Menu rootMenu;
+ private MenuCollector rootMenu;
public MenuBuilder() {}
return m;
}
- public Menu generateMenu() throws ServletException {
+ public MenuCollector generateMenu() throws ServletException {
putPage("/denied", new AccessDenied(), null);
putPage("/error", new PageNotFound(), null);
putPage("/login", new LoginPage("Password Login"), null);
- getMenu("CAcert.org").addItem(new SimpleMenuItem("https://" + ServerConstants.getWwwHostNamePort() + "/login", "Password Login") {
+ getMenu("SomeCA.org").addItem(new SimpleMenuItem("https://" + ServerConstants.getWwwHostNamePort() + "/login", "Password Login") {
@Override
public boolean isPermitted(AuthorizationContext ac) {
return ac == null;
}
});
- getMenu("CAcert.org").addItem(new SimpleMenuItem("https://" + ServerConstants.getSecureHostNamePort() + "/login", "Certificate Login") {
+ getMenu("SomeCA.org").addItem(new SimpleMenuItem("https://" + ServerConstants.getSecureHostNamePort() + "/login", "Certificate Login") {
@Override
public boolean isPermitted(AuthorizationContext ac) {
return ac == null;
}
});
- putPage("/", new MainPage("CAcert - Home"), null);
- putPage("/roots", new RootCertPage(truststore), "CAcert.org");
- putPage(ChangePasswordPage.PATH, new ChangePasswordPage(), "My Account");
- putPage(LogoutPage.PATH, new LogoutPage("Logout"), "My Account");
+ putPage("/", new MainPage("SomeCA - Home"), null);
+ putPage("/roots", new RootCertPage(truststore), "SomeCA.org");
+
putPage("/secure", new TestSecure(), null);
putPage(Verify.PATH, new Verify(), null);
putPage(Certificates.PATH + "/*", new Certificates(), "Certificates");
- putPage(MyDetails.PATH, new MyDetails(), "My Account");
- putPage(RegisterPage.PATH, new RegisterPage(), "CAcert.org");
+ putPage(RegisterPage.PATH, new RegisterPage(), "SomeCA.org");
putPage(CertificateAdd.PATH, new CertificateAdd(), "Certificates");
putPage(MailOverview.DEFAULT_PATH, new MailOverview("Email addresses"), "Certificates");
putPage(DomainOverview.PATH + "*", new DomainOverview("Domains"), "Certificates");
putPage(FindDomainPage.PATH, new FindDomainPage("Find Domain"), "Support Console");
putPage(SupportUserDetailsPage.PATH + "*", new SupportUserDetailsPage("Support: User Details"), null);
+ putPage(ChangePasswordPage.PATH, new ChangePasswordPage(), "My Account");
+ putPage(LogoutPage.PATH, new LogoutPage("Logout"), "My Account");
putPage(History.PATH, new History(false), "My Account");
putPage(History.SUPPORT_PATH, new History(true), null);
putPage(UserTrainings.PATH, new UserTrainings(false), "My Account");
+ putPage(MyDetails.PATH, new MyDetails(), "My Account");
putPage(UserTrainings.SUPPORT_PATH, new UserTrainings(true), null);
putPage(PasswordResetPage.PATH, new PasswordResetPage(), null);
throw new ServletException(e);
}
baseTemplate = new Template(Gigi.class.getResource("Gigi.templ"));
- rootMenu = new Menu("Main");
- Menu about = new Menu("About CAcert.org");
+ rootMenu = new MenuCollector();
+ Menu about = new Menu("About SomeCA.org");
categories.add(about);
- about.addItem(new SimpleMenuItem("//blog.cacert.org/", "CAcert News"));
+ about.addItem(new SimpleMenuItem("//blog.cacert.org/", "SomeCA News"));
about.addItem(new SimpleMenuItem("//wiki.cacert.org/", "Wiki Documentation"));
- putPage(PolicyIndex.DEFAULT_PATH, new PolicyIndex(), "About CAcert.org");
+ putPage(PolicyIndex.DEFAULT_PATH, new PolicyIndex(), "About SomeCA.org");
about.addItem(new SimpleMenuItem("//wiki.cacert.org/FAQ/Privileges", "Point System"));
about.addItem(new SimpleMenuItem("//bugs.cacert.org/", "Bug Database"));
- about.addItem(new SimpleMenuItem("//wiki.cacert.org/Board", "CAcert Board"));
+ about.addItem(new SimpleMenuItem("//wiki.cacert.org/Board", "SomeCA Board"));
about.addItem(new SimpleMenuItem("//lists.cacert.org/wws", "Mailing Lists"));
- about.addItem(new SimpleMenuItem("//blog.CAcert.org/feed", "RSS News Feed"));
+ about.addItem(new SimpleMenuItem("//blog.SomeCA.org/feed", "RSS News Feed"));
+ about.addItem(new SimpleMenuItem("//wiki.cacert.org/Impress", "Impress"));
Menu languages = new Menu("Translations");
for (Locale l : Language.getSupportedLocales()) {
categories.add(languages);
for (Menu menu : categories) {
menu.prepare();
- rootMenu.addItem(menu);
+ rootMenu.put(menu);
}
- rootMenu.prepare();
+ // rootMenu.prepare();
return rootMenu;
}
private boolean testing;
- private Menu rootMenu;
+ private MenuCollector rootMenu;
private Map<String, Page> pages;