Author: gmazza
Date: Sun Jul 13 20:07:17 2014
New Revision: 1610299

URL: http://svn.apache.org/r1610299
Log:
ROL-2038 (WIP) Removed unused type attribute from theme.xml and associated DB 
table & POJOs.

Modified:
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogManager.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedTheme.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadata.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataTemplate.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/WeblogSharedTheme.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
    
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java
    
roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.orm.xml
    roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm
    roller/trunk/app/src/main/resources/sql/createdb.vm
    roller/trunk/app/src/main/webapp/themes/basic/theme.xml
    roller/trunk/app/src/main/webapp/themes/basicmobile/theme.xml
    roller/trunk/app/src/main/webapp/themes/fauxcoly/theme.xml
    roller/trunk/app/src/main/webapp/themes/frontpage/theme.xml
    roller/trunk/app/src/main/webapp/themes/gaurav/theme.xml

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogManager.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogManager.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogManager.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogManager.java
 Sun Jul 13 20:07:17 2014
@@ -215,8 +215,4 @@ public interface WeblogManager {
      */
     void release();
 
-    /**
-     *   get Theme Associativity object for type
-     */
-    WeblogThemeAssoc getThemeAssoc(Weblog weblog , String type) throws 
WebloggerException;
 }

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
 Sun Jul 13 20:07:17 2014
@@ -469,22 +469,6 @@ public class JPAWeblogManagerImpl implem
         return query.getResultList();
     }
 
-    public WeblogThemeAssoc getThemeAssoc(Weblog weblog , String type) throws 
WebloggerException {
-
-        if (weblog == null) {
-            throw new WebloggerException("Weblog is null");
-        }
-        if (type == null) {
-            throw new WebloggerException("Type is null");
-        }
-        TypedQuery<WeblogThemeAssoc> query = 
strategy.getNamedQuery("WeblogThemeAssoc.getThemeAssocByType",
-                WeblogThemeAssoc.class);
-        query.setParameter(1,weblog);
-        query.setParameter(2,type);
-
-        return query.getSingleResult();
-    }
-
     public void saveThemeAssoc(WeblogThemeAssoc themeAssoc) throws 
WebloggerException {
         this.strategy.store(themeAssoc);
 

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedTheme.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedTheme.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedTheme.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedTheme.java
 Sun Jul 13 20:07:17 2014
@@ -35,7 +35,6 @@ public abstract class SharedTheme implem
     protected String id = null;
     protected String name = null;
     protected String description = null;
-    private   String type = null;
     protected String author = null;
     protected Date lastModified = null;
     protected boolean enabled = false;
@@ -100,12 +99,4 @@ public abstract class SharedTheme implem
     public void setEnabled(boolean enabled) {
         this.enabled = enabled;
     }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
 }

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/SharedThemeFromDir.java
 Sun Jul 13 20:07:17 2014
@@ -189,7 +189,6 @@ public class SharedThemeFromDir extends 
         } else {
             setDescription(" ");
         }
-        setType(themeMetadata.getType());
         setAuthor(themeMetadata.getAuthor());
         setLastModified(null);
         setEnabled(true);

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadata.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadata.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadata.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadata.java
 Sun Jul 13 20:07:17 2014
@@ -30,7 +30,6 @@ public class ThemeMetadata {
     private String name = null;
     private String description = null;
     private String author = null;
-    private String type = null;
     private String previewImage = null;
     private ThemeMetadataTemplate stylesheet = null;
     private Set<ThemeMetadataTemplate> templates = new 
HashSet<ThemeMetadataTemplate>();
@@ -111,11 +110,4 @@ public class ThemeMetadata {
         this.stylesheet = stylesheet;
     }
 
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
 }

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataParser.java
 Sun Jul 13 20:07:17 2014
