Return-Path: Delivered-To: apmail-roller-commits-archive@www.apache.org Received: (qmail 70422 invoked from network); 17 May 2007 17:53:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 May 2007 17:53:56 -0000 Received: (qmail 73483 invoked by uid 500); 17 May 2007 17:54:03 -0000 Delivered-To: apmail-roller-commits-archive@roller.apache.org Received: (qmail 73459 invoked by uid 500); 17 May 2007 17:54:03 -0000 Mailing-List: contact commits-help@roller.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@roller.apache.org Delivered-To: mailing list commits@roller.apache.org Received: (qmail 73444 invoked by uid 99); 17 May 2007 17:54:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 10:54:02 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 10:53:56 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id DD30D1A9838; Thu, 17 May 2007 10:53:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r539041 - in /roller/trunk: src/org/apache/roller/ui/core/struts2/Setup.java web/WEB-INF/classes/struts.xml web/WEB-INF/jsps/core/struts2/Setup.jsp web/WEB-INF/tiles.xml Date: Thu, 17 May 2007 17:53:35 -0000 To: commits@roller.apache.org From: agilliland@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070517175335.DD30D1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: agilliland Date: Thu May 17 10:53:34 2007 New Revision: 539041 URL: http://svn.apache.org/viewvc?view=rev&rev=539041 Log: adding a new struts2 action for the setup page. Added: roller/trunk/src/org/apache/roller/ui/core/struts2/Setup.java roller/trunk/web/WEB-INF/jsps/core/struts2/Setup.jsp Modified: roller/trunk/web/WEB-INF/classes/struts.xml roller/trunk/web/WEB-INF/tiles.xml Added: roller/trunk/src/org/apache/roller/ui/core/struts2/Setup.java URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/struts2/Setup.java?view=auto&rev=539041 ============================================================================== --- roller/trunk/src/org/apache/roller/ui/core/struts2/Setup.java (added) +++ roller/trunk/src/org/apache/roller/ui/core/struts2/Setup.java Thu May 17 10:53:34 2007 @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. The ASF licenses this file to You + * under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. For additional information regarding + * copyright in this work, please see the NOTICE file in the top level + * directory of this distribution. + */ + +package org.apache.roller.ui.core.struts2; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.roller.RollerException; +import org.apache.roller.business.RollerFactory; +import org.apache.roller.business.UserManager; +import org.apache.roller.ui.core.util.struts2.UIAction; + + +/** + * Page used to display Roller isntall instructions. + */ +public class Setup extends UIAction { + + private static final Log log = LogFactory.getLog(Setup.class); + + private long userCount = 0; + private long blogCount = 0; + + + public Setup() { + // TODO: i18n + this.pageTitle = "index.heading"; + } + + + @Override + public boolean isUserRequired() { + return false; + } + + @Override + public boolean isWeblogRequired() { + return false; + } + + + public String execute() { + + try { + UserManager umgr = RollerFactory.getRoller().getUserManager(); + setUserCount(umgr.getUserCount()); + setBlogCount(umgr.getWeblogCount()); + } catch (RollerException ex) { + log.error("Error getting user/weblog counts", ex); + } + + return SUCCESS; + } + + + public long getUserCount() { + return userCount; + } + + public void setUserCount(long userCount) { + this.userCount = userCount; + } + + public long getBlogCount() { + return blogCount; + } + + public void setBlogCount(long blogCount) { + this.blogCount = blogCount; + } + +} Modified: roller/trunk/web/WEB-INF/classes/struts.xml URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/struts.xml?view=diff&rev=539041&r1=539040&r2=539041 ============================================================================== --- roller/trunk/web/WEB-INF/classes/struts.xml (original) +++ roller/trunk/web/WEB-INF/classes/struts.xml Thu May 17 10:53:34 2007 @@ -84,6 +84,11 @@ + + .Setup + + .Login Added: roller/trunk/web/WEB-INF/jsps/core/struts2/Setup.jsp URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/core/struts2/Setup.jsp?view=auto&rev=539041 ============================================================================== --- roller/trunk/web/WEB-INF/jsps/core/struts2/Setup.jsp (added) +++ roller/trunk/web/WEB-INF/jsps/core/struts2/Setup.jsp Thu May 17 10:53:34 2007 @@ -0,0 +1,72 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. The ASF licenses this file to You + under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. For additional information regarding + copyright in this work, please see the NOTICE file in the top level + directory of this distribution. +--%> +<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %> + +

+
+
    + <%-- + Tell the user how to complete their Roller install, with helpful + notes and links to the appropriate places in the Roller UI. + --%> + + <%-- STEP 1: Create a user if you don't already have one --%> +
  • + - + + + + +

    +

    + + + + . +


    +
  • + + <%-- STEP 2: Create a weblog if you don't already have one --%> +
  • + - + + + + +

    +

    + + + + +


    +
  • + + <%-- STEP 3: Designate a weblog to be the frontpage weblot --%> +

  • +
    +
    +
    + + + + +
  • + +
+
Modified: roller/trunk/web/WEB-INF/tiles.xml URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/tiles.xml?view=diff&rev=539041&r1=539040&r2=539041 ============================================================================== --- roller/trunk/web/WEB-INF/tiles.xml (original) +++ roller/trunk/web/WEB-INF/tiles.xml Thu May 17 10:53:34 2007 @@ -54,6 +54,10 @@ + + + +