roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r545666 - in /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui: rendering/model/ rendering/servlets/ rendering/util/ rendering/velocity/deprecated/ struts2/editor/
Date Sat, 09 Jun 2007 00:10:10 GMT
Author: agilliland
Date: Fri Jun  8 17:10:09 2007
New Revision: 545666

URL: http://svn.apache.org/viewvc?view=rev&rev=545666
Log:
the proper way for getting templates for a weblog is through it's theme, the weblog getPageBy
methods are going to be EOLed.


Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
Fri Jun  8 17:10:09 2007
@@ -154,7 +154,7 @@
             return ThemeTemplateWrapper.wrap(pageRequest.getWeblogPage());
         } else {
             try {
-                return ThemeTemplateWrapper.wrap(weblog.getDefaultPage());
+                return ThemeTemplateWrapper.wrap(weblog.getTheme().getDefaultTemplate());
             } catch (WebloggerException ex) {
                 log.error("Error getting default page", ex);
             }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
Fri Jun  8 17:10:09 2007
@@ -61,9 +61,6 @@
 
 /**
  * Provides access to weblog pages.
- *
- * @web.servlet name="PageServlet" load-on-startup="5"
- * @web.servlet-mapping url-pattern="/roller-ui/rendering/page/*"
  */
 public class PageServlet extends HttpServlet {
     
@@ -231,7 +228,7 @@
         if (request.getParameter("popup") != null) {
             try {
                 // Does user have a popupcomments page?
-                page = weblog.getPageByName("_popupcomments");
+                page = weblog.getTheme().getTemplateByName("_popupcomments");
             } catch(Exception e ) {
                 // ignored ... considered page not found
             }
@@ -249,7 +246,7 @@
         } else if("tags".equals(pageRequest.getContext()) &&
                 pageRequest.getTags() == null) {
             try {
-                page = weblog.getPageByAction(ThemeTemplate.ACTION_TAGSINDEX);
+                page = weblog.getTheme().getTemplateByAction(ThemeTemplate.ACTION_TAGSINDEX);
             } catch(Exception e) {
                 log.error("Error getting weblog page for action 'tagsIndex'", e);
             }
@@ -265,7 +262,7 @@
         // If this is a permalink then look for a permalink template
         } else if(pageRequest.getWeblogAnchor() != null) {
             try {
-                page = weblog.getPageByAction(ThemeTemplate.ACTION_PERMALINK);
+                page = weblog.getTheme().getTemplateByAction(ThemeTemplate.ACTION_PERMALINK);
             } catch(Exception e) {
                 log.error("Error getting weblog page for action 'permalink'", e);
             }
@@ -274,7 +271,7 @@
         // if we haven't found a page yet then try our default page
         if(page == null) {
             try {
-                page = weblog.getDefaultPage();
+                page = weblog.getTheme().getDefaultTemplate();
             } catch(Exception e) {
                 log.error("Error getting default page for weblog = "+
                         weblog.getHandle(), e);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java
Fri Jun  8 17:10:09 2007
@@ -51,9 +51,6 @@
  * This servlet is used as part of the authoring interface to provide previews
  * of what a weblog will look like with a given theme.  It is not available
  * outside of the authoring interface.
- *
- * @web.servlet name="PreviewServlet" load-on-startup="9"
- * @web.servlet-mapping url-pattern="/roller-ui/authoring/preview/*"
  */
 public class PreviewServlet extends HttpServlet {
     
@@ -120,7 +117,7 @@
         Template page = null;
         try {
             // we just want to show the default view
-            page = tmpWebsite.getDefaultPage();
+            page = tmpWebsite.getTheme().getDefaultTemplate();
             
             if(page == null) {
                 throw new WebloggerException("No default page for weblog: "+tmpWebsite.getHandle());

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java
Fri Jun  8 17:10:09 2007
@@ -49,9 +49,6 @@
 
 /**
  * Handles search queries for weblogs.
- *
- * @web.servlet name="SearchServlet" load-on-startup="5"
- * @web.servlet-mapping url-pattern="/roller-ui/rendering/search/*"
  */
 public class SearchServlet extends HttpServlet {
     
@@ -99,11 +96,11 @@
         ThemeTemplate page = null;
         try {
             // first try looking for a specific search page
-            page = weblog.getPageByAction(ThemeTemplate.ACTION_SEARCH);
+            page = weblog.getTheme().getTemplateByAction(ThemeTemplate.ACTION_SEARCH);
             
             // if not found then fall back on default page
             if(page == null) {
-                page = weblog.getDefaultPage();
+                page = weblog.getTheme().getDefaultTemplate();
             }
             
             // if still null then that's a problem

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.java
Fri Jun  8 17:10:09 2007
@@ -349,8 +349,7 @@
         
         if(weblogPage == null && weblogPageName != null) {
             try {
-                UserManager umgr = RollerFactory.getRoller().getUserManager();
-                weblogPage = getWeblog().getPageByLink(weblogPageName);                
+                weblogPage = getWeblog().getTheme().getTemplateByLink(weblogPageName);  
             
             } catch (WebloggerException ex) {
                 log.error("Error getting weblog page "+weblogPageName, ex);
             }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java
Fri Jun  8 17:10:09 2007
@@ -120,7 +120,7 @@
         category = pageRequest.getWeblogCategory();
         page = pageRequest.getWeblogPage();
         if(page == null) {
-            page = weblog.getDefaultPage();
+            page = weblog.getTheme().getDefaultTemplate();
         }
         
         // setup date, isDay, and isMonth
@@ -241,7 +241,7 @@
         mLogger.debug("context viewLocale = "+ctx.get( "viewLocale"));
         
         // alternative display pages - customization
-        ThemeTemplate entryPage = weblog.getPageByName("_entry");
+        ThemeTemplate entryPage = weblog.getTheme().getTemplateByName("_entry");
         if (entryPage != null) {
             ctx.put("entryPage",ThemeTemplateWrapper.wrap(entryPage));
         }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/OldWeblogPageModel.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
Fri Jun  8 17:10:09 2007
@@ -133,7 +133,7 @@
             
             List pages = Collections.EMPTY_LIST;
             try {
-                pages = mWebsite.getPages();
+                pages = mWebsite.getTheme().getTemplates();
             } catch (WebloggerException ex) {
                 mLogger.error("error getting weblog pages", ex);
             }
@@ -266,7 +266,7 @@
             if (pageName == null)
                 throw new NullPointerException("pageName is null");
             
-            page = ThemeTemplateWrapper.wrap(website.getPageByName(pageName));
+            page = ThemeTemplateWrapper.wrap(website.getTheme().getTemplateByName(pageName));
         } catch (NullPointerException npe) {
             mLogger.warn(npe.getMessage());
         } catch (WebloggerException e) {
@@ -291,7 +291,7 @@
         String template_id = null;
         
         try {
-            ThemeTemplate pd = mWebsite.getPageByName(pageName);
+            ThemeTemplate pd = mWebsite.getTheme().getTemplateByName(pageName);
             if(pd != null) {
                 template_id = pd.getId();
             }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java?view=diff&rev=545666&r1=545665&r2=545666
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
Fri Jun  8 17:10:09 2007
@@ -72,9 +72,9 @@
             
             // get current list of templates, minus custom stylesheet
             List<WeblogTemplate> pages = mgr.getPages(getActionWeblog());
-            if(getActionWeblog().getTheme().getCustomStylesheet() != null) {
+            if(getActionWeblog().getTheme().getStylesheet() != null) {
                 pages.remove(mgr.getPageByLink(getActionWeblog(), 
-                        getActionWeblog().getTheme().getCustomStylesheet()));
+                        getActionWeblog().getTheme().getStylesheet().getLink()));
             }
             setTemplates(pages);
             



Mime
View raw message