@@ -59,8 +59,7 @@ public class ThemeMetadataParser {
         theme.setName(root.getChildText("name"));
         theme.setDescription(root.getChildText("description"));
         theme.setAuthor(root.getChildText("author"));
-        theme.setType(root.getChildText("type"));
-        
+
         // if either id or name is null then throw a parsing exception
         if(StringUtils.isEmpty(theme.getId()) || 
StringUtils.isEmpty(theme.getName())) {
             throw new ThemeParsingException("'id' and 'name' are required 
theme elements");

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataTemplate.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataTemplate.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataTemplate.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/ThemeMetadataTemplate.java
 Sun Jul 13 20:07:17 2014
@@ -35,7 +35,7 @@ public class ThemeMetadataTemplate {
     private String templateLanguage = null;
     private String contentType = null;
     private String contentsFile = null;
-    private String type = null;
+
     // Hash table to keep metadata about parsed template code files
     private Map<String, ThemeMetadataTemplateCode> templateCodeTable
             = new HashMap<String, ThemeMetadataTemplateCode>();
@@ -112,14 +112,6 @@ public class ThemeMetadataTemplate {
         this.contentsFile = contentsFile;
     }
 
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
     public void addTemplateCode(String type, ThemeMetadataTemplateCode 
templateCode) {
         this.getTemplateCodeTable().put(type, templateCode);
     }

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/WeblogSharedTheme.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/WeblogSharedTheme.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/WeblogSharedTheme.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/themes/WeblogSharedTheme.java
 Sun Jul 13 20:07:17 2014
@@ -56,10 +56,6 @@ public class WeblogSharedTheme extends W
         return this.theme.getName();
     }
 
-    public String getType() {
-        return this.theme.getType();
-    }
-
     public String getDescription() {
         return this.theme.getDescription();
     }

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java 
(original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/Weblog.java 
Sun Jul 13 20:07:17 2014
@@ -176,8 +176,7 @@ public class Weblog implements Serializa
         // TODO: maybe we should return a default theme in this case?
         return null;
     }
-    
-    
+
     /**
      * Lookup the default page for this website.
      */
@@ -191,8 +190,7 @@ public class Weblog implements Serializa
         
         return null;
     }
-    
-    
+
     /**
      * Id of the Website.
      */
@@ -944,24 +942,6 @@ public class Weblog implements Serializa
         return count;
     }
 
-    /**
-     * @return  mobileTheme
-     */
-    public Theme getTheme(String type){
-        WeblogThemeAssoc themeAssoc;
-        Theme theme = null;
-        try {
-            //get Theme Associativity object so we can get the ThemeName for 
the type given
-            themeAssoc = 
WebloggerFactory.getWeblogger().getWeblogManager().getThemeAssoc(this ,type);
-            if (themeAssoc != null) {
-                // get the Theme from theme manager
-                theme = 
WebloggerFactory.getWeblogger().getThemeManager().getTheme(themeAssoc.getName());
-            }
-        } catch (WebloggerException e) {
-            log.error("Error getting Weblog Theme type -"+type+"for weblog 
"+getHandle(),e);
-        }
-        return theme;
-    }
 
     /**
      * Add a category as a child of this category.

Modified: 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java
 (original)
+++ 
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.java
 Sun Jul 13 20:07:17 2014
@@ -35,16 +35,14 @@ public class WeblogThemeAssoc implements
     private Weblog weblog = null;
     private String name = null;
     private boolean isCustom = false;
-    private String type = null;
 
     public WeblogThemeAssoc() {
     }
 
-    public WeblogThemeAssoc(Weblog weblog ,String themeId, boolean isCustom , 
String type ){
+    public WeblogThemeAssoc(Weblog weblog ,String themeId, boolean isCustom) {
        this.weblog = weblog;
        this.name = themeId;
        this.isCustom = isCustom;
-       this.type = type;
     }
 
     public static long getSerialVersionUID() {
@@ -83,20 +81,8 @@ public class WeblogThemeAssoc implements
         isCustom = custom;
     }
 
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
     public String toString() {
-        StringBuilder buf = new StringBuilder();
-        buf.append("{");
-        buf.append(getId());
-        buf.append("}");
-        return buf.toString();
+        return "{" + getId() + "}";
     }
 
     public boolean equals(Object other) {
@@ -111,7 +97,6 @@ public class WeblogThemeAssoc implements
             .append(getId(), o.getId())
             .append(getWeblog(), o.getWeblog())
             .append(getName(), o.getName())
-            .append(getType(), o.getType())
             .isEquals();
     }
 

Modified: 
roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.orm.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.orm.xml?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- 
roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.orm.xml
 (original)
+++ 
roller/trunk/app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogThemeAssoc.orm.xml
 Sun Jul 13 20:07:17 2014
@@ -7,9 +7,6 @@
     <entity metadata-complete="true" name="WeblogThemeAssoc"
             class="org.apache.roller.weblogger.pojos.WeblogThemeAssoc" 
access="PROPERTY">
         <table name="roller_weblogtheme"/>
-        <named-query name="WeblogThemeAssoc.getThemeAssocByType">
-            <query>SELECT a FROM WeblogThemeAssoc a WHERE a.weblog = ?1 AND 
a.type =?2</query>
-        </named-query>
         <named-query name="WeblogThemeAssoc.getThemeAssocsByWeblog">
             <query>SELECT a FROM WeblogThemeAssoc a WHERE a.weblog = ?1</query>
         </named-query>
@@ -23,9 +20,6 @@
             <basic name="custom">
                 <column name="custom" insertable="true" updatable="true" 
nullable="false"/>
             </basic>
-            <basic name="type">
-                <column name="type" insertable="true" updatable="true" 
nullable="false"/>
-            </basic>
             <many-to-one name="weblog" 
target-entity="org.apache.roller.weblogger.pojos.Weblog">
                 <join-column name="weblogid" insertable="true" 
updatable="true" nullable="false"/>
             </many-to-one>

Modified: roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm (original)
+++ roller/trunk/app/src/main/resources/sql/500-to-510-migration.vm Sun Jul 13 
20:07:17 2014
@@ -8,8 +8,7 @@ create table roller_weblogtheme (
     id              varchar(48)  not null primary key,
     weblogid varchar(48) not null,
     name            varchar(255)  not null,
-    custom          $db.BOOLEAN_SQL_TYPE_FALSE not null,
-    #columnNotNullWithDefault('type' 'varchar(16)' 'standard')
+    custom          $db.BOOLEAN_SQL_TYPE_FALSE not null
 );
 
 create table roller_templatecode (

Modified: roller/trunk/app/src/main/resources/sql/createdb.vm
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/createdb.vm?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/createdb.vm (original)
+++ roller/trunk/app/src/main/resources/sql/createdb.vm Sun Jul 13 20:07:17 2014
@@ -147,8 +147,7 @@ create table roller_weblogtheme (
     id              varchar(48)  not null primary key,
     weblogid varchar(48) not null,
     name            varchar(255)  not null,
-    custom          $db.BOOLEAN_SQL_TYPE_FALSE not null,
-    #columnNotNullWithDefault('type' 'varchar(16)' 'standard')
+    custom          $db.BOOLEAN_SQL_TYPE_FALSE not null
 );
 
 create table roller_templatecode (

Modified: roller/trunk/app/src/main/webapp/themes/basic/theme.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basic/theme.xml?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basic/theme.xml (original)
+++ roller/trunk/app/src/main/webapp/themes/basic/theme.xml Sun Jul 13 20:07:17 
2014
@@ -5,8 +5,7 @@
     <name>Basic</name>
     <description>Offers wide margins for blogging programming language source 
code.</description>
     <author>Roller Weblogger</author>
-    <type>standard</type>
-    
+
     <!-- theme preview image -->
     <preview-image path="basic-preview.png" />
     

Modified: roller/trunk/app/src/main/webapp/themes/basicmobile/theme.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basicmobile/theme.xml?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basicmobile/theme.xml (original)
+++ roller/trunk/app/src/main/webapp/themes/basicmobile/theme.xml Sun Jul 13 
20:07:17 2014
@@ -5,7 +5,7 @@
     <name>Basic Mobile</name>
     <description>Offers wide margins for blogging programming language source 
code and a separate button for mobile viewing.</description>
     <author>Roller Weblogger</author>
-    <type>standard</type>
+    <multiLayout>true</multiLayout>
     
     <!-- theme preview image -->
     <preview-image path="basic-preview.png" />

Modified: roller/trunk/app/src/main/webapp/themes/fauxcoly/theme.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/fauxcoly/theme.xml?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/fauxcoly/theme.xml (original)
+++ roller/trunk/app/src/main/webapp/themes/fauxcoly/theme.xml Sun Jul 13 
20:07:17 2014
@@ -7,8 +7,7 @@
     <name>Fauxcoly</name>
     <author>Dave Johnson</author>
     <description>Theme built on the Yahoo! User Interface (YUI) 
library.</description>
-    <type>standard</type>
-    
+
     <!-- theme preview image -->
     <preview-image path="images/fauxcoly-preview.png" />
 

Modified: roller/trunk/app/src/main/webapp/themes/frontpage/theme.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/frontpage/theme.xml?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/frontpage/theme.xml (original)
+++ roller/trunk/app/src/main/webapp/themes/frontpage/theme.xml Sun Jul 13 
20:07:17 2014
@@ -5,8 +5,7 @@
     <name>Frontpage</name>
     <description>Not a standard blog template; meant only as a front page 
accumulator of all blogs hosted by this server.</description>
     <author>Dave Johnson</author>
-    <type>standard</type>
-    
+
     <!-- theme preview image -->
     <preview-image path="sm-theme-frontpage.png" />
     

Modified: roller/trunk/app/src/main/webapp/themes/gaurav/theme.xml
URL: 
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/gaurav/theme.xml?rev=1610299&r1=1610298&r2=1610299&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/gaurav/theme.xml (original)
+++ roller/trunk/app/src/main/webapp/themes/gaurav/theme.xml Sun Jul 13 
20:07:17 2014
@@ -7,8 +7,6 @@
     <name>Gaurav</name>
     <description>Responsive Bootstrap-based theme using modern HTML5 and CSS3 
design by Gaurav Saini.</description>
     <author>Gaurav Saini</author>
-    <type>standard</type>
-
 
     <!-- theme preview image -->
     <preview-image path="images/theme-resposive.png" />


Reply via email to