roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r230810 [5/6] - in /incubator/roller/branches/roller_2.0: ./ contrib/plugins/src/org/roller/presentation/velocity/plugins/acronyms/ contrib/plugins/src/org/roller/presentation/velocity/plugins/convertbreaks/ contrib/plugins/src/org/roller/p...
Date Mon, 08 Aug 2005 14:43:03 GMT
Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java Mon Aug  8 07:41:04 2005
@@ -1,651 +1,429 @@
 package org.roller.presentation.website.actions;
 
-import java.io.BufferedReader;
-import java.io.FileReader;
 import java.io.IOException;
+import java.util.Collection;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Iterator;
-
-import javax.servlet.ServletContext;
+import java.util.List;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionError;
 import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
+import org.roller.pojos.WeblogTemplate;
+import org.roller.pojos.WebsiteData;
+import org.roller.presentation.RollerRequest;
+import org.roller.ThemeNotFoundException;
 import org.roller.config.RollerRuntimeConfig;
+import org.roller.model.Roller;
 import org.roller.model.RollerFactory;
+import org.roller.model.ThemeManager;
 import org.roller.model.UserManager;
-import org.roller.pojos.PageData;
-import org.roller.pojos.WebsiteData;
-import org.roller.presentation.RollerContext;
-import org.roller.presentation.RollerRequest;
+import org.roller.pojos.Theme;
+import org.roller.pojos.ThemeTemplate;
 import org.roller.presentation.RollerSession;
 import org.roller.presentation.pagecache.PageCacheFilter;
-import org.roller.presentation.velocity.PreviewResourceLoader;
-import org.roller.presentation.website.ThemeCache;
-import org.roller.presentation.website.formbeans.ThemeEditorForm;
-
 
-/////////////////////////////////////////////////////////////////////////////
 
 /**
- * Actions for theme chooser page.
- * 
- * @author llavandowska
- * 
+ * Struts Action class that handles the website theme chooser page.
+ *
+ * @author Allen Gilliland
+ *
  * @struts.action name="themeEditorForm" path="/editor/themeEditor"
  *    scope="session" parameter="method"
- * 
+ *
  * @struts.action-forward name="editTheme.page" path="/website/theme-editor.jsp"
  */
-public class ThemeEditorAction extends DispatchAction
-{
-	private static final String SESSION_TEMPLATE = "weblog.template";
-    private static final String LAST_THEME = "weblog.prev.theme";
-    private static Log mLogger = 
-        LogFactory.getFactory().getInstance(ThemeEditorAction.class);
-    private ThemeCache themeCache = ThemeCache.getInstance();
-	
-	/**
-     * Take user to edit theme page.
-     * 
-     * @param mapping Struts action mapping.
-     * @param form Theme editor form bean.
-     * @param request Servlet request.
-     * @param response Servlet response.
-     * @return Forward to edit-website page.
-     * @throws IOException
-     * @throws ServletException
-	 */
-	//-----------------------------------------------------------------------
-	public ActionForward edit(
-		ActionMapping       mapping,
-		ActionForm          form,
-		HttpServletRequest  request,
-		HttpServletResponse response)
-		throws IOException, ServletException
-	{
-		ActionErrors errors = new ActionErrors();
-		ActionForward forward = mapping.findForward("editTheme.page");
-		try
-		{
-             RollerSession rollerSession = RollerSession.getRollerSession(request);
-			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rollerSession.isUserAuthorizedToAdmin() )
-			{
-				loadThemes( rreq, errors, true);
-				ThemeEditorForm teForm = (ThemeEditorForm)form;
-				
-				teForm.setThemeName(null); // start fresh
-                
-                if (mLogger.isDebugEnabled())
-                {
-                    mLogger.debug("loaded themes, form="+teForm);
-                }  
-                
-//				// if a custom template has been previewed already,
-//				// it'll be in memory.
-//				String template = 
-//                   (String)request.getSession().getAttribute(SESSION_TEMPLATE);
-//                
-//                if (mLogger.isDebugEnabled())
-//                {
-//                    mLogger.debug("got template="+template);
-//                }
-//                
-//				if (StringUtils.isNotEmpty(template))
-//				{
-//					// load the template in memory
-//					teForm.setThemeTemplate( template );
-//                    
-//                    if (mLogger.isDebugEnabled())
-//                    {
-//                        mLogger.debug("set template");
-//                    }
-//				}
-//				// otherwise the "custom" template will need be loaded
-//				// from the current page.
-//				else
-//				{
-                
-				// clear any previously set themes
-                clearThemePages(rreq, 
-					(String)request.getSession(true).getAttribute(LAST_THEME)); 
-                                
-			     // load the current default page
-                PageData page = getDefaultPage( request );
-					teForm.setThemeTemplate( page.getTemplate() );
-					
-					
-				//}				
-			}
-			else
-			{
-				forward = mapping.findForward("access-denied");
-			}
-		}
-		catch (Exception e)
-		{
-            mLogger.error("ERROR in action",e);
-			throw new ServletException(e); 
-		}
-		return forward;
-	}
-
-	//-----------------------------------------------------------------------
-	/**
-	 * Load the template/theme to be previewed.  The template must be stashed
-	 * in PreviewResourceLoader so that PreviewServlet can find it.
-     * 
-     * @param mapping Struts action mapping.
-     * @param form Theme editor form bean.
-     * @param request Servlet request.
-     * @param response Servlet response.
-     * @return Forward to edit-website page.
-     * @throws IOException
-     * @throws ServletException
-	 */
-	public ActionForward preview(
-		ActionMapping       mapping,
-		ActionForm          form,
-		HttpServletRequest  request,
-		HttpServletResponse response)
-		throws IOException, ServletException
-	{
-		ActionErrors errors = new ActionErrors();
-		ActionForward forward = mapping.findForward("editTheme.page");
-		try
-		{
-             RollerSession rollerSession = RollerSession.getRollerSession(request);
-			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rollerSession.isUserAuthorizedToAdmin() )
-			{
-                HttpSession session = request.getSession();
-				ThemeEditorForm teForm = (ThemeEditorForm)form;
-				
-                String theme = teForm.getThemeName();
-                ServletContext ctx = rreq.getServletContext();
-                RollerContext rollerContext =
-                    RollerContext.getRollerContext( ctx );
-                                      
-                boolean showCustom = false;
-				if ( !"Custom".equals( theme ) )
-				{
-                    // if it isn't a custom template, load it from file
-					String sb = this.readTheme(rollerContext, theme);
-					teForm.setThemeTemplate( sb );
-
-					// clear any previously set themes
-					clearThemePages(rreq, 
-						(String) session.getAttribute(LAST_THEME)); 
-						                   
-                    setThemePages(request, theme);
-					session.setAttribute(LAST_THEME, theme);
-				}
-                else
-                {
-                	showCustom = true;
-                    clearThemePages(rreq, 
-                        (String) session.getAttribute(LAST_THEME));
-                        
-                    session.removeAttribute(LAST_THEME);
-					//session.removeAttribute(SESSION_TEMPLATE);
-                    
-				   //UserData ud = rreq.getUser();
-				   //PreviewResourceLoader.clearAllTemplates( ud.getUserName());
-                }
-				loadThemes( rreq, errors, showCustom);
-
-				// put the template where PreviewServlet
-				// will be able to find it
-				PageData page = getDefaultPage( request );			
-				PreviewResourceLoader.setTemplate(page.getId(), 
-					teForm.getThemeTemplate(), RollerSession.getRollerSession(request).getCurrentWebsite().getHandle() );
-				
-				// save the template in session for later editing
-				session.setAttribute(SESSION_TEMPLATE,
-					teForm.getThemeTemplate() );
-			}
-			else
-			{
-				forward = mapping.findForward("access-denied");
-			}
-		}
-		catch (Exception e)
-		{
-            mLogger.error("ERROR in action",e);
-			throw new ServletException(e);
-		}
-		return forward;
-	}	
-
-	//-----------------------------------------------------------------------
-	/**
-	 * Save the selected Theme or edited template as the Weblog pages template.
+public class ThemeEditorAction extends DispatchAction {
+    
+    private static Log mLogger =
+            LogFactory.getFactory().getInstance(ThemeEditorAction.class);
+    
+    
+    /**
+     * Default action method.
+     */
+    public ActionForward unspecified(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
+        
+        // make "edit" our default action
+        return this.edit(mapping, actionForm, request, response);
+    }
+    
+    
+    /**
+     * Base action method.
      * 
-     * @param mapping Struts action mapping.
-     * @param form Theme editor form bean.
-     * @param request Servlet request.
-     * @param response Servlet response.
-     * @return Forward to edit-website page.
-     * @throws IOException
-     * @throws ServletException
-	 */
-	public ActionForward save(
-		ActionMapping       mapping,
-		ActionForm          form,
-		HttpServletRequest  request,
-		HttpServletResponse response)
-		throws IOException, ServletException
-	{
-		ActionErrors errors = new ActionErrors();
-		ActionForward forward = mapping.findForward("editTheme.page");
-		try
-		{
-             RollerSession rollerSession = RollerSession.getRollerSession(request);
-			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rollerSession.isUserAuthorizedToAdmin() )
-			{
-                 loadThemes( rreq, errors, true);
-                 ThemeEditorForm teForm = (ThemeEditorForm)form;
-                 String theme = teForm.getThemeName();
-                 ServletContext ctx = rreq.getServletContext();
-                 RollerContext rollerContext = 
-                                RollerContext.getRollerContext( ctx );
-                 
-                 WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
-                	
-				// load the template either from the Form
-				// or from the disk (if its a stock Theme).
-				String template = "";
-				if ( "Custom".equals( theme ) )
-				{
-					// use the edited template
-					template = teForm.getThemeTemplate();
-				}
-				else
-				{
-					// Figure path to new user theme
-					String sb = this.readTheme(rollerContext, theme);
-					template = sb;
-				}
-
-                // clear the places holding onto the template
-                PreviewResourceLoader.clearAllTemplates(website.getHandle());
-                request.getSession().removeAttribute(SESSION_TEMPLATE);
-
-				// store the template in the page
-				UserManager mgr = RollerFactory.getRoller().getUserManager();
-				PageData page = getDefaultPage( request );
-
-				page.setTemplate( template );
-				mgr.storePage( page);
+     * Shows the theme chooser page with this users current theme selected.
+     **/
+    public ActionForward edit(
+            ActionMapping       mapping,
+            ActionForm          form,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
+        
+        ActionErrors errors = new ActionErrors();
+        ActionForward forward = mapping.findForward("editTheme.page");
+        try {
+            RollerSession rses = RollerSession.getRollerSession(request);
+            RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            if ( rses.isUserAuthorizedToAdmin() ) {
                 
-                saveThemePages( rreq, theme);
+                // get users current theme and our themes list
+                Roller roller = RollerFactory.getRoller();
+                ThemeManager themeMgr = roller.getThemeManager();
                 
-                // put them into the PreviewResourceLoader also
-                setThemePages(request, theme);
-
-				// clear the page cache
-				PageCacheFilter.removeFromCache(request, RollerSession.getRollerSession(request).getCurrentWebsite());
-				teForm.setThemeName("Custom");
-			}
-			else
-			{
-				forward = mapping.findForward("access-denied");
-			}
-		}
-		catch (Exception e)
-		{
-            mLogger.error("ERROR in action",e);
-			throw new ServletException(e);
-		}
-		return forward;
-	}
-	
-
-	/**
-     * Cancel choosing of theme.
-     * 
-	 * @param mapping Struts action mapping.
-	 * @param form Theme editor form bean.
-	 * @param request Servlet request.
-	 * @param response Servlet response.
-	 * @return Forward to edit-website page.
-	 * @throws IOException
-	 * @throws ServletException
-	 */
-	public ActionForward cancel(
-		ActionMapping       mapping,
-		ActionForm          form,
-		HttpServletRequest  request,
-		HttpServletResponse response)
-		throws IOException, ServletException
-	{
-		ActionForward forward = mapping.findForward("editTheme");
-		try
-		{
-             RollerSession rollerSession = RollerSession.getRollerSession(request);
-			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rollerSession.isUserAuthorizedToAdmin() )
-			{
-				// clear the page cache
-				WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
-				PageCacheFilter.removeFromCache( request, website );
-                 ThemeEditorForm teForm = (ThemeEditorForm)form;
-								
-				// clear the places holding onto the template
-				PreviewResourceLoader.clearAllTemplates( website.getHandle() );
-				request.getSession().removeAttribute(SESSION_TEMPLATE);
-				teForm.setThemeName("Custom");
-			}
-			else
-			{
-				forward = mapping.findForward("access-denied");
-			}
-		}
-		catch (Exception e)
-		{
-            mLogger.error("ERROR in action",e);
-			throw new ServletException(e);
-		}
-		return forward;
-	}
-	
-	/**
-	 * Load the Themes from disk ONCE per user session.
-     * 
-	 * @param rreq
-	 * @param errors
-	 */
-	private void loadThemes( 
-        RollerRequest rreq, ActionErrors errors, boolean listCustom)
-	{
-		HttpSession session = rreq.getRequest().getSession(false);
-		try
-		{
-			// Figure path to new user templates
-			ServletContext ctx = rreq.getServletContext();
-			String[] themes = null;			
-			if (ctx.getAttribute("themeStore") != null)
-			{
-				themes = (String[]) ctx.getAttribute("themeStore");
-			}
-			else
-			{
-				RollerContext rollerContext = 
-								RollerContext.getRollerContext( ctx );
-				themes = rollerContext.getThemeNames();
-				ctx.setAttribute("themeStore", themes);
-			}
-			
-			// need to insert "Custom" as the top theme.
-			// "Custom" means the hand-edited template.
-			if (listCustom)
-			{
-				// probably should use arraycopy here?
-				String[] themes2 = new String[ themes.length+1 ];
-				themes2[0] = "Custom";
-				for (int i=1; i<themes2.length; i++)
-				{
-					themes2[i] = themes[i-1];
-				}
-				themes = themes2;
-			}
-			session.setAttribute( "themes", themes );
-		}
-		catch (Exception e)
-		{
-			errors.add(ActionErrors.GLOBAL_ERROR,
-				new ActionError("error.editing.user", e.toString()));
-		}
-	}
-	
-	/**
-	 * Get the Default Page for the website specified by request.
-     * 
-	 * @param rreq
-	 * @return PageData
-	 */
-	private PageData getDefaultPage(HttpServletRequest request) throws RollerException
-	{
-		try
-		{
-			UserManager mgr = RollerFactory.getRoller().getUserManager();
-			WebsiteData wd = RollerSession.getRollerSession(request).getCurrentWebsite();
-			String defaultPageId = wd.getDefaultPageId();
-			return mgr.retrievePage( defaultPageId );
-		}
-		catch (Exception e)
-		{
+                String username = rses.getAuthenticatedUser().getUserName();
+                WebsiteData website = rses.getCurrentWebsite();
+                String currentTheme = website.getEditorTheme();
+                List themes = themeMgr.getEnabledThemesList();
+                
+                // if we allow custom themes then add it to the end of the list
+                if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed"))
+                    themes.add(Theme.CUSTOM);
+                
+                // on the first pass just show a preview of the current theme
+                request.setAttribute("previewTheme", currentTheme);
+                request.setAttribute("currentTheme", currentTheme);
+                request.setAttribute("themesList", themes);
+                
+                mLogger.debug("Previewing theme "+currentTheme+" to "+username);
+                
+            } else {
+                forward = mapping.findForward("access-denied");
+            }
+            
+        } catch (Exception e) {
             mLogger.error("ERROR in action",e);
-			throw new RollerException( e );
-		}
-	}
+            throw new ServletException(e);
+        }
+        
+        return forward;
+    }
     
+
     /**
-     * Loads theme into preview resource loader.
-     * 
-     * @param rreq
-     * @param theme
-     * @throws RollerException
+     * Preview action method.
+     *
+     * Happens when the user selects a new preview theme from the dropdown menu.
+     * Shows a new preview theme.
      */
-    private void setThemePages( HttpServletRequest request, String theme )
-       throws RollerException
-    {
-        RollerContext rollerContext = 
-           RollerContext.getRollerContext(request);
-           
-        try
-        {        
-            HashMap pages = rollerContext.readThemeMacros(theme);
-            Iterator iter = pages.keySet().iterator();
-            while ( iter.hasNext() )
-            {
-                String pageName = (String) iter.next();
-                String sb = (String)pages.get( pageName );
-                UserManager umgr = RollerFactory.getRoller().getUserManager();
-                WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
-                String handle = website.getHandle();
-                PageData page = umgr.getPageByName( RollerSession.getRollerSession(request).getCurrentWebsite(), pageName );
-                if (page != null)
-                {
-                    PreviewResourceLoader.setTemplate(page.getId(),sb, handle);
-                }
-                else
-                {
-                    PreviewResourceLoader.setTemplate(pageName, sb, handle);
+    public ActionForward preview(
+            ActionMapping       mapping,
+            ActionForm          form,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
+        
+        ActionErrors errors = new ActionErrors();
+        ActionForward forward = mapping.findForward("editTheme.page");
+        try {
+            RollerSession rses = RollerSession.getRollerSession(request);            
+            RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            if ( rses.isUserAuthorizedToAdmin() ) {
+
+                // get users current theme
+                Roller roller = RollerFactory.getRoller();
+                ThemeManager themeMgr = roller.getThemeManager();
+                
+                String username = rses.getAuthenticatedUser().getUserName();
+                WebsiteData website = rses.getCurrentWebsite();
+                String currentTheme = website.getEditorTheme();
+                List themes = themeMgr.getEnabledThemesList();
+                
+                // if we allow custom themes then add it to the end of the list
+                if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed"))
+                    themes.add(Theme.CUSTOM);
+                
+                // set the current theme in the request
+                request.setAttribute("currentTheme", currentTheme);
+                request.setAttribute("themesList", themes);
+                
+                String theme = request.getParameter("theme");
+                try {
+                    Theme previewTheme = themeMgr.getTheme(theme);
+                    
+                    if(previewTheme.isEnabled()) {
+                        // make sure the view knows what theme to preview
+                        request.setAttribute("previewTheme", previewTheme.getName());
+                    
+                        mLogger.debug("Previewing theme "+previewTheme.getName()+
+                                " to "+username);
+                    } else {
+                        request.setAttribute("previewTheme", currentTheme);
+                        errors.add(null, new ActionMessage("Theme not enabled"));
+                        saveErrors(request, errors);
+                    }
+
+                } catch(ThemeNotFoundException tnfe) {
+                    // hmm ... maybe they chose "custom"?
+                    if(theme != null && theme.equals(Theme.CUSTOM)) {
+                        request.setAttribute("previewTheme", Theme.CUSTOM);
+                    } else {
+                        // we should never get here
+                        request.setAttribute("previewTheme", currentTheme);
+                        errors.add(null, new ActionMessage("Theme not found"));
+                        saveErrors(request, errors);
+                    }
                 }
+                
+            } else {
+                forward = mapping.findForward("access-denied");
             }
-        }
-        catch (Exception e)
-        {
+            
+        } catch (Exception e) {
             mLogger.error("ERROR in action",e);
-            throw new RollerException( e );
+            throw new ServletException(e);
         }
         
+        return forward;
     }
     
+
     /**
-     * Clears users preview theme from the preview resource loader.
-     * 
-     * @param rreq
-     * @param theme
-     * @throws RollerException
+     * Save action method.
+     *
+     * Happens when the user clicks the "Save" button to set a new theme.
+     * This method simply updates the WebsiteData.editorTheme property with
+     * the value of the new theme.
      */
-    private void clearThemePages( RollerRequest rreq, String theme )
-       throws RollerException
-    {
-        if (mLogger.isDebugEnabled()) 
-        {
-            mLogger.debug("theme="+theme);
-        }
-        
-    	if (theme == null) return;
-    	
-        RollerContext rollerContext = 
-           RollerContext.getRollerContext(rreq.getRequest());
-           
-        try
-        {
-            //UserData ud = rreq.getUser();
-            UserManager mgr = RollerFactory.getRoller().getUserManager();
-            //String username = ud.getUserName();
+    public ActionForward save(
+            ActionMapping       mapping,
+            ActionForm          form,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
         
-            String themeDir = rollerContext.getThemePath(theme);        
-            String[] children = RollerContext.getThemeFilenames(themeDir);
-            
-            // Custom theme won't have any files
-            if (children == null) return;
+        ActionErrors errors = new ActionErrors();
+        ActionForward forward = mapping.findForward("editTheme.page");
+        try {
+            RollerSession rses = RollerSession.getRollerSession(request);
+            RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            if ( rses.isUserAuthorizedToAdmin() ) {
+                
+                String newTheme = null;
+                
+                // lookup what theme the user wants first
+                String theme = request.getParameter("theme");
+                try {
+                    Roller roller = RollerFactory.getRoller();
+                    ThemeManager themeMgr = roller.getThemeManager();
+                    Theme previewTheme = themeMgr.getTheme(theme);
                     
-            for (int i = 0; i < children.length; i++)
-            {
-                String pageName = children[i].substring(
-                    0,children[i].length()-3);
-    
-                PageData page = mgr.getPageByName(
-                        RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite(), pageName);
-                if (page != null)
-                {
-                    PreviewResourceLoader.clearTemplate( page.getId() );
+                    if(previewTheme.isEnabled()) {
+                        newTheme = previewTheme.getName();
+                    } else {
+                        errors.add(null, new ActionMessage("Theme not enabled"));
+                        saveErrors(request, errors);
+                    }
+                    
+                } catch(ThemeNotFoundException tnfe) {
+                    // possibly selected "custom"
+                    if(theme != null && theme.equals(Theme.CUSTOM)) {
+                        newTheme = Theme.CUSTOM;
+                    } else {
+                        // hmm ... that's weird
+                        mLogger.warn(tnfe);
+                        errors.add(null, new ActionMessage("Theme not found"));
+                        saveErrors(request, errors);
+                    }
                 }
-                else
-                {
-                    PreviewResourceLoader.clearTemplate( pageName );
+                
+                // update theme for website and save
+                if(newTheme != null) {
+                    try {
+                        Roller roller = RollerFactory.getRoller();
+                        String username = rses.getAuthenticatedUser().getUserName();
+                        WebsiteData website = rses.getCurrentWebsite();
+                        website.setEditorTheme(newTheme);
+                        website.save();
+                        
+                        mLogger.debug("Saved theme "+newTheme+
+                                " for "+username);
+                        
+                        // make sure to flush the page cache so ppl can see the change
+                        PageCacheFilter.removeFromCache(request, website);
+                
+                        // update complete ... now just send them back to edit
+                        return this.edit(mapping, form, request, response);
+                        
+                    } catch(RollerException re) {
+                        mLogger.error(re);
+                        errors.add(null, new ActionMessage("Error setting theme"));
+                        saveErrors(request, errors);
+                    }
                 }
+                
+                // if we got down here then there was an error :(
+                // send the user back to preview page with errors already set
+                return this.preview(mapping, form, request, response);
+                
+            } else {
+                forward = mapping.findForward("access-denied");
             }
+        } catch (Exception e) {
+            mLogger.error("ERROR in action",e);
+            throw new ServletException(e);
         }
-        catch (Exception e)
-        {
-            if (mLogger.isDebugEnabled())
-            {
-                mLogger.debug("clearThemePages error: ", e);
-            }
-            
-            throw new RollerException( e );
-        }
-        
+        return forward;
     }
+   
     
     /**
-     * Reads theme pages from disk and saves them as pages in website of
-     * the user specified by the RollerRequest. 
-     * 
-     * @param rreq Request wrapper.
-     * @param theme Name of theme to save.
-     * @throws RollerException
+     * Customize action method.
+     *
+     * Happens when a user clicks the "Customize" button on their current theme.
+     * This method copies down all the theme templates from the currently
+     * selected theme into the users custom template pages and updates the users
+     * theme to "custom".
      */
-    private void saveThemePages( RollerRequest rreq, String theme )
-       throws RollerException
-    {
-        RollerContext rollerContext = 
-           RollerContext.getRollerContext(rreq.getRequest());
-           
-        try
-        {
-            UserManager mgr = RollerFactory.getRoller().getUserManager();
-            WebsiteData website = RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite();
+    public ActionForward customize(
+            ActionMapping       mapping,
+            ActionForm          form,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
         
-            HashMap pages = rollerContext.readThemeMacros(theme);
-            Iterator iter = pages.keySet().iterator();
-            while ( iter.hasNext() )
-            {
-                String pageName = (String) iter.next();
-                String pageContent = (String)pages.get( pageName );
-    
-                PageData page = mgr.getPageByName( 
-                        RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite(), pageName );
-                if (page != null)
-                {
-                    // User already has page by that name, so overwrite it.
-                    page.setTemplate( pageContent );
-                }
-                else
-                {
-                    // User does not have page by that name, so create new page.
-                    page = new PageData( null,
-                        website,         // website
-                        pageName,        // name
-                        pageName,        // description
-                        pageName,        // link
-                        pageContent,     // template
-                        new Date()       // updateTime                
-                    );
-                    mgr.storePage( page );
+        ActionErrors errors = new ActionErrors();
+        ActionForward forward = mapping.findForward("editTheme.page");
+        try {
+            RollerSession rses = RollerSession.getRollerSession(request);
+            RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            if ( rses.isUserAuthorizedToAdmin() ) {
+                
+                // copy down current theme to weblog templates
+                Roller roller = RollerFactory.getRoller();
+                ThemeManager themeMgr = roller.getThemeManager();
+                
+                String username = rses.getAuthenticatedUser().getUserName();
+                WebsiteData website = rses.getCurrentWebsite();
+                
+                try {
+                    Theme usersTheme = themeMgr.getTheme(website.getEditorTheme());
+                    
+                    // only if custom themes are allowed
+                    if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
+                        try {
+                            this.saveThemePages(website, usersTheme);
+                        } catch(RollerException re) {
+                            mLogger.error(re);
+                            errors.add(null, new ActionMessage("Error customizing theme"));
+                            saveErrors(request, errors);
+                        }
+                        
+                        // make sure to flush the page cache so ppl can see the change
+                        PageCacheFilter.removeFromCache(request, website);
+                    }
+                    
+                } catch(ThemeNotFoundException tnfe) {
+                    // this catches the potential case where someone customizes
+                    // a theme and has their theme as "custom" but then hits the
+                    // browser back button and presses the button again, so
+                    // they are basically trying to customize a "custom" theme
+                    
+                    // log this as a warning just in case
+                    mLogger.warn(tnfe);
+                    
+                    // show the user an error message and let things go back
+                    // to the edit page
+                    errors.add(null, new ActionMessage("Oops!  You already have a custom theme."));
                 }
+                
+                // just take the user back home to the edit theme page
+                return this.edit(mapping, form, request, response);
+                
+            } else {
+                forward = mapping.findForward("access-denied");
             }
-            RollerFactory.getRoller().commit();
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             mLogger.error("ERROR in action",e);
-            throw new RollerException( e );
+            throw new ServletException(e);
         }
-        
+        return forward;
     }
     
+    
     /**
-     * Read the 'Weblog.vm' file for a theme and return it as a String.
-     * 
-     * @param ctx Roller context.
-     * @param theme Name of theme.
-     * @return Theme in the form of a string.
+     * Helper method that copies down the pages from a given theme into a
+     * users weblog templates.
+     *
+     * @param rreq Request wrapper.
+     * @param theme Name of theme to save.
      * @throws RollerException
      */
-    public String readTheme(RollerContext ctx, String theme)
-        throws RollerException
-    {
-        String fileName = "Weblog.vm";
-        if (themeCache.getFromCache(theme, fileName) != null)
-        {
-            return themeCache.getFromCache(theme, fileName);
-        }
+    private void saveThemePages(WebsiteData website, Theme theme)
+        throws RollerException {
         
-        String themesDir = RollerRuntimeConfig.getProperty("users.themes.path");
+        mLogger.debug("Setting custom templates for website: "+website.getName());
         
-        String themeFile = RollerContext.getServletContext(
-            ).getRealPath( "/" + themesDir
-            + "/" + theme + "/" + fileName );
-                        
-        // Import weblog page template from specified theme
-        StringBuffer sb = new StringBuffer();
-        BufferedReader rdr = null;
-        try
-        {
-            rdr = new BufferedReader(
-                                    new FileReader(themeFile));
-            String line = null;
-            while ( null != (line = rdr.readLine()) )
-            {
-                sb.append( line );
-                sb.append("\n");
+        try {
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
+            
+            Collection templates = theme.getTemplates();
+            Iterator iter = templates.iterator();
+            ThemeTemplate theme_template = null;
+            while ( iter.hasNext() ) {
+                theme_template = (ThemeTemplate) iter.next();
+                //String pageContent = (String) templates.get( pageName );
+                
+                WeblogTemplate template = 
+                        userMgr.getPageByName(website, theme_template.getName());
+                if (template != null) {
+                    // User already has page by that name, so overwrite it.
+                    template.setContents(theme_template.getContents());
+                    
+                } else {
+                    // User does not have page by that name, so create new page.
+                    template = new WeblogTemplate( null,
+                            website,                            // website
+                            theme_template.getName(),           // name
+                            theme_template.getDescription(),    // description
+                            theme_template.getName(),           // link
+                            theme_template.getContents(),       // contents
+                            new Date()                          // last mod
+                            );
+                    userMgr.storePage( template );
+                }
             }
-            themeCache.putIntoCache(theme, fileName, sb.toString());
-        }
-        catch (Exception e)
-        {
-            mLogger.error("themeFile:" + themeFile, e);
-            throw new RollerException( e );
-        }
-        finally
-        {
-            try {
-                if (rdr != null) rdr.close();
-            } catch (IOException ioe) {
-                mLogger.warn("unable to close " + themeFile);
+            
+            // now update this website's theme to custom
+            website.setEditorTheme(Theme.CUSTOM);
+            
+            // if this is the first time someone is customizing a theme then
+            // we need to set a default page
+            if(website.getDefaultPageId() == null ||
+                    website.getDefaultPageId().equals("dummy")) {
+                // we have to go back to the db to figure out the id
+                WeblogTemplate template = userMgr.getPageByName(website, "Weblog");
+                if(template != null) {
+                    mLogger.debug("Setting default page to "+template.getId());
+                    website.setDefaultPageId(template.getId());
+                }
             }
+            
+            // save our updated website
+            userMgr.storeWebsite(website);
+            
+            // commit?  i still don't understand when this is needed :/
+            RollerFactory.getRoller().commit();
+            
+        } catch (Exception e) {
+            mLogger.error("ERROR in action",e);
+            throw new RollerException( e );
         }
         
-        return sb.toString();
     }
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java Mon Aug  8 07:41:04 2005
@@ -24,7 +24,14 @@
 import org.roller.presentation.website.formbeans.UserFormEx;
 import org.roller.util.DateUtil;
 import org.roller.util.Utilities;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.TimeZone;
+import java.util.TreeSet;
 
+import org.roller.model.RollerFactory;
 
 
 /////////////////////////////////////////////////////////////////////////////

Copied: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java (from r225818, incubator/roller/trunk/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java)
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java?p2=incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java&p1=incubator/roller/trunk/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java&r1=225818&r2=230810&rev=230810&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WeblogTemplateFormAction.java Mon Aug  8 07:41:04 2005
@@ -20,12 +20,13 @@
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
 import org.roller.RollerPermissionsException;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
-import org.roller.pojos.Template;
 import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.forms.WeblogTemplateForm;
 import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.util.StringUtils;
@@ -58,7 +59,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rses = RollerSession.getRollerSession(request);
+            if ( rses.isUserAuthorizedToAdmin() )
             {
                 WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
                 WeblogTemplate data = new WeblogTemplate();
@@ -71,9 +73,9 @@
                 data.setContents("");
                 validateLink( data );
 
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 mgr.storePage( data );
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 ActionMessages uiMessages = new ActionMessages();
                 uiMessages.add(ActionMessages.GLOBAL_MESSAGE, 
@@ -81,8 +83,8 @@
                                 data.getName()));
                 saveMessages(request, uiMessages);
                 
-                UserData user = rreq.getUser();
-                PageCacheFilter.removeFromCache( request, user );
+                UserData user = rses.getAuthenticatedUser();
+                PageCacheFilter.removeFromCache( request, hd );
                     
                 actionForm.reset(mapping,request);                
                 
@@ -113,14 +115,15 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rses = RollerSession.getRollerSession(request);
+            if ( rses.isUserAuthorizedToAdmin() )
             {
-                UserData ud = rreq.getUser();
+                UserData ud = rses.getAuthenticatedUser();
                 WeblogTemplate pd = (WeblogTemplate) rreq.getPage();
                 WeblogTemplateForm pf = (WeblogTemplateForm)actionForm;
                 pf.copyFrom(pd, request.getLocale());
 
-                PageCacheFilter.removeFromCache( request,ud );
+                PageCacheFilter.removeFromCache( request, pd.getWebsite() );
                 
                 addModelObjects(rreq);
             }
@@ -149,7 +152,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rses = RollerSession.getRollerSession(request);
+            if ( rses.isUserAuthorizedToAdmin() )
             {
                 addModelObjects(rreq);
             }
@@ -178,18 +182,19 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rses = RollerSession.getRollerSession(request);
+            if ( rses.isUserAuthorizedToAdmin() )
             {
                 WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
                 WeblogTemplate data = new WeblogTemplate();
                 form.copyTo(data, request.getLocale());
 
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 mgr.removePageSafely( data.getId() );
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
-                UserData user = rreq.getUser();
-                PageCacheFilter.removeFromCache( request,user );
+                UserData user = rses.getAuthenticatedUser();
+                PageCacheFilter.removeFromCache( request, data.getWebsite() );
                     
                 addModelObjects(rreq);
 
@@ -226,14 +231,15 @@
         ActionForward forward = mapping.findForward("removePage.page");
         try
         {
+            RollerSession rses = RollerSession.getRollerSession(request);
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rses.isUserAuthorizedToAdmin() )
             {
                 WeblogTemplate cd = (WeblogTemplate) rreq.getPage();
                 WeblogTemplateForm pf = (WeblogTemplateForm)actionForm;
                 pf.copyFrom(cd, request.getLocale());
 
-                UserData ud = rreq.getUser();
+                UserData ud = rses.getAuthenticatedUser();
                 request.setAttribute("user",ud);
             }
             else
@@ -260,21 +266,22 @@
         ActionForward forward = mapping.findForward("editPage.page");
         try
         {
+            RollerSession rses = RollerSession.getRollerSession(request);
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rses.isUserAuthorizedToAdmin() )
             {
                 WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 WeblogTemplate data = mgr.retrievePage(form.getId());
                 data.save(); // should through exception if no save permission
                 form.copyTo(data, request.getLocale());
                 data.setLastModified( new java.util.Date() );
-                data.setWebsite( rreq.getWebsite() );
+                data.setWebsite(mgr.retrieveWebsite(form.getWebsite().getId()));
 
                 validateLink( data );
 
                 mgr.storePage( data );
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 // set the (possibly) new link back into the Form bean
                 ((WeblogTemplateForm)actionForm).setLink( data.getLink() );
@@ -285,8 +292,8 @@
                                 data.getName()));
                 saveMessages(request, uiMessages);
 
-                UserData user = rreq.getUser();
-                PageCacheFilter.removeFromCache( request,user );
+                UserData user = rses.getAuthenticatedUser();
+                PageCacheFilter.removeFromCache(request, data.getWebsite());
             }
             else
             {
@@ -356,14 +363,14 @@
     private void addModelObjects( RollerRequest rreq ) 
         throws RollerException {  
             
-        HttpServletRequest request = rreq.getRequest();
-            
-        UserManager mgr = rreq.getRoller().getUserManager();
+        HttpServletRequest request = rreq.getRequest();            
+        UserManager mgr = RollerFactory.getRoller().getUserManager();        
+        RollerSession rses = RollerSession.getRollerSession(rreq.getRequest());
 
-        UserData user = rreq.getUser();
+        UserData user = rses.getAuthenticatedUser();
         request.setAttribute("user",user);
 
-        WebsiteData wd = rreq.getWebsite();
+        WebsiteData wd = rses.getCurrentWebsite();
         request.setAttribute("website", wd);
 
         List pages = mgr.getPages(wd);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java Mon Aug  8 07:41:04 2005
@@ -138,8 +138,11 @@
             if ( rollerSession.isUserAuthorizedToAdmin() )
             {
                 WebsiteFormEx form = (WebsiteFormEx)actionForm;
-                if (!form.getDefaultPageId().equals(form.getWeblogDayPageId()))
-                {                    
+
+                /* we don't need this check any longer -- Allen G
+                if(!form.getDefaultPageId().equals(form.getWeblogDayPageId()))
+                {
+                */               
                     WebsiteData wd = umgr.retrieveWebsite(form.getId());
                     wd.save(); // should throw if save not permitted
 
@@ -168,6 +171,7 @@
                     List epages = Arrays.asList(StringUtils.split(
                         org.apache.commons.lang.StringUtils.deleteWhitespace(editorPages), ","));
                     request.setAttribute("editorPagesList", epages);                
+                /*
                 }
                 else
                 {
@@ -175,6 +179,7 @@
                         new ActionError("websiteSettings.error.sameTemplate"));                   
                     saveErrors(request, errors);
                 }
+                */
             }
             else
             {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/package.html?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/package.html (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/package.html Mon Aug  8 07:41:04 2005
@@ -4,6 +4,7 @@
   <title></title>
 </head>
 <body>
-Actions for user forms.<br>
+Struts actions for managing Roller config, website settings and admin.
+
 </body>
 </html>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/RollerConfigFormEx.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/RollerConfigFormEx.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/RollerConfigFormEx.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/RollerConfigFormEx.java Mon Aug  8 07:41:04 2005
@@ -8,8 +8,6 @@
 import org.roller.pojos.RollerConfigData;
 import org.roller.presentation.forms.RollerConfigForm;
 
-import sun.security.krb5.internal.crypto.d;
-
 /**
  * These properties are not persistent and are only needed for the UI.
  *

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/package.html?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/package.html (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/package.html Mon Aug  8 07:41:04 2005
@@ -4,6 +4,7 @@
   <title></title>
 </head>
 <body>
-Form beans for user forms.<br>
+Form beans for managing Roller config, website settings and admin.
+
 </body>
 </html>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/package.html?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/package.html (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/package.html Mon Aug  8 07:41:04 2005
@@ -4,11 +4,7 @@
   <title></title>
 </head>
 <body>
-
-<p>
-Struts Actions, Form beans, and JSP tags for managing the various aspects of a 
-Roller Website including the Users, Themes, Page templates, and configuration.
-</p>
+ThemeCache keeps us from hitting Velocity/disk so often.
 
 </body>
 </html>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/package.html?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/package.html (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/package.html Mon Aug  8 07:41:04 2005
@@ -4,6 +4,7 @@
   <title></title>
 </head>
 <body>
-JSP tags for user display and editing.<br>
+JSP tags for file manager and user authorization.
+
 </body>
 </html>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java Mon Aug  8 07:41:04 2005
@@ -22,7 +22,7 @@
 import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
-import org.roller.pojos.PageData;
+import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogEntryData;
 import org.roller.pojos.WebsiteData;
@@ -133,8 +133,8 @@
             Roller roller = RollerFactory.getRoller(); 
             UserManager userMgr = roller.getUserManager();
 
-            PageData page = userMgr.retrievePage(templateType);
-            page.setTemplate(templateData);
+            WeblogTemplate page = userMgr.retrievePage(templateType);
+            page.setContents(templateData);
             userMgr.storePage(page);
             flushPageCache(page.getWebsite());
 
@@ -177,7 +177,7 @@
         {
             Roller roller = RollerFactory.getRoller(); 
             UserManager userMgr = roller.getUserManager();
-            PageData page = userMgr.retrievePage(templateType);
+            WeblogTemplate page = userMgr.retrievePage(templateType);
 
             if ( null == page )
             {
@@ -185,7 +185,7 @@
             }
             else
             {
-                return page.getTemplate();
+                return page.getContents();
             }
         }
         catch (Exception e)

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java Mon Aug  8 07:41:04 2005
@@ -124,6 +124,9 @@
         String title = (String)postcontent.get("title");
         if (title == null) title = "";
 
+        Date dateCreated = (Date)postcontent.get("dateCreated");
+        if (dateCreated == null) dateCreated = (Date)postcontent.get("pubDate");
+
         String cat = null;
         if ( postcontent.get("categories") != null )
         {
@@ -150,6 +153,11 @@
             {
                 entry.setStatus(WeblogEntryData.DRAFT);
             }
+            if (dateCreated != null) 
+            {
+                entry.setPubTime(new Timestamp(dateCreated.getTime()));
+            }
+
 
 
             if ( cat != null )
@@ -207,6 +215,10 @@
         String title = (String)postcontent.get("title");
         if (title == null) title = "";
 
+        Date dateCreated = (Date)postcontent.get("dateCreated");
+        if (dateCreated == null) dateCreated = (Date)postcontent.get("pubDate");
+        if (dateCreated == null) dateCreated = new Date();
+
         String cat = null;
         if ( postcontent.get("categories") != null )
         {
@@ -225,12 +237,13 @@
             Roller roller = RollerFactory.getRoller(); 
             WeblogManager weblogMgr = roller.getWeblogManager();
 
-            Timestamp current = new Timestamp(System.currentTimeMillis());
+            Timestamp current =
+                new Timestamp(System.currentTimeMillis());
 
             WeblogEntryData entry = new WeblogEntryData();
             entry.setTitle(title);
             entry.setText(description);
-            entry.setPubTime(current);
+            entry.setPubTime(new Timestamp(dateCreated.getTime()));
             entry.setUpdateTime(current);
             entry.setWebsite(website);
             if (Boolean.valueOf(publish).booleanValue())

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/package.html?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/package.html (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/package.html Mon Aug  8 07:41:04 2005
@@ -4,17 +4,13 @@
   <title></title>
 </head>
 <body>
-XML-RPC API Implementations<br>
+Roller implementation of Blogger and MetaWeblog APIs.
+
+<p>Blogger API spec can be found at http://plant.blogger.com/api/index.html</p>
+
+<p>See also http://xmlrpc.free-conversant.com/docs/bloggerAPI</p>
+
+<p>MetaWeblog API spec can be found at http://www.xmlrpc.com/metaWeblogApi</p>
 
-<h3>Roller XML-RPC Handler for the Blogger v1 API.</h3>
-<p>
-Blogger API spec can be found at http://plant.blogger.com/api/index.html<br />
-See also http://xmlrpc.free-conversant.com/docs/bloggerAPI
-</p>
- 
-<h3>Roller XML-RPC Handler for the MetaWeblog API.</h3>
-<p>
-MetaWeblog API spec can be found at http://www.xmlrpc.com/metaWeblogApi
-</p>
 </body>
 </html>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/util/package.html
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/util/package.html?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/util/package.html (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/util/package.html Mon Aug  8 07:41:04 2005
@@ -4,7 +4,7 @@
   <title></title>
 </head>
 <body>
-This package is home to general purpose utility classes, especially those that 
-are truly generic and have no dependency on Roller.<br>
+Roller utility classes including date processing, mail, caching, etc.
+
 </body>
 </html>

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/RollerTestBase.java Mon Aug  8 07:41:04 2005
@@ -22,9 +22,11 @@
 import org.roller.model.WeblogManager;
 import org.roller.pojos.CommentData;
 import org.roller.pojos.PermissionsData;
+import org.roller.pojos.Theme;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WeblogEntryData;
+import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.WebsiteData;
 
 /**

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/IndexManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/IndexManagerTest.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/IndexManagerTest.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/IndexManagerTest.java Mon Aug  8 07:41:04 2005
@@ -2,31 +2,53 @@
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
- 
+
+import org.roller.RollerTestBase;
+import org.roller.business.search.operations.AddEntryOperation;
 import org.roller.business.search.operations.SearchOperation;
 import org.roller.model.IndexManager;
-import org.roller.RollerTestBase;
+import org.roller.pojos.WeblogEntryData;
 
 /**
  * @author Dave Johnson
  */
 public class IndexManagerTest extends RollerTestBase
 {
-    public void testSearch() 
+    public void testSearch() throws Exception
     {
         try
         {
             IndexManager imgr = getRoller().getIndexManager();
             
+            WeblogEntryData wd1 = new WeblogEntryData();
+            wd1.setId("dummy");
+            wd1.setTitle("The Tholian Web");
+            wd1.setText(
+                "When the Enterprise attempts to ascertain the fate of the U.S.S. "
+               +"Defiant which vanished 3 weeks ago, the warp engines begin to lose "
+               +"power, and Spock reports strange sensor readings.");
+            imgr.executeIndexOperationNow(
+                    new AddEntryOperation((IndexManagerImpl)imgr, wd1));
+            
+            WeblogEntryData wd2 = new WeblogEntryData();
+            wd2.setId("dummy");
+            wd2.setTitle("A Piece of the Action");
+            wd2.setText(
+               "The crew of the Enterprise attempts to make contact with "
+               +"the inhabitants of planet Sigma Iotia II, and Uhura puts Kirk "
+               +"in communication with Boss Oxmyx.");
+            imgr.executeIndexOperationNow(
+                    new AddEntryOperation((IndexManagerImpl)imgr, wd2));
+            
             SearchOperation search = new SearchOperation(imgr);
-            search.setTerm("test");
+            search.setTerm("Enterprise");
             imgr.executeIndexOperationNow(search);
-            assertTrue(search.getResultsCount() > 0);
+            assertTrue(search.getResultsCount() == 2);
             
             SearchOperation search2 = new SearchOperation(imgr);
-            search2.setTerm("test");
+            search2.setTerm("Tholian");
             imgr.executeIndexOperationNow(search2);
-            assertTrue(search2.getResultsCount() > 0);
+            assertTrue(search2.getResultsCount() == 1);
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/PermissionsTest.java Mon Aug  8 07:41:04 2005
@@ -12,7 +12,7 @@
 import org.roller.model.WeblogManager;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
-import org.roller.pojos.PageData;
+import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.PermissionsData;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogEntryData;
@@ -152,7 +152,7 @@
         UserData testuser0 = umgr.getUser("testuser0");
         WebsiteData website0 = (WebsiteData)umgr.getWebsites(testuser0, null).get(0);
         assertNotNull(website0);
-        PageData page = (PageData)getRoller().getUserManager().getPages(website0).get(0);
+        WeblogTemplate page = (WeblogTemplate)getRoller().getUserManager().getPages(website0).get(0);
         assertNotNull(page);
         
         // and tries to save it

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/business/UserManagerTest.java Mon Aug  8 07:41:04 2005
@@ -18,6 +18,7 @@
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.FolderData;
+import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WebsiteData;
@@ -258,7 +259,8 @@
         assertNotNull(root);
 
         List pages1 = getRoller().getUserManager().getPages(website);
-        assertEquals(3, pages1.size());
+        // new registrations require a theme, so no pages are created -- Allen G
+        assertEquals(0, pages1.size());
         getRoller().rollback();
 
         // Remove the website and user

Propchange: incubator/roller/branches/roller_2.0/tools/lib/xmlrpc-1.2-b1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties Mon Aug  8 07:41:04 2005
@@ -145,7 +145,6 @@
 configForm.adminUsers=Admin Users
 configForm.encryptPasswords=Encrypt Passwords?
 configForm.algorithm=Encryption Algorithm
-configForm.newUserThemes=New User Themes
 configForm.editorPages=Editor Pages
 configForm.autoformatComments=Autoformat Comments?
 configForm.escapeCommentHtml=Escape Comment HTML?
@@ -160,6 +159,10 @@
 configForm.uploadDir=Upload Directory
 configForm.uploadPath=Upload Path
 
+configForm.themeSettings=Theme Settings
+configForm.newUserThemes=Themes Directory
+configForm.allowCustomTheme=Allow Custom Themes?
+
 configForm.rssAggregatorSettings=RSS Aggregator Settings
 configForm.enableRssAggregator=Enable RSS Aggregator?
 configForm.cacheIncomingRss=Cache Incoming RSS Newsfeeds?
@@ -582,6 +585,7 @@
 pagesForm.addNewPage.success=New page <strong>{0}</strong> added successfully.
 pagesForm.add=Add
 pagesForm.emptyPage=Empty page...
+pagesForm.themesReminder=<b>Reminder:</b> You are currently using the {0} shared theme, so some page edits may not effect how your blog looks.
 
 pageCache.flushed=Page cache has been successfully flushed.
 
@@ -855,6 +859,7 @@
 Page Templates of your previous theme.
 themeEditor.save=Save
 themeEditor.cancel=Cancel
+themeEditor.customize=Customize
 
 # ---------------------------------------------------------------------- Uploads
 
@@ -1183,8 +1188,4 @@
 yourWebsites.declined=You have declined an invitation to join weblog [{0}]
 yourWebsites.accepted=You are now a member of weblog [{0}]
 yourWebsites.resigned=You have resigned from weblog [{0}]
-
-
-
-
 

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/bookmark.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/bookmark.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/bookmark.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/bookmark.vm Mon Aug  8 07:41:04 2005
@@ -1,5 +1,5 @@
 #**
- * Macros to display Bookmark Folders and Bookmarks.
+ * Bookmarks and bookmark folders.
  * @author Lance Lavandowska (conversion to Velocimacros)
  *#
 
@@ -33,6 +33,9 @@
 
 #**
  * Displays the Bookmarks in a Folder instance.
+ * @param folder          FolderData object to be displayed
+ * @param showFolderName  True to show folder's name
+ * @param expandingFolder True to show expandable folder
  *#
 #macro( showFolder $folder $showFolderName $expandingFolder )
     #set( $bookmarks = $pageModel.getBookmarks($folder) )
@@ -67,9 +70,9 @@
 
 #**
  * Displays a bookmark folder as named.
- * @param folderName Name of the folder to be displayed.
- * @param showFolderName True if folder's name is to be displayed.
- * @param expandingFolder True if folder is to be displayed as a expanding folder.
+ * @param folderName      Name of the folder to be displayed.
+ * @param showFolderName  True to show folder's name
+ * @param expandingFolder True to show expandable folder
  *#
 #macro( showBookmarks $folderName $showFolderName $expandingFolder )
     #if ( $pageModel.getFolder($folderName) )
@@ -82,16 +85,22 @@
 
 #**
  * Display all Bookmarks (from all Folders) for user.
+ * @param expandingFolder True to show expandable folder
 **#
 #macro( showAllBookmarks $expandingFolder )
     #set( $root = $pageModel.getFolderByPath("/") )
     #showFolder($root true $expandingFolder)
 #end
 
+#**
+ * Show link to OPML file for specified folder.
+ * @param folderName Name of folder to be displayed (or / separated path)
+ *#
 #macro( showOpmlLink $folderName )
     #if ( $pageModel.getFolder( $folderName ) )
-        <a href="$ctxPath/flavor/$userName?flavor=opml&path=$folder.path">
-            <img src="$ctxPath/images/opml.png" alt="OPML for $folderName" />
+        <a href="$ctxPath/flavor/$userName?flavor=opml&path=$folderName">
+            <img src="$ctxPath/images/opml.png" 
+               alt="OPML badge" title="OPML for $folderName" />
         </a>
     #else
         <span class="error">$text.get( "macro.bookmark.error", [$folderName])</span>

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/comments.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/comments.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/comments.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/comments.vm Mon Aug  8 07:41:04 2005
@@ -1,9 +1,12 @@
+#**
+ * Comment page links and comment forms.
+ *#
 
 #**
  * Display the pop-up comments link for a weblog entry.
  * Use the URL for the href attribute for those who have disabled
  * javascript or who desire to open the comments window in another (Mozilla) tab.
- * @param entry WeblogEntry object.
+ * @param entry WeblogEntryData object for which link is to be displayed.
  *#
 #macro( showCommentsLink $entry )
     #set( $commentCount = $pageModel.getCommentCount($entry.Id) )
@@ -17,7 +20,7 @@
 
 #**
  * Display the in-page comments link for a weblog entry.
- * @param entry WeblogEntry object.
+ * @param entry WeblogEntryData object for which link is to be displayed.
  *#
 #macro( showCommentsPageLink $entry )
     #set( $commentCount = $pageModel.getCommentCount($entry.Id) )
@@ -29,8 +32,8 @@
 
 #**
  * Display link for comments that renders a dynamically (DHTML) generated
- * comments form - Matt Raible style.
- * @param entry WeblogEntry object.
+ * comments form - Matt Raible's "twisty comments" style.
+ * @param entry WeblogEntryData object for which link is to be displayed.
  *#
 #macro( showCommentsDiv $entry )
     #set( $commentCount = $pageModel.getCommentCount($entry.Id) )
@@ -84,8 +87,8 @@
 #end
 
 #**
- * Display comments for an entry.
- * @param entry WeblogEntry object.
+ * Display all comments comments for an entry.
+ * @param entry WeblogEntryData object for which comments are to be displayed.
  *#
 #macro( showComments $entry )
     <div class="comments" id="comments">
@@ -117,6 +120,7 @@
 
 #**
  * Display recent comments for whole blog (not just one entry).
+ * @param numComments Maximum number of comments to be displayed
 **#
 #macro( showRecentComments $numComments )
     #if( !$numComments ) #set( $numComments = 20 ) #end
@@ -143,8 +147,9 @@
 #end
 
 #**
- * Display list of recent comments.  $maxWidth determines the amount of text
- * from the comment to display in the list.
+ * Display list of most recent comments for a blog.
+ * @param numComments Max number of comments to show.
+ * @param maxWidth    Limit width of comment text to this number of characters
 **#
 #macro( showRecentCommentsListWidth $numComments $maxWidth )
     #if( !$numComments ) #set( $numComments = 20 ) #end
@@ -165,8 +170,10 @@
     #end
     </ul>
 #end
+
 #**
- * Convenience method. Show list with 25 character width.
+ * Display list of most recent comments for a blog (with maxWidth = 25)
+ * @param numComments Max number of comments to show.
 **#
 #macro( showRecentCommentsList $numComments )
 #showRecentCommentsListWidth( $numComments 25 )
@@ -174,7 +181,7 @@
 
 #**
  * Display comment form for a weblog entry.
- * @param entry WeblogEntry object.
+ * @param entry WeblogEntry object for which form is to be shown.
  *#
 #macro( showCommentForm $entry )
     <div class="comments-form">
@@ -307,7 +314,7 @@
 
 #**
  * Display hidden comment form for a weblog entry.
- * @param entry WeblogEntry object.
+ * @param entry WeblogEntry object for which form is to be shown,
  *#
 #macro( showHiddenCommentForm )
   <div style="display: none" class="comments">

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm Mon Aug  8 07:41:04 2005
@@ -1,29 +1,37 @@
-$pageHelper.setContentType("application/atom+xml;charset=utf-8")<?xml version="1.0" encoding='utf-8'?>
-<feed version="0.3" xmlns="http://purl.org/atom/ns#">
-    <title>$utilities.textToHTML($website.name,true)</title>
-    <tagline>$utilities.textToHTML($website.description,true)</tagline>
-    <link rel="alternate" type="text/html" href="$websiteURL" />
-    <modified>$utilities.formatIso8601Date($updateTime)</modified>
-    <generator url="http://www.rollerweblogger.org" version="#showVersion() ($rollerBuildTime:$rollerBuildUser)">Roller Weblogger</generator>
-    #if( $userName != "zzz_none_zzz" )
-    <author>
-      <name>$fullName</name>
-      <url>$websiteURL</url>
-    </author>
-    #end
-    #set( $entries = $pageModel.getRecentWeblogEntriesArray($entryCount, 'nil') )
-    #foreach( $entry in $entries )
-    <entry>
-        <title>$utilities.textToHTML($entry.title,true)</title>
-        <issued>$utilities.formatIso8601Date($entry.pubTime)</issued>
-        <created>$utilities.formatIso8601Date($entry.pubTime)</created>
-        <modified>$utilities.formatIso8601Date($entry.updateTime)</modified>
-        #if( $userName == "zzz_none_zzz" )
-        <author><name>$entry.creator.fullName</name></author>
-        #end
-        <link rel="alternate" type="text/html" href="$absBaseURL$entry.permaLink"/>
-        <id>tag:$host,$utilities.formatIso8601Day($entry.pubTime):/$entry.website.user.userName?anchor=$entry.anchor</id>
-        <content type="text/html" mode="escaped">#showEntryDescription($entry)</content>
-    </entry>
-    #end
-</feed>
+$pageHelper.setContentType("application/atom+xml;charset=utf-8")<?xml version="1.0" encoding='utf-8'?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+    <title>$utilities.textToHTML($website.name,true)</title>
+    <subtitle>$utilities.textToHTML($website.description,true)</subtitle>
+    <id>$absBaseURL/flavor/${website.handle}?flavor=atom</id>
+    <link rel="alternate" type="text/html" href="$websiteURL" />
+    <link rel="self" type="application/atom+xml" 
+       href="$absBaseURL/flavor/${website.handle}?flavor=atom" />
+    <updated>$utilities.formatIso8601Date($updateTime)</updated>
+    <generator uri="http://www.rollerweblogger.org" version="#showVersion() ($rollerBuildTime:$rollerBuildUser)">
+       Roller Weblogger
+    </generator>
+    #if( $userName != "zzz_none_zzz" )<author>
+      <name>$fullName</name>
+      <uri>$websiteURL</uri>
+    </author>#end
+    #set( $entries = $pageModel.getRecentWeblogEntriesArray($entryCount, 'nil') )
+    #foreach( $entry in $entries )
+    <entry>
+        <title>$utilities.textToHTML($entry.title,true)</title>
+        <id>$absBaseURL$entry.permaLink</id>
+        <link rel="alternate" type="text/html" href="$absBaseURL$entry.permaLink"/>
+        <published>$utilities.formatIso8601Date($entry.pubTime)</published>
+        <updated>$utilities.formatIso8601Date($entry.updateTime)</updated>
+        #if( $userName == "zzz_none_zzz" )<author><name>$entry.creator.fullName</name></author>#end
+        <content type="html">#showEntryDescription($entry)</content>
+        #set( $mc_url = $entry.findEntryAttribute("att_mediacast_url") )
+        #set( $mc_type = $entry.findEntryAttribute("att_mediacast_type") )
+        #set( $mc_length = $entry.findEntryAttribute("att_mediacast_length") )
+        #if( $mc_url && $mc_length && $mc_type )
+        <link rel="enclosure" type="$mc_type" length="$mc_length" href="$mc_url"/>
+        #set($mc_url = false) #set($mc_type = false) #set($mc_length = false)
+        #end
+    </entry>
+    #end
+</feed>
+

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm Mon Aug  8 07:41:04 2005
@@ -1,5 +1,5 @@
 #**
- * Macros to display the Roller Navigation bars.
+ * Roller menus and navigation bars.
  * @author Lance Lavandowska (conversion to Velocimacros)
  *#
 
@@ -28,15 +28,15 @@
 #end
 
 #**
- * Print a link for a menu item.  Take into consideration:
- * 1. Should this be particularly CSS friendly.
- * 2. Or is this specifically a vertical menu.
- * 3. Otherwise use the specified delimiter.
+ * Print a link for a menu item.  Take into consideration:<br />
+ * 1. Should this be particularly CSS friendly.<br />
+ * 2. Or is this specifically a vertical menu.<br />
+ * 3. Otherwise use the specified delimiter.<br />
  *
- * @param linkUrl The URL to be used in the href attribute.
+ * @param linkUrl   The URL to be used in the href attribute.
  * @param linkValue The value used to look up the link's label.
- * @param useCSS  Use CSS based formatting.
- * @param vertical Use "hard-formatting" to create vertical menu.
+ * @param useCSS    Use CSS based formatting.
+ * @param vertical  Use "hard-formatting" to create vertical menu.
  * @param delimiter Seperate horizontal items with this value.
  *#
 #macro( printNavLink $linkUrl $linkValue $useCSS $vertical $delimiter )
@@ -49,8 +49,9 @@
 #**
  * Show Roller Page Navigation Bar, includes links to all pages
  * except those that are hidden (because the start with "_").
- * @param vertical True if bar is to be displayed vertically.
+ * @param vertical  True if bar is to be displayed vertically.
  * @param delimiter Delimiter between entries in bar.
+ * @param useCSS    Use CSS based formatting.
  *#
 #macro( showNavBar2 $vertical $delimiter $useCSS)
     #set( $container = "div" )
@@ -107,7 +108,10 @@
 #end
 
 #**
- * Backwards compatibility version.
+ * Show Roller Page Navigation Bar, includes links to all pages
+ * except those that are hidden (because the start with "_").
+ * @param vertical  True if bar is to be displayed vertically.
+ * @param delimiter Delimiter between entries in bar.
  *#
 #macro( showNavBar $vertical $delimiter )
     #showNavBar2( $vertical $delimiter false)

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/newsfeed.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/newsfeed.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/newsfeed.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/newsfeed.vm Mon Aug  8 07:41:04 2005
@@ -1,5 +1,5 @@
 #**
- * Macros to display RSS Newschannels.
+ * The deprecated #showNewsfeeds() macro.
  * @author Lance Lavandowska (conversion to Velocimacros)
  * @author Dave Johnson (conversion from Digestor to Flock)
  *#

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/planetrss.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/planetrss.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/planetrss.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/planetrss.vm Mon Aug  8 07:41:04 2005
@@ -1,13 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
 <channel>
+  #if($group)
+  <title>$utilities.textToHTML($group.title,true)</title>
+  <description>Aggregated feed for group [$utilities.textToHTML($group.title,true)]</description>
+  #else
   <title>$utilities.textToHTML($planet.configuration.title,true)</title>
-  <description>Aggregated Feed generated by Roller Planet aggregator</description>
+  <description>$utilities.textToHTML($planet.configuration.title,true)</description>
+  #end
   <link>$utilities.textToHTML($planet.configuration.siteUrl)</link>
   <lastBuildDate>$utilities.formatRfc822Date($planet.lastUpdated)</lastBuildDate>
-  <generator>Roller Planet 1.1-dev</generator>
-  #if($groupName)
-     #set($entries = $planet.getAggregation($groupName,50))
+  <generator>Roller</generator>
+  #if($group)
+     #set($entries = $planet.getAggregation($group, 50))
   #else
      #set($entries = $planet.getAggregation(50))
   #end
@@ -32,4 +37,4 @@
   </item>
   #end
 </channel>
-</rss>
+</rss>
\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/referer.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/referer.vm?rev=230810&r1=230809&r2=230810&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/referer.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/referer.vm Mon Aug  8 07:41:04 2005
@@ -1,5 +1,5 @@
 #**
- * Macros to display referers and Linkbacks.
+ * Referers and linkbacks.
  * @author  Lance Lavandowska (conversion to Velocimacros)
  *#
 



Mime
View raw message