1 18 19 package org.apache.roller.ui.rendering.model; 20 21 import java.net.MalformedURLException ; 22 import java.util.Arrays ; 23 import java.util.HashMap ; 24 import java.util.List ; 25 import java.util.Map ; 26 import javax.servlet.jsp.PageContext ; 27 import org.apache.commons.logging.Log; 28 import org.apache.commons.logging.LogFactory; 29 import org.apache.roller.RollerException; 30 import org.apache.roller.config.RollerRuntimeConfig; 31 import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper; 32 import org.apache.roller.pojos.wrapper.WebsiteDataWrapper; 33 import org.apache.roller.ui.core.RequestConstants; 34 import org.apache.roller.ui.core.RollerContext; 35 import org.apache.struts.util.RequestUtils; 36 37 38 42 public class ConfigModel implements Model { 43 44 private static Log log = LogFactory.getLog(ConfigModel.class); 45 46 47 48 public String getModelName() { 49 return "config"; 50 } 51 52 53 54 public void init(Map map) throws RollerException { 55 } 57 58 59 public String getSiteName() { 60 return getProperty("site.name"); 61 } 62 63 public String getSiteShortName() { 64 return getProperty("site.shortName"); 65 } 66 67 public String getSiteDescription() { 68 return getProperty("site.description"); 69 } 70 71 public String getSiteEmail() { 72 return getProperty("site.adminemail"); 73 } 74 75 public boolean getRegistrationEnabled() { 76 return getBooleanProperty("users.registration.enabled"); 77 } 78 79 public String getRegistrationURL() { 80 return getProperty("users.registration.url"); 81 } 82 83 public int getFeedSize() { 84 return getIntProperty("site.newsfeeds.defaultEntries"); 85 } 86 87 public int getFeedMaxSize() { 88 return getIntProperty("site.newsfeeds.maxEntries"); 89 } 90 91 public boolean getFeedStyle() { 92 return getBooleanProperty("site.newsfeeds.styledFeeds"); 93 } 94 95 public boolean getCommentAutoFormat() { 96 return getBooleanProperty("users.comments.autoformat"); 97 } 98 99 public boolean getCommentEscapeHtml() { 100 return getBooleanProperty("users.comments.escapehtml"); 101 } 102 103 public boolean getCommentEmailNotify() { 104 return getBooleanProperty("users.comments.emailnotify"); 105 } 106 107 public boolean getTrackbacksEnabled() { 108 return getBooleanProperty("users.trackbacks.enabled"); 109 } 110 111 112 113 public String getRollerVersion() { 114 return RollerContext.getRollerContext().getRollerVersion(); 115 } 116 117 118 119 public String getRollerBuildTimestamp() { 120 return RollerContext.getRollerContext().getRollerBuildTime(); 121 } 122 123 124 125 public String getRollerBuildUser() { 126 return RollerContext.getRollerContext().getRollerBuildUser(); 127 } 128 129 130 private String getProperty(String name) { 131 return RollerRuntimeConfig.getProperty(name); 132 } 133 134 135 private int getIntProperty(String name) { 136 return RollerRuntimeConfig.getIntProperty(name); 137 } 138 139 140 private boolean getBooleanProperty(String name) { 141 return RollerRuntimeConfig.getBooleanProperty(name); 142 } 143 144 } 145 146 | Popular Tags |