04-07-2010 03:37 PM
Exception: org.alfresco.config.ConfigException - 03060000 Reading the Server config via the generic interfaces is not supported
04-08-2010 04:41 PM
05-17-2010 07:43 AM
05-17-2010 08:48 AM
05-20-2010 12:08 AM
package com.xxxx.alfresco.km.property;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.log4j.Logger;
/**
* @author Lalit Jangra.
* Class to read property from a property file.
*/
public class KmPropertyReader {
private static Logger logger = Logger.getLogger(KmPropertyReader.class);
public String property;
Properties properties = new Properties();
public static final String PROPERTIES_FILE = "alfresco-global.properties";
public KmPropertyReader() {
ClassLoader classLoader = Thread.currentThread()
.getContextClassLoader();
InputStream inputStream = classLoader
.getResourceAsStream(PROPERTIES_FILE);
try {
properties.load(inputStream);
} catch (IOException e) {
logger
.error("Error while loading property file in KmPropertyReader() : "
+ e.getMessage());
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
logger
.error("Error while closing property file in KmPropertyReader() : "
+ e.getMessage());
e.printStackTrace();
}
}
}
}
public String getProperty(String property) {
return properties.getProperty(property);
}
public void setProperty(String property) {
this.property = property;
}
}
05-20-2010 05:02 AM
you can inject the global properties as a dependency. The bean is called "global-properties" and it's a java.util.Properties type. Then you can read whatever you want from that value.
05-20-2010 08:18 AM
05-30-2012 11:52 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="global-properties" parent="baseJavaScriptExtension" class="java.util.Properties">
<property name="extensionName">
<value>globalProperties</value>
</property>
</bean>
</beans>
in my module,06-06-2012 05:12 AM
06-11-2012 06:20 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.