- Einige static initalizer (static {...} Blöcke in ccm-cms::com.arsdigita.cms.dispatcher.BaseAsset und ccm-cms-assets-relatedlink::com.arsdigita.cms.contentassets.ui.RelatedLinkPropertyForm entfernt
- Alle anderen static initalizers haben jetzt am Anfang und Ende eine Log-Ausgabe (Level debug), in Klassen die bisher keinen Logger hatten wurde ein Logger eingebaut - log4j.properties in ccm-core enthält jetzt vorbereitetet, auskommentierte Zeilen für alle Klassen mit static Blöcken git-svn-id: https://svn.libreccm.org/ccm/trunk@748 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
0a96c0fed6
commit
32aec3251d
|
|
@ -22,6 +22,7 @@ import com.arsdigita.web.Application;
|
|||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -31,10 +32,13 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
|||
*/
|
||||
public class HTTPAuth extends Application {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HTTPAuth.class);
|
||||
private static HTTPAuthConfig s_config = new HTTPAuthConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static HTTPAuthConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.auth.http;
|
||||
|
||||
import com.arsdigita.util.parameter.Converters;
|
||||
|
|
@ -43,29 +42,27 @@ import java.io.InputStream;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class HTTPAuthConfig extends AbstractConfig {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HTTPAuthConfig.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Converters.set(Inet4AddressRange.class,
|
||||
new Inet4AddressRangeConvertor());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private BooleanParameter m_isActive;
|
||||
private BooleanParameter m_isDebugMode;
|
||||
|
||||
private IntegerParameter m_nonceTTL;
|
||||
|
||||
private StringParameter m_serverName;
|
||||
private IntegerParameter m_serverPort;
|
||||
|
||||
private Inet4AddressRangeParameter m_clientIPRange;
|
||||
|
||||
private StringParameter m_keyAlias;
|
||||
private StringParameter m_keyCypher;
|
||||
private StringParameter m_keyPassword;
|
||||
|
||||
private StringParameter m_keystorePassword;
|
||||
private StringParameter m_keystorePath;
|
||||
|
||||
|
|
@ -90,11 +87,13 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
// XXX bz108251
|
||||
//Parameter.REQUIRED,
|
||||
null);
|
||||
m_serverPort = new IntegerParameter("com.arsdigita.auth.http.server_port",
|
||||
m_serverPort = new IntegerParameter(
|
||||
"com.arsdigita.auth.http.server_port",
|
||||
Parameter.OPTIONAL,
|
||||
new Integer(80));
|
||||
|
||||
m_clientIPRange = new Inet4AddressRangeParameter("com.arsdigita.auth.http.client_ip_range",
|
||||
m_clientIPRange = new Inet4AddressRangeParameter(
|
||||
"com.arsdigita.auth.http.client_ip_range",
|
||||
Parameter.OPTIONAL,
|
||||
// XXX bz108251
|
||||
//Parameter.REQUIRED,
|
||||
|
|
@ -106,19 +105,22 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
m_keyCypher = new StringParameter("com.arsdigita.auth.http.key_cypher",
|
||||
Parameter.OPTIONAL,
|
||||
"RSA");
|
||||
m_keyPassword = new StringParameter("com.arsdigita.auth.http.key_password",
|
||||
m_keyPassword = new StringParameter(
|
||||
"com.arsdigita.auth.http.key_password",
|
||||
Parameter.OPTIONAL,
|
||||
// XXX bz108251
|
||||
//Parameter.REQUIRED,
|
||||
null);
|
||||
|
||||
|
||||
m_keystorePassword = new StringParameter("com.arsdigita.auth.http.keystore_password",
|
||||
m_keystorePassword = new StringParameter(
|
||||
"com.arsdigita.auth.http.keystore_password",
|
||||
Parameter.OPTIONAL,
|
||||
// XXX bz108251
|
||||
//Parameter.REQUIRED,
|
||||
null);
|
||||
m_keystorePath = new StringParameter("com.arsdigita.auth.http.keystore_path",
|
||||
m_keystorePath = new StringParameter(
|
||||
"com.arsdigita.auth.http.keystore_path",
|
||||
Parameter.OPTIONAL,
|
||||
// XXX bz108251
|
||||
//Parameter.REQUIRED,
|
||||
|
|
@ -190,7 +192,6 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
return (String) get(m_keystorePath);
|
||||
}
|
||||
|
||||
|
||||
public final InputStream getKeyStoreStream() {
|
||||
String file = getKeyStorePath();
|
||||
|
||||
|
|
@ -222,16 +223,15 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
store.load(is, getKeyStorePassword().toCharArray());
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot load keystore from " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot load keystore from " + getKeyStorePath(), ex);
|
||||
} catch (CertificateException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot load keystore certificates from " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot load keystore certificates from "
|
||||
+ getKeyStorePath(), ex);
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot check integrity of keystore " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot check integrity of keystore " + getKeyStorePath(),
|
||||
ex);
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
|
@ -244,8 +244,8 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
cert = keystore.getCertificate(getKeyAlias());
|
||||
} catch (KeyStoreException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot get public key from keystore " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot get public key from keystore " + getKeyStorePath(),
|
||||
ex);
|
||||
}
|
||||
|
||||
Assert.exists(cert, Certificate.class);
|
||||
|
|
@ -262,16 +262,16 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
getKeyPassword().toCharArray());
|
||||
} catch (KeyStoreException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot get private key from keystore " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot get private key from keystore " + getKeyStorePath(),
|
||||
ex);
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot get private key from keystore " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot get private key from keystore " + getKeyStorePath(),
|
||||
ex);
|
||||
} catch (UnrecoverableKeyException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot get private key from keystore " +
|
||||
getKeyStorePath(), ex);
|
||||
"cannot get private key from keystore " + getKeyStorePath(),
|
||||
ex);
|
||||
}
|
||||
|
||||
Assert.exists(key, Key.class);
|
||||
|
|
@ -280,6 +280,7 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
}
|
||||
|
||||
private static class Inet4AddressRangeConvertor implements Converter {
|
||||
|
||||
public Object convert(Class type,
|
||||
Object value) {
|
||||
return Inet4AddressRange.getByName((String) value);
|
||||
|
|
@ -287,6 +288,7 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
}
|
||||
|
||||
private static class Inet4AddressRangeParameter extends AbstractParameter {
|
||||
|
||||
public Inet4AddressRangeParameter(final String name) {
|
||||
super(name, Inet4AddressRange.class);
|
||||
}
|
||||
|
|
@ -296,6 +298,5 @@ public class HTTPAuthConfig extends AbstractConfig {
|
|||
final Object defaalt) {
|
||||
super(name, multiplicity, defaalt, Inet4AddressRange.class);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ public class HTTPLoginModule extends MappingLoginModule {
|
|||
|
||||
private static PublicKey s_publicKey = null;
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
if (HTTPAuth.getConfig().isActive()) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Loading public key");
|
||||
|
|
@ -145,6 +146,7 @@ public class HTTPLoginModule extends MappingLoginModule {
|
|||
s_log.info("HTTP auth is not active");
|
||||
}
|
||||
}
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static BASE64Decoder s_base64Decoder = new BASE64Decoder();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ public class FileAttachment extends FileAsset {
|
|||
private static final FileAttachmentConfig s_config = new FileAttachmentConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
|
|
@ -51,18 +50,18 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
public static final String IMAGE_ATTACHMENTS = "imageAttachments";
|
||||
public static final String ITEM_ATTACHMENTS = "itemAttachments";
|
||||
public static final String IMAGE_LINK = "imageLink";
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.contentassets.ItemImageAttachment";
|
||||
|
||||
private static final Logger s_log
|
||||
= Logger.getLogger(ItemImageAttachment.class);
|
||||
|
||||
private static final ItemImageAttachmentConfig s_config = new ItemImageAttachmentConfig();
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentassets.ItemImageAttachment";
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
ItemImageAttachment.class);
|
||||
private static final ItemImageAttachmentConfig s_config =
|
||||
new ItemImageAttachmentConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private ItemImageAttachment() {
|
||||
|
|
@ -95,9 +94,11 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
public static ItemImageAttachmentConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
public ReusableImageAsset getImage() {
|
||||
if( s_log.isDebugEnabled() )
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Getting image for " + getOID());
|
||||
}
|
||||
|
||||
DataObject dobj = (DataObject) get(IMAGE);
|
||||
Assert.exists(dobj);
|
||||
|
|
@ -126,11 +127,12 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
public static DataCollection getImageAttachments(ContentItem item) {
|
||||
Assert.exists(item, ContentItem.class);
|
||||
|
||||
if( s_log.isDebugEnabled() )
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Getting attachments for " + item.getOID());
|
||||
}
|
||||
|
||||
DataCollection attachments = SessionManager.getSession().retrieve
|
||||
( BASE_DATA_OBJECT_TYPE );
|
||||
DataCollection attachments = SessionManager.getSession().retrieve(
|
||||
BASE_DATA_OBJECT_TYPE);
|
||||
attachments.addEqualsFilter(ITEM + ".id", item.getID());
|
||||
|
||||
return attachments;
|
||||
|
|
@ -168,7 +170,6 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
return (String) get(DESCRIPTION);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Automatically publish an unpublished image
|
||||
*/
|
||||
|
|
@ -176,9 +177,8 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
final Property property,
|
||||
final ItemCopier copier) {
|
||||
String attribute = property.getName();
|
||||
if( ItemCopier.VERSION_COPY == copier.getCopyType() &&
|
||||
IMAGE.equals( attribute ) )
|
||||
{
|
||||
if (ItemCopier.VERSION_COPY == copier.getCopyType() && IMAGE.equals(
|
||||
attribute)) {
|
||||
ItemImageAttachment attachment = (ItemImageAttachment) source;
|
||||
ReusableImageAsset image = attachment.getImage();
|
||||
|
||||
|
|
@ -197,7 +197,6 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
}
|
||||
|
||||
// chris gilbert - optional link
|
||||
|
||||
public Link getLink() {
|
||||
Link link = null;
|
||||
DataObject dobj = (DataObject) get(IMAGE_LINK);
|
||||
|
|
@ -217,11 +216,11 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
// when we delete the link, the image still references it in DB
|
||||
// can't make it composite because then image is deleted if we delete
|
||||
// link. Have to set link to null first (I think)
|
||||
DomainObject link = DomainObjectFactory.newInstance((DataObject)get(IMAGE_LINK));
|
||||
DomainObject link = DomainObjectFactory.newInstance((DataObject) get(
|
||||
IMAGE_LINK));
|
||||
set(IMAGE_LINK, null);
|
||||
save();
|
||||
link.delete();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public class Note extends ACSObject {
|
|||
private static final Logger s_log = Logger.getLogger( Note.class );
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer is starting...");
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
BASE_DATA_OBJECT_TYPE,
|
||||
new DomainObjectInstantiator() {
|
||||
|
|
@ -58,6 +59,8 @@ public class Note extends ACSObject {
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static final String CONTENT = "content";
|
||||
|
|
|
|||
|
|
@ -49,13 +49,9 @@ import com.arsdigita.util.Assert;
|
|||
*/
|
||||
public class RelatedLinkPropertyForm extends LinkPropertyForm {
|
||||
|
||||
private static boolean isHideAdditionalResourceFields;
|
||||
private static boolean isHideAdditionalResourceFields = ContentSection.getConfig().isHideAdditionalResourceFields();
|
||||
private String m_linkListName = "";
|
||||
|
||||
static {
|
||||
isHideAdditionalResourceFields = ContentSection.getConfig().isHideAdditionalResourceFields();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new form to edit the RelatedLink object specified
|
||||
* by the item selection model passed in.
|
||||
|
|
|
|||
|
|
@ -95,7 +95,9 @@ public class Event extends GenericArticle {
|
|||
private static final EventConfig s_config = new EventConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static final EventConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -24,10 +24,8 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This content type represents a GlossaryItem.
|
||||
|
|
@ -36,17 +34,20 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
public class GlossaryItem extends ContentPage {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GlossaryItem.class);
|
||||
/** PDL property name for definition */
|
||||
public static final String DEFINITION = "definition";
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.contenttypes.GlossaryItem";
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.GlossaryItem";
|
||||
private static GlossaryItemConfig config = new GlossaryItemConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static GlossaryItemConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
|
@ -73,7 +74,6 @@ public class GlossaryItem extends ContentPage {
|
|||
super(type);
|
||||
}
|
||||
|
||||
|
||||
public void beforeSave() {
|
||||
super.beforeSave();
|
||||
|
||||
|
|
@ -93,5 +93,4 @@ public class GlossaryItem extends ContentPage {
|
|||
public String getSearchSummary() {
|
||||
return getDefinition();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ public class HealthCareFacility extends GenericOrganization {
|
|||
* Called when the class is loaded by the Java class loader.
|
||||
*/
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ public class MultiPartArticle extends ContentPage {
|
|||
private static MultiPartArticleConfig s_config = new MultiPartArticleConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static MultiPartArticleConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.arsdigita.util.Assert;
|
|||
import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <p><code>DomainObject</code> class to represent news item <code>ContentType</code>
|
||||
|
|
@ -57,6 +58,7 @@ import java.util.Date;
|
|||
**/
|
||||
public class NewsItem extends GenericArticle {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(NewsItem.class);
|
||||
/** PDL property name for lead */
|
||||
public static final String LEAD = "lead";
|
||||
/** PDL property name for news date */
|
||||
|
|
@ -69,7 +71,9 @@ public class NewsItem extends GenericArticle {
|
|||
private static final NewsItemConfig s_config = new NewsItemConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static final NewsItemConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
|
|
@ -42,6 +41,7 @@ import java.math.BigDecimal;
|
|||
**/
|
||||
public class SimpleAddress extends ContentPage {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SimpleAddress.class);
|
||||
/** PDL property name for address */
|
||||
public static final String ADDRESS = "address";
|
||||
/** PDL property name for country iso code */
|
||||
|
|
@ -60,17 +60,19 @@ public class SimpleAddress extends ContentPage {
|
|||
public static final String NOTES = "notes";
|
||||
/** PDL property name for URI*/
|
||||
public static final String URI = "uri";
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.contenttypes.Address";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.Address";
|
||||
private static final SimpleAddressConfig s_config =
|
||||
new SimpleAddressConfig();
|
||||
|
||||
private static final SimpleAddressConfig s_config = new SimpleAddressConfig();
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finisheds. .");
|
||||
}
|
||||
public static final SimpleAddressConfig getConfig()
|
||||
{
|
||||
|
||||
public static final SimpleAddressConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
|
|
@ -226,5 +228,4 @@ public class SimpleAddress extends ContentPage {
|
|||
public String getURI() {
|
||||
return (String) get(URI);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ public class SiteProxyPanel extends ContentPanel {
|
|||
private static URLPool s_pool = new URLPool();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
URLFetcher.registerService(s_cacheServiceKey, s_pool, s_cache);
|
||||
s_log.debug("Static initalizer finished.");
|
||||
};
|
||||
|
||||
public SiteProxyPanel() {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.arsdigita.kernel.User;
|
|||
import com.arsdigita.persistence.metadata.Property;
|
||||
import com.arsdigita.xml.Element;
|
||||
import java.util.Date;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A survey content type that represents a survey. This is partially based on
|
||||
|
|
@ -50,9 +51,13 @@ public class Survey extends ContentPage implements XMLGenerator {
|
|||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Survey";
|
||||
/* Config */
|
||||
private static final SurveyConfig s_config = new SurveyConfig();
|
||||
/* Logger to debug to static initializer */
|
||||
private static final Logger logger = Logger.getLogger(Survey.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initializer finished.");
|
||||
}
|
||||
|
||||
public static final SurveyConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@ public abstract class CMS {
|
|||
};
|
||||
private static final CMSConfig s_config = new CMSConfig();
|
||||
static {
|
||||
s_log.debug("Static initializer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initializer finished.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,9 @@ public class ContentSection extends Application {
|
|||
private static final CMSConfig s_config = new CMSConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initializer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initializer finished...");
|
||||
}
|
||||
// Cached properties
|
||||
PageResolver m_pageResolver = null;
|
||||
|
|
|
|||
|
|
@ -63,10 +63,12 @@ public class Template extends TextAsset {
|
|||
public static final Map SUPPORTED_MIME_TYPES = new HashMap();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer is starting...");
|
||||
SUPPORTED_MIME_TYPES.put(JSP_MIME_TYPE,
|
||||
GlobalizationUtil.globalize("mime_type_jsp"));
|
||||
SUPPORTED_MIME_TYPES.put(XSL_MIME_TYPE,
|
||||
GlobalizationUtil.globalize("mime_type_xsl"));
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
|
||||
import com.arsdigita.globalization.LocaleNegotiator;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
|
|
@ -29,6 +28,7 @@ import com.arsdigita.util.Assert;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
import java.util.TreeMap;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <p><code>DomainObject</code> class to represent address <code>ContentType</code>
|
||||
|
|
@ -44,6 +44,7 @@ import java.util.TreeMap;
|
|||
**/
|
||||
public class GenericAddress extends ContentPage {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GenericAddress.class);
|
||||
/** PDL property name for address */
|
||||
public static final String ADDRESS = "address";
|
||||
/** PDL property name for postal code */
|
||||
|
|
@ -54,17 +55,18 @@ public class GenericAddress extends ContentPage {
|
|||
public static final String STATE = "state";
|
||||
/** PDL property name for country iso code */
|
||||
public static final String ISO_COUNTRY_CODE = "isoCountryCode";
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.contenttypes.GenericAddress";
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.GenericAddress";
|
||||
private static GenericAddressConfig s_config = new GenericAddressConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initializer finished.");
|
||||
}
|
||||
public static GenericAddressConfig getConfig()
|
||||
{
|
||||
|
||||
public static GenericAddressConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +178,8 @@ public class GenericAddress extends ContentPage {
|
|||
// Convert the iso country code to country names using the current locale
|
||||
public static String getCountryNameFromIsoCode(String isoCountryCode) {
|
||||
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "", null);
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "",
|
||||
null);
|
||||
java.util.Locale locale = new java.util.Locale("", isoCountryCode);
|
||||
return locale.getDisplayCountry(negotiatedLocale.getLocale());
|
||||
|
||||
|
|
@ -185,15 +188,18 @@ public class GenericAddress extends ContentPage {
|
|||
// Get a sorted list auf all countries
|
||||
public static TreeMap getSortedListOfCountries(Locale inLang) {
|
||||
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "", null);
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "",
|
||||
null);
|
||||
String[] countries = Locale.getISOCountries();
|
||||
TreeMap<String, String> countryNames = new TreeMap<String, String>();
|
||||
|
||||
for (String country : countries) {
|
||||
if (inLang != null) {
|
||||
countryNames.put(new java.util.Locale("", country).getDisplayCountry(inLang), country);
|
||||
countryNames.put(new java.util.Locale("", country).
|
||||
getDisplayCountry(inLang), country);
|
||||
} else {
|
||||
countryNames.put(new java.util.Locale("", country).getDisplayCountry(negotiatedLocale.getLocale()), country);
|
||||
countryNames.put(new java.util.Locale("", country).
|
||||
getDisplayCountry(negotiatedLocale.getLocale()), country);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.persistence.DataCollection;
|
|||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.StringTokenizer;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This content type represents an basic contact
|
||||
|
|
@ -37,6 +38,7 @@ import java.util.StringTokenizer;
|
|||
public class GenericContact extends ContentPage implements
|
||||
RelationAttributeInterface {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GenericContact.class);
|
||||
/** PDL property names */
|
||||
public static final String PERSON = "person";
|
||||
// public static final String CONTACT_TYPE = "";
|
||||
|
|
@ -51,9 +53,11 @@ public class GenericContact extends ContentPage implements
|
|||
new GenericContactConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initializer finished");
|
||||
}
|
||||
/** Data object type for tihs domain object */
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.GenericContact";
|
||||
|
||||
|
|
|
|||
|
|
@ -50,14 +50,18 @@ class BaseAsset extends ResourceHandlerImpl {
|
|||
|
||||
private final static String s_defaultName = "File";
|
||||
|
||||
private static final BigDecimalParameter s_assetId;
|
||||
private static final OIDParameter s_oid;
|
||||
private static final BigDecimalParameter s_assetId = new BigDecimalParameter(ASSET_ID);
|
||||
private static final OIDParameter s_oid = new OIDParameter(OID_PARAM);
|
||||
|
||||
static {
|
||||
/*
|
||||
* jensp 2011-02-11: No need for static initalizer block here. Moved
|
||||
* to variable declaration (see above).
|
||||
*/
|
||||
/*static {
|
||||
s_assetId = new BigDecimalParameter(ASSET_ID);
|
||||
s_oid = new OIDParameter(OID_PARAM);
|
||||
//s_assetId.addParameterListener(new NotNullValidationListener());
|
||||
}
|
||||
}*/
|
||||
|
||||
private final boolean m_download;
|
||||
private String m_disposition;
|
||||
|
|
|
|||
|
|
@ -53,13 +53,14 @@ import java.util.Iterator;
|
|||
*/
|
||||
public class SimpleXMLGenerator implements XMLGenerator {
|
||||
|
||||
private static Logger s_log =
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(SimpleXMLGenerator.class);
|
||||
public static final String ADAPTER_CONTEXT = SimpleXMLGenerator.class.
|
||||
getName();
|
||||
|
||||
// Register general purpose adaptor for all content items
|
||||
static {
|
||||
s_log.debug("Static initializer starting...");
|
||||
SimpleDomainObjectTraversalAdapter adapter =
|
||||
new SimpleDomainObjectTraversalAdapter();
|
||||
adapter.addAssociationProperty("/object/type");
|
||||
|
|
@ -69,6 +70,7 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
|||
ContentItem.BASE_DATA_OBJECT_TYPE,
|
||||
adapter,
|
||||
ADAPTER_CONTEXT);
|
||||
s_log.debug("Static initializer finished");
|
||||
}
|
||||
|
||||
public SimpleXMLGenerator() {
|
||||
|
|
|
|||
|
|
@ -62,26 +62,24 @@ import org.apache.oro.text.regex.Perl5Matcher;
|
|||
*/
|
||||
class LinkScanner {
|
||||
|
||||
private static Logger s_log = Logger.getLogger(LinkScanner.class.getName());
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(LinkScanner.class);
|
||||
// Regexp magic. We deliberately don't use the JDK 1.4 regex features, so
|
||||
// that this class can also be used under JDK 1.3
|
||||
|
||||
// The option we use for matching
|
||||
private static final int MATCH_MASK = Perl5Compiler.CASE_INSENSITIVE_MASK
|
||||
| Perl5Compiler.MULTILINE_MASK;
|
||||
|
||||
// The HTML elements we are interested in. This must match exactly the
|
||||
// elements listed in TAGS
|
||||
private static final String ELEMS_RE = "(a|img|link)";
|
||||
// Regexp to find a tag
|
||||
private static final String TAG_RE = "\\<\\s*" + ELEMS_RE + "\\s*([^>]*?)\\s*/?\\>";
|
||||
private static final String TAG_RE = "\\<\\s*" + ELEMS_RE
|
||||
+ "\\s*([^>]*?)\\s*/?\\>";
|
||||
// Regexp to find an attribute/value pair within a tag
|
||||
private static final String ATTR_RE = "([a-z][a-z0-9]*)\\s*=\\s*([^\\s'\"]+|'[^']*'|\"[^\"]*\")";
|
||||
private static final String ATTR_RE =
|
||||
"([a-z][a-z0-9]*)\\s*=\\s*([^\\s'\"]+|'[^']*'|\"[^\"]*\")";
|
||||
// These two variables will be initialized with precompiled patterns
|
||||
private static final Pattern TAG_PAT;
|
||||
private static final Pattern ATTR_PAT;
|
||||
|
||||
// The tags that we are interested in. The regexp ELEMS_RE must match
|
||||
// exactly these tags.
|
||||
// REF_ATTR contains for each of the TAGS which of their attribute holds
|
||||
|
|
@ -91,7 +89,6 @@ class LinkScanner {
|
|||
// The special oid attribute we use to figure out which tags we need to
|
||||
// futz with.
|
||||
private static final String OID_ATTR = "oid";
|
||||
|
||||
// FIXME: These are references to what should be displayed when tag
|
||||
// rewriting can't find the live target item. These values only work for
|
||||
// DP.
|
||||
|
|
@ -100,19 +97,32 @@ class LinkScanner {
|
|||
"/notfound.html"};
|
||||
|
||||
static {
|
||||
s_log.debug("Static initializer is starting...s");
|
||||
Perl5Compiler comp = new Perl5Compiler();
|
||||
try {
|
||||
TAG_PAT = comp.compile(TAG_RE, MATCH_MASK);
|
||||
} catch (MalformedPatternException e) {
|
||||
throw new RuntimeException("Failed to compile \n'" + TAG_RE +"' " + e.getMessage());
|
||||
s_log.error(String.format("Failed to compile regex tag '%s' "
|
||||
+ "with match mask '%s':",
|
||||
TAG_RE,
|
||||
MATCH_MASK),
|
||||
e);
|
||||
throw new RuntimeException("Failed to compile \n'" + TAG_RE + "' " + e.
|
||||
getMessage());
|
||||
}
|
||||
try {
|
||||
ATTR_PAT = comp.compile(ATTR_RE, MATCH_MASK);
|
||||
} catch (MalformedPatternException e) {
|
||||
throw new RuntimeException("Failed to compile \n'" + ATTR_RE +"' " + e.getMessage());
|
||||
s_log.error(String.format("Failed to compile regex tag '%s' "
|
||||
+ "with match mask '%s':",
|
||||
ATTR_RE,
|
||||
MATCH_MASK),
|
||||
e);
|
||||
throw new RuntimeException("Failed to compile \n'" + ATTR_RE + "' " + e.
|
||||
getMessage());
|
||||
}
|
||||
s_log.debug("Static initalizer finshed.");
|
||||
}
|
||||
|
||||
private String m_content;
|
||||
private TagRef[] m_tags;
|
||||
|
||||
|
|
@ -189,7 +199,8 @@ class LinkScanner {
|
|||
}
|
||||
}
|
||||
if (oid != null) {
|
||||
TagRef ref = new TagRef(tagType, tagStart, tagEnd, linkStart, linkEnd,
|
||||
TagRef ref = new TagRef(tagType, tagStart, tagEnd, linkStart,
|
||||
linkEnd,
|
||||
oid);
|
||||
foundTags.add(ref);
|
||||
}
|
||||
|
|
@ -211,9 +222,13 @@ class LinkScanner {
|
|||
|
||||
private int getTagType(String tag) {
|
||||
for (int i = 0; i < TAGS.length; i++) {
|
||||
if (TAGS[i].equalsIgnoreCase(tag)) return i;
|
||||
if (TAGS[i].equalsIgnoreCase(tag)) {
|
||||
return i;
|
||||
}
|
||||
throw new IllegalStateException("Tag '" + tag + "' found, but no information registered for it in TAGS. This is a programming error.");
|
||||
}
|
||||
throw new IllegalStateException(
|
||||
"Tag '" + tag
|
||||
+ "' found, but no information registered for it in TAGS. This is a programming error.");
|
||||
}
|
||||
|
||||
/***
|
||||
|
|
@ -228,7 +243,6 @@ class LinkScanner {
|
|||
int linkEnd;
|
||||
String url;
|
||||
BigDecimal oid;
|
||||
|
||||
private ContentItem m_item;
|
||||
|
||||
public TagRef(int type, int start, int end, int lstart, int lend,
|
||||
|
|
@ -272,10 +286,11 @@ class LinkScanner {
|
|||
// items. Fixing that requires parsing the HTML of the page
|
||||
// separately. Here, we just kludge around it by getting the live
|
||||
// version of referenced items. [lutter]
|
||||
if ( m_item != null ) m_item = m_item.getLiveVersion();
|
||||
if (m_item != null) {
|
||||
m_item = m_item.getLiveVersion();
|
||||
}
|
||||
}
|
||||
return m_item;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.ui.authoring;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
|
@ -67,7 +66,6 @@ import com.arsdigita.mimetypes.converters.ConvertFormat;
|
|||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
|
||||
/**
|
||||
* Displays the mime-type and the body of a single {@link TextAsset}. Maintains
|
||||
* a form or uploading files into the text body of the asset, and a form for
|
||||
|
|
@ -92,19 +90,18 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
private static Logger s_log =
|
||||
Logger.getLogger(TextAssetBody.class);
|
||||
|
||||
private ItemSelectionModel m_assetModel;
|
||||
|
||||
public static final String FILE_UPLOAD = "file";
|
||||
public static final String TEXT_ENTRY = "text";
|
||||
|
||||
private StringParameter m_streamlinedCreationParam;
|
||||
private static final String STREAMLINED = "_streamlined";
|
||||
private static final String STREAMLINED_DONE = "1";
|
||||
|
||||
private static final CMSConfig s_config = new CMSConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initializer is starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initializer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -116,6 +113,7 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
public TextAssetBody(ItemSelectionModel assetModel) {
|
||||
this(assetModel, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new GenericArticleBody component
|
||||
*
|
||||
|
|
@ -125,13 +123,14 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
* may use the wizard's methods, such as stepForward and stepBack,
|
||||
* in its process listener.
|
||||
*/
|
||||
public TextAssetBody(ItemSelectionModel assetModel, AuthoringKitWizard parent) {
|
||||
public TextAssetBody(ItemSelectionModel assetModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super();
|
||||
m_assetModel = assetModel;
|
||||
|
||||
m_streamlinedCreationParam =
|
||||
new StringParameter(parent == null ? "item" :
|
||||
parent.getContentType().getAssociatedObjectType() + "_body_done");
|
||||
new StringParameter(parent == null ? "item" : parent.getContentType().
|
||||
getAssociatedObjectType() + "_body_done");
|
||||
|
||||
if (!s_config.getHideTextAssetUploadFile()) {
|
||||
PageFileForm f = getPageFileForm();
|
||||
|
|
@ -149,7 +148,8 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
DomainObjectPropertySheet sheet = getBodyPropertySheet(assetModel);
|
||||
sheet.add("Text Type:",
|
||||
Asset.MIME_TYPE + "." + MimeType.LABEL);
|
||||
sheet.add((String) GlobalizationUtil.globalize("cms.ui.authoring.body").localize(), TextAsset.CONTENT);
|
||||
sheet.add((String) GlobalizationUtil.globalize("cms.ui.authoring.body").
|
||||
localize(), TextAsset.CONTENT);
|
||||
|
||||
setDisplayComponent(sheet);
|
||||
|
||||
|
|
@ -157,7 +157,8 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
}
|
||||
|
||||
protected DomainObjectPropertySheet getBodyPropertySheet(ItemSelectionModel assetModel) {
|
||||
protected DomainObjectPropertySheet getBodyPropertySheet(
|
||||
ItemSelectionModel assetModel) {
|
||||
return new TextAssetBodyPropertySheet(assetModel);
|
||||
}
|
||||
|
||||
|
|
@ -238,8 +239,8 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
* @param state the PageState
|
||||
*/
|
||||
protected void maybeForwardToNextStep(PageState state) {
|
||||
if (ContentItemPage.isStreamlinedCreationActive(state) &&
|
||||
!STREAMLINED_DONE.equals(state.getValue(m_streamlinedCreationParam))) {
|
||||
if (ContentItemPage.isStreamlinedCreationActive(state) && !STREAMLINED_DONE.
|
||||
equals(state.getValue(m_streamlinedCreationParam))) {
|
||||
state.setValue(m_streamlinedCreationParam, STREAMLINED_DONE);
|
||||
fireCompletionEvent(state);
|
||||
}
|
||||
|
|
@ -270,8 +271,8 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
//if (getTextAsset(state) != null) {
|
||||
// ComponentAccess ca = (ComponentAccess) getAccessMap().get(TEXT_ENTRY);
|
||||
|
||||
if (ContentItemPage.isStreamlinedCreationActive(state) &&
|
||||
!STREAMLINED_DONE.equals(state.getValue(m_streamlinedCreationParam))) {
|
||||
if (ContentItemPage.isStreamlinedCreationActive(state) && !STREAMLINED_DONE.
|
||||
equals(state.getValue(m_streamlinedCreationParam))) {
|
||||
showComponent(state, TEXT_ENTRY);
|
||||
}
|
||||
//}
|
||||
|
|
@ -298,7 +299,6 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
// Variables saved by validate for processing
|
||||
private RequestLocal m_file_upload_content;
|
||||
private RequestLocal m_file_upload_usedINSO;
|
||||
|
||||
/**
|
||||
* The text entry widget
|
||||
*/
|
||||
|
|
@ -323,14 +323,12 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
private void validateFileType(MimeType mime, boolean textType)
|
||||
throws FormProcessException {
|
||||
|
||||
boolean validType = textType || (
|
||||
(mime instanceof TextMimeType) &&
|
||||
((TextMimeType)mime).allowINSOConvert().booleanValue()
|
||||
);
|
||||
boolean validType = textType || ((mime instanceof TextMimeType) && ((TextMimeType) mime).
|
||||
allowINSOConvert().booleanValue());
|
||||
|
||||
if (!validType) {
|
||||
throw new FormProcessException("Cannot load " +
|
||||
"files of type " + mime.getMimeType() + " into the article body.");
|
||||
throw new FormProcessException("Cannot load " + "files of type " + mime.
|
||||
getMimeType() + " into the article body.");
|
||||
}
|
||||
|
||||
boolean insoWorks = MimeTypeStatus.getMimeTypeStatus().
|
||||
|
|
@ -338,12 +336,12 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
if (!textType && !insoWorks) {
|
||||
// Can't convert. inso filter is not working. Give message.
|
||||
throw new FormProcessException("Could not convert to html " +
|
||||
"format because interMedia INSO filter is not installed.");
|
||||
throw new FormProcessException(
|
||||
"Could not convert to html "
|
||||
+ "format because interMedia INSO filter is not installed.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* read in the content of the file (in bytes).
|
||||
*/
|
||||
|
|
@ -355,12 +353,13 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
fs.read(file_bytes);
|
||||
fs.close();
|
||||
} catch (Exception e) {
|
||||
throw new FormProcessException( (String) GlobalizationUtil.globalize("cms.ui.authoring.unable_to_load_file").localize() + e.getMessage());
|
||||
throw new FormProcessException((String) GlobalizationUtil.
|
||||
globalize("cms.ui.authoring.unable_to_load_file").
|
||||
localize() + e.getMessage());
|
||||
}
|
||||
return file_bytes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert bytes to String, possibly using INSO filter to convert to
|
||||
* HTML type
|
||||
|
|
@ -376,23 +375,25 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
// Converted successfully, flag type should be html
|
||||
used_inso[0] = true;
|
||||
} else {
|
||||
throw new FormProcessException("Could not convert to html format. " +
|
||||
"interMedia INSO filter conversion failed.");
|
||||
throw new FormProcessException(
|
||||
"Could not convert to html format. "
|
||||
+ "interMedia INSO filter conversion failed.");
|
||||
}
|
||||
} else {
|
||||
// Text type, no need to convert
|
||||
String enc = Globalization.getDefaultCharset(Kernel.getContext().getLocale());
|
||||
String enc = Globalization.getDefaultCharset(Kernel.getContext().
|
||||
getLocale());
|
||||
try {
|
||||
file_content = new String(file_bytes, enc);
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
throw new UncheckedWrapperException("cannot convert to encoding " + enc, ex);
|
||||
throw new UncheckedWrapperException("cannot convert to encoding "
|
||||
+ enc, ex);
|
||||
}
|
||||
used_inso[0] = false;
|
||||
}
|
||||
return file_content;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extract the contents of the html Body tag.
|
||||
* (Done to prevent base and other header tags
|
||||
|
|
@ -405,7 +406,8 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
int bodyStart_v = lc.indexOf(">", bodyStart);
|
||||
int bodyEnd = lc.indexOf("</body>", bodyStart_v);
|
||||
if (bodyStart == -1 || bodyEnd == -1) {
|
||||
final String errMsg = "The file (which should be type "
|
||||
final String errMsg =
|
||||
"The file (which should be type "
|
||||
+ "HTML) is missing the <body> or </body> tag.";
|
||||
throw new FormProcessException(errMsg);
|
||||
}
|
||||
|
|
@ -428,15 +430,15 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
boolean[] used_inso = new boolean[1];
|
||||
String file_content = convertBytes(file_bytes, textType, used_inso);
|
||||
|
||||
if (TextMimeType.MIME_TEXT_HTML.equals(mime.getMimeType()))
|
||||
if (TextMimeType.MIME_TEXT_HTML.equals(mime.getMimeType())) {
|
||||
file_content = extractHTMLBody(file_content);
|
||||
}
|
||||
|
||||
PageState state = e.getPageState();
|
||||
m_file_upload_content.set(state, file_content);
|
||||
m_file_upload_usedINSO.set(state, new Boolean(used_inso[0]));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process file upload. Must be validated first.
|
||||
*/
|
||||
|
|
@ -449,13 +451,14 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
// Get info created during validation
|
||||
String upload_content = (String) m_file_upload_content.get(state);
|
||||
boolean usedINSO = ((Boolean) m_file_upload_usedINSO.get(state))
|
||||
.booleanValue();
|
||||
boolean usedINSO = ((Boolean) m_file_upload_usedINSO.get(state)).
|
||||
booleanValue();
|
||||
|
||||
// Set the mime type
|
||||
MimeType mime = m_fileUploadSection.getMimeType(e);
|
||||
if (usedINSO)
|
||||
if (usedINSO) {
|
||||
mime = MimeType.loadMimeType("text/html");
|
||||
}
|
||||
if (mime != null) {
|
||||
t.setMimeType(mime);
|
||||
}
|
||||
|
|
@ -469,7 +472,9 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
// Save everything
|
||||
updateTextAsset(state, t);
|
||||
if(t.isNew() || t.isModified()) t.save();
|
||||
if (t.isNew() || t.isModified()) {
|
||||
t.save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -486,24 +491,23 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
public FileUploadSection getFileUploadSection() {
|
||||
return m_fileUploadSection;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A form for editing the body of the text.
|
||||
*/
|
||||
public class PageTextForm extends Form
|
||||
implements FormInitListener, FormProcessListener, FormSubmissionListener {
|
||||
implements FormInitListener, FormProcessListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private SingleSelect m_mimeWidget;
|
||||
private Label m_mimeLabel;
|
||||
private TextArea m_textWidget;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
|
||||
/**
|
||||
* The text entry widget
|
||||
*/
|
||||
public static final String TEXT_ENTRY = "text_entry";
|
||||
|
||||
/**
|
||||
* The mime type widget
|
||||
*/
|
||||
|
|
@ -523,7 +527,6 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
}
|
||||
|
||||
// These are here so that TemplateBody can set them.
|
||||
|
||||
public final void setMimeWidget(final SingleSelect widget) {
|
||||
m_mimeWidget = widget;
|
||||
}
|
||||
|
|
@ -556,8 +559,8 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
/** Cancels streamlined editing. */
|
||||
public void submitted(FormSectionEvent e) {
|
||||
if (getSaveCancelSection().getCancelButton()
|
||||
.isSelected( e.getPageState())) {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(e.
|
||||
getPageState())) {
|
||||
TextAssetBody.this.cancelStreamlinedCreation(e.getPageState());
|
||||
}
|
||||
}
|
||||
|
|
@ -576,13 +579,17 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
// Get the string and normalize it
|
||||
String text = (String) data.get(TEXT_ENTRY);
|
||||
|
||||
if(text == null) text = "";
|
||||
if (text == null) {
|
||||
text = "";
|
||||
}
|
||||
|
||||
|
||||
t.setText((String) data.get(TEXT_ENTRY));
|
||||
// Save everything
|
||||
updateTextAsset(state, t);
|
||||
if(t.isNew() || t.isModified()) t.save();
|
||||
if (t.isNew() || t.isModified()) {
|
||||
t.save();
|
||||
}
|
||||
|
||||
TextAssetBody.this.maybeForwardToNextStep(e.getPageState());
|
||||
}
|
||||
|
|
@ -593,7 +600,6 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
public SaveCancelSection getSaveCancelSection() {
|
||||
return m_saveCancelSection;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected String getDefaultMimeType() {
|
||||
|
|
@ -605,10 +611,11 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
|
||||
c.m_fileUploadSection =
|
||||
new FileUploadSection("Text Type:", "text", getDefaultMimeType());
|
||||
c.m_fileUploadSection.getFileUploadWidget()
|
||||
.addValidationListener(new NotNullValidationListener());
|
||||
c.m_fileUploadSection.getFileUploadWidget().addValidationListener(
|
||||
new NotNullValidationListener());
|
||||
// Default to -guess- because want to use file extension to determine type.
|
||||
c.m_fileUploadSection.getMimeTypeWidget().setDefaultValue(FileUploadSection.GUESS_MIME);
|
||||
c.m_fileUploadSection.getMimeTypeWidget().setDefaultValue(
|
||||
FileUploadSection.GUESS_MIME);
|
||||
c.add(c.m_fileUploadSection);
|
||||
|
||||
c.m_saveCancelSection = new SaveCancelSection();
|
||||
|
|
@ -637,13 +644,15 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
panel.setColumnWidth(2, "80%");
|
||||
panel.setWidth("100%");
|
||||
|
||||
c.add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.text_type")));
|
||||
c.add(new Label(
|
||||
GlobalizationUtil.globalize("cms.ui.authoring.text_type")));
|
||||
c.m_mimeWidget = new SingleSelect(PageTextForm.MIME_TYPE);
|
||||
c.m_mimeWidget.setClassAttr("displayOneOptionAsLabel");
|
||||
setMimeTypeOptions(c.m_mimeWidget);
|
||||
c.add(c.m_mimeWidget, ColumnPanel.LEFT);
|
||||
|
||||
c.add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.edit_body_text")),
|
||||
c.add(new Label(GlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.edit_body_text")),
|
||||
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
||||
|
||||
c.m_textWidget = new CMSDHTMLEditor(PageTextForm.TEXT_ENTRY);
|
||||
|
|
@ -663,7 +672,9 @@ public abstract class TextAssetBody extends SecurityPropertyEditor
|
|||
// optionally, we clear the text of MSWord tags every time
|
||||
// the text is submitted/saved
|
||||
if (ContentSection.getConfig().getSaveTextCleansWordTags()) {
|
||||
c.m_saveCancelSection.getSaveButton().setOnClick("wordClean_"+PageTextForm.TEXT_ENTRY+"();");
|
||||
c.m_saveCancelSection.getSaveButton().setOnClick("wordClean_"
|
||||
+ PageTextForm.TEXT_ENTRY
|
||||
+ "();");
|
||||
}
|
||||
|
||||
c.addInitListener(c);
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ public class FolderBrowser extends Table {
|
|||
Assert.exists( m_currentFolder.getStateParameter() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
|
||||
|
|
@ -217,6 +218,7 @@ public class FolderBrowser extends Table {
|
|||
m_deleteColumn.setVisible(state, canDelete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void respond(PageState state) throws ServletException {
|
||||
String key = state.getControlEventName();
|
||||
String value = state.getControlEventValue();
|
||||
|
|
@ -407,6 +409,7 @@ public class FolderBrowser extends Table {
|
|||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
boolean isSelected, Object key,
|
||||
int row, int column) {
|
||||
|
|
@ -438,12 +441,15 @@ public class FolderBrowser extends Table {
|
|||
private static class ActionCellRenderer implements TableCellRenderer {
|
||||
private static Label s_noAction;
|
||||
private static ControlLink s_link;
|
||||
private static final Logger logger = Logger.getLogger(ActionCellRenderer.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_noAction = new Label(" ", false);
|
||||
s_noAction.lock();
|
||||
s_link = new ControlLink(new Label(globalize("cms.ui.folder.delete")));
|
||||
s_link.setConfirmation("Permanently delete this item?"); // XXX G11N ?
|
||||
logger.debug("Static initializer finished.");
|
||||
}
|
||||
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import com.arsdigita.toolbox.ui.DataTable;
|
|||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -115,17 +116,20 @@ public class ItemLanguagesTable extends DataTable {
|
|||
* Delete language instance action link.
|
||||
*/
|
||||
private static class ActionCellRenderer implements TableCellRenderer {
|
||||
private static final Logger logger = Logger.getLogger(ActionCellRenderer.class);
|
||||
private static Label s_noAction;
|
||||
private static Label s_primary;
|
||||
private static ControlLink s_link;
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_noAction = new Label(" ", false);
|
||||
s_noAction.lock();
|
||||
s_primary = new Label(GlobalizationUtil.globalize("cms.ui.primary_instance"), false);
|
||||
s_primary.lock();
|
||||
s_link = new ControlLink(new Label(GlobalizationUtil.globalize("cms.ui.delete")));
|
||||
s_link.setConfirmation("Permanently delete this item?"); // XXX G11N ?
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private ItemSelectionModel m_model;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ import com.arsdigita.domain.DomainObjectFactory;
|
|||
import com.arsdigita.toolbox.ui.DataTable;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -171,10 +172,13 @@ public abstract class ItemTemplatesListing extends TemplatesListing {
|
|||
|
||||
// Static is safe since these components will never ever change
|
||||
private static ControlLink s_link;
|
||||
private static final Logger logger = Logger.getLogger(AssignCellRenderer.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_link = new ControlLink(new Label(GlobalizationUtil.globalize("cms.ui.templates.assign_template")));
|
||||
s_link.setClassAttr("assignTemplateLink");
|
||||
logger.debug("Static initializer finished.");
|
||||
}
|
||||
|
||||
public AssignCellRenderer() {}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.cms.ui.type;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.BoxPanel;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
|
|
@ -45,7 +44,6 @@ import org.apache.log4j.Logger;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Iterator;
|
||||
|
||||
|
||||
/**
|
||||
* This class contains the component to generate a table
|
||||
* of elements for a particular content type
|
||||
|
|
@ -54,7 +52,6 @@ public class TypeElements extends BoxPanel {
|
|||
|
||||
private static Logger s_log =
|
||||
Logger.getLogger(TypeElements.class);
|
||||
|
||||
private SingleSelectionModel m_types;
|
||||
private Table m_elementsTable;
|
||||
private TableColumn m_removeColumn;
|
||||
|
|
@ -91,7 +88,9 @@ public class TypeElements extends BoxPanel {
|
|||
try {
|
||||
type = new ContentType(typeId);
|
||||
} catch (DataObjectNotFoundException e) {
|
||||
UncheckedWrapperException.throwLoggedException(getClass(), "Unable to make content type for id: " + typeId, e);
|
||||
UncheckedWrapperException.throwLoggedException(getClass(), "Unable to make content type for id: "
|
||||
+ typeId,
|
||||
e);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
|
@ -100,14 +99,19 @@ public class TypeElements extends BoxPanel {
|
|||
* Produce remove links.
|
||||
*/
|
||||
private static class RemoveCellRenderer implements TableCellRenderer {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RemoveCellRenderer.class);
|
||||
private static Label s_noAction;
|
||||
private static ControlLink s_link;
|
||||
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_noAction = new Label(" ", false);
|
||||
s_noAction.lock();
|
||||
s_link = new ControlLink(new Label(GlobalizationUtil.globalize("cms.ui.type.element.delete")));
|
||||
s_link = new ControlLink(new Label(GlobalizationUtil.globalize(
|
||||
"cms.ui.type.element.delete")));
|
||||
s_link.setConfirmation("Permanently remove this element?");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
|
|
@ -123,6 +127,7 @@ public class TypeElements extends BoxPanel {
|
|||
|
||||
// Removes an element
|
||||
private class ElementRemover extends TableActionAdapter {
|
||||
|
||||
public void cellSelected(TableActionEvent e) {
|
||||
int col = e.getColumn().intValue();
|
||||
|
||||
|
|
@ -154,9 +159,11 @@ public class TypeElements extends BoxPanel {
|
|||
*/
|
||||
private Table makeElementsTable() {
|
||||
|
||||
final String[] headers = { "Name", "Element Type", "Multiplicity", "Remove" };
|
||||
final String[] headers = {"Name", "Element Type", "Multiplicity",
|
||||
"Remove"};
|
||||
|
||||
TableModelBuilder b = new TableModelBuilder() {
|
||||
|
||||
private boolean m_locked;
|
||||
|
||||
public TableModel makeModel(final Table t, final PageState s) {
|
||||
|
|
@ -164,11 +171,10 @@ public class TypeElements extends BoxPanel {
|
|||
return new TableModel() {
|
||||
|
||||
DynamicObjectType dot = getDynamicObjectType(s);
|
||||
|
||||
//NOTE: this only gets the non-inherited properties of
|
||||
// the object type
|
||||
|
||||
Iterator declaredProperties = dot.getObjectType().getDeclaredProperties();
|
||||
Iterator declaredProperties = dot.getObjectType().
|
||||
getDeclaredProperties();
|
||||
Property currentProperty = null;
|
||||
|
||||
public int getColumnCount() {
|
||||
|
|
@ -178,7 +184,8 @@ public class TypeElements extends BoxPanel {
|
|||
public boolean nextRow() {
|
||||
boolean next = declaredProperties.hasNext();
|
||||
if (next) {
|
||||
currentProperty = (Property) declaredProperties.next();
|
||||
currentProperty =
|
||||
(Property) declaredProperties.next();
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
|
@ -192,7 +199,8 @@ public class TypeElements extends BoxPanel {
|
|||
case 0:
|
||||
return currentProperty.getName();
|
||||
case 1:
|
||||
String dataType = currentProperty.getType().getName();
|
||||
String dataType = currentProperty.getType().
|
||||
getName();
|
||||
if (dataType.equals("String")) {
|
||||
return "text";
|
||||
} else if (dataType.equals("BigDecimal")) {
|
||||
|
|
@ -210,13 +218,15 @@ public class TypeElements extends BoxPanel {
|
|||
} else if (currentProperty.isCollection()) {
|
||||
return "0 to n";
|
||||
} else {
|
||||
return new Integer(currentProperty.getMultiplicity());
|
||||
return new Integer(currentProperty.
|
||||
getMultiplicity());
|
||||
}
|
||||
case 3:
|
||||
return new Boolean(isRemovable());
|
||||
default:
|
||||
throw new IllegalArgumentException("columnIndex exceeds " +
|
||||
"number of columns available");
|
||||
throw new IllegalArgumentException(
|
||||
"columnIndex exceeds "
|
||||
+ "number of columns available");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -232,7 +242,6 @@ public class TypeElements extends BoxPanel {
|
|||
private boolean isRemovable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -244,7 +253,6 @@ public class TypeElements extends BoxPanel {
|
|||
public boolean isLocked() {
|
||||
return m_locked;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Table result = new Table(b, headers);
|
||||
|
|
@ -256,5 +264,4 @@ public class TypeElements extends BoxPanel {
|
|||
return result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,10 +109,12 @@ public class Page extends BlockStylable implements Container {
|
|||
static final Collection CONTROL_EVENT_KEYS;
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer is starting...");
|
||||
CONTROL_EVENT_KEYS = new ArrayList(3);
|
||||
CONTROL_EVENT_KEYS.add(SELECTED);
|
||||
CONTROL_EVENT_KEYS.add(CONTROL_EVENT);
|
||||
CONTROL_EVENT_KEYS.add(CONTROL_VALUE);
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.list.ListModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.NoSuchElementException;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A class that provides a sample set of workflows and tasks. The class
|
||||
|
|
@ -37,6 +38,7 @@ import java.util.NoSuchElementException;
|
|||
*/
|
||||
public class SampleProcesses {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SampleProcesses.class);
|
||||
private static SampleProcesses m_instance;
|
||||
|
||||
/**
|
||||
|
|
@ -51,6 +53,7 @@ public class SampleProcesses {
|
|||
|
||||
// Set up some default task types
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Task write = new Task("Write");
|
||||
write.setAssignee("Authors");
|
||||
Task edit = new Task("Edit");
|
||||
|
|
@ -68,6 +71,7 @@ public class SampleProcesses {
|
|||
m_allTasks.add(approve);
|
||||
m_allTasks.add(publish);
|
||||
m_allTasks.add(review);
|
||||
logger.debug("Static initalizer finished...");
|
||||
}
|
||||
|
||||
public synchronized static SampleProcesses getInstance() {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ public class PageTransformer implements PresentationManager {
|
|||
|
||||
// load the default xsl parameter generators
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
registerXSLParameterGenerator("contextPath",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
|
|
@ -167,6 +168,7 @@ public class PageTransformer implements PresentationManager {
|
|||
return DispatcherHelper.getNegotiatedLocale().getLanguage();
|
||||
}
|
||||
});
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
// XXX These need to move somewhere else.
|
||||
/**
|
||||
|
|
@ -229,7 +231,8 @@ public class PageTransformer implements PresentationManager {
|
|||
s_log.warn("Using getOutputStream instead of getWriter");
|
||||
|
||||
try {
|
||||
return new PrintWriter(new OutputStreamWriter(resp.getOutputStream(),
|
||||
return new PrintWriter(new OutputStreamWriter(resp.
|
||||
getOutputStream(),
|
||||
charset));
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedWrapperException(ex);
|
||||
|
|
@ -280,7 +283,8 @@ public class PageTransformer implements PresentationManager {
|
|||
|
||||
Profiler.startOp("XSLT");
|
||||
try {
|
||||
final String charset = Globalization.getDefaultCharset(Kernel.getContext().getLocale());
|
||||
final String charset = Globalization.getDefaultCharset(Kernel.
|
||||
getContext().getLocale());
|
||||
|
||||
final String output = req.getParameter("output");
|
||||
s_log.info("output=" + output);
|
||||
|
|
@ -289,12 +293,14 @@ public class PageTransformer implements PresentationManager {
|
|||
DeveloperSupport.startStage("PresMgr get stylesheet");
|
||||
|
||||
boolean fancyErrors = Bebop.getConfig().wantFancyXSLErrors()
|
||||
|| Boolean.TRUE.equals(req.getAttribute(FANCY_ERRORS));
|
||||
|| Boolean.TRUE.equals(req.getAttribute(
|
||||
FANCY_ERRORS));
|
||||
|
||||
// Get the stylesheet transformer object corresponding to the
|
||||
// current request.
|
||||
final XSLTemplate template = Templating.getTemplate(req,
|
||||
fancyErrors, !Boolean.TRUE.equals(req.getAttribute(CACHE_XSL_NONE)));
|
||||
fancyErrors, !Boolean.TRUE.
|
||||
equals(req.getAttribute(CACHE_XSL_NONE)));
|
||||
|
||||
DeveloperSupport.endStage("PresMgr get stylesheet");
|
||||
|
||||
|
|
@ -322,7 +328,8 @@ public class PageTransformer implements PresentationManager {
|
|||
while (entries.hasNext()) {
|
||||
final Map.Entry entry = (Map.Entry) entries.next();
|
||||
|
||||
xf.setParameter((String) entry.getKey(), entry.getValue());
|
||||
xf.setParameter((String) entry.getKey(),
|
||||
entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,8 +358,10 @@ public class PageTransformer implements PresentationManager {
|
|||
|
||||
// copy and paste from BasePresentationManager
|
||||
if (Kernel.getConfig().isDebugEnabled()) {
|
||||
Document origDoc = (Document) req.getAttribute("com.arsdigita.xml.Document");
|
||||
Debugger.addDebugger(new TransformationDebugger(template.getSource(), template.getDependents()));
|
||||
Document origDoc = (Document) req.getAttribute(
|
||||
"com.arsdigita.xml.Document");
|
||||
Debugger.addDebugger(new TransformationDebugger(template.
|
||||
getSource(), template.getDependents()));
|
||||
writer.print(Debugger.getDebugging(req));
|
||||
}
|
||||
|
||||
|
|
@ -374,8 +383,10 @@ public class PageTransformer implements PresentationManager {
|
|||
// current request.
|
||||
template = Templating.getTemplate(
|
||||
req,
|
||||
Boolean.TRUE.equals(req.getAttribute(PageTransformer.FANCY_ERRORS)),
|
||||
!Boolean.TRUE.equals(req.getAttribute(PageTransformer.CACHE_XSL_NONE)));
|
||||
Boolean.TRUE.equals(req.getAttribute(
|
||||
PageTransformer.FANCY_ERRORS)),
|
||||
!Boolean.TRUE.equals(req.getAttribute(
|
||||
PageTransformer.CACHE_XSL_NONE)));
|
||||
endTransaction(req);
|
||||
} finally {
|
||||
DeveloperSupport.endStage("PresMgr get stylesheet");
|
||||
|
|
@ -481,7 +492,8 @@ public class PageTransformer implements PresentationManager {
|
|||
while (entries.hasNext()) {
|
||||
final Map.Entry entry = (Map.Entry) entries.next();
|
||||
|
||||
String value = ((XSLParameterGenerator) entry.getValue()).generateValue(request);
|
||||
String value = ((XSLParameterGenerator) entry.getValue()).
|
||||
generateValue(request);
|
||||
if (value == null) {
|
||||
// XSL does not like nulls
|
||||
value = "";
|
||||
|
|
|
|||
|
|
@ -123,7 +123,9 @@ public class Category extends ACSObject {
|
|||
private static CategorizationConfig s_config = new CategorizationConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
// Quasimodo: End
|
||||
public static final String ROOT_CATEGORY = "rootCategory";
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.arsdigita.util.Assert;
|
|||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* LibCheck uses the checklist mechanism to perform additional checks for
|
||||
|
|
@ -37,14 +38,16 @@ import java.io.InputStreamReader;
|
|||
|
||||
public class LibCheck extends BaseCheck {
|
||||
|
||||
|
||||
private static final Logger logger = Logger.getLogger(LibCheck.class);
|
||||
// Integrating the packaging.MessageMap service class providing a
|
||||
// package specific message file by overriding the variable in BaseCheck.
|
||||
static {
|
||||
logger.debug("Static initializer starting...");
|
||||
final InputStream in = LibCheck.class.getResourceAsStream
|
||||
("libcheck.messages_linux");
|
||||
Assert.exists(in, InputStream.class);
|
||||
s_messages.load(new InputStreamReader(in));
|
||||
logger.debug("Static initializer finished...");
|
||||
}
|
||||
|
||||
private boolean checkJAAS() {
|
||||
|
|
|
|||
|
|
@ -155,9 +155,11 @@ public final class Comodifications {
|
|||
* the Proxy class do most of the work for me.
|
||||
*/
|
||||
private static class ListHandler implements InvocationHandler {
|
||||
private static final Logger logger = Logger.getLogger(ListHandler.class);
|
||||
private final static Set s_mutators = new HashSet();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
registerMutator("add", new Class[] {Integer.TYPE, Object.class});
|
||||
registerMutator("add", new Class[] {Object.class});
|
||||
registerMutator("addAll", new Class[] {Collection.class});
|
||||
|
|
@ -169,6 +171,7 @@ public final class Comodifications {
|
|||
registerMutator("removeAll", new Class[] {Collection.class});
|
||||
registerMutator("retainAll", new Class[] {Collection.class});
|
||||
registerMutator("set", new Class[] {Integer.TYPE, Object.class});
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private final static Method s_iteratorMethod =
|
||||
|
|
|
|||
|
|
@ -62,8 +62,10 @@ public final class Counter {
|
|||
|
||||
private final static DecimalFormat DURATION_FMT = new DecimalFormat();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
DURATION_FMT.setGroupingSize(3);
|
||||
DURATION_FMT.setGroupingUsed(true);
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -224,16 +224,20 @@ public final class LoggingProxyFactory implements LoggerConfigurator {
|
|||
}
|
||||
|
||||
private static class Handler implements InvocationHandler {
|
||||
private static final Logger logger = Logger.getLogger(Handler.class);
|
||||
private static final Method s_getProxiedObject;
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
try {
|
||||
s_getProxiedObject =
|
||||
LoggingProxy.class.getMethod("getProxiedObject",
|
||||
new Class[] {});
|
||||
} catch (NoSuchMethodException ex) {
|
||||
logger.error("Statis initalizer failed: ", ex);
|
||||
throw new UncheckedWrapperException("failed", ex);
|
||||
}
|
||||
logger.debug("Static initalizer finished...");
|
||||
}
|
||||
|
||||
private Config m_config;
|
||||
|
|
|
|||
|
|
@ -83,33 +83,31 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
public abstract class BaseDispatcherServlet extends HttpServlet
|
||||
implements Dispatcher, DispatcherConstants {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger
|
||||
(BaseDispatcherServlet.class);
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
BaseDispatcherServlet.class);
|
||||
private final static int NOT_FOUND = 0;
|
||||
private final static int STATIC_FILE = 1;
|
||||
private final static int JSP_FILE = 2;
|
||||
|
||||
private final static String WEB_XML_22_PUBLIC_ID =
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
|
||||
private final static String WEB_XML_23_PUBLIC_ID =
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
|
||||
|
||||
/**
|
||||
* We use a Vector here instead of another collection because
|
||||
* Vector is synchronized.
|
||||
*/
|
||||
private static Vector s_listenerList = new Vector();
|
||||
|
||||
/**
|
||||
* list of active requests
|
||||
*/
|
||||
private static Vector s_activeList = new Vector();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
// Add the basic request listeners.
|
||||
|
||||
BaseDispatcherServlet.addRequestListener(new RequestListener() {
|
||||
|
||||
public void requestStarted(RequestEvent re) {
|
||||
DispatcherHelper.setRequest(re.getRequest());
|
||||
}
|
||||
|
|
@ -127,6 +125,7 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
});
|
||||
|
||||
BaseDispatcherServlet.addRequestListener(new RequestListener() {
|
||||
|
||||
public void requestStarted(RequestEvent re) {
|
||||
Kernel.getContext().getTransaction().begin();
|
||||
}
|
||||
|
|
@ -153,8 +152,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
* it depends upon there being at least one DeveloperSupportListener when counting
|
||||
* whether to log queries to webdevsupport.
|
||||
*/
|
||||
com.arsdigita.developersupport.DeveloperSupport.addListener
|
||||
(new com.arsdigita.developersupport.DeveloperSupportListener() {
|
||||
com.arsdigita.developersupport.DeveloperSupport.addListener(new com.arsdigita.developersupport.DeveloperSupportListener() {
|
||||
|
||||
public void requestStart(Object request) {
|
||||
s_log.debug("DS: requestStart: " + request);
|
||||
}
|
||||
|
|
@ -162,10 +161,9 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
public void requestEnd(Object request) {
|
||||
s_log.debug("DS: requestEnd: " + request);
|
||||
}
|
||||
});
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private List m_welcomeFiles = new ArrayList();
|
||||
|
||||
/**
|
||||
|
|
@ -220,8 +218,7 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
* @throws com.arsdigita.dispatcher.RedirectException if the dispatcher
|
||||
* should redirect the client to the page contained in the exception
|
||||
**/
|
||||
protected abstract RequestContext authenticateUser
|
||||
(HttpServletRequest req,
|
||||
protected abstract RequestContext authenticateUser(HttpServletRequest req,
|
||||
HttpServletResponse resp,
|
||||
RequestContext ctx)
|
||||
throws RedirectException;
|
||||
|
|
@ -246,10 +243,9 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
throws ServletException, IOException {
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug
|
||||
("\n*** *** *** *** *** ***\n" +
|
||||
"Servicing request for URL '" + req.getRequestURI() + "'\n" +
|
||||
"*** *** *** *** *** ***");
|
||||
s_log.debug("\n*** *** *** *** *** ***\n"
|
||||
+ "Servicing request for URL '" + req.getRequestURI()
|
||||
+ "'\n" + "*** *** *** *** *** ***");
|
||||
}
|
||||
|
||||
boolean reentrant = true;
|
||||
|
|
@ -307,8 +303,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
|
||||
// need an identifier for this particular request
|
||||
String requestId =
|
||||
Thread.currentThread().getName() + "|" +
|
||||
System.currentTimeMillis();
|
||||
Thread.currentThread().getName() + "|" + System.
|
||||
currentTimeMillis();
|
||||
req.setAttribute(REENTRANCE_ATTRIBUTE, requestId);
|
||||
s_activeList.add(requestId);
|
||||
|
||||
|
|
@ -345,8 +341,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
// whole object since it might actually be a
|
||||
// KernelRequestContext with user / session info
|
||||
if (reqCtx instanceof InitialRequestContext) {
|
||||
((InitialRequestContext)reqCtx)
|
||||
.initializeURLFromRequest(req, true);
|
||||
((InitialRequestContext) reqCtx).
|
||||
initializeURLFromRequest(req, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -411,7 +407,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
DeveloperSupport.endStage("BaseDispatcherServlet.service()");
|
||||
// run the request listener events
|
||||
fireFinishedListener(
|
||||
new RequestEvent(req, resp, reqCtx, false, finishedNormal));
|
||||
new RequestEvent(req, resp, reqCtx, false,
|
||||
finishedNormal));
|
||||
// at this point, clear the attribute so
|
||||
// a secondary request will work
|
||||
// and remove the request from the list of currently-active
|
||||
|
|
@ -473,8 +470,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
try {
|
||||
((RequestListener) s_listenerList.get(i)).requestFinished(evt);
|
||||
} catch (Exception e) {
|
||||
s_log.error("Error running request finished listener " +
|
||||
s_listenerList.get(i) + " (#" + i + ")", e);
|
||||
s_log.error("Error running request finished listener " + s_listenerList.
|
||||
get(i) + " (#" + i + ")", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -496,6 +493,7 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
* Kludge for returning a typed 2-tuple.
|
||||
*/
|
||||
private class StartRequestRecord {
|
||||
|
||||
RequestContext m_reqCtx;
|
||||
HttpServletRequest m_req;
|
||||
|
||||
|
|
@ -520,7 +518,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
synchronized (s_activeList) {
|
||||
s_activeList.wait();
|
||||
}
|
||||
} catch (InterruptedException ie) { }
|
||||
} catch (InterruptedException ie) {
|
||||
}
|
||||
}
|
||||
sess.removeAttribute(REDIRECT_SEMAPHORE);
|
||||
}
|
||||
|
|
@ -552,8 +551,8 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
|
||||
ServletContext sctx = this.getServletContext();
|
||||
File realFile = new File(sctx.getRealPath(path));
|
||||
if (realFile.exists() &&
|
||||
(!realFile.isDirectory() || hasWelcomeFile(realFile))) {
|
||||
if (realFile.exists() && (!realFile.isDirectory() || hasWelcomeFile(
|
||||
realFile))) {
|
||||
// yup. Go there, bypass the site map.
|
||||
// we have a concrete file so no forwarding to
|
||||
// rewrite the request URL is necessary.
|
||||
|
|
@ -612,6 +611,7 @@ public abstract class BaseDispatcherServlet extends HttpServlet
|
|||
* web.xml
|
||||
*/
|
||||
private class WebXMLReader extends DefaultHandler {
|
||||
|
||||
StringBuffer m_buffer = new StringBuffer();
|
||||
|
||||
public InputSource resolveEntity(String publicId, String systemId)
|
||||
|
|
|
|||
|
|
@ -18,13 +18,12 @@
|
|||
*/
|
||||
package com.arsdigita.formbuilder;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.event.ParameterListener;
|
||||
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This class contains the attribute data type that are used for form
|
||||
|
|
@ -36,8 +35,8 @@ import java.util.List;
|
|||
*/
|
||||
public class AttributeType {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(AttributeType.class);
|
||||
private Class m_parameterModelClass;
|
||||
|
||||
private List m_validationListeners;
|
||||
|
||||
public AttributeType(Class parameterModelClass) {
|
||||
|
|
@ -46,14 +45,12 @@ public class AttributeType {
|
|||
|
||||
m_validationListeners = new java.util.ArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard attribute types
|
||||
*/
|
||||
public static AttributeType INTEGER;
|
||||
public static AttributeType TEXT;
|
||||
public static AttributeType DATE;
|
||||
|
||||
// The classes of the standard data types
|
||||
private static Class s_integerClass;
|
||||
private static Class s_textClass;
|
||||
|
|
@ -61,12 +58,15 @@ public class AttributeType {
|
|||
|
||||
// Initialization of the standard attribute types
|
||||
static {
|
||||
|
||||
logger.debug("Static initalizer starting...");
|
||||
try {
|
||||
|
||||
s_integerClass = Class.forName("com.arsdigita.bebop.parameters.IntegerParameter");
|
||||
s_textClass = Class.forName("com.arsdigita.bebop.parameters.StringParameter");
|
||||
s_dateClass = Class.forName("com.arsdigita.bebop.parameters.DateParameter");
|
||||
s_integerClass = Class.forName(
|
||||
"com.arsdigita.bebop.parameters.IntegerParameter");
|
||||
s_textClass = Class.forName(
|
||||
"com.arsdigita.bebop.parameters.StringParameter");
|
||||
s_dateClass = Class.forName(
|
||||
"com.arsdigita.bebop.parameters.DateParameter");
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new UncheckedWrapperException(e);
|
||||
|
|
@ -75,10 +75,10 @@ public class AttributeType {
|
|||
INTEGER = new AttributeType(s_integerClass);
|
||||
TEXT = new AttributeType(s_textClass);
|
||||
DATE = new AttributeType(s_dateClass);
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
//*** Attribute Methods
|
||||
|
||||
public Class getParameterModelClass() {
|
||||
return m_parameterModelClass;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@ public class Crypto {
|
|||
public static final String CHARACTER_ENCODING = "UTF-8";
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
s_log.debug("Static initalizer finished");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -48,8 +48,10 @@ public class URLLoginModule extends UserLoginModule {
|
|||
|
||||
private static Set s_models = new HashSet();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_models.add(NORMAL_PARAM);
|
||||
s_models.add(SECURE_PARAM);
|
||||
s_log.debug("Static initalizer finished...");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ public class ErrorReport {
|
|||
private static final Logger s_log = Logger.getLogger(ErrorReport.class);
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
final JavaPropertyReader reader = new JavaPropertyReader
|
||||
(System.getProperties());
|
||||
|
||||
|
|
@ -76,6 +77,7 @@ public class ErrorReport {
|
|||
if (dir != null) {
|
||||
ErrorReport.initializeAppender(dir);
|
||||
}
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static void initializeAppender(String directory) {
|
||||
|
|
|
|||
|
|
@ -69,9 +69,13 @@ import java.util.Set;
|
|||
* @author Ron Henderson
|
||||
* @version $Id: Mail.java 994 2005-11-14 14:29:25Z apevec $
|
||||
*/
|
||||
|
||||
public class Mail implements MessageType {
|
||||
|
||||
/**
|
||||
* Used for logging.
|
||||
*/
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(Mail.class);
|
||||
private static MailConfig s_config;
|
||||
|
||||
public static MailConfig getConfig() {
|
||||
|
|
@ -82,119 +86,93 @@ public class Mail implements MessageType {
|
|||
}
|
||||
return s_config;
|
||||
}
|
||||
|
||||
private static final InternetAddress[] EMPTY_ADDRESS_LIST =
|
||||
new InternetAddress[0];
|
||||
|
||||
/**
|
||||
* Table of message headers.
|
||||
*/
|
||||
private Hashtable m_headers;
|
||||
|
||||
/**
|
||||
* Email addresses the message is being sent to.
|
||||
*/
|
||||
private InternetAddress[] m_to;
|
||||
|
||||
private InternetAddress[] m_filteredTo = EMPTY_ADDRESS_LIST;
|
||||
private InternetAddress[] m_invalidTo = EMPTY_ADDRESS_LIST;
|
||||
private static Set s_invalidDomains = new HashSet();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_invalidDomains.add("example.com");
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address the message is being sent from.
|
||||
*/
|
||||
private InternetAddress m_from;
|
||||
|
||||
/**
|
||||
* Email address used for replies to this message.
|
||||
*/
|
||||
private InternetAddress[] m_replyTo;
|
||||
|
||||
/**
|
||||
* Email addresses that the message is being carbon-copied to.
|
||||
*/
|
||||
private InternetAddress[] m_cc;
|
||||
|
||||
/**
|
||||
* Email addresses that the message is being blind carbon-copied to.
|
||||
*/
|
||||
private InternetAddress[] m_bcc;
|
||||
|
||||
/**
|
||||
* Message subject.
|
||||
*/
|
||||
private String m_subject;
|
||||
|
||||
/**
|
||||
* Message body (can be text or HTML).
|
||||
*/
|
||||
private String m_body;
|
||||
|
||||
/**
|
||||
* Message body alternate (if the body is HTML)
|
||||
*/
|
||||
private String m_alternate;
|
||||
|
||||
/**
|
||||
* Encoding specification for m_body and m_alternate (optional).
|
||||
* Default value (null) implies "us-ascii" encoding.
|
||||
*/
|
||||
private String m_encoding;
|
||||
|
||||
/**
|
||||
* Message attachments (optional)
|
||||
*/
|
||||
private MimeMultipart m_attachments;
|
||||
|
||||
/**
|
||||
* Unique identifier for each mail send out.
|
||||
*/
|
||||
private String m_messageID;
|
||||
|
||||
/**
|
||||
* Session object used to send mail.
|
||||
*/
|
||||
private static Session s_session;
|
||||
|
||||
/**
|
||||
* SMTP host to connect to. Only used to override the default for
|
||||
* testing purposes.
|
||||
*/
|
||||
private static String s_host;
|
||||
|
||||
/**
|
||||
* SMTP port to connect to. Only used to override the default for
|
||||
* testing purposes.
|
||||
*/
|
||||
private static String s_port;
|
||||
|
||||
// Constants used by Mail
|
||||
|
||||
final static String CONTENT_TYPE = "Content-Type";
|
||||
final static String CONTENT_ID = "Content-ID";
|
||||
final static String MIXED = "mixed";
|
||||
final static String ALTERNATIVE = "alternative";
|
||||
|
||||
/**
|
||||
* Disposition of "inline"
|
||||
*/
|
||||
public final static String INLINE = javax.mail.Part.INLINE;
|
||||
|
||||
/**
|
||||
* Disposition of "attachment"
|
||||
*/
|
||||
public final static String ATTACHMENT = javax.mail.Part.ATTACHMENT;
|
||||
|
||||
/**
|
||||
* Used for logging.
|
||||
*/
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(Mail.class);
|
||||
|
||||
/**
|
||||
* Default constructor. Must use the setTo, setSubject (and so on)
|
||||
* methods to create a valid mail message.
|
||||
|
|
@ -212,8 +190,7 @@ public class Mail implements MessageType {
|
|||
*/
|
||||
public Mail(String to,
|
||||
String from,
|
||||
String subject)
|
||||
{
|
||||
String subject) {
|
||||
this(to, from, subject, null);
|
||||
}
|
||||
|
||||
|
|
@ -228,8 +205,7 @@ public class Mail implements MessageType {
|
|||
public Mail(String to,
|
||||
String from,
|
||||
String subject,
|
||||
String body)
|
||||
{
|
||||
String body) {
|
||||
m_to = (to == null ? EMPTY_ADDRESS_LIST : parseAddressField(to));
|
||||
filterRecipients();
|
||||
m_from = (from == null ? null : parseAddress(from));
|
||||
|
|
@ -251,8 +227,7 @@ public class Mail implements MessageType {
|
|||
String from,
|
||||
String subject,
|
||||
String body,
|
||||
String enc)
|
||||
{
|
||||
String enc) {
|
||||
this(to, from, subject, body);
|
||||
setEncoding(enc);
|
||||
}
|
||||
|
|
@ -265,14 +240,12 @@ public class Mail implements MessageType {
|
|||
* @param subject the subject for the message
|
||||
* @param body the plain text body of the message
|
||||
*/
|
||||
|
||||
public static void send(String to,
|
||||
String from,
|
||||
String subject,
|
||||
String body)
|
||||
throws MessagingException,
|
||||
SendFailedException
|
||||
{
|
||||
SendFailedException {
|
||||
Mail msg = new Mail(to, from, subject, body);
|
||||
msg.send();
|
||||
}
|
||||
|
|
@ -280,11 +253,9 @@ public class Mail implements MessageType {
|
|||
/**
|
||||
* Sends the message.
|
||||
*/
|
||||
|
||||
public void send()
|
||||
throws MessagingException,
|
||||
SendFailedException
|
||||
{
|
||||
SendFailedException {
|
||||
Transport transport = getSession().getTransport();
|
||||
transport.connect();
|
||||
send(transport);
|
||||
|
|
@ -300,11 +271,9 @@ public class Mail implements MessageType {
|
|||
* also such returned from the server. Applications might try
|
||||
* to catch this and re-schedule sending the mail.
|
||||
*/
|
||||
|
||||
void send(Transport transport)
|
||||
throws MessagingException,
|
||||
SendFailedException
|
||||
{
|
||||
SendFailedException {
|
||||
Message msg = null;
|
||||
if (m_filteredTo.length > 0) {
|
||||
msg = getMessage();
|
||||
|
|
@ -329,8 +298,8 @@ public class Mail implements MessageType {
|
|||
try {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
msg.writeTo(os);
|
||||
s_log.debug("message sent:\n" + os.toString() +
|
||||
"\n-- EOT --");
|
||||
s_log.debug("message sent:\n" + os.toString()
|
||||
+ "\n-- EOT --");
|
||||
} catch (IOException ex) {
|
||||
s_log.error("unable to log message");
|
||||
}
|
||||
|
|
@ -338,10 +307,10 @@ public class Mail implements MessageType {
|
|||
s_log.debug("no message sent. No valid recipients:\n");
|
||||
}
|
||||
} else {
|
||||
s_log.info("message sent to <" + Arrays.asList(m_filteredTo) + "> from <" + m_from +
|
||||
"> subject <" + m_subject + ">");
|
||||
s_log.info("messages filtered for <" + Arrays.asList(m_invalidTo) + "> from <" + m_from +
|
||||
"> subject <" + m_subject + ">");
|
||||
s_log.info("message sent to <" + Arrays.asList(m_filteredTo)
|
||||
+ "> from <" + m_from + "> subject <" + m_subject + ">");
|
||||
s_log.info("messages filtered for <" + Arrays.asList(m_invalidTo)
|
||||
+ "> from <" + m_from + "> subject <" + m_subject + ">");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -458,7 +427,6 @@ public class Mail implements MessageType {
|
|||
*
|
||||
* @param enc the requested encoding
|
||||
*/
|
||||
|
||||
public void setEncoding(String enc) {
|
||||
m_encoding = enc;
|
||||
}
|
||||
|
|
@ -469,12 +437,10 @@ public class Mail implements MessageType {
|
|||
*
|
||||
* @return the string value of the character encoding being used
|
||||
*/
|
||||
|
||||
public String getEncoding() {
|
||||
return m_encoding;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds an attachment to a message. This method is private but
|
||||
* is invoked by all of the other attach methods once they've
|
||||
|
|
@ -482,10 +448,8 @@ public class Mail implements MessageType {
|
|||
*
|
||||
* @param part the message part to attach
|
||||
*/
|
||||
|
||||
private void attach(MimeBodyPart part)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
if (m_attachments == null) {
|
||||
m_attachments = new MimeMultipart();
|
||||
}
|
||||
|
|
@ -501,12 +465,10 @@ public class Mail implements MessageType {
|
|||
* @param name the name of the attachment
|
||||
* @param description a description of the attachment
|
||||
*/
|
||||
|
||||
public void attach(URL url,
|
||||
String name,
|
||||
String description)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
attach(url, name, description, Mail.ATTACHMENT);
|
||||
}
|
||||
|
||||
|
|
@ -519,13 +481,11 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
public void attach(URL url,
|
||||
String name,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
MimeBodyPart part = new MimeBodyPart();
|
||||
attach(part);
|
||||
|
||||
|
|
@ -546,12 +506,10 @@ public class Mail implements MessageType {
|
|||
* @param name the name of the attachment
|
||||
* @param description a description of the attachment
|
||||
*/
|
||||
|
||||
public void attach(File path,
|
||||
String name,
|
||||
String description)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
attach(path, name, description, ATTACHMENT);
|
||||
}
|
||||
|
||||
|
|
@ -565,13 +523,11 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
public void attach(File path,
|
||||
String name,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
MimeBodyPart part = new MimeBodyPart();
|
||||
attach(part);
|
||||
|
||||
|
|
@ -592,12 +548,10 @@ public class Mail implements MessageType {
|
|||
* @param type the MIME type of the attachment
|
||||
* @param name the name of the attachment
|
||||
*/
|
||||
|
||||
public void attach(byte[] data,
|
||||
String type,
|
||||
String name)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
attach(data, type, name, null, ATTACHMENT);
|
||||
}
|
||||
|
||||
|
|
@ -611,14 +565,12 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
public void attach(byte[] data,
|
||||
String type,
|
||||
String name,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
ByteArrayDataSource ds = new ByteArrayDataSource(data, type, name);
|
||||
attach(ds, description, disposition);
|
||||
}
|
||||
|
|
@ -631,12 +583,10 @@ public class Mail implements MessageType {
|
|||
* @param type the MIME type of the attachment
|
||||
* @param name the name of the attachment
|
||||
*/
|
||||
|
||||
public void attach(String data,
|
||||
String type,
|
||||
String name)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
attach(data, type, name, null, ATTACHMENT);
|
||||
}
|
||||
|
||||
|
|
@ -650,14 +600,12 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
public void attach(String data,
|
||||
String type,
|
||||
String name,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
ByteArrayDataSource ds = new ByteArrayDataSource(data, type, name);
|
||||
attach(ds, description, disposition);
|
||||
}
|
||||
|
|
@ -671,12 +619,10 @@ public class Mail implements MessageType {
|
|||
* @param type the MIME type of the attachment
|
||||
* @param name the name of the attachment
|
||||
*/
|
||||
|
||||
public void attach(ByteArrayInputStream is,
|
||||
String type,
|
||||
String name)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
attach(is, type, name, null, ATTACHMENT);
|
||||
}
|
||||
|
||||
|
|
@ -691,14 +637,12 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
public void attach(ByteArrayInputStream is,
|
||||
String type,
|
||||
String name,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
ByteArrayDataSource ds = new ByteArrayDataSource(is, type, name);
|
||||
attach(ds, description, disposition);
|
||||
}
|
||||
|
|
@ -713,12 +657,10 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
protected void attach(ByteArrayDataSource dataSource,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
MimeBodyPart part = new MimeBodyPart();
|
||||
attach(part);
|
||||
|
||||
|
|
@ -730,7 +672,6 @@ public class Mail implements MessageType {
|
|||
part.setDisposition(disposition);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attaches content to a message by supplying a DataHandler. All
|
||||
* relevant parameters (MIME type, name, ...) are determined
|
||||
|
|
@ -738,14 +679,11 @@ public class Mail implements MessageType {
|
|||
*
|
||||
* @param dh a DataHandler for some piece of content.
|
||||
*/
|
||||
|
||||
public void attach(DataHandler dh)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
attach(dh, null, ATTACHMENT);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attaches content to a message by supplying a DataHandler. Sets
|
||||
* the description and disposition of the content.
|
||||
|
|
@ -754,12 +692,10 @@ public class Mail implements MessageType {
|
|||
* @param description a description of the attachment
|
||||
* @param disposition Mail.ATTACHMENT or Mail.INLINE
|
||||
*/
|
||||
|
||||
public void attach(DataHandler dh,
|
||||
String description,
|
||||
String disposition)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
MimeBodyPart part = new MimeBodyPart();
|
||||
attach(part);
|
||||
|
||||
|
|
@ -775,7 +711,6 @@ public class Mail implements MessageType {
|
|||
* initializer and any of properties that can be overridden at
|
||||
* the package level.
|
||||
*/
|
||||
|
||||
static synchronized Session getSession() {
|
||||
|
||||
if (s_session == null) {
|
||||
|
|
@ -805,10 +740,8 @@ public class Mail implements MessageType {
|
|||
* example, to queue a number of messages to send all at once rather
|
||||
* than invoke the Mail.send() method for each instance.)
|
||||
*/
|
||||
|
||||
private Message getMessage()
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
// Create the message
|
||||
MimeMessage msg = new MimeMessage(getSession());
|
||||
|
||||
|
|
@ -875,7 +808,6 @@ public class Mail implements MessageType {
|
|||
* @param host the SMTP host to connect to
|
||||
* @param port the port number on that host
|
||||
*/
|
||||
|
||||
synchronized static void setSmtpServer(String host, String port) {
|
||||
s_host = host;
|
||||
s_port = port;
|
||||
|
|
@ -884,7 +816,6 @@ public class Mail implements MessageType {
|
|||
s_session = null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the SMTP mail host for debugging and account information.
|
||||
* @return the SMTP mail host for debugging and account information.
|
||||
|
|
@ -893,17 +824,14 @@ public class Mail implements MessageType {
|
|||
return s_host;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Writes the content of the message to the given output stream.
|
||||
* Useful for debugging.
|
||||
*
|
||||
* @param os the output stream to write the message to
|
||||
*/
|
||||
|
||||
public void writeTo(OutputStream os)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
try {
|
||||
getMessage().writeTo(os);
|
||||
} catch (IOException ex) {
|
||||
|
|
@ -1024,10 +952,8 @@ public class Mail implements MessageType {
|
|||
/**
|
||||
* Utility function to prepare the content of the message.
|
||||
*/
|
||||
|
||||
private Message prepareMessageContent(MimeMessage msg)
|
||||
throws MessagingException
|
||||
{
|
||||
throws MessagingException {
|
||||
if (m_alternate == null && m_attachments == null) {
|
||||
|
||||
// We have a plain-text message with no attachments. Use
|
||||
|
|
@ -1122,12 +1048,14 @@ public class Mail implements MessageType {
|
|||
filtered.add(m_to[i]);
|
||||
} else {
|
||||
invalid.add(m_to[i]);
|
||||
s_log.debug("filtering message to non-existent email address " + m_to[i]);
|
||||
s_log.debug("filtering message to non-existent email address "
|
||||
+ m_to[i]);
|
||||
}
|
||||
}
|
||||
m_filteredTo = (InternetAddress[]) filtered.toArray(new InternetAddress[filtered.size()]);
|
||||
m_invalidTo = (InternetAddress[]) invalid.toArray(new InternetAddress[invalid.size()]);
|
||||
m_filteredTo = (InternetAddress[]) filtered.toArray(new InternetAddress[filtered.
|
||||
size()]);
|
||||
m_invalidTo = (InternetAddress[]) invalid.toArray(new InternetAddress[invalid.
|
||||
size()]);
|
||||
return m_filteredTo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import java.util.ArrayList;
|
|||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* BaseCheck: Extension of the Check abstract class, which can be used as a
|
||||
|
|
@ -45,6 +46,7 @@ import java.util.List;
|
|||
|
||||
abstract public class BaseCheck extends Check {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BaseCheck.class);
|
||||
public static final String versionId =
|
||||
"$Id: BaseCheck.java 736 2005-09-01 10:46:05Z sskracic $" +
|
||||
" by $Author: sskracic $, " +
|
||||
|
|
@ -53,12 +55,14 @@ abstract public class BaseCheck extends Check {
|
|||
public static final MessageMap s_messages = new MessageMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
final InputStream in = BaseCheck.class.getResourceAsStream
|
||||
("basecheck.messages_linux");
|
||||
|
||||
Assert.exists(in, InputStream.class);
|
||||
|
||||
s_messages.load(new InputStreamReader(in));
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static String message(final String key) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import java.sql.Connection;
|
|||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -43,6 +44,7 @@ import java.io.InputStreamReader;
|
|||
|
||||
public class CheckDB extends BaseCheck {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CheckDB.class);
|
||||
public final static String versionId =
|
||||
"$Id: DBCheck.java 736 2005-09-01 10:46:05Z sskracic $" +
|
||||
" by $Author: sskracic $, " +
|
||||
|
|
@ -51,10 +53,12 @@ public class CheckDB extends BaseCheck {
|
|||
// Integration of service class packaging.MessageMap.
|
||||
// Specifies a package specific message file overriding BaseCheck
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
final InputStream in = CheckDB.class.getResourceAsStream
|
||||
("checkdb.messages_linux");
|
||||
Assert.exists(in, InputStream.class);
|
||||
s_messages.load(new InputStreamReader(in));
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.apache.commons.cli.OptionGroup;
|
|||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Get
|
||||
|
|
@ -49,37 +50,31 @@ import org.apache.commons.cli.PosixParser;
|
|||
* @author Rafael H. Schloming <rhs@mit.edu>
|
||||
* @version $Revision: #6 $ $Date: 2004/08/16 $
|
||||
**/
|
||||
|
||||
class Get extends Command {
|
||||
|
||||
public static final Logger logger = Logger.getLogger(Get.class);
|
||||
public final static String versionId =
|
||||
"$Id: Get.java 1324 2006-09-21 22:13:16Z apevec $" +
|
||||
" by $Author: apevec $, " +
|
||||
"$DateTime: 2004/08/16 18:10:38 $";
|
||||
|
||||
"$Id: Get.java 1324 2006-09-21 22:13:16Z apevec $"
|
||||
+ " by $Author: apevec $, "
|
||||
+ "$DateTime: 2004/08/16 18:10:38 $";
|
||||
private static final Options OPTIONS = getOptions();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
OptionGroup group = new OptionGroup();
|
||||
group.addOption
|
||||
(OptionBuilder
|
||||
.hasArg(false)
|
||||
.withLongOpt("all")
|
||||
.withDescription("Lists all configuration parameters")
|
||||
.create("all"));
|
||||
group.addOption
|
||||
(OptionBuilder
|
||||
.hasArg()
|
||||
.withArgName("PARAMETER")
|
||||
.withLongOpt("value")
|
||||
.withDescription("Prints a scalar value without the key")
|
||||
.create("value"));
|
||||
group.addOption(OptionBuilder.hasArg(false).withLongOpt("all").
|
||||
withDescription("Lists all configuration parameters").create(
|
||||
"all"));
|
||||
group.addOption(OptionBuilder.hasArg().withArgName("PARAMETER").
|
||||
withLongOpt("value").withDescription(
|
||||
"Prints a scalar value without the key").create("value"));
|
||||
OPTIONS.addOptionGroup(group);
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public Get() {
|
||||
super("get", "Print one or more values from a CCM " +
|
||||
"configuration database");
|
||||
super("get", "Print one or more values from a CCM "
|
||||
+ "configuration database");
|
||||
}
|
||||
|
||||
public boolean run(String[] args) {
|
||||
|
|
@ -109,8 +104,7 @@ class Get extends Command {
|
|||
if (line.hasOption("value")) {
|
||||
names = new String[]{line.getOptionValue("value")};
|
||||
if (line.getArgs().length > 0) {
|
||||
System.err.println
|
||||
("--value option does not allow parameters");
|
||||
System.err.println("--value option does not allow parameters");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -138,7 +132,9 @@ class Get extends Command {
|
|||
parameters.add(param);
|
||||
}
|
||||
}
|
||||
if (err) { return false; }
|
||||
if (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (Iterator it = parameters.iterator(); it.hasNext();) {
|
||||
|
|
@ -174,12 +170,13 @@ class Get extends Command {
|
|||
new BufferedReader(new StringReader(baos.toString()));
|
||||
while (true) {
|
||||
String line = reader.readLine();
|
||||
if (line == null) { return; }
|
||||
if (line == null) {
|
||||
return;
|
||||
}
|
||||
if (line.trim().startsWith("#")) {
|
||||
continue;
|
||||
}
|
||||
out.println(line);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ public class HostInit {
|
|||
private static final Options OPTIONS = new Options();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg()
|
||||
|
|
@ -109,6 +110,7 @@ public class HostInit {
|
|||
.withLongOpt("clean")
|
||||
.withDescription("Remove the destination directory before copying files")
|
||||
.create());
|
||||
s_log.debug("Static initalizer finsished.");
|
||||
}
|
||||
|
||||
private static final void err(String msg) {
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ import org.apache.commons.cli.OptionBuilder;
|
|||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* PackageTool worker class, implements the "load" command.
|
||||
|
|
@ -85,9 +86,11 @@ import org.apache.commons.cli.PosixParser;
|
|||
|
||||
class Load extends Command {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Load.class);
|
||||
private static final Options OPTIONS = getOptions();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg(false)
|
||||
|
|
@ -146,6 +149,7 @@ class Load extends Command {
|
|||
.withDescription("Log parameter values as key-value " +
|
||||
"pairs in FILE")
|
||||
.create());*/
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import org.apache.commons.cli.OptionBuilder;
|
|||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Set
|
||||
|
|
@ -43,6 +44,7 @@ import org.apache.commons.cli.PosixParser;
|
|||
|
||||
class Set extends Command {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(Set.class);
|
||||
public final static String versionId =
|
||||
"$Id: Set.java 736 2005-09-01 10:46:05Z sskracic $" +
|
||||
" by $Author: sskracic $, " +
|
||||
|
|
@ -51,12 +53,14 @@ class Set extends Command {
|
|||
private static final Options OPTIONS = getOptions();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg(false)
|
||||
.withLongOpt("interactive")
|
||||
.withDescription("Interactively edit configuration values")
|
||||
.create());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public Set() {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import org.apache.commons.cli.OptionBuilder;
|
|||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Unload
|
||||
|
|
@ -39,6 +40,7 @@ import org.apache.commons.cli.PosixParser;
|
|||
|
||||
class Unload extends Command {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Unload.class);
|
||||
public final static String versionId =
|
||||
"$Id: Unload.java 736 2005-09-01 10:46:05Z sskracic $" +
|
||||
" by $Author: sskracic $, " +
|
||||
|
|
@ -47,20 +49,24 @@ class Unload extends Command {
|
|||
private static final Options OPTIONS = new Options();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg(false)
|
||||
.withLongOpt("config")
|
||||
.withDescription("Unload configuration")
|
||||
.create());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static final Set EXCLUDE = new HashSet();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
EXCLUDE.add("resin.conf");
|
||||
EXCLUDE.add("resin.pid");
|
||||
EXCLUDE.add("server.xml");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public Unload() {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import org.apache.commons.cli.OptionBuilder;
|
|||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
|
|
@ -52,6 +53,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
*/
|
||||
class Upgrade extends Command {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Upgrade.class);
|
||||
private static final Options s_options = getOptions();
|
||||
|
||||
private String m_from;
|
||||
|
|
@ -59,6 +61,7 @@ class Upgrade extends Command {
|
|||
private final List m_scripts;
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_options.addOption
|
||||
(OptionBuilder
|
||||
.isRequired()
|
||||
|
|
@ -79,6 +82,7 @@ class Upgrade extends Command {
|
|||
.withLongOpt("parameters")
|
||||
.withDescription("Parameters to pass to upgrade scripts")
|
||||
.create());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public Upgrade() {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@ public class SessionManager {
|
|||
|
||||
private static Set s_beforeFlushProcManagers = new HashSet();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
addBeforeFlushProcManager(Versions.EPM);
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
private static Set s_afterFlushProcManagers = new HashSet();
|
||||
private static Map s_configurations = new HashMap();
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ public class PDL {
|
|||
new CommandLine(PDL.class.getName(), null);
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
CMD.addSwitch(new PathSwitch(
|
||||
"-library-path",
|
||||
"PDL files appearing in this path will be searched " +
|
||||
|
|
@ -167,6 +168,7 @@ public class PDL {
|
|||
CMD.addSwitch(new BooleanSwitch("-quiet", "sets logging to ERROR and does not complain if no PDL files are found",
|
||||
Boolean.FALSE));
|
||||
CMD.addSwitch(new StringSwitch("-testddl", "no clue", null));
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -73,10 +73,12 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class SQLRegressionGenerator {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SQLRegressionGenerator.class);
|
||||
static final CommandLine CMD =
|
||||
new CommandLine(PDL.class.getName(), null);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
CMD.addSwitch(new PathSwitch(
|
||||
"-path",
|
||||
"PDL files appearing in this path will be processed",
|
||||
|
|
@ -95,6 +97,7 @@ public class SQLRegressionGenerator {
|
|||
CMD.addSwitch(new BooleanSwitch("-quiet", "sets logging to ERROR and does not complain if no PDL files are found",
|
||||
Boolean.FALSE));
|
||||
CMD.addSwitch(new StringSwitch("-database", "target database", null));
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Simple Profiler.
|
||||
|
|
@ -21,15 +22,18 @@ import java.util.Set;
|
|||
*/
|
||||
public class Profiler {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Profiler.class);
|
||||
private static final Set enabledOperations = new HashSet();
|
||||
// TODO add a configuration page under Developer Support
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
enabledOperations.add("APP");
|
||||
enabledOperations.add("FILT");
|
||||
enabledOperations.add("CMS");
|
||||
enabledOperations.add("XML");
|
||||
enabledOperations.add("DB");
|
||||
enabledOperations.add("XSLT");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static ProfilerConfig config = null;
|
||||
|
|
|
|||
|
|
@ -44,9 +44,11 @@ public class QueryEngineRegistry {
|
|||
Logger.getLogger(QueryEngineRegistry.class);
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
registerEngine(IndexerType.NOOP,
|
||||
new FilterType[] {},
|
||||
new NoopQueryEngine());
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.arsdigita.kernel.Kernel;
|
|||
import com.arsdigita.kernel.Party;
|
||||
import com.arsdigita.kernel.User;
|
||||
import com.arsdigita.kernel.PersonName;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This is an advanced servlet error report generator
|
||||
|
|
@ -44,6 +45,8 @@ import com.arsdigita.kernel.PersonName;
|
|||
* (guru meditation) code.
|
||||
*/
|
||||
public class ServletErrorReport extends ErrorReport {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ServletErrorReport.class);
|
||||
/**
|
||||
* The name of the Servlet request attribute which will
|
||||
* contain the guru meditation code
|
||||
|
|
@ -52,16 +55,18 @@ public class ServletErrorReport extends ErrorReport {
|
|||
public static final String GURU_ERROR_REPORT = "guruErrorReport";
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Exceptions.registerUnwrapper(
|
||||
ServletException.class,
|
||||
new ExceptionUnwrapper() {
|
||||
|
||||
public Throwable unwrap(Throwable t) {
|
||||
ServletException ex = (ServletException) t;
|
||||
return ex.getRootCause();
|
||||
}
|
||||
});
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private HttpServletRequest m_request;
|
||||
private HttpServletResponse m_response;
|
||||
|
||||
|
|
@ -128,8 +133,8 @@ public class ServletErrorReport extends ErrorReport {
|
|||
String lines[] = new String[cookies.length];
|
||||
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
lines[i] = cookies[i].getName() + ": " + cookies[i].getValue() +
|
||||
" (expires: " + cookies[i].getMaxAge() + ")";
|
||||
lines[i] = cookies[i].getName() + ": " + cookies[i].getValue()
|
||||
+ " (expires: " + cookies[i].getMaxAge() + ")";
|
||||
}
|
||||
|
||||
addSection("Cookies", lines);
|
||||
|
|
@ -187,8 +192,8 @@ public class ServletErrorReport extends ErrorReport {
|
|||
Enumeration props = m_request.getAttributeNames();
|
||||
while (props.hasMoreElements()) {
|
||||
String key = (String) props.nextElement();
|
||||
if (GURU_ERROR_REPORT.equals(key) ||
|
||||
GURU_MEDITATION_CODE.equals(key)) {
|
||||
if (GURU_ERROR_REPORT.equals(key)
|
||||
|| GURU_MEDITATION_CODE.equals(key)) {
|
||||
continue;
|
||||
}
|
||||
Object value = m_request.getAttribute(key);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class ApplyTemplates {
|
|||
"-loop [count] -log [loglevel] -verbose -warmup [count] Stylesheet Input Output "
|
||||
);
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_cmd.addSwitch(new StringSwitch(OPT_LOG,
|
||||
"Log4j debug level",
|
||||
"warn"));
|
||||
|
|
@ -69,6 +70,7 @@ public class ApplyTemplates {
|
|||
s_cmd.addSwitch(new BooleanSwitch(OPT_VERBOSE,
|
||||
"Display progress",
|
||||
Boolean.FALSE));
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public final static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public class PatternStylesheetResolver implements StylesheetResolver {
|
|||
}
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
registerPatternGenerator
|
||||
("locale", new LocalePatternGenerator());
|
||||
registerPatternGenerator
|
||||
|
|
@ -148,6 +149,7 @@ public class PatternStylesheetResolver implements StylesheetResolver {
|
|||
("webapps", new WebAppPatternGenerator());
|
||||
registerPatternGenerator
|
||||
("host", new HostPatternGenerator());
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private String m_path = null;
|
||||
|
|
|
|||
|
|
@ -58,39 +58,35 @@ import org.apache.log4j.Logger;
|
|||
public class Templating {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(Templating.class);
|
||||
|
||||
// just a tag to assure an implementation exists
|
||||
// public static final Class DEFAULT_PRESENTATION_MANAGER
|
||||
// = SimplePresentationManager.class;
|
||||
|
||||
/**
|
||||
* This is the name of the attribute that is set in the request whose
|
||||
* value, if present, is a collection of TransformerExceptions that
|
||||
* can be used to produce a "pretty" error.
|
||||
*/
|
||||
public static final String FANCY_ERROR_COLLECTION = "fancyErrorCollection";
|
||||
|
||||
// this was instantiated with hardcoded values, not anymore
|
||||
private static CacheTable s_templates = null;
|
||||
private static final TemplatingConfig s_config = new TemplatingConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load("ccm-core/templating.properties");
|
||||
}
|
||||
|
||||
static {
|
||||
Exceptions.registerUnwrapper(
|
||||
TransformerException.class,
|
||||
new ExceptionUnwrapper() {
|
||||
|
||||
public Throwable unwrap(Throwable t) {
|
||||
TransformerException ex = (TransformerException) t;
|
||||
return ex.getCause();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// now we initiate the CacheTable here
|
||||
static {
|
||||
|
||||
// default cache size used to be 50, which is too high I reckon,
|
||||
// each template can eat up to 4 megs
|
||||
Integer setting = s_config.getCacheSize();
|
||||
|
|
@ -101,6 +97,8 @@ public class Templating {
|
|||
|
||||
s_templates = new CacheTable("templating", cacheSize, cacheAge);
|
||||
s_templates.setPurgeAllowed(true);
|
||||
|
||||
s_log.debug("Static initalizer finished...");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -184,8 +182,8 @@ public class Templating {
|
|||
|
||||
if (template == null) {
|
||||
if (s_log.isInfoEnabled()) {
|
||||
s_log.info("The template for URL " + source + " is not " +
|
||||
"cached; creating and caching it now");
|
||||
s_log.info("The template for URL " + source + " is not "
|
||||
+ "cached; creating and caching it now");
|
||||
}
|
||||
|
||||
if (fancyErrors) {
|
||||
|
|
@ -207,8 +205,8 @@ public class Templating {
|
|||
// probably on UtilConfig.
|
||||
|
||||
if (s_log.isInfoEnabled()) {
|
||||
s_log.info("Template " + template + " has been modified; " +
|
||||
"recreating it from scratch");
|
||||
s_log.info("Template " + template + " has been modified; "
|
||||
+ "recreating it from scratch");
|
||||
}
|
||||
|
||||
if (fancyErrors) {
|
||||
|
|
@ -338,9 +336,12 @@ public class Templating {
|
|||
HttpHost self = Web.getConfig().getHost();
|
||||
|
||||
String path = url.getPath();
|
||||
if (self.getName().equals(url.getHost()) &&
|
||||
((self.getPort() == url.getPort()) ||
|
||||
(url.getPort() == -1 && self.getPort() == 80))) {
|
||||
if (self.getName().equals(url.getHost()) && ((self.getPort() == url.
|
||||
getPort()) || (url.getPort()
|
||||
== -1
|
||||
&& self.
|
||||
getPort()
|
||||
== 80))) {
|
||||
|
||||
if (path.startsWith("/resource")) {
|
||||
// A virtual path to the servlet
|
||||
|
|
@ -352,14 +353,15 @@ public class Templating {
|
|||
return newURL;
|
||||
} else {
|
||||
// A real path to disk
|
||||
final String filename = Web.getServletContext().getRealPath(path);
|
||||
final String filename =
|
||||
Web.getServletContext().getRealPath(path);
|
||||
File file = new File(filename);
|
||||
if (file.exists()) {
|
||||
try {
|
||||
URL newURL = file.toURL();
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Transforming resource " +
|
||||
url + " to " + newURL);
|
||||
s_log.debug("Transforming resource " + url + " to "
|
||||
+ newURL);
|
||||
}
|
||||
return newURL;
|
||||
} catch (MalformedURLException ex) {
|
||||
|
|
@ -367,7 +369,8 @@ public class Templating {
|
|||
}
|
||||
} else {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("File " + filename + " doesn't exist on disk");
|
||||
s_log.debug("File " + filename
|
||||
+ " doesn't exist on disk");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -382,9 +385,9 @@ public class Templating {
|
|||
}
|
||||
|
||||
class LoggingErrorListener implements ErrorListener {
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(LoggingErrorListener.class);
|
||||
|
||||
private ArrayList m_errors;
|
||||
|
||||
LoggingErrorListener() {
|
||||
|
|
@ -408,8 +411,8 @@ class LoggingErrorListener implements ErrorListener {
|
|||
}
|
||||
|
||||
private void log(Level level, TransformerException ex) {
|
||||
s_log.log(level, "Transformer " + level + ": " +
|
||||
ex.getLocationAsString() + ": " + ex.getMessage(),
|
||||
s_log.log(level, "Transformer " + level + ": "
|
||||
+ ex.getLocationAsString() + ": " + ex.getMessage(),
|
||||
ex);
|
||||
m_errors.add(ex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,8 +60,10 @@ public class XHTMLParser implements HTMLParser {
|
|||
private final static Set s_emptyTags = new HashSet();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer is starting...");
|
||||
s_emptyTags.add("br");
|
||||
s_emptyTags.add("hr");
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private final Set m_tags;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import java.util.HashSet;
|
|||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -40,15 +41,18 @@ import javax.servlet.http.HttpServletRequest;
|
|||
*/
|
||||
public class CharsetEncodingProvider implements ParameterProvider {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CharsetEncodingProvider.class);
|
||||
private static StringParameter s_encodingParam =
|
||||
new StringParameter(Globalization.ENCODING_PARAM_NAME);
|
||||
|
||||
private static Set s_models = new HashSet();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_encodingParam.setDefaultValue(Globalization.DEFAULT_ENCODING);
|
||||
s_encodingParam.setDefaultOverridesNull(true);
|
||||
s_models.add(s_encodingParam);
|
||||
logger.debug("Static initalizer finished...");
|
||||
}
|
||||
|
||||
public Set getModels() {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.text.NumberFormat;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -52,6 +53,7 @@ import java.util.Map;
|
|||
* @version $Revision: #4 $ $DateTime: 2004/08/16 18:10:38 $
|
||||
**/
|
||||
public final class ConcurrentDict {
|
||||
private static final Logger logger = Logger.getLogger(ConcurrentDict.class);
|
||||
// We may want to make it possible to specify the bucket size at
|
||||
// construction time. Hardcoding it is good enough for now.
|
||||
private static final int N_BUCKETS = 64;
|
||||
|
|
@ -59,9 +61,11 @@ public final class ConcurrentDict {
|
|||
private static final Map[] BUCKETS = new Map[N_BUCKETS];
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
for (int ii=0; ii<N_BUCKETS; ii++) {
|
||||
BUCKETS[ii] = new HashMap();
|
||||
}
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private final EntrySupplier m_supplier;
|
||||
|
|
|
|||
|
|
@ -249,12 +249,14 @@ public class StringUtils {
|
|||
|
||||
private static Map s_entities = new HashMap();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_entities.put("fraction12", "½");
|
||||
s_entities.put("fraction14", "¼");
|
||||
s_entities.put("fraction34", "¾");
|
||||
s_entities.put("copyright", "©");
|
||||
s_entities.put("registered", "®");
|
||||
s_entities.put("trademark", "<sup>TM</sup>");
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static String smartTextInline(String s) {
|
||||
|
|
|
|||
|
|
@ -42,17 +42,23 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class UncheckedWrapperException extends RuntimeException {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(
|
||||
UncheckedWrapperException.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Exceptions.registerUnwrapper(
|
||||
UncheckedWrapperException.class,
|
||||
new ExceptionUnwrapper() {
|
||||
|
||||
public Throwable unwrap(Throwable t) {
|
||||
UncheckedWrapperException ex = (UncheckedWrapperException)t;
|
||||
UncheckedWrapperException ex =
|
||||
(UncheckedWrapperException) t;
|
||||
return ex.getRootCause();
|
||||
}
|
||||
});
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
Throwable m_rootCause;
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +104,9 @@ public class UncheckedWrapperException extends RuntimeException {
|
|||
*
|
||||
* @throws UncheckedWrapperException
|
||||
*/
|
||||
public static void throwLoggedException(Class source, String msg, Throwable rootCause) throws UncheckedWrapperException {
|
||||
public static void throwLoggedException(Class source, String msg,
|
||||
Throwable rootCause) throws
|
||||
UncheckedWrapperException {
|
||||
Logger log = Logger.getLogger(source);
|
||||
log.error(msg, rootCause);
|
||||
|
||||
|
|
@ -121,7 +129,6 @@ public class UncheckedWrapperException extends RuntimeException {
|
|||
|
||||
// All further methods override normal throwable behavior to
|
||||
// combine information w/ the root cause.
|
||||
|
||||
/**
|
||||
* Get a string representing this exception and the root cause.
|
||||
*/
|
||||
|
|
@ -158,7 +165,8 @@ public class UncheckedWrapperException extends RuntimeException {
|
|||
*/
|
||||
public String getMessage() {
|
||||
if (m_rootCause != null) {
|
||||
return super.getMessage() + " (root cause: " + m_rootCause.getMessage() + ")";
|
||||
return super.getMessage() + " (root cause: " + m_rootCause.
|
||||
getMessage() + ")";
|
||||
} else {
|
||||
return super.getMessage();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,10 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class WrappedError extends Error {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(WrappedError.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Exceptions.registerUnwrapper(
|
||||
WrappedError.class,
|
||||
new ExceptionUnwrapper() {
|
||||
|
|
@ -44,6 +47,7 @@ public class WrappedError extends Error {
|
|||
return ex.getRootCause();
|
||||
}
|
||||
});
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
Throwable m_rootCause;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package com.arsdigita.util.parameter;
|
||||
|
||||
import org.apache.commons.beanutils.converters.ClassConverter;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A parameter representing a Java <code>Class</code>.
|
||||
|
|
@ -32,8 +33,12 @@ import org.apache.commons.beanutils.converters.ClassConverter;
|
|||
*/
|
||||
public class ClassParameter extends AbstractParameter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ClassParameter.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Converters.set(Class.class, new ClassConverter());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public ClassParameter(final String name) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package com.arsdigita.util.parameter;
|
||||
|
||||
import org.apache.commons.beanutils.converters.IntegerConverter;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A parameter representing a Java <code>Integer</code>.
|
||||
|
|
@ -32,8 +33,12 @@ import org.apache.commons.beanutils.converters.IntegerConverter;
|
|||
*/
|
||||
public class IntegerParameter extends AbstractParameter {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(IntegerParameter.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Converters.set(Integer.class, new IntegerConverter());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public IntegerParameter(final String name) {
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ final class ParameterPrinter {
|
|||
private static final Options OPTIONS = new Options();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg(false)
|
||||
|
|
@ -77,6 +78,7 @@ final class ParameterPrinter {
|
|||
.withArgName("FILE")
|
||||
.withDescription("Use list of additional Config classes from FILE")
|
||||
.create());
|
||||
s_log.debug("Static initalizer starting...");
|
||||
}
|
||||
|
||||
private static void writeXML(final PrintWriter out) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package com.arsdigita.util.parameter;
|
||||
|
||||
import org.apache.commons.beanutils.converters.StringConverter;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A parameter representing a Java <code>String</code>.
|
||||
|
|
@ -32,8 +33,12 @@ import org.apache.commons.beanutils.converters.StringConverter;
|
|||
*/
|
||||
public class StringParameter extends AbstractParameter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(StringParameter.class);
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
Converters.set(String.class, new StringConverter());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public StringParameter(final String name,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ final class Adapter {
|
|||
|
||||
private static final Map s_converters = new HashMap();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
initializeAdapters();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
private Adapter() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import java.io.PrintWriter;
|
|||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
// new versioning
|
||||
|
||||
|
|
@ -206,6 +207,8 @@ final class DevSupport {
|
|||
|
||||
private static class DependenceFormatter implements GraphFormatter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DependenceFormatter.class);
|
||||
|
||||
private static final String GRAPH_ATTRS =
|
||||
GRAPH_ATTRS_HEADER +
|
||||
" edge[style=invis];\n" +
|
||||
|
|
@ -229,6 +232,7 @@ final class DevSupport {
|
|||
private static final Map COLORS = new HashMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
COLORS.put(NodeType.VERSIONED_TYPE,
|
||||
"[fillcolor=Tomato,comment=\"versioned type\"]");
|
||||
COLORS.put(NodeType.COVERSIONED_TYPE,
|
||||
|
|
@ -236,6 +240,7 @@ final class DevSupport {
|
|||
COLORS.put(NodeType.RECOVERABLE,
|
||||
"[fillcolor=LemonChiffon,comment=recoverable]");
|
||||
COLORS.put(NodeType.UNREACHABLE, "[comment=unreachable]");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public String graphAttributes(Graph graph) {
|
||||
|
|
|
|||
|
|
@ -52,14 +52,13 @@ import java.io.UnsupportedEncodingException;
|
|||
* @since ACS 4.5a
|
||||
*/
|
||||
public class Document {
|
||||
public static final String versionId =
|
||||
"$Id: Document.java 287 2005-02-22 00:29:02Z sskracic $" +
|
||||
" by $Author: sskracic $, " +
|
||||
"$DateTime: 2004/08/16 18:10:38 $";
|
||||
|
||||
public static final String versionId =
|
||||
"$Id: Document.java 287 2005-02-22 00:29:02Z sskracic $"
|
||||
+ " by $Author: sskracic $, "
|
||||
+ "$DateTime: 2004/08/16 18:10:38 $";
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(Document.class.getName());
|
||||
|
||||
/**
|
||||
* this is the identity XSL stylesheet. We need to provide the
|
||||
* identity transform as XSL explicitly because the default
|
||||
|
|
@ -101,13 +100,11 @@ public class Document {
|
|||
+ " xmlns:bebop=\"http://www.arsdigita.com/bebop/1.0\">\n"
|
||||
+ "</xsl:template>\n"
|
||||
+ "</xsl:stylesheet>";
|
||||
|
||||
/**
|
||||
* A single <code>DocumentBuilderFactory</code> to use for
|
||||
* creating Documents.
|
||||
*/
|
||||
protected static DocumentBuilderFactory s_builder = null;
|
||||
|
||||
/**
|
||||
* A single <code>DocumentBuilder</code> to use for
|
||||
* creating Documents.
|
||||
|
|
@ -119,9 +116,11 @@ public class Document {
|
|||
// instead to achieve independence from a JVM wide configuration.
|
||||
// Requires additional modifications in c.ad.util.xml.XML
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_builder = DocumentBuilderFactory.newInstance();
|
||||
s_builder.setNamespaceAware(true);
|
||||
s_db = new ThreadLocal() {
|
||||
|
||||
public Object initialValue() {
|
||||
try {
|
||||
return s_builder.newDocumentBuilder();
|
||||
|
|
@ -130,10 +129,10 @@ public class Document {
|
|||
}
|
||||
}
|
||||
};
|
||||
s_log.debug("Static initalized finished.");
|
||||
}
|
||||
|
||||
/* Used to build the DOM Documents that this class wraps */
|
||||
|
||||
/**
|
||||
* The internal DOM document being wrapped.
|
||||
*/
|
||||
|
|
@ -145,8 +144,8 @@ public class Document {
|
|||
public Document() throws ParserConfigurationException {
|
||||
DocumentBuilder db = (DocumentBuilder) s_db.get();
|
||||
if (db == null) {
|
||||
throw new ParserConfigurationException
|
||||
("Unable to create a DocumentBuilder");
|
||||
throw new ParserConfigurationException(
|
||||
"Unable to create a DocumentBuilder");
|
||||
}
|
||||
m_document = db.newDocument();
|
||||
}
|
||||
|
|
@ -170,8 +169,8 @@ public class Document {
|
|||
public Document(Element rootNode) throws ParserConfigurationException {
|
||||
DocumentBuilder db = (DocumentBuilder) s_db.get();
|
||||
if (db == null) {
|
||||
throw new ParserConfigurationException
|
||||
("Unable to create a DocumentBuilder");
|
||||
throw new ParserConfigurationException(
|
||||
"Unable to create a DocumentBuilder");
|
||||
}
|
||||
|
||||
m_document = db.newDocument();
|
||||
|
|
@ -185,22 +184,21 @@ public class Document {
|
|||
*/
|
||||
public Document(String xmlString)
|
||||
throws ParserConfigurationException, org.xml.sax.SAXException {
|
||||
this(new org.xml.sax.InputSource
|
||||
(new java.io.StringReader(xmlString)));
|
||||
this(new org.xml.sax.InputSource(new java.io.StringReader(xmlString)));
|
||||
}
|
||||
|
||||
public Document(byte[] xmlBytes)
|
||||
throws ParserConfigurationException, org.xml.sax.SAXException {
|
||||
this(new org.xml.sax.InputSource
|
||||
(new java.io.ByteArrayInputStream(xmlBytes)));
|
||||
this(new org.xml.sax.InputSource(new java.io.ByteArrayInputStream(
|
||||
xmlBytes)));
|
||||
}
|
||||
|
||||
private Document(org.xml.sax.InputSource inputSource)
|
||||
throws ParserConfigurationException, org.xml.sax.SAXException {
|
||||
DocumentBuilder db = (DocumentBuilder) s_db.get();
|
||||
if (db == null) {
|
||||
throw new ParserConfigurationException
|
||||
("Unable to create a DocumentBuilder");
|
||||
throw new ParserConfigurationException(
|
||||
"Unable to create a DocumentBuilder");
|
||||
}
|
||||
|
||||
org.w3c.dom.Document domDoc;
|
||||
|
|
@ -273,8 +271,6 @@ public class Document {
|
|||
return root;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Not a part of <code>org.jdom.Document</code>, this function returns
|
||||
* the internal DOM representation of this document. This method should
|
||||
|
|
@ -307,8 +303,8 @@ public class Document {
|
|||
try {
|
||||
StreamSource identitySource =
|
||||
new StreamSource(new StringReader(identityXSL));
|
||||
identity = TransformerFactory.newInstance()
|
||||
.newTransformer(identitySource);
|
||||
identity = TransformerFactory.newInstance().newTransformer(
|
||||
identitySource);
|
||||
identity.setOutputProperty("method", "xml");
|
||||
identity.setOutputProperty("indent", (indent ? "yes" : "no"));
|
||||
identity.setOutputProperty("encoding", "UTF-8");
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@ public class XML {
|
|||
|
||||
private static Map s_formatters = new HashMap();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_formatters.put(Date.class, new DateTimeFormatter());
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private XML() {}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* The Column class is used to keep information about the physical schema in
|
||||
|
|
@ -40,6 +41,8 @@ public class Column extends Element {
|
|||
|
||||
public final static String versionId = "$Id: Column.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Column.class);
|
||||
|
||||
/**
|
||||
* The name of this Column.
|
||||
**/
|
||||
|
|
@ -353,6 +356,7 @@ public class Column extends Element {
|
|||
private static final Map ORACLE = new HashMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
DEFAULT.put(new Integer(Types.ARRAY), "ARRAY");
|
||||
DEFAULT.put(new Integer(Types.BIGINT), "BIGINT");
|
||||
ORACLE.put(new Integer(Types.BIGINT), "integer");
|
||||
|
|
@ -389,6 +393,7 @@ public class Column extends Element {
|
|||
DEFAULT.put(new Integer(Types.TINYINT), "TINYINT");
|
||||
DEFAULT.put(new Integer(Types.VARBINARY), "VARBINARY");
|
||||
DEFAULT.put(new Integer(Types.VARCHAR), "VARCHAR");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static final String getDatabaseType(int type) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Static
|
||||
|
|
@ -44,6 +45,8 @@ import java.util.Map;
|
|||
|
||||
public class Static extends Expression {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Static.class);
|
||||
|
||||
public final static String versionId = "$Id: Static.java 1130 2006-04-30 13:40:54Z apevec $ by $Author: apevec $, $DateTime: 2004/08/16 18:10:38 $";
|
||||
|
||||
private SQL m_sql;
|
||||
|
|
@ -55,6 +58,7 @@ public class Static extends Expression {
|
|||
|
||||
private static final Collection s_functions = new HashSet();
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
String[] functions = {
|
||||
/* sql standard functions supported by both oracle and postgres.
|
||||
* there is an added caveat that the function uses normal function
|
||||
|
|
@ -70,6 +74,7 @@ public class Static extends Expression {
|
|||
for (int i = 0; i < functions.length; i++) {
|
||||
s_functions.add(functions[i]);
|
||||
}
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static final boolean isAllowedFunction(String s) {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.redhat.persistence.common.SQLParser;
|
|||
import com.redhat.persistence.common.SQLToken;
|
||||
import java.io.StringReader;
|
||||
import java.util.HashMap;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* SQLSummary
|
||||
|
|
@ -37,6 +38,8 @@ import java.util.HashMap;
|
|||
|
||||
class SQLSummary {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SQLSummary.class);
|
||||
|
||||
private static final HashMap SUMMARIES = new HashMap();
|
||||
|
||||
public static SQLSummary get(String text) {
|
||||
|
|
@ -61,10 +64,12 @@ class SQLSummary {
|
|||
private static final HashMap TYPES = new HashMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
TYPES.put("select", new Integer(SELECT));
|
||||
TYPES.put("insert into", new Integer(INSERT));
|
||||
TYPES.put("update", new Integer(UPDATE));
|
||||
TYPES.put("delete from", new Integer(DELETE));
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private final int m_type;
|
||||
|
|
|
|||
|
|
@ -65,4 +65,122 @@ log4j.logger.com.arsdigita.packaging.Loader=INFO
|
|||
#log4j.logger.com.arsdigita.london.importer=DEBUG
|
||||
#log4j.logger.com.arsdigita.london.terms.importer.TermItemBuilder=DEBUG
|
||||
#log4j.logger.com.arsdigita.categorization.Category=DEBUG
|
||||
log4j.logger.com.arsdigita.london.util.cmd.BulkPublish=DEBUG
|
||||
|
||||
#For debugging static initalizer blocks (static {})
|
||||
#com.arsdigita.auth.http.HTTPAuth=DEBUG
|
||||
#com.arsdigita.auth.http.HTTPAuthConfig=DEBUG
|
||||
#com.arsdigita.auth.http.HTTPLoginModule=DEBUG
|
||||
#com.arsdigita.cms.dispatcher.SimpleXMLGenerator=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.GenericAddress=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.GenericContact=DEBUG
|
||||
#com.arsdigita.cms.publishtofile.LinkScanner=DEBUG
|
||||
#com.arsdigita.cms.ui.type.TypeElements=DEBUG
|
||||
#com.arsdigita.cms.ui.item.ItemLanguagesTable=DEBUG
|
||||
#com.arsdigita.cms.ui.templates.ItemTemplateListing=DEBUG
|
||||
#com.arsdigita.cms.ui.folder.FolderBrowser=DEBUG
|
||||
#com.arsdigita.cms.ui.authoring.TextAssetBody=DEBUG
|
||||
#com.arsdigita.cms.ContentSection=DEBUG
|
||||
#com.arsdigita.cms.CMS=DEBUG
|
||||
#com.arsdigita.cms.Loader=DEBUG
|
||||
#com.arsdigita.cms.Template=DEBUG
|
||||
#com.arsdigita.cms.Initalizer=DEBUG
|
||||
#com.arsdigita.cms.contentassets.FileAttachment=DEBUG
|
||||
#com.arsdigita.cms.contentassets.ItemImageAttachment=DEBUG
|
||||
#com.arsdigita.cms.contentassets.Note=DEBUG
|
||||
#com.arsdigita.cms.contentassets.ui=RelatedLinkPropertyForm=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.Event=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.GenericOrganization=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.GlossaryItem=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.HealthCareFacility=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.MultiPartArticle=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.NewsItem=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.SimpleAddress=DEBUG
|
||||
#com.arsdigita.cms.dispatcherSiteProxyPanel=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.Survey=DEBUG
|
||||
#com.arsdigita.kernel.security.KernelLoginException=DEBUG
|
||||
#com.arsdigita.kernel.security.URLLoginModule=DEBUG
|
||||
#com.arsdigita.kernel.security.Crypto=DEBUG
|
||||
#com.arsdigita.profiler.Profiler=DEBUG
|
||||
#com.arsdigita.categorization.Category=DEBUG
|
||||
#com.arsdigita.developersupport.#Comodifications=DEBUG
|
||||
#com.arsdigita.developersupport.Counter=DEBUG
|
||||
#com.arsdigita.developersupport.LoggingProxyFactory=DEBUG
|
||||
#com.arsdigita.persistence.pdl.PDL=DEBUG
|
||||
#com.arsdigita.persistence.pdl.SQLRegressionGenerator=DEBUG
|
||||
#com.arsdigita.persistence.SessionManager=DEBUG
|
||||
#com.arsdigita.packaging.HostInit=DEBUG
|
||||
#com.arsdigita.packaging.BaseCheck=DEBUG
|
||||
#com.arsdigita.packaging.Load=DEBUG
|
||||
#com.arsdigita.packaging.Get=DEBUG
|
||||
#com.arsdigita.packaging.Unload=DEBUG
|
||||
#com.arsdigita.packaging.CheckDB=DEBUG
|
||||
#com.arsdigita.packaging.Upgrade=DEBUG
|
||||
#com.arsdigita.packaging.Set=DEBUG
|
||||
#com.arsdigita.toolbox.CharsetEncodingProvider=DEBUG
|
||||
#com.arsdigita.bebop.demo.workflow.SampleProcess=DEBUG
|
||||
#com.arsdigita.bebop.page.PageTransformer=DEBUG
|
||||
#com.arsdigita.bebop.parameters.TidyHTMLValidationListener=DEBUG
|
||||
#com.arsdigita.bebop.Page=DEBUG
|
||||
#com.arsdigita.core.LibCheck=DEBUG
|
||||
#com.arsdigita.templating.html.XHTMLParser=DEBUG
|
||||
#com.arsdigita.templating.ApplyTemplates=DEBUG
|
||||
#com.arsdigita.templating.Templating=DEBUG
|
||||
#com.arsdigita.templating.PatternStylesheetResolver=DEBUG
|
||||
#com.arsdigita.search.QueryEngineRegistry=DEBUG
|
||||
#com.arsdigita.formbuilder.AttributeType=DEBUG
|
||||
#com.arsdigita.mail.Mail=DEBUG
|
||||
#com.arsdigita.versioning.DevSupport=DEBUG
|
||||
#com.arsdigita.versioning.Adapter=DEBUG
|
||||
#com.arsdigita.dispatcher.BaseDispatcherServlet=DEBUG
|
||||
#com.arsdigita.logging.ErrorReport=DEBUG
|
||||
#com.arsdigita.xml.XML=DEBUG
|
||||
#com.arsdigita.xml.Document=DEBUG
|
||||
#com.arsdigita.sitenode.ServletErrorReport=DEBUG
|
||||
#com.arsdigita.util.parameter.IntegerParameter=DEBUG
|
||||
#com.arsdigita.util.parameter.ClassParameter=DEBUG
|
||||
#com.arsdigita.util.parameter.StringParameter=DEBUG
|
||||
#com.arsdigita.util.parameter.ParameterPrinter=DEBUG
|
||||
#com.arsdigita.util.Assert=DEBUG
|
||||
#com.arsdigita.util.StringUtils=DEBUG
|
||||
#com.arsdigita.util.UncheckedWrapperException=DEBUG
|
||||
#com.arsdigita.util.WrappedError=DEBUG
|
||||
#com.arsdigita.util.ConcurrentDict=DEBUG
|
||||
#com.redhat.persistence.profiler.rdbms.SQLSummary=DEBUG
|
||||
#com.redhat.persistence.metadata.Column=DEBUG
|
||||
#com.redhat.persistence.ogl.Static=DEBUG
|
||||
#com.arsdigita.cms.docmgr.ui.CreateDocLinkSearchTable=DEBUG
|
||||
#com.arsdigita.formbuilder.pdf.PDFConfig=DEBUG
|
||||
#com.arsdigita.ui.TopicsList=DEBUG
|
||||
#com.arsdigita.forum.ForumPageFactory=DEBUG
|
||||
#com.arsdigita.forum.Forum=DEBUG
|
||||
#com.arsdigita.aplaws.ObjectTypeSchemaGenerator=DEBUG
|
||||
#com.arsdigita.london.atoz.AtoZ=DEBUG
|
||||
#com.arsdigita.london.cms.dublin.DublinCoreItem=DEBUG
|
||||
#com.arsdigita.london.exporter.Exporter=DEBUG
|
||||
#com.arsdigita.london.importer.cms.ItemParser=DEBUG
|
||||
#com.arsdigita.london.navigation.ui.TemplateURLs=DEBUG
|
||||
#com.arsdigita.london.navigation.Navigation=DEBUG
|
||||
#com.arsdigita.london.navigation.ApplicationNavigationModel=DEBUG
|
||||
#com.arsdigita.london.portal.portlet.RSSFeedPortletHelper=DEBUG
|
||||
#com.arsdigita.london.portal.ui.admin.GrantsTable=DEBUG
|
||||
#com.arsdigita.london.portal.ui.Icons=DEBUG
|
||||
#com.arsdigita.london.Workspace=DEBUG
|
||||
#com.arsdigita.london.rss.RSS=DEBUG
|
||||
#com.arsdigita.london.rss.RSSService=DEBUG
|
||||
#com.arsdigita.london.search.Search=DEBUG
|
||||
#com.arsdigita.london.shortcuts.Shortcuts=DEBUG
|
||||
#com.arsdigita.london.subsite.Subsite=DEBUG
|
||||
#kea.stemmers.LovinsStemmer=DEBUG
|
||||
#kea.stemmers.StopwordsFrench=DEBUG
|
||||
#kea.stemmers.StopwordsSpanish=DEBUG
|
||||
#kea.stemmers.StopwordsEnglish=DEBUG
|
||||
#kea.stemmers.StopwordsGerman=DEBUG
|
||||
#com.arsdigita.london.terms.Terms=DEBUG
|
||||
#com.arsdigita.london.theme.ThemeApplication=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.ContactInitalizer=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.SciDepartment=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.SciOrganization=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.SciProject=DEBUG
|
||||
#com.arsdigita.cms.contenttypes.SciMember=DEBUG
|
||||
#com.arsdigita.cms.webpage.installer.Initializer=DEBUG
|
||||
|
||||
|
|
|
|||
|
|
@ -204,11 +204,14 @@ public class CreateDocLinkSearchTable extends Table implements DMConstants{
|
|||
*/
|
||||
private static class ActionCellRenderer implements TableCellRenderer {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(ActionCellRenderer.class);
|
||||
private static ControlLink s_link;
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_link = new ControlLink(new Label(DMConstants.FOLDER_NEW_CREATE_LINK));
|
||||
s_link.setConfirmation("Create Link to this Document ?");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
|
|
|
|||
|
|
@ -45,12 +45,14 @@ public class PDFConfig extends AbstractConfig {
|
|||
private static final PDFConfig s_config = new PDFConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
try {
|
||||
s_config.load();
|
||||
} catch (java.lang.IllegalArgumentException ex) {
|
||||
s_log.info("Unable to load PDFConfig. This is not a problem " +
|
||||
"during ccm load, but is a problem at all other times");
|
||||
}
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public PDFConfig() {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@ public class Forum extends Application {
|
|||
|
||||
private static final ForumConfig s_config = new ForumConfig();
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static ForumConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|||
import com.arsdigita.bebop.Page;
|
||||
// import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.util.Assert;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Factory class that enables projects to provide their own page creators.
|
||||
|
|
@ -35,21 +36,23 @@ import com.arsdigita.util.Assert;
|
|||
*/
|
||||
public class ForumPageFactory {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ForumPageFactory.class);
|
||||
public static final String THREAD_PAGE = "thread";
|
||||
public static final String FORUM_PAGE = "forum";
|
||||
|
||||
private static Map pageBuilders = new HashMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
// default pageBuilders are those provided with this project
|
||||
pageBuilders.put(THREAD_PAGE, new ThreadPageBuilder());
|
||||
pageBuilders.put(FORUM_PAGE, new ForumPageBuilder());
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static Page getPage(String pageType) {
|
||||
Assert.isTrue(pageBuilders.containsKey(pageType),
|
||||
"Requested page type (" + pageType +
|
||||
") does not have a builder registered" );
|
||||
"Requested page type (" + pageType
|
||||
+ ") does not have a builder registered");
|
||||
PageBuilder builder = (PageBuilder) pageBuilders.get(pageType);
|
||||
Page page = builder.buildPage();
|
||||
page.lock();
|
||||
|
|
@ -62,11 +65,8 @@ public class ForumPageFactory {
|
|||
return pageBuilders.keySet().iterator();
|
||||
}
|
||||
|
||||
|
||||
public static void registerPageBuilder(String pageType, PageBuilder builder) {
|
||||
pageBuilders.put(pageType, builder);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import com.arsdigita.forum.ForumContext;
|
|||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -46,14 +47,17 @@ import java.util.Iterator;
|
|||
*/
|
||||
public class TopicsList extends SimpleComponent implements Constants {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(TopicsList.class);
|
||||
/** List of properties a topic may have. */
|
||||
private final static Set s_catProps;
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_catProps = new HashSet();
|
||||
s_catProps.add("id");
|
||||
s_catProps.add("name");
|
||||
s_catProps.add("numThreads");
|
||||
s_catProps.add("latestPost");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.aplaws;
|
||||
|
||||
import com.arsdigita.xml.Element;
|
||||
|
|
@ -26,18 +25,16 @@ import com.arsdigita.persistence.metadata.Property;
|
|||
import java.util.HashMap;
|
||||
import java.util.Stack;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ObjectTypeSchemaGenerator.class);
|
||||
private boolean m_wrapRoot = false;
|
||||
private boolean m_wrapObjects = false;
|
||||
private boolean m_wrapAttributes = false;
|
||||
|
||||
|
||||
|
||||
private Stack m_history = new Stack();
|
||||
private HashMap m_elements = new HashMap();
|
||||
|
||||
// The xs:element
|
||||
private Element m_element;
|
||||
// The (optional) xs:complexType
|
||||
|
|
@ -47,21 +44,20 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
// The (optional property
|
||||
private Property m_property;
|
||||
private Stack m_properties = new Stack();
|
||||
|
||||
private Element m_root;
|
||||
private String m_rootName;
|
||||
|
||||
public static final String SCHEMA_PREFIX = "xs:";
|
||||
|
||||
public static final String SCHEMA_NS =
|
||||
"http://www.w3.org/2001/XMLSchema";
|
||||
|
||||
private static HashMap s_types = new HashMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_types.put(String.class, "xs:string");
|
||||
s_types.put(Boolean.class, "xs:boolean");
|
||||
s_types.put(Integer.class, "xs:integer");
|
||||
s_types.put(BigDecimal.class, "xs:double");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
protected static String lookupType(Class klass) {
|
||||
|
|
@ -75,7 +71,6 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
s_types.put(klass, type);
|
||||
}
|
||||
|
||||
|
||||
public ObjectTypeSchemaGenerator(String rootName,
|
||||
String namespace) {
|
||||
m_root = new Element(SCHEMA_PREFIX + "schema",
|
||||
|
|
@ -95,7 +90,6 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
return m_root;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines XML output for root object.
|
||||
* If set to true a separate element will
|
||||
|
|
@ -148,13 +142,16 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
String name;
|
||||
if (m_element == null) {
|
||||
if (m_wrapRoot) {
|
||||
Element element = m_root.newChildElement(SCHEMA_PREFIX + "element",
|
||||
Element element = m_root.newChildElement(SCHEMA_PREFIX
|
||||
+ "element",
|
||||
SCHEMA_NS);
|
||||
element.addAttribute("name", m_rootName);
|
||||
|
||||
Element type = element.newChildElement(SCHEMA_PREFIX + "complexType",
|
||||
Element type = element.newChildElement(SCHEMA_PREFIX
|
||||
+ "complexType",
|
||||
SCHEMA_NS);
|
||||
Element sequence = type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
|
||||
parent = sequence;
|
||||
|
|
@ -223,7 +220,8 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
Property property) {
|
||||
if (m_wrapAttributes) {
|
||||
if (m_sequence == null) {
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
m_sequence = sequence;
|
||||
}
|
||||
|
|
@ -271,12 +269,14 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
Property property) {
|
||||
if (m_wrapObjects) {
|
||||
if (m_sequence == null) {
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
m_sequence = sequence;
|
||||
}
|
||||
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX + "element",
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX
|
||||
+ "element",
|
||||
SCHEMA_NS);
|
||||
element.addAttribute("name", property.getName());
|
||||
if (property.isNullable()) {
|
||||
|
|
@ -324,12 +324,14 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
Property property) {
|
||||
if (m_wrapObjects) {
|
||||
if (m_sequence == null) {
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
m_sequence = sequence;
|
||||
}
|
||||
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX + "element",
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX
|
||||
+ "element",
|
||||
SCHEMA_NS);
|
||||
element.addAttribute("name", property.getName());
|
||||
if (property.isNullable()) {
|
||||
|
|
@ -367,5 +369,4 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
}
|
||||
m_property = (Property) m_properties.pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.aplaws;
|
||||
|
||||
import com.arsdigita.xml.Element;
|
||||
|
|
@ -26,18 +25,16 @@ import com.arsdigita.persistence.metadata.Property;
|
|||
import java.util.HashMap;
|
||||
import java.util.Stack;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ObjectTypeSchemaGenerator.class);
|
||||
private boolean m_wrapRoot = false;
|
||||
private boolean m_wrapObjects = false;
|
||||
private boolean m_wrapAttributes = false;
|
||||
|
||||
|
||||
|
||||
private Stack m_history = new Stack();
|
||||
private HashMap m_elements = new HashMap();
|
||||
|
||||
// The xs:element
|
||||
private Element m_element;
|
||||
// The (optional) xs:complexType
|
||||
|
|
@ -47,21 +44,20 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
// The (optional property
|
||||
private Property m_property;
|
||||
private Stack m_properties = new Stack();
|
||||
|
||||
private Element m_root;
|
||||
private String m_rootName;
|
||||
|
||||
public static final String SCHEMA_PREFIX = "xs:";
|
||||
|
||||
public static final String SCHEMA_NS =
|
||||
"http://www.w3.org/2001/XMLSchema";
|
||||
|
||||
private static HashMap s_types = new HashMap();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_types.put(String.class, "xs:string");
|
||||
s_types.put(Boolean.class, "xs:boolean");
|
||||
s_types.put(Integer.class, "xs:integer");
|
||||
s_types.put(BigDecimal.class, "xs:double");
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
protected static String lookupType(Class klass) {
|
||||
|
|
@ -75,7 +71,6 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
s_types.put(klass, type);
|
||||
}
|
||||
|
||||
|
||||
public ObjectTypeSchemaGenerator(String rootName,
|
||||
String namespace) {
|
||||
m_root = new Element(SCHEMA_PREFIX + "schema",
|
||||
|
|
@ -95,7 +90,6 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
return m_root;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines XML output for root object.
|
||||
* If set to true a separate element will
|
||||
|
|
@ -148,13 +142,16 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
String name;
|
||||
if (m_element == null) {
|
||||
if (m_wrapRoot) {
|
||||
Element element = m_root.newChildElement(SCHEMA_PREFIX + "element",
|
||||
Element element = m_root.newChildElement(SCHEMA_PREFIX
|
||||
+ "element",
|
||||
SCHEMA_NS);
|
||||
element.addAttribute("name", m_rootName);
|
||||
|
||||
Element type = element.newChildElement(SCHEMA_PREFIX + "complexType",
|
||||
Element type = element.newChildElement(SCHEMA_PREFIX
|
||||
+ "complexType",
|
||||
SCHEMA_NS);
|
||||
Element sequence = type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
|
||||
parent = sequence;
|
||||
|
|
@ -223,7 +220,8 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
Property property) {
|
||||
if (m_wrapAttributes) {
|
||||
if (m_sequence == null) {
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
m_sequence = sequence;
|
||||
}
|
||||
|
|
@ -271,12 +269,14 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
Property property) {
|
||||
if (m_wrapObjects) {
|
||||
if (m_sequence == null) {
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
m_sequence = sequence;
|
||||
}
|
||||
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX + "element",
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX
|
||||
+ "element",
|
||||
SCHEMA_NS);
|
||||
element.addAttribute("name", property.getName());
|
||||
if (property.isNullable()) {
|
||||
|
|
@ -324,12 +324,14 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
Property property) {
|
||||
if (m_wrapObjects) {
|
||||
if (m_sequence == null) {
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX + "sequence",
|
||||
Element sequence = m_type.newChildElement(SCHEMA_PREFIX
|
||||
+ "sequence",
|
||||
SCHEMA_NS);
|
||||
m_sequence = sequence;
|
||||
}
|
||||
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX + "element",
|
||||
Element element = m_sequence.newChildElement(SCHEMA_PREFIX
|
||||
+ "element",
|
||||
SCHEMA_NS);
|
||||
element.addAttribute("name", property.getName());
|
||||
if (property.isNullable()) {
|
||||
|
|
@ -367,5 +369,4 @@ public class ObjectTypeSchemaGenerator extends ObjectTypeTraversal {
|
|||
}
|
||||
m_property = (Property) m_properties.pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import com.arsdigita.util.Assert;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Base class of the AtoZ application (module)
|
||||
|
|
@ -40,12 +41,15 @@ import java.util.ArrayList;
|
|||
*/
|
||||
public class AtoZ extends Application {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(AtoZ.class);
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.london.atoz.AtoZ";
|
||||
|
||||
private static final AtoZConfig s_config = new AtoZConfig();
|
||||
static {
|
||||
logger.debug("Static initializer is starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initializer is finished.");
|
||||
}
|
||||
|
||||
public static final AtoZConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.arsdigita.persistence.DataCollection;
|
|||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.kernel.ACSObject;
|
||||
import java.util.Date;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/***
|
||||
*
|
||||
|
|
@ -61,12 +62,15 @@ import java.util.Date;
|
|||
**/
|
||||
public class DublinCoreItem extends ContentItem {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DublinCoreItem.class);
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.london.cms.dublin.DublinCoreItem";
|
||||
|
||||
private static final DublinCoreConfig s_config = new DublinCoreConfig();
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static final DublinCoreConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -18,14 +18,19 @@
|
|||
|
||||
package com.arsdigita.london.exporter;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
|
||||
public class Exporter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Exporter.class);
|
||||
private static ExporterConfig s_config = new ExporterConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static ExporterConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ public class ItemParser extends DomainObjectParser {
|
|||
private Date m_archiveDate;
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_ignoredProps = new ArrayList();
|
||||
s_ignoredProps.add(ID);
|
||||
s_ignoredProps.add(OID_ATTR);
|
||||
|
|
@ -115,6 +116,7 @@ public class ItemParser extends DomainObjectParser {
|
|||
s_ignoredProps.add(ARTICLE_ID);
|
||||
s_ignoredProps.add(DEFAULT_ANCESTORS);
|
||||
s_ignoredProps.add(DO_NOT_SAVE);
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public ItemParser(File lobDir, DomainObjectMapper mapper) {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@ public class ApplicationNavigationModel implements NavigationModel {
|
|||
new GenericNavigationModel();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
register(ContentSection.BASE_DATA_OBJECT_TYPE, new CMSNavigationModel());
|
||||
register(Navigation.BASE_DATA_OBJECT_TYPE, new DefaultNavigationModel());
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public ACSObject getObject() {
|
||||
|
|
|
|||
|
|
@ -27,10 +27,13 @@ import com.arsdigita.web.ParameterMap;
|
|||
import com.arsdigita.web.URL;
|
||||
import com.arsdigita.web.Web;
|
||||
import com.arsdigita.xml.Element;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
public class Navigation extends Application {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Navigation.class);
|
||||
|
||||
public static final String NAV_NS =
|
||||
"http://ccm.redhat.com/london/navigation";
|
||||
public static final String NAV_PREFIX = "nav";
|
||||
|
|
@ -42,7 +45,9 @@ public class Navigation extends Application {
|
|||
private static NavigationContext s_context = new NavigationContext();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static NavigationConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.london.navigation.ui;
|
||||
|
||||
import com.arsdigita.london.navigation.NavigationConstants;
|
||||
|
|
@ -30,14 +29,18 @@ import com.arsdigita.xml.Element;
|
|||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class TemplateURLs extends SimpleComponent {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(TemplateURLs.class);
|
||||
private static final String[] s_contexts;
|
||||
|
||||
// Pull out and pre-populate the template use contexts. Note that this will
|
||||
// only be done once per server load, but this is ok because there's no UI
|
||||
// for creating contexts.
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
TemplateContextCollection templates = TemplateContext.retrieveAll();
|
||||
LinkedList buffer = new LinkedList();
|
||||
|
||||
|
|
@ -50,6 +53,7 @@ public class TemplateURLs extends SimpleComponent {
|
|||
for (int i = 0; i < s_contexts.length; i++) {
|
||||
s_contexts[i] = iter.next().toString();
|
||||
}
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public TemplateURLs() {
|
||||
|
|
@ -58,12 +62,13 @@ public class TemplateURLs extends SimpleComponent {
|
|||
|
||||
public void generateXML(PageState ps, Element p) {
|
||||
ContentItem item = CMS.getContext().getContentItem();
|
||||
if( null == item ) return;
|
||||
if (null == item) {
|
||||
return;
|
||||
}
|
||||
|
||||
Element container = p.newChildElement(
|
||||
NavigationConstants.NAV_PREFIX + ":templateContexts",
|
||||
NavigationConstants.NAV_NS
|
||||
);
|
||||
NavigationConstants.NAV_NS);
|
||||
container.addAttribute("type", item.getContentType().getClassName());
|
||||
|
||||
String sectionPath = item.getContentSection().getPath();
|
||||
|
|
@ -72,8 +77,7 @@ public class TemplateURLs extends SimpleComponent {
|
|||
for (int i = 0; i < s_contexts.length; i++) {
|
||||
Element context = container.newChildElement(
|
||||
NavigationConstants.NAV_PREFIX + ":context",
|
||||
NavigationConstants.NAV_NS
|
||||
);
|
||||
NavigationConstants.NAV_NS);
|
||||
context.addAttribute("name", s_contexts[i]);
|
||||
|
||||
String path = sectionPath + "/tem_" + s_contexts[i] + '/' + itemPath;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.london.portal;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -62,34 +61,29 @@ import java.util.LinkedList;
|
|||
public class Workspace extends Application {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(Workspace.class);
|
||||
|
||||
private static final WorkspaceConfig s_config = new WorkspaceConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static WorkspaceConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.london.portal.Workspace";
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.london.portal.Workspace";
|
||||
public static final String PARTY = "party";
|
||||
|
||||
public static final String PARTY_ID = PARTY + "." + ACSObject.ID;
|
||||
|
||||
public static final String DEFAULT_LAYOUT = "defaultLayout";
|
||||
|
||||
public static final String PAGES = "pages";
|
||||
|
||||
/**
|
||||
* store this as a static variable as it cannot change during the lifetime
|
||||
* of the ccm service
|
||||
*/
|
||||
private static Workspace defaultHomepageWorkspace = null;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param obj
|
||||
|
|
@ -110,7 +104,6 @@ public class Workspace extends Application {
|
|||
/*
|
||||
* public String getContextPath() { return "ccm-ldn-portal"; }
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @return ServletPath (constant) probably should be synchron with web.xml
|
||||
|
|
@ -162,7 +155,8 @@ public class Workspace extends Application {
|
|||
* @return
|
||||
*/
|
||||
public static Workspace createWorkspace(String url, String title,
|
||||
PageLayout layout, Application parent,
|
||||
PageLayout layout,
|
||||
Application parent,
|
||||
boolean isPublic) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Creating group workspace, isPublic:" + isPublic
|
||||
|
|
@ -188,7 +182,8 @@ public class Workspace extends Application {
|
|||
* @return
|
||||
*/
|
||||
public static Workspace createWorkspace(String url, String title,
|
||||
PageLayout layout, Application parent, User owner) {
|
||||
PageLayout layout,
|
||||
Application parent, User owner) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Creating personal workspace for " + owner.getOID()
|
||||
+ " on " + url + " with parent "
|
||||
|
|
@ -259,7 +254,6 @@ public class Workspace extends Application {
|
|||
// super.beforeDelete();
|
||||
// Category.clearRootForObject(this);
|
||||
// }
|
||||
|
||||
// This method wouldn't need to exist if permissioning used
|
||||
// the associations rather than direct queries which require
|
||||
// the object to be saved
|
||||
|
|
@ -362,8 +356,8 @@ public class Workspace extends Application {
|
|||
wks.addEqualsFilter(PARTY_ID, owner.getID());
|
||||
|
||||
if (wks.next()) {
|
||||
Workspace workspace = (Workspace) Application
|
||||
.retrieveApplication(wks.getDataObject());
|
||||
Workspace workspace = (Workspace) Application.retrieveApplication(wks.
|
||||
getDataObject());
|
||||
|
||||
wks.close();
|
||||
|
||||
|
|
@ -392,8 +386,8 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
public PageLayout getDefaultLayout() {
|
||||
return (PageLayout) DomainObjectFactory
|
||||
.newInstance((DataObject) get(DEFAULT_LAYOUT));
|
||||
return (PageLayout) DomainObjectFactory.newInstance((DataObject) get(
|
||||
DEFAULT_LAYOUT));
|
||||
}
|
||||
|
||||
public void setParty(Party party) {
|
||||
|
|
@ -461,12 +455,12 @@ public class Workspace extends Application {
|
|||
|
||||
public PartyCollection getNonParticipants() {
|
||||
DataCollection dc =
|
||||
SessionManager.getSession()
|
||||
.retrieve("com.arsdigita.kernel.User");
|
||||
SessionManager.getSession().retrieve(
|
||||
"com.arsdigita.kernel.User");
|
||||
// .retrieve("com.arsdigita.kernel.Party");
|
||||
Filter f = dc
|
||||
.addNotInSubqueryFilter
|
||||
("id", "com.arsdigita.london.portal.WorkspaceParticipantIDs");
|
||||
Filter f =
|
||||
dc.addNotInSubqueryFilter("id",
|
||||
"com.arsdigita.london.portal.WorkspaceParticipantIDs");
|
||||
f.set("workspaceID", getID());
|
||||
return new PartyCollection(dc);
|
||||
}
|
||||
|
|
@ -484,8 +478,8 @@ public class Workspace extends Application {
|
|||
* alphabetical order.</p>
|
||||
**/
|
||||
public Iterator getParticipantInitials() {
|
||||
DataQuery query = SessionManager.getSession().retrieveQuery
|
||||
("com.arsdigita.london.portal.WorkspaceParticipantInitials");
|
||||
DataQuery query = SessionManager.getSession().retrieveQuery(
|
||||
"com.arsdigita.london.portal.WorkspaceParticipantInitials");
|
||||
query.setParameter("workspaceID", getID());
|
||||
|
||||
LinkedList result = new LinkedList();
|
||||
|
|
@ -516,10 +510,11 @@ public class Workspace extends Application {
|
|||
// ("id", "com.arsdigita.london.portal.WorkspaceParticipantsWithInitial");
|
||||
|
||||
DataCollection dc =
|
||||
SessionManager.getSession()
|
||||
.retrieve("com.arsdigita.kernel.User");
|
||||
Filter f = dc.addInSubqueryFilter
|
||||
("id", "com.arsdigita.london.portal.WorkspaceParticipantsWithInitial");
|
||||
SessionManager.getSession().retrieve(
|
||||
"com.arsdigita.kernel.User");
|
||||
Filter f =
|
||||
dc.addInSubqueryFilter("id",
|
||||
"com.arsdigita.london.portal.WorkspaceParticipantsWithInitial");
|
||||
f.set("workspaceID", getID());
|
||||
f.set("nameInitial", initial);
|
||||
|
||||
|
|
@ -621,9 +616,9 @@ public class Workspace extends Application {
|
|||
|
||||
dobj = (DataObject) get("theme");
|
||||
|
||||
if (dobj == null)
|
||||
if (dobj == null) {
|
||||
return null;
|
||||
else {
|
||||
} else {
|
||||
WorkspaceTheme theme = new WorkspaceTheme(dobj);
|
||||
return theme;
|
||||
}
|
||||
|
|
@ -638,8 +633,8 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
public WorkspaceCollection getChildWorkspaces() {
|
||||
DataQuery query = SessionManager.getSession().retrieveQuery
|
||||
("com.arsdigita.london.portal.childWorkspacesForApplicationID");
|
||||
DataQuery query = SessionManager.getSession().retrieveQuery(
|
||||
"com.arsdigita.london.portal.childWorkspacesForApplicationID");
|
||||
query.setParameter("applicationID", getID());
|
||||
|
||||
DataCollection collection =
|
||||
|
|
@ -676,14 +671,12 @@ public class Workspace extends Application {
|
|||
// public String getDescription() {
|
||||
// return (String) get("description");
|
||||
// }
|
||||
|
||||
/**
|
||||
* Set's the description for a Workspace.
|
||||
*/
|
||||
// public void setDescription(String description) {
|
||||
// set("description", description);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Sets the user who owns the workspace
|
||||
*
|
||||
|
|
@ -705,8 +698,8 @@ public class Workspace extends Application {
|
|||
|
||||
String url = "" + owner.getID();
|
||||
String title = "Personal Workspace for " + owner.getDisplayName();
|
||||
Application parent = Application
|
||||
.retrieveApplicationForPath(PersonalPortalPage.PERSONAL_PORTAL_PATH);
|
||||
Application parent = Application.retrieveApplicationForPath(
|
||||
PersonalPortalPage.PERSONAL_PORTAL_PATH);
|
||||
final Workspace workspace = createWorkspace(url, title, parent, false);
|
||||
|
||||
// TODO the setOwner method should probably deal with all the
|
||||
|
|
@ -715,6 +708,7 @@ public class Workspace extends Application {
|
|||
group.addMember(owner);
|
||||
workspace.setOwner(owner);
|
||||
new KernelExcursion() {
|
||||
|
||||
public void excurse() {
|
||||
setEffectiveParty(Kernel.getSystemParty());
|
||||
PermissionDescriptor pd = new PermissionDescriptor(
|
||||
|
|
@ -743,20 +737,20 @@ public class Workspace extends Application {
|
|||
}
|
||||
|
||||
public static Workspace retrievePersonalWorkspace(User owner) {
|
||||
DataCollection personalWorkspaces = SessionManager.getSession()
|
||||
.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
DataCollection personalWorkspaces = SessionManager.getSession().retrieve(
|
||||
BASE_DATA_OBJECT_TYPE);
|
||||
personalWorkspaces.addEqualsFilter("owner", owner.getID());
|
||||
|
||||
if (personalWorkspaces.next()) {
|
||||
Workspace workspace = (Workspace) Application
|
||||
.retrieveApplication(personalWorkspaces.getDataObject());
|
||||
if (personalWorkspaces.next())
|
||||
Workspace workspace = (Workspace) Application.retrieveApplication(personalWorkspaces.
|
||||
getDataObject());
|
||||
if (personalWorkspaces.next()) {
|
||||
s_log.error("more than one personal workspaces for this user!!");
|
||||
}
|
||||
personalWorkspaces.close();
|
||||
|
||||
return workspace;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.london.portal.portlet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -42,18 +41,17 @@ import com.arsdigita.xml.Element;
|
|||
|
||||
public class RSSFeedPortletHelper {
|
||||
|
||||
private static final Logger s_log = Logger
|
||||
.getLogger(RSSFeedPortletHelper.class);
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
RSSFeedPortletHelper.class);
|
||||
private static final String CACHE_SERVICE_KEY = "RSSFeedPortletHelper";
|
||||
|
||||
private static final URLCache cache = new URLCache(1000000, 15 * 60 * 1000);
|
||||
|
||||
private static final URLPool pool = new URLPool();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
URLFetcher.registerService(CACHE_SERVICE_KEY, pool, cache);
|
||||
};
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static Element getRSSElement(String location) {
|
||||
s_log.debug("getRSSElement from " + location);
|
||||
|
|
@ -115,13 +113,9 @@ public class RSSFeedPortletHelper {
|
|||
protected static class ItemExtractor extends DefaultHandler {
|
||||
|
||||
private List m_items;
|
||||
|
||||
private boolean m_item;
|
||||
|
||||
private String m_url;
|
||||
|
||||
private String m_title;
|
||||
|
||||
private StringBuffer m_scratch;
|
||||
|
||||
public ItemExtractor(List items) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package com.arsdigita.london.portal.ui;
|
||||
|
||||
import com.arsdigita.bebop.Image;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This class contains Images for the various CW icons. These image
|
||||
|
|
@ -25,6 +26,8 @@ import com.arsdigita.bebop.Image;
|
|||
**/
|
||||
public class Icons {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Icons.class);
|
||||
|
||||
public static final Image USER_16;
|
||||
public static final Image GROUP_16;
|
||||
public static final Image LEFT_16;
|
||||
|
|
@ -40,6 +43,7 @@ public class Icons {
|
|||
public static final Image TRASH_16;
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
USER_16 = new Image("/packages/workspace/www/assets/User16.gif");
|
||||
USER_16.setBorder("0");
|
||||
USER_16.lock();
|
||||
|
|
@ -97,5 +101,6 @@ public class Icons {
|
|||
TRASH_16 = new Image("/packages/workspace/www/assets/delete.gif");
|
||||
TRASH_16.setBorder("0");
|
||||
TRASH_16.lock();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ abstract class GrantsTable extends Table {
|
|||
private static TableCellRenderer[] s_viewCellRenderers;
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
int n = Grant.s_interestingPrivileges.length;
|
||||
s_editCellRenderers = new TableCellRenderer[n];
|
||||
s_viewCellRenderers = new TableCellRenderer[n];
|
||||
|
|
@ -134,6 +135,7 @@ abstract class GrantsTable extends Table {
|
|||
s_viewCellRenderers[i] =
|
||||
new ViewPrivilegeCellRenderer(Grant.s_interestingPrivileges[i]);
|
||||
}
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
// Per-request label for renderer getComponent calls
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.persistence.DataObject;
|
|||
import com.arsdigita.persistence.OID;
|
||||
|
||||
import com.arsdigita.web.Application;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Base class of the RSS application (module).
|
||||
|
|
@ -29,14 +30,17 @@ import com.arsdigita.web.Application;
|
|||
*/
|
||||
public class RSS extends Application {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RSS.class);
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.london.rss.RSS";
|
||||
|
||||
|
||||
private static final RSSConfig s_config = new RSSConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -69,7 +69,9 @@ public class RSSService {
|
|||
private static final RSSConfig s_config = new RSSConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static RSSConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.persistence.DataObject;
|
|||
import com.arsdigita.persistence.OID;
|
||||
|
||||
import com.arsdigita.web.Application;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Base class for the search application (module)
|
||||
|
|
@ -29,13 +30,16 @@ import com.arsdigita.web.Application;
|
|||
*/
|
||||
public class Search extends Application {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Search.class);
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.london.search.Search";
|
||||
|
||||
private static SearchConfig s_config = new SearchConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static SearchConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.persistence.DataObject;
|
|||
import com.arsdigita.persistence.OID;
|
||||
|
||||
import com.arsdigita.web.Application;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Base class of the shortcuts application.
|
||||
|
|
@ -29,13 +30,17 @@ import com.arsdigita.web.Application;
|
|||
*/
|
||||
public class Shortcuts extends Application {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Shortcuts.class);
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.london.shortcuts.Shortcuts";
|
||||
|
||||
private static ShortcutsConfig s_config = new ShortcutsConfig();
|
||||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
logger.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static ShortcutsConfig getConfig() {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ public class Subsite extends Application {
|
|||
private static final SubsiteConfig s_config = new SubsiteConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
private static final SubsiteContext s_context = new SubsiteContext();
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue