roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From she...@apache.org
Subject svn commit: r1140970 [2/2] - in /roller/branches/roller_mobile: weblogger-business/src/main/java/org/apache/roller/weblogger/business/ weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/ weblogger-business/src/main/java/org/apach...
Date Wed, 29 Jun 2011 05:55:07 GMT
Modified: roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java (original)
+++ roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java Wed Jun 29 05:55:05 2011
@@ -18,10 +18,6 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -35,6 +31,11 @@ import org.apache.roller.weblogger.util.
 import org.apache.roller.weblogger.util.cache.CacheManager;
 import org.apache.struts2.interceptor.validation.SkipValidation;
 
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
 
 /**
  * Action which handles editing for a single WeblogTemplate.
@@ -48,6 +49,8 @@ public class TemplateEdit extends UIActi
     
     // the template we are working on
     private WeblogTemplate template = null;
+
+    private boolean mobileTemplateAvailable = false;
     
     
     public TemplateEdit() {
@@ -62,10 +65,13 @@ public class TemplateEdit extends UIActi
         return Collections.singletonList(WeblogPermission.ADMIN);
     }
     
-    
+
     public void myPrepare() {
         try {
             setTemplate(WebloggerFactory.getWeblogger().getWeblogManager().getPage(getBean().getId()));
+            getBean().setStandardTemplateId(getStandardID());
+            getBean().setMobileTemplateId(getMobileID());
+            setMobileTemplateAvailable(hasManyTemplates());
         } catch (WebloggerException ex) {
             log.error("Error looking up template - "+getBean().getId(), ex);
         }
@@ -86,7 +92,8 @@ public class TemplateEdit extends UIActi
         
         WeblogTemplate page = getTemplate();
         getBean().copyFrom(template);
-        
+
+
         // empty content-type indicates that page uses auto content-type detection
         if (StringUtils.isEmpty(page.getOutputContentType())) {
             getBean().setAutoContentType(Boolean.TRUE);
@@ -97,6 +104,49 @@ public class TemplateEdit extends UIActi
         
         return INPUT;
     }
+
+    /**
+     * This is to sync mobile theme and standard theme if name or link changed
+     */
+      private void synchronizeThemes(){
+
+          boolean isModified = false;
+          WeblogTemplate mobileTemplate = null;
+          WeblogTemplate standardTemplate = null;
+          try {
+              mobileTemplate = WebloggerFactory.getWeblogger().getWeblogManager().
+                      getPage(getBean().getMobileTemplateId());
+              standardTemplate = WebloggerFactory.getWeblogger().getWeblogManager().
+                      getPage(getBean().getStandardTemplateId());
+          } catch (WebloggerException e) {
+              log.error("error in looking up theme ", e);
+          }
+
+          if (standardTemplate != null && mobileTemplate != null) {
+              // if standard template has a different tempalte version we are going to change mobile accordingly
+              if (!mobileTemplate.getName().equals(standardTemplate.getName() + ".Mobile")) {
+                  mobileTemplate.setName(standardTemplate.getName() + ".Mobile");
+                  isModified = true;
+              }
+              if (!mobileTemplate.getLink().equals(standardTemplate.getLink())) {
+                  mobileTemplate.setLink(standardTemplate.getLink());
+                  isModified = true;
+              }
+              if (isModified) {
+                  // save template and flush
+                  try {
+                      WebloggerFactory.getWeblogger().getWeblogManager().savePage(mobileTemplate);
+                      WebloggerFactory.getWeblogger().flush();
+                  } catch (WebloggerException e) {
+                      log.error("Error syncing with standard template", e);
+                  }
+                  // notify caches
+                  CacheManager.invalidate(mobileTemplate);
+              }
+
+          }
+
+      }
     
     
     /**
@@ -133,6 +183,8 @@ public class TemplateEdit extends UIActi
             
             // notify caches
             CacheManager.invalidate(template);
+
+            synchronizeThemes();
             
             // success message
             addMessage("pageForm.save.success", template.getName());
@@ -145,7 +197,43 @@ public class TemplateEdit extends UIActi
         
         return INPUT;
     }
-    
+
+
+    public String loadMobileTheme(){
+         if(getTemplate() == null) {
+            // TODO: i18n
+            addError("Unable to locate specified template");
+            return LIST;
+        }
+
+             WeblogTemplate mobile = null;
+
+        try {
+                mobile = WebloggerFactory.getWeblogger().getWeblogManager().getPageByName(getActionWeblog(),
+                    template.getName()+".mobile");
+        } catch (WebloggerException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+
+         if(mobile == null){
+            addError("Unable to locate specified template");
+            return LIST;
+         }
+        getBean().copyFrom(mobile);
+
+
+        // empty content-type indicates that page uses auto content-type detection
+        if (StringUtils.isEmpty(mobile.getOutputContentType())) {
+            getBean().setAutoContentType(Boolean.TRUE);
+        } else {
+            getBean().setAutoContentType(Boolean.FALSE);
+            getBean().setManualContentType(mobile.getOutputContentType());
+        }
+
+        return INPUT;
+    }
+
+
     
     private void myValidate() {
         
@@ -159,18 +247,19 @@ public class TemplateEdit extends UIActi
                 log.error("Error checking page name uniqueness", ex);
             }
         }
-        
+         //TODO handle validation for link with combining type and link together
         // if link changed make sure there isn't a conflict
-        if(!StringUtils.isEmpty(getBean().getLink()) &&
+      /*  if(!StringUtils.isEmpty(getBean().getLink()) &&
                 !getBean().getLink().equals(getTemplate().getLink())) {
             try {
-                if(WebloggerFactory.getWeblogger().getWeblogManager().getPageByLink(getActionWeblog(), getBean().getLink()) != null) {
+                if(WebloggerFactory.getWeblogger().getWeblogManager().getPagesByLink(getActionWeblog(), getBean().getLink()) != null &&
+                        ) {
                     addError("pagesForm.error.alreadyExists", getBean().getLink());
                 }
             } catch (WebloggerException ex) {
                 log.error("Error checking page link uniqueness", ex);
             }
-        }
+        }*/
     }
     
     
@@ -195,6 +284,74 @@ public class TemplateEdit extends UIActi
 
     public void setTemplate(WeblogTemplate template) {
         this.template = template;
+
+
     }
-    
-}
+       //get the ID for mobile tempalte
+    private String getMobileID(){
+
+        List<WeblogTemplate> templates = null;
+        try {
+            templates = WebloggerFactory.getWeblogger().getWeblogManager().
+                    getPagesByLink(getActionWeblog(), template.getLink()) ;
+        } catch (WebloggerException e) {
+            log.error("error while getting template list." , e);
+        }
+
+        if (templates != null && templates.size() >1){
+            for(WeblogTemplate template : templates){
+                  if("mobile".equals(template.getType())){
+                      return template.getId();
+                  }
+            }
+        }
+        return null;
+    }
+
+    public String getStandardID(){
+
+        List<WeblogTemplate> templates = null;
+        try {
+            templates = WebloggerFactory.getWeblogger().getWeblogManager().
+                    getPagesByLink(getActionWeblog(), template.getLink()) ;
+        } catch (WebloggerException e) {
+            log.error("error while getting template list." , e);
+        }
+
+        if (templates != null && !templates.isEmpty()){
+            for(WeblogTemplate template : templates){
+                  if("standard".equals(template.getType())){
+                      return template.getId();
+                  }
+            }
+        }
+        return null;
+    }
+
+    public boolean hasManyTemplates() {
+
+        List<WeblogTemplate> templates = null;
+        try {
+            templates = WebloggerFactory.getWeblogger().getWeblogManager().
+                    getPagesByLink(getActionWeblog(), template.getLink());
+        } catch (WebloggerException e) {
+            log.error("error while getting template list.", e);
+        }
+        // we do not support editing mobile template pages for custom themes.
+        if( "custom".equals(getActionWeblog().getEditorTheme())){
+            return false;
+        }
+        else if (templates != null && templates.size() > 1) {
+            return true;
+        }
+        return false;
+    }
+
+    public boolean isMobileTemplateAvailable() {
+        return mobileTemplateAvailable;
+    }
+
+    public void setMobileTemplateAvailable(boolean mobileTemplateAvailable) {
+        this.mobileTemplateAvailable = mobileTemplateAvailable;
+    }
+}
\ No newline at end of file

Modified: roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEditBean.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEditBean.java?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEditBean.java (original)
+++ roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEditBean.java Wed Jun 29 05:55:05 2011
@@ -18,8 +18,6 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.util.Locale;
-import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.pojos.WeblogTemplate;
 
 
@@ -39,6 +37,13 @@ public class TemplateEditBean {
     private boolean hidden = false;
     private Boolean autoContentType = Boolean.TRUE;
     private String manualContentType = null;
+    private String type = null;
+
+     // template ID of mobile template version
+    private String mobileTemplateId = null;
+
+    // template ID of standard template version
+    private String standardTemplateId = null;
     
     
     public String getId() {
@@ -159,6 +164,7 @@ public class TemplateEditBean {
         this.navbar = dataHolder.isNavbar();
         this.hidden = dataHolder.isHidden();
         this.templateLanguage = dataHolder.getTemplateLanguage();
+        this.type = dataHolder.getType();
         
         setManualContentType(dataHolder.getOutputContentType());
         if(getManualContentType() != null) {
@@ -166,4 +172,24 @@ public class TemplateEditBean {
         }
     }
 
+    public String getMobileTemplateId() {
+        return mobileTemplateId;
+    }
+
+    public void setMobileTemplateId(String mobileTemplateId) {
+        this.mobileTemplateId = mobileTemplateId;
+    }
+
+    public String getStandardTemplateId() {
+        return standardTemplateId;
+    }
+
+    public void setStandardTemplateId(String standardTemplateId) {
+        this.standardTemplateId = standardTemplateId;
+    }
+
+    public boolean isMobile() {
+        return (id.equals(mobileTemplateId));
+    }
+
 }

Modified: roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java (original)
+++ roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java Wed Jun 29 05:55:05 2011
@@ -18,10 +18,6 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -32,6 +28,11 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.WeblogTheme;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
 
 /**
  * Templates listing page.
@@ -49,6 +50,7 @@ public class Templates extends UIAction 
     // name and action of new template if we are adding a template
     private String newTmplName = null;
     private String newTmplAction = null;
+    private String type = null;
     
     
     public Templates() {
@@ -68,13 +70,24 @@ public class Templates extends UIAction 
         // query for templates list
         try {
             
-            // get current list of templates, minus custom stylesheet
+            // get current list of templates, minus custom stylesheet and auto generated mobile templates
             List<WeblogTemplate> raw = WebloggerFactory.getWeblogger().getWeblogManager().getPages(getActionWeblog()); 
             List<WeblogTemplate> pages = new ArrayList<WeblogTemplate>();
+
             pages.addAll(raw);
-            if(getActionWeblog().getTheme().getStylesheet() != null) {
-                pages.remove(WebloggerFactory.getWeblogger().getWeblogManager().getPageByLink(getActionWeblog(), 
-                        getActionWeblog().getTheme().getStylesheet().getLink()));
+
+            for(WeblogTemplate template : raw){
+                if("mobile".equals(template.getType())&&template.getName().endsWith(".Mobile")){
+                    pages.remove(template);
+                }
+            }
+
+            if (getActionWeblog().getTheme().getStylesheet() != null) {
+                List<WeblogTemplate> stylesheets = WebloggerFactory.getWeblogger().getWeblogManager().getPagesByLink(getActionWeblog(),
+                        getActionWeblog().getTheme().getStylesheet().getLink());
+                if (stylesheets != null && !stylesheets.isEmpty()) {
+                    pages.remove(stylesheets.get(0));
+                }
             }
             setTemplates(pages);
             
@@ -127,6 +140,11 @@ public class Templates extends UIAction 
             newTemplate.setHidden(false);
             newTemplate.setNavbar(false);
             newTemplate.setLastModified( new Date() );
+            newTemplate.setType("standard");
+
+            if(WeblogTemplate.ACTION_CUSTOM.equals(getNewTmplAction())){
+                newTemplate.setLink(getNewTmplName());
+            }
             
             // all templates start out as velocity templates
             newTemplate.setTemplateLanguage("velocity");
@@ -148,10 +166,9 @@ public class Templates extends UIAction 
             
             // flush results to db
             WebloggerFactory.getWeblogger().flush();
-            
-            // reset form fields
-            setNewTmplName(null);
-            setNewTmplAction(null);
+
+            // add roller generated mobile template
+            addMobileTemplate();
             
         } catch (WebloggerException ex) {
             log.error("Error adding new template for weblog - "+getActionWeblog().getHandle(), ex);
@@ -161,6 +178,62 @@ public class Templates extends UIAction 
         
         return execute();
     }
+
+    public void addMobileTemplate(){
+
+         // validation
+       // myValidate();
+
+        if(!hasActionErrors()) try {
+
+            WeblogTemplate newMobileTemplate = new WeblogTemplate();
+            newMobileTemplate.setWebsite(getActionWeblog());
+            newMobileTemplate.setAction(getNewTmplAction());
+            newMobileTemplate.setName(getNewTmplName()+".Mobile");
+            newMobileTemplate.setDescription(newMobileTemplate.getName());
+            newMobileTemplate.setContents(getText("pageForm.newTemplateContent"));
+            newMobileTemplate.setHidden(false);
+            newMobileTemplate.setNavbar(false);
+            newMobileTemplate.setLastModified( new Date() );
+            newMobileTemplate.setType("mobile");
+
+             if(WeblogTemplate.ACTION_CUSTOM.equals(getNewTmplAction())){
+                newMobileTemplate.setLink(getNewTmplName());
+            }
+
+            // all templates start out as velocity templates
+            newMobileTemplate.setTemplateLanguage("velocity");
+
+            // for now, all templates just use _decorator
+            if(!"_decorator".equals(newMobileTemplate.getName())) {
+                newMobileTemplate.setDecoratorName("_decorator");
+            }
+
+            // save the new Template
+            WebloggerFactory.getWeblogger().getWeblogManager().savePage( newMobileTemplate );
+
+            // if this person happened to create a Weblog template from
+            // scratch then make sure and set the defaultPageId
+            if(WeblogTemplate.DEFAULT_PAGE.equals(newMobileTemplate.getName())) {
+                getActionWeblog().setDefaultPageId(newMobileTemplate.getId());
+                WebloggerFactory.getWeblogger().getWeblogManager().saveWeblog(getActionWeblog());
+            }
+
+            // flush results to db
+            WebloggerFactory.getWeblogger().flush();
+
+            // reset form fields
+            setNewTmplName(null);
+            setNewTmplAction(null);
+            setType(null);
+
+        } catch (WebloggerException ex) {
+            log.error("Error adding new mobile template for weblog - "+getActionWeblog().getHandle(), ex);
+            // TODO: i18n
+            addError("Error adding new mobile template");
+        }
+
+    }
     
     
     // validation when adding a new template
@@ -221,5 +294,13 @@ public class Templates extends UIAction 
     public void setNewTmplAction(String newTmplAction) {
         this.newTmplAction = newTmplAction;
     }
-    
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
 }

Modified: roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java (original)
+++ roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java Wed Jun 29 05:55:05 2011
@@ -18,8 +18,6 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
-import java.util.Collections;
-import java.util.List;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -28,14 +26,13 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.themes.SharedTheme;
 import org.apache.roller.weblogger.business.themes.ThemeManager;
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
-import org.apache.roller.weblogger.pojos.Theme;
-import org.apache.roller.weblogger.pojos.WeblogTheme;
-import org.apache.roller.weblogger.pojos.Weblog;
-import org.apache.roller.weblogger.pojos.WeblogPermission;
-import org.apache.roller.weblogger.pojos.WeblogTemplate;
+import org.apache.roller.weblogger.pojos.*;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;
 import org.apache.roller.weblogger.util.cache.CacheManager;
 
+import java.util.Collections;
+import java.util.List;
+
 
 /**
  * Action for controlling theme selection.
@@ -44,14 +41,19 @@ public class ThemeEdit extends UIAction 
     
     private static Log log = LogFactory.getLog(Templates.class);
     
-    // list of available themes
+    // list of available standard themes
     private List themes = Collections.EMPTY_LIST;
+
+    private List mobileThemes = Collections.EMPTY_LIST;
     
     // type of theme desired, either 'shared' or 'custom'
     private String themeType = null;
     
     // the chosen shared theme id
     private String themeId = null;
+
+    //the chosen mobile theme id
+    private String mobileThemeId = null;
     
     // import the selected theme to the action weblog
     private boolean importTheme = false;
@@ -74,7 +76,8 @@ public class ThemeEdit extends UIAction 
     
     public void myPrepare() {
         ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
-        setThemes(themeMgr.getEnabledThemesList());
+        setThemes(themeMgr.getEnabledStandardThemeList());
+        setMobileThemes(themeMgr.getEnabledMobileThemeList());
     }
     
     
@@ -85,6 +88,7 @@ public class ThemeEdit extends UIAction 
             setThemeId(null);
         } else {
             setThemeId(getActionWeblog().getTheme().getId());
+            setMobileThemeId(getActionWeblog().getMobileTheme().getId());
             setImportThemeId(getActionWeblog().getTheme().getId());
         }
         
@@ -206,6 +210,54 @@ public class ThemeEdit extends UIAction 
         return execute();
     }
     
+    public String saveMobileTheme(){
+        
+           Weblog weblog = getActionWeblog();
+                    // make sure theme is valid and enabled
+            Theme newMobileTheme = null;
+            if(getThemeId() == null) {
+                // TODO: i18n
+                addError("No theme specified");
+                
+            } else {
+                try {
+                    ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
+                    newMobileTheme = themeMgr.getTheme(getMobileThemeId());
+                    
+                    if(!newMobileTheme.isEnabled()) {
+                        // TODO: i18n
+                        addError("Theme not enabled");
+                    }
+                    
+                } catch(Exception ex) {
+                    log.warn(ex);
+                    // TODO: i18n
+                    addError("Theme not found");
+                }
+            }
+            
+            if(!hasActionErrors()) try {
+                weblog.setMobileThemeName(getMobileThemeId());
+                log.debug("Saving theme "+getMobileThemeId()+" for weblog "+weblog.getHandle());
+                
+                // save updated weblog and flush
+                WebloggerFactory.getWeblogger().getWeblogManager().saveWeblog(weblog);
+                WebloggerFactory.getWeblogger().flush();
+                
+                // make sure to flush the page cache so ppl can see the change
+                CacheManager.invalidate(weblog);
+                
+                // TODO: i18n
+                addMessage("Successfully set Mobile theme to - "+newMobileTheme.getName());
+                
+            } catch(WebloggerException re) {
+                log.error("Error saving weblog - "+getActionWeblog().getHandle(), re);
+                addError("Error setting theme");
+            }
+            
+        return execute();
+}
+    
     
     public boolean isCustomTheme() {
         return (WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme()));
@@ -261,5 +313,20 @@ public class ThemeEdit extends UIAction 
     public void setImportThemeId(String importThemeId) {
         this.importThemeId = importThemeId;
     }
-    
+
+    public List getMobileThemes() {
+        return mobileThemes;
+    }
+
+    public void setMobileThemes(List mobileThemes) {
+        this.mobileThemes = mobileThemes;
+    }
+
+    public String getMobileThemeId() {
+        return mobileThemeId;
+    }
+
+    public void setMobileThemeId(String mobileThemeId) {
+        this.mobileThemeId = mobileThemeId;
+    }
 }

Modified: roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerWeblogHandler.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerWeblogHandler.java?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerWeblogHandler.java (original)
+++ roller/branches/roller_mobile/weblogger-web/src/main/java/org/apache/roller/weblogger/webservices/adminprotocol/RollerWeblogHandler.java Wed Jun 29 05:55:05 2011
@@ -18,31 +18,24 @@
 
 package org.apache.roller.weblogger.webservices.adminprotocol;
 
-import java.io.Reader;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Collections;
-import java.util.Date;
-import javax.servlet.http.HttpServletRequest;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.jdom.Document;
 import org.apache.roller.weblogger.WebloggerException;
-import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.business.UserManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
+import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogPermission;
-import org.apache.roller.weblogger.util.cache.CacheManager;
 import org.apache.roller.weblogger.util.Utilities;
-import org.apache.roller.weblogger.webservices.adminprotocol.sdk.Entry;
-import org.apache.roller.weblogger.webservices.adminprotocol.sdk.EntrySet;
-import org.apache.roller.weblogger.webservices.adminprotocol.sdk.UnexpectedRootElementException;
-import org.apache.roller.weblogger.webservices.adminprotocol.sdk.WeblogEntry;
-import org.apache.roller.weblogger.webservices.adminprotocol.sdk.WeblogEntrySet;
+import org.apache.roller.weblogger.util.cache.CacheManager;
+import org.apache.roller.weblogger.webservices.adminprotocol.sdk.*;
+import org.jdom.Document;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.util.*;
 
 /**
  * This class handles requests concerning Roller weblog resources.
@@ -53,6 +46,9 @@ class RollerWeblogHandler extends Handle
     
     /** Theme name used when creating weblogs */
     private static final String DEFAULT_THEME = "basic";
+
+    //Default mobile theme when creating weblogs//
+    private static final String DEFAULT_MOBILE_THEME = "mobile";
     
     public RollerWeblogHandler(HttpServletRequest request) throws HandlerException {
         super(request);
@@ -176,7 +172,7 @@ class RollerWeblogHandler extends Handle
                         entry.getDescription(),
                         entry.getEmailAddress(),
                         entry.getEmailAddress(),
-                        DEFAULT_THEME,
+                        DEFAULT_THEME,DEFAULT_MOBILE_THEME,
                         entry.getLocale().toString(),
                         entry.getTimezone().getID());
                 

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/core/CreateWeblog.jsp
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/core/CreateWeblog.jsp?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/core/CreateWeblog.jsp (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/core/CreateWeblog.jsp Wed Jun 29 05:55:05 2011
@@ -22,6 +22,11 @@
 function previewImage(theme) {
     document.preview.src="<s:property value="siteURL" />/roller-ui/authoring/previewtheme?theme="+theme;
 }
+
+function previewMobileThemeImage(theme) {
+    document.mobile_preview.src="<s:property value="siteURL" />/roller-ui/authoring/previewtheme?theme="+theme;
+}
+
 function handlePreview(handle) {
     previewSpan = document.getElementById("handlePreview");
     var n1 = previewSpan.childNodes[0];
@@ -92,7 +97,7 @@ function handlePreview(handle) {
 <tr>
     <td class="label"><label for="theme" /><s:text name="createWebsite.theme" /></label></td>
     <td class="field">
-        <s:select name="bean.theme" size="1" list="themes" listKey="id" listValue="name" onchange="previewImage(this[selectedIndex].value)"/>
+        <s:select name="bean.theme" size="1" list="standardThemes" listKey="id" listValue="name" onchange="previewImage(this[selectedIndex].value)"/>
        <br />
        <br />
        <img name="preview" src='' />
@@ -108,6 +113,27 @@ function handlePreview(handle) {
     </td>
     <td class="description"><s:text name="createWebsite.tip.theme" /></td>
 </tr>
+
+<tr>
+    <td class="label"><label for="mobileTheme" /><s:text name="Mobile Theme" /></label></td>
+    <td class="field">
+        <s:select name="bean.mobileTheme" size="1" list="mobileThemes" listKey="id" listValue="name" onchange="previewMobileThemeImage(this[selectedIndex].value)"/>
+       <br />
+       <br />
+       <img name="mobile_preview" src='' />
+       <!-- initialize preview image at page load -->
+       <script type="text/javascript">
+           <s:if test="bean.mobileTheme == null">
+              previewMobileThemeImage('<s:property value="mobileThemes[0].id"/>');
+           </s:if>
+           <s:else>
+               previewMobileThemeImage('<s:property value="bean.mobileTheme"/>');
+           </s:else>
+       </script>
+    </td>
+    <td class="description"><s:text name="The theme to be used for mobile devices." /></td>
+</tr>
+
 </table>
 
 <br />
@@ -120,4 +146,4 @@ function handlePreview(handle) {
 <script type="text/javascript">
     document.forms[0].elements[0].focus();
 </script>
-    
\ No newline at end of file
+    

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp Wed Jun 29 05:55:05 2011
@@ -42,7 +42,7 @@
         <tr>
             <td class="label"><s:text name="pageForm.name" />&nbsp;</td>
             <td class="field">
-                <s:if test="template.required">
+                <s:if test="template.required || bean.mobile">
                     <s:textfield name="bean.name" size="50" readonly="true" cssStyle="background: #e5e5e5" />
                 </s:if>
                 <s:else>
@@ -87,7 +87,7 @@
         -->
         </script>
         
-        <s:if test="!template.required && template.custom">
+        <s:if test="!template.required && template.custom && !bean.mobile">
             <tr>
                 <td class="label" valign="top"><s:text name="pageForm.link" />&nbsp;</td>
                 <td class="field">
@@ -99,6 +99,17 @@
                 <td class="description"></td>
             </tr>
         </s:if>
+
+         <s:elseif test="!template.required && template.custom && bean.mobile">
+            <tr>
+                <td class="label" valign="top"><s:text name="pageForm.link" />&nbsp;</td>
+                <td class="field">
+                    <s:textfield name="bean.link" size="50" readonly="true" cssStyle="background: #e5e5e5" />
+                    <br />
+                      </td>
+                <td class="description"></td>
+            </tr>
+        </s:elseif>
         
         <tr>
             <td class="label" valign="top" style="padding-top: 4px"><s:text name="pageForm.description" />&nbsp;</td>
@@ -114,7 +125,49 @@
         </tr>
         
     </table>
-    
+
+    <s:if test="mobileTemplateAvailable">
+
+     <s:set name="tabMenu" value="menu"/>
+
+    <table class="menuTabTable" cellspacing="0" >
+     <tr>
+          <s:if test="!bean.mobile">
+        <td class="menuTabSelected">
+    </s:if>
+    <s:else>
+        <td class="menuTabUnselected">
+    </s:else>
+
+          <div class="menu-tr">
+           <s:url id="edit" action="templateEdit">
+               <s:param name="weblog" value="actionWeblog.handle" />
+               <s:param name="bean.id" value="bean.standardTemplateId" />
+           </s:url>
+	       <div class="menu-tl">&nbsp;&nbsp;<s:a href="%{edit}">Standard</s:a>&nbsp;&nbsp; </div>
+	    </div></td>
+
+
+          <td class="menuTabSeparator"></td>
+
+        <s:if test="bean.mobile">
+        <td class="menuTabSelected">
+    </s:if>
+    <s:else>
+        <td class="menuTabUnselected">
+    </s:else>
+        <div class="menu-tr">
+
+           <s:url id="edit" action="templateEdit">
+               <s:param name="weblog" value="actionWeblog.handle" />
+               <s:param name="bean.id" value="bean.mobileTemplateId" />
+           </s:url>
+	       <div class="menu-tl">&nbsp;&nbsp;<s:a href="%{edit}">mobile</s:a>&nbsp;&nbsp; </div>
+	    </div></td>
+
+     </tr>
+        </table>
+   </s:if>
     <%-- ================================================================== --%>
     <%-- Template editing area w/resize buttons --%>
     

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp Wed Jun 29 05:55:05 2011
@@ -29,9 +29,10 @@ function fullPreview(selector) {
 }
 function updateThemeChooser(selected) {
     if (selected[0].value == 'shared') {
-        $('#sharedChooser').css('background','#CCFFCC'); 
-        $('#sharedChooser').css('border','1px solid #008000'); 
+        $('#sharedChooser').css('background','#CCFFCC');
+        $('#sharedChooser').css('border','1px solid #008000');
         $('#sharedOptioner').show();
+        $('#mobileSharedOptioner').show();
 
         $('#customChooser').css('background','#eee'); 
         $('#customChooser').css('border','1px solid #gray'); 
@@ -44,6 +45,7 @@ function updateThemeChooser(selected) {
         $('#sharedChooser').css('background','#eee'); 
         $('#sharedChooser').css('border','1px solid #gray'); 
         $('#sharedOptioner').hide();
+         $('#mobileSharedOptioner').hide();
     }
 }
 function toggleImportThemeDisplay() {
@@ -84,6 +86,11 @@ function toggleImportThemeDisplay() {
         </tr>
     </table>
 
+
+    <table>
+        <tr>
+            <td>
+
     <div id="sharedOptioner" class="optioner" style="display:none;">
         <p>
             <s:if test="!customTheme">
@@ -127,8 +134,61 @@ function toggleImportThemeDisplay() {
                 <s:text name="themeEditor.customStylesheetDescription" />
             </p>
         </s:if>
-        <p><s:submit value="%{getText('themeEditor.save')}" /></p>
+        <p><s:submit value="%{getText('themeEditor.save')}"/></p>
+    </div>
+    </td>
+            <td>
+         <div id="mobileSharedOptioner" class="optioner" style="display:none;">
+
+            <p>
+                <s:if test="!customTheme">
+                    <s:text name="themeEditor.yourCurrentTheme"/>:
+                    <b><s:property value="actionWeblog.mobileTheme.name"/></b>
+                </s:if>
+                <s:else>
+                    <s:text name="themeEditor.selectTheme"/>
+                </s:else>
+            </p>
+
+            <p>
+                <s:select id="mobileSharedSelector" name="mobileThemeId" list="mobileThemes"
+                          listKey="id" listValue="name" size="1"
+                          onchange="previewImage($('#sharedMobilePreviewImg'), this[selectedIndex].value)"/>
+            </p>
+
+            <p>
+                <img id="sharedMobilePreviewImg" src=""/>
+                <!-- initialize preview image at page load -->
+                <script type="text/javascript">
+                    <s:if test="customTheme">
+                    previewImage($('#sharedMobilePreviewImg'), '<s:property value="mobileThemes[0].id"/>');
+                    </s:if>
+                    <s:else>
+                    previewImage($('#sharedMobilePreviewImg'), '<s:property value="mobileThemeId"/>');
+                    </s:else>
+                </script>
+            </p>
+            <p>
+                &raquo; <a href="#" onclick="fullPreview($('#mobileSharedSelector').get(0))">
+                <s:text name="themeEditor.previewLink"/></a><br/>
+                <s:text name="themeEditor.previewDescription"/>
+            </p>
+
+            <s:if test="!customTheme && actionWeblog.theme.customStylesheet != null">
+                <p>
+                    <s:url action="stylesheetEdit" id="stylesheetEdit">
+                        <s:param name="weblog" value="%{actionWeblog.handle}"/>
+                    </s:url>
+                    &raquo; <s:a href="%{stylesheetEdit}"><s:text name="themeEditor.customStylesheetLink"/></s:a><br/>
+                    <s:text name="themeEditor.customStylesheetDescription"/>
+                </p>
+            </s:if>
+        <p><s:submit value="%{getText('themeEditor.save')}"  action="themeEdit!saveMobileTheme"/></p>
     </div>
+     </td>
+            </tr>
+    </table>
+
 
     <div id="customOptioner" class="optioner" style="display:none;">
 

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEditSharedThemesOnly.jsp
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEditSharedThemesOnly.jsp?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEditSharedThemesOnly.jsp (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/WEB-INF/jsps/editor/ThemeEditSharedThemesOnly.jsp Wed Jun 29 05:55:05 2011
@@ -27,6 +27,11 @@ function fullPreview() {
     selected=document.getElementById('themeEdit_themeId').selectedIndex;
     window.open('<s:url value="/roller-ui/authoring/preview/%{actionWeblog.handle}"/>?theme='+document.getElementById('themeEdit_themeId').options[selected].value, '_preview', '');
 }
+
+function previewMobileImage(element, theme) {
+    element.src="<s:property value="siteURL" />/themes/" + theme + "/sm-theme-" + theme + ".png";
+}
+
 -->
 </script>
 

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/basic/theme.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/basic/theme.xml?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/basic/theme.xml (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/basic/theme.xml Wed Jun 29 05:55:05 2011
@@ -4,6 +4,7 @@
     <id>basic</id>
     <name>Basic</name>
     <author>Roller Weblogger</author>
+    <type>standard</type>
     
     <!-- theme preview image -->
     <preview-image path="basic-preview.png" />

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/brushedmetal/theme.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/brushedmetal/theme.xml?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/brushedmetal/theme.xml (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/brushedmetal/theme.xml Wed Jun 29 05:55:05 2011
@@ -4,6 +4,7 @@
     <id>brushedmetal</id>
     <name>Brushed Metal</name>
     <author>Bryan Bell</author>
+    <type>standard</type>
     
     <!-- theme preview image -->
     <preview-image path="brushedmetal-preview.png" />

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/fauxcoly/theme.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/fauxcoly/theme.xml?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/fauxcoly/theme.xml (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/fauxcoly/theme.xml Wed Jun 29 05:55:05 2011
@@ -6,6 +6,7 @@
     <id>fauxcoly</id>
     <name>Fauxcoly</name>
     <author>Dave Johnson</author>
+    <type>standard</type>
     
     <!-- theme preview image -->
     <preview-image path="images/fauxcoly-preview.png" />

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/frontpage/theme.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/frontpage/theme.xml?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/frontpage/theme.xml (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/frontpage/theme.xml Wed Jun 29 05:55:05 2011
@@ -4,6 +4,7 @@
     <id>frontpage</id>
     <name>Frontpage</name>
     <author>Dave Johnson</author>
+    <type>standard</type>
     
     <!-- theme preview image -->
     <preview-image path="sm-theme-frontpage.png" />

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/_day.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/_day.vm?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/_day.vm (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/_day.vm Wed Jun 29 05:55:05 2011
@@ -0,0 +1,34 @@
+<div class="dayBox">
+
+    <div class="dayTitle">
+       $utils.formatDate($day, "EEEE MMM dd, yyyy")
+    </div>
+
+    #foreach( $entry in $entries )
+    <div class="entryBox">
+        <a name="$utils.encode($entry.anchor)" id="$utils.encode($entry.anchor)"></a>
+        <p class="entryTitle">$entry.title</p>
+        <p class="entryContent">
+            #if($model.permalink)
+                $entry.displayContent
+            #else
+                $entry.displayContent($url.entry($entry.anchor))
+            #end
+        </p>
+        <p class="entryInfo">
+            Posted at <a href="$url.entry($entry.anchor)">$utils.formatDate($entry.pubTime, "hh:mma MMM dd, yyyy")</a>
+            by $entry.creator.screenName in <span class="category">$entry.category.name</span> &nbsp;|&nbsp;
+            #if ($utils.isUserAuthorizedToAuthor($entry.website))
+                <a href="$url.editEntry($entry.anchor)">$text.get("macro.weblog.entrypermalink.edit")</a> &nbsp;|&nbsp;
+            #end
+            #set($commentCount = $entry.commentCount)
+            #if($entry.commentsStillAllowed || $commentCount > 0)  
+                #set($link = "$url.comments($entry.anchor)" )
+                <a href="$link" class="commentsLink">$text.get("macro.weblog.comments")[$commentCount]</a>
+            #end
+        </p>
+        #showTrackbackAutodiscovery($entry)
+    </div>
+    #end
+
+</div>

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-custom.css
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-custom.css?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-custom.css (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-custom.css Wed Jun 29 05:55:05 2011
@@ -0,0 +1,265 @@
+/*-------------------------------------------------------------
+Base styles
+--------------------------------------------------------------*/
+
+a {
+  text-decoration: none;
+}
+
+a:hover {
+  text-decoration: underline overline;
+}
+
+body {
+    background: white;
+    font-family:"Lucida Grande", lucida, Geneva, Arial, sans-serif;
+}
+
+.img {
+    border: 0px;
+    margin: 0px; 
+}
+
+/* entries ----------------------------------------------- */
+
+.entryBox {
+    font-size: 90%;
+}
+.entryTitle {
+    font-weight: bold;
+}
+
+.entryInfo {
+    font-size: 90%;
+    color: #999;
+}
+div.dayTitle {
+    font-size: 120%;
+    font-weight:bold;	
+    padding: .5em 0 0 0;
+}
+div.next-previous {
+    font-size: 80%;
+    text-align: center;
+    padding: .5em 0 .5em 0;
+
+}
+
+/* category chooser ----------------------------------------------- */
+
+.category-chooser {
+    margin: -50%;
+    width:100%;
+}
+.rCategory li {
+    font-size: 80%;
+    display: inline;
+    list-style-type: none;
+    padding-right: 20px;
+}
+li.selected {
+    font-weight: bold;
+}
+
+/* other lists ----------------------------------------------- */
+
+ul.rNavigationBar, ul.rMenu, ul.rFolder, ul.rFeeds, ul.rReferersList, ul.rEntriesList {
+    list-style-type: none;
+    padding: 0;
+    margin: 0;
+    font-size: 80%;
+}
+ul.rFeeds li {
+    background-image: url($url.absoluteSite/images/feed-icon-12x12.gif);
+    background-repeat: no-repeat;
+    background-position: 0 .2em; 
+    padding-left: 1.4em;
+    line-height: 1.5em;
+}
+
+/* calendar ----------------------------------------------- */
+
+.hCalendarDay{
+    text-align : center;
+    font-size: small;
+}
+th.hCalendarDayNameRow {
+    text-align : center;
+    font-size : small;
+    font-weight : bold;
+}
+td.hCalendarDayCurrent {
+    text-align : center;
+    font-size  : small;
+    font-weight: bold;
+}
+td.hCalendarDayLinked {
+    text-align : center;
+    font-size  : small;
+    font-weight: bold;
+}
+
+/* comments ----------------------------------------------- */
+
+div.comments-form span.status {
+    display: block;
+    background: white;
+    color: green;
+    border: 1px solid green;
+    margin: 10px 0px;
+    padding: 10px;
+    font-size: 18px;
+    font-weight: bold;
+}
+
+span.error {
+    display: block;
+    background: white;
+    color: #c00;
+    border: 1px solid #c00;
+    margin: 10px 0px;
+    padding: 10px;
+    font-size: 18px;
+    font-weight: bold;
+}
+
+p.comment-details {
+    font-size: 80%;
+    color: #999;
+}
+.comments-syntax-indicator {
+    font-weight: bold;
+}
+.comments-syntax-indicator span.enabled {
+    background: transparent;
+    color: green;
+    font-style: italic;
+}
+.comments-syntax-indicator span.disabled {
+    background: transparent;
+    color: red;
+    font-style: italic;
+}
+
+form ul{ position: relative; list-style: none; width: 100%; }
+form li{ line-height: 2em; margin: 0; padding: 1px 1px 6px 9px; }
+form li.focused{ background-color: #fff7c0 !important; }
+form li p{ font-size: 9px; line-height: 13px; color: #444; }
+form li{ display: inline-block; }
+form[id] li{ display: block; }
+form li div{ display: inline-block; }
+form[id] li div{ display: inline; }
+form .left{ float: left !important; margin: 0; }
+form .right{ float: right !important; margin: 0; }
+form .clear{ clear: both; } 
+form li div p{ margin: 0 0 5px 0; }
+form div.left{ margin-right: 2px !important; }
+form div.left[class]{ margin-right: 4px !important; }
+form div.left img{ margin: 0 0 -2px 0; }
+form h2{ font-size: 1.8em; clear: left; } 
+form .info{ display: inline-block; margin: 0 0 10px 0; padding: 0 0 4px 0; border-bottom: 1px dotted #ccc !important;}
+form .info[class]{ display: block; }
+form .info p{ font-size: 1em; line-height: 1.3em; margin: 0 0 8px 0; }
+textarea.textarea{margin-bottom: 1px;}
+textarea.textarea[class]{font-family: "Lucida Grande", Tahoma, "Trebuchet MS", Verdana, sans-serif;}
+select.select{ padding: 1px 0 0 0; margin: 1px 0 3px 0; }
+select.select[class]{ margin: 0; padding: 1px 0 1px 0; }
+form .small{ width: 70px; }
+form .medium{ width: 170px; }
+form .large, form textarea.textarea{ width: 340px; }
+form .tags{ width: 320px; }
+form textarea.small{ height: 5.5em; }
+form textarea.medium{ height: 10em; }
+form textarea.large{ height: 20em; }
+.choices input{ width: 200px; margin-right: 3px; }
+.choices ol{ margin: 10px 0 0 0; }
+.choices[class] ol{ margin: 0 !important; }
+.choices img{ margin: 0 0 1px 0; }
+fieldset ol li{ display: list-item !important; margin: 0 5px 2px 3px !important; padding: 0 !important; list-style: inside decimal; }
+input.button, button { width: 6em; padding: 2px 2px 0 0; /* fix for IE */ }
+/* revert to normal for Firefox */
+li>input.button, li>button, input.button>input.button, button>button { padding: 2px; }
+label.desc{
+    margin: 4px 0 3px 0;
+    border: 0;
+    color: #444;
+    font-size: 1em;
+    line-height: 1.3em;
+    display: block;
+    font-weight: bold;
+}
+input.text, input.number, input.url, input.email, input.password, input.file, 
+textarea.textarea, select.select{
+    font-size: 1.2em;
+    border-top: 1px solid #7c7c7c;
+    border-left: 1px solid #c3c3c3;
+    border-right: 1px solid #c3c3c3;
+    border-bottom: 1px solid #ddd;
+    color: #333;
+}
+input.text, input.number, input.url, input.email, input.password, input.file{ padding: 2px; }
+input.currency{ text-align: right; }
+input.checkbox, input.radio{
+    display: block;
+    line-height: 1.4em;
+    margin: 8px 0 0 3px;
+    width: 13px;
+    height: 13px;
+}
+input.focus, textarea.focus { background: #ffd; color: #000; }
+label.choice{
+    display: block;
+    line-height: 1.4em;
+    margin: -19px 0 0 25px;
+    padding: 4px 0 5px 0;
+    color: #444;
+    width: 80%;
+}
+
+div.comments-form form ul {
+   width:40em;
+}
+
+/*-------------------------------------------------------------
+Basic theme styles
+--------------------------------------------------------------*/
+
+h1 {
+  font-size:200%;
+  color:#CC9933;
+}
+h2, .comments-head {
+    color:#CC9933;
+    font-size:90%;
+    font-weight:bold;
+    border-bottom:1px dotted #666;
+    text-transform:uppercase;
+    letter-spacing: .2em;  	
+    margin-top: .5em;			
+}
+h1.weblogName {
+    text-align:center;
+}
+p.weblogDescription {
+    text-align: center;
+}
+div.dayTitle {
+    color:#CC9933;
+    font-size:90%;
+    text-transform:uppercase;
+    border-bottom:1px dotted #666;		
+}
+
+/* layout ----------------------------------------------- */
+
+.content_wrapper {
+    width: 80%;
+    float: left;
+}
+.content {
+    padding: 0em 2em 2em 2em;
+}
+.rightbar_wrapper { 
+    width: 20%;
+    float: right;
+}

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-preview.png
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-preview.png?rev=1140970&view=auto
==============================================================================
Binary file - no diff available.

Propchange: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/basic-preview.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/permalink.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/permalink.vm?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/permalink.vm (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/permalink.vm Wed Jun 29 05:55:05 2011
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>$model.weblogEntry.title : $model.weblog.name</title>
+    #showAutodiscoveryLinks($model.weblog)
+    <link rel="stylesheet" type="text/css" media="all" href="$model.weblog.mobilestylesheet">
+</head>
+<body>
+
+<div class="content_wrapper">
+  <div class="content">
+    <h1 class="weblogName">$utils.escapeHTML($model.weblog.name)</h1>
+
+        <center>
+        #set($rootCategory = $model.weblog.getWeblogCategory("nil"))
+        #showWeblogCategoryLinksList($rootCategory false false)
+        </center>
+
+        ## show next/previous paging controls
+        #set($pager = $model.getWeblogEntriesPager()) 
+        <div class="next-previous">
+            #showNextPrevEntriesControl($pager)
+        </div>
+
+        ## show entry
+        #showWeblogEntriesPager($pager)
+
+        ## show comments and comment form
+        #showWeblogEntryComments($model.weblogEntry)
+        #showWeblogEntryCommentForm($model.weblogEntry)
+
+  </div>
+</div>
+
+<div class="rightbar_wrapper">
+  <div class="rightbar">
+    #includeTemplate($model.weblog "sidebar")
+  </div>
+</div>
+
+</body>
+</html>

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/searchresults.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/searchresults.vm?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/searchresults.vm (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/searchresults.vm Wed Jun 29 05:55:05 2011
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Search Results for '$model.term' : $model.weblog.name</title>
+    #showAutodiscoveryLinks($model.weblog)
+    <link rel="stylesheet" type="text/css" media="all" href="$model.weblog.mobileStylesheet">
+</head>
+<body>
+
+<div class="content_wrapper">
+  <div class="content">
+    <h1 class="weblogName">$utils.escapeHTML($model.weblog.name)</h1>
+
+        <center>
+        #set($rootCategory = $model.weblog.getWeblogCategory("nil"))
+        #showWeblogCategoryLinksList($rootCategory false false)
+        </center>
+
+        ## show next/previous paging controls
+        #set($pager = $model.getWeblogEntriesPager()) 
+        <div class="next-previous">
+            #showWeblogSearchAgainForm($model.weblog)
+            #showNextPrevSearchControl($pager)
+        </div>
+
+        ## show entries
+        #showWeblogEntriesPager($pager)
+
+  </div>
+</div>
+
+<div class="rightbar_wrapper">
+  <div class="rightbar">
+    #includeTemplate($model.weblog "sidebar")
+  </div>
+</div>
+
+</body>
+</html>

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/sidebar.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/sidebar.vm?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/sidebar.vm (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/sidebar.vm Wed Jun 29 05:55:05 2011
@@ -0,0 +1,34 @@
+## sidebar contents
+
+    <h2>Calendar</h2>
+    <div class="sidebar">
+    #showWeblogEntryCalendar($model.weblog "nil")
+    </div>
+
+    <h2>Feeds</h2>
+    <div class="sidebar">
+    #showAtomFeedsList($model.weblog)
+    </div>
+
+    <h2>Search</h2>
+    <div class="sidebar">
+    #showWeblogSearchForm($model.weblog false)
+    </div>
+
+    <h2>Links</h2>
+    <div class="sidebar">
+    #set($rootFolder = $model.weblog.getBookmarkFolder("/"))
+    #showBookmarkLinksList($rootFolder false false) 
+    </div>
+
+    <h2>Navigation</h2>
+    <div class="sidebar">
+    #showPageMenu($model.weblog)
+    #showAuthorMenu(true)
+    </div>
+
+    <h2>Referrers</h2>
+    <div class="sidebar">
+    #set($refs = $model.weblog.getTodaysReferrers())
+    #showReferrersList($refs 30 20 true)
+    </div>

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/theme.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/theme.xml?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/theme.xml (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/theme.xml Wed Jun 29 05:55:05 2011
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weblogtheme>
+    
+    <id>mobile</id>
+    <name>Mobile</name>
+    <author>Roller Weblogger</author>
+    <type>mobile</type>
+    
+    <!-- theme preview image -->
+    <preview-image path="basic-preview.png" />
+    
+    <!-- stylesheet -->
+    <stylesheet>
+        <name>basic-custom.css</name>
+        <description>Stylesheet for Basic theme</description>
+	<link>basic-custom.css</link>
+        <templateLanguage>velocity</templateLanguage>
+        <contentsFile>basic-custom.css</contentsFile>
+    </stylesheet>
+    
+    <!-- templates -->
+    <template action="weblog">
+        <name>weblog</name>
+        <description>weblog</description>
+	<link></link>
+        <navbar>false</navbar>
+        <hidden>true</hidden>
+        <templateLanguage>velocity</templateLanguage>
+        <contentType>text/html</contentType>
+        <contentsFile>weblog.vm</contentsFile>
+    </template>
+    
+    <template action="permalink">
+        <name>permalink</name>
+        <description>permalink</description>
+	<link></link>
+        <navbar>false</navbar>
+        <hidden>true</hidden>
+        <templateLanguage>velocity</templateLanguage>
+        <contentType>text/html</contentType>
+        <contentsFile>permalink.vm</contentsFile>
+    </template>
+    
+    <template action="search">
+        <name>searchresults</name>
+        <description>searchresults</description>
+	<link></link>
+        <navbar>false</navbar>
+        <hidden>true</hidden>
+        <templateLanguage>velocity</templateLanguage>
+        <contentType>text/html</contentType>
+        <contentsFile>searchresults.vm</contentsFile>
+    </template>
+    
+    <template action="custom">
+        <name>_day</name>
+        <description>_day</description>
+	<link></link>
+        <navbar>false</navbar>
+        <hidden>true</hidden>
+        <templateLanguage>velocity</templateLanguage>
+        <contentType>text/html</contentType>
+        <contentsFile>_day.vm</contentsFile>
+    </template>
+    
+    <template action="custom">
+        <name>sidebar</name>
+        <description>sidebar</description>
+	<link></link>
+        <navbar>false</navbar>
+        <hidden>true</hidden>
+        <templateLanguage>velocity</templateLanguage>
+        <contentType>text/html</contentType>
+        <contentsFile>sidebar.vm</contentsFile>
+    </template>
+    
+</weblogtheme>

Added: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/weblog.vm
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/weblog.vm?rev=1140970&view=auto
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/weblog.vm (added)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/mobile/weblog.vm Wed Jun 29 05:55:05 2011
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>$model.weblog.name</title>
+    #showAutodiscoveryLinks($model.weblog)
+    <link rel="stylesheet" type="text/css" media="all" href="$model.weblog.mobileStylesheet">
+</head>
+<body>
+
+<div class="content_wrapper">
+  <div class="content">
+    <h1 class="weblogName">$utils.escapeHTML($model.weblog.name)</h1>
+
+        <center>
+        #set($rootCategory = $model.weblog.getWeblogCategory("nil"))
+        #showWeblogCategoryLinksList($rootCategory false false)
+        </center>
+
+        ## show next/previous paging controls
+        #set($pager = $model.getWeblogEntriesPager()) 
+        <div class="next-previous">
+            #showNextPrevEntriesControl($pager)
+        </div>
+
+        ## show entries
+        #showWeblogEntriesPager($pager)
+
+  </div>
+</div>
+
+<div class="rightbar_wrapper">
+  <div class="rightbar">
+    #includeTemplate($model.weblog "sidebar")
+  </div>
+</div>
+
+</body>
+</html>

Modified: roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/sotto/theme.xml
URL: http://svn.apache.org/viewvc/roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/sotto/theme.xml?rev=1140970&r1=1140969&r2=1140970&view=diff
==============================================================================
--- roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/sotto/theme.xml (original)
+++ roller/branches/roller_mobile/weblogger-webapp/src/main/webapp/themes/sotto/theme.xml Wed Jun 29 05:55:05 2011
@@ -4,6 +4,7 @@
     <id>sotto</id>
     <name>Sotto</name>
     <author>Matt Raible</author>
+    <type>standard</type>
     
     <!-- theme preview image -->
     <preview-image path="sotto-preview.png" />



Mime
View raw message