jvanzyl 01/07/12 16:42:59
Modified: src/java/org/apache/turbine/modules ActionEvent.java
src/java/org/apache/turbine/modules/actions LoginUser.java
LogoutUser.java TemplateAction.java
src/java/org/apache/turbine/modules/actions/sessionvalidator
TemplateSecureSessionValidator.java
TemplateSessionValidator.java
src/java/org/apache/turbine/modules/screens Error.java
src/java/org/apache/turbine/om/security TurbineUserPeer.java
src/java/org/apache/turbine/services BaseService.java
BaseServiceBroker.java
BaseUnicastRemoteService.java Service.java
ServiceBroker.java TurbineServices.java
src/java/org/apache/turbine/services/security/db
DBSecurityService.java
src/java/org/apache/turbine/services/upload
TurbineUpload.java UploadService.java
Log:
- cleaning up some more code.
o Trying to stop using TurbineResources in Turbine classes, the
app configuration should come from the app, not a service. Using
Turbine.getConfiguration() instead.
o getting rid of Properties in the services framework all together
and changing last remaining classes using service Properties
objects.
Revision Changes Path
1.14 +5 -5
jakarta-turbine/src/java/org/apache/turbine/modules/ActionEvent.java
Index: ActionEvent.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/ActionEvent.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ActionEvent.java 2001/07/10 01:03:15 1.13
+++ ActionEvent.java 2001/07/12 23:42:34 1.14
@@ -54,11 +54,10 @@
* <http://www.apache.org/>.
*/
+import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
-
import java.lang.reflect.Method;
import java.util.Enumeration;
-import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.util.ParameterParser;
/**
@@ -101,7 +100,7 @@
* method naming in your Action class.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens </a>
- * @version $Id: ActionEvent.java,v 1.13 2001/07/10 01:03:15 jvanzyl Exp $
+ * @version $Id: ActionEvent.java,v 1.14 2001/07/12 23:42:34 jvanzyl Exp $
*/
public abstract class ActionEvent
extends Action
@@ -206,8 +205,9 @@
protected final String formatString(String input)
{
String fold =
- TurbineResources.getString(ParameterParser.URL_CASE_FOLDING, "")
- .toLowerCase();
+ Turbine.getConfiguration().getString(
+ Turbine.PP_URL_CASE_FOLDING, "").toLowerCase();
+
if ((fold == null) ||
(fold.length()==0) ||
(! fold.equals(ParameterParser.URL_CASE_FOLDING_NONE)))
1.14 +5 -8
jakarta-turbine/src/java/org/apache/turbine/modules/actions/LoginUser.java
Index: LoginUser.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/actions/LoginUser.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- LoginUser.java 2001/07/10 01:03:27 1.13
+++ LoginUser.java 2001/07/12 23:42:36 1.14
@@ -54,15 +54,12 @@
* <http://www.apache.org/>.
*/
-
import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
-
import org.apache.turbine.modules.Action;
-import org.apache.turbine.util.Log;
-import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.om.security.User;
+import org.apache.turbine.util.Log;
import org.apache.turbine.util.security.DataBackendException;
import org.apache.turbine.util.security.TurbineSecurityException;
@@ -72,7 +69,7 @@
* that users last login time will be updated.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Dave Bryson</a>
- * @version $Id: LoginUser.java,v 1.13 2001/07/10 01:03:27 jvanzyl Exp $
+ * @version $Id: LoginUser.java,v 1.14 2001/07/12 23:42:36 jvanzyl Exp $
*/
public class LoginUser
extends Action
@@ -143,11 +140,11 @@
{
Log.error(e);
}
- data.setMessage(TurbineResources.getString(
+ data.setMessage(Turbine.getConfiguration().getString(
Turbine.LOGIN_ERROR));
// Retrieve an anonymous user.
data.setUser (TurbineSecurity.getAnonymousUser());
- String loginTemplate = TurbineResources.getString(
+ String loginTemplate = Turbine.getConfiguration().getString(
Turbine.TEMPLATE_LOGIN);
if (loginTemplate != null && loginTemplate.length() > 0)
@@ -156,7 +153,7 @@
}
else
{
- data.setScreen(TurbineResources.getString(
+ data.setScreen(Turbine.getConfiguration().getString(
Turbine.SCREEN_LOGIN));
}
}
1.12 +4 -6
jakarta-turbine/src/java/org/apache/turbine/modules/actions/LogoutUser.java
Index: LogoutUser.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/actions/LogoutUser.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- LogoutUser.java 2001/07/10 01:03:28 1.11
+++ LogoutUser.java 2001/07/12 23:42:37 1.12
@@ -56,10 +56,8 @@
import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
-
import org.apache.turbine.modules.Action;
import org.apache.turbine.om.security.User;
-import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.util.Log;
import org.apache.turbine.util.security.AccessControlList;
@@ -69,7 +67,7 @@
* the User object in the session.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Dave Bryson</a>
- * @version $Id: LogoutUser.java,v 1.11 2001/07/10 01:03:28 jvanzyl Exp $
+ * @version $Id: LogoutUser.java,v 1.12 2001/07/12 23:42:37 jvanzyl Exp $
*/
public class LogoutUser
extends Action
@@ -106,7 +104,7 @@
TurbineSecurity.saveUser( user );
}
- data.setMessage(TurbineResources.getString(
+ data.setMessage(Turbine.getConfiguration().getString(
Turbine.LOGOUT_MESSAGE));
// This will cause the acl to be removed from the session in
@@ -129,10 +127,10 @@
// - it is recommended that action.logout is set to "LogoutUser" and
// that the session validator does handle setting the screen/template
// for a logged out (read not-logged-in) user.
- if (!TurbineResources.getString(Turbine.ACTION_LOGOUT, "")
+ if (!Turbine.getConfiguration().getString(Turbine.ACTION_LOGOUT, "")
.equals("LogoutUser"))
{
- data.setScreen(TurbineResources.getString(
+ data.setScreen(Turbine.getConfiguration().getString(
Turbine.SCREEN_HOMEPAGE));
}
}
1.2 +2 -4
jakarta-turbine/src/java/org/apache/turbine/modules/actions/TemplateAction.java
Index: TemplateAction.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/actions/TemplateAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TemplateAction.java 2001/07/10 01:13:22 1.1
+++ TemplateAction.java 2001/07/12 23:42:37 1.2
@@ -56,11 +56,9 @@
import org.apache.turbine.RunData;
import org.apache.turbine.TemplateContext;
-
import java.lang.reflect.Method;
import java.util.Enumeration;
import org.apache.turbine.modules.ActionEvent;
-import org.apache.turbine.modules.screens.TemplateScreen;
import org.apache.turbine.services.template.TurbineTemplate;
import org.apache.turbine.util.ParameterParser;
import org.apache.turbine.util.ValueParser;
@@ -81,7 +79,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: TemplateAction.java,v 1.1 2001/07/10 01:13:22 jvanzyl Exp $
+ * @version $Id: TemplateAction.java,v 1.2 2001/07/12 23:42:37 jvanzyl Exp $
*/
public abstract class TemplateAction
extends ActionEvent
@@ -191,7 +189,7 @@
public void setTemplate(RunData data,
String template)
{
- TemplateScreen.setTemplate(data, template);
+ data.setTarget(template);
}
/**
1.11 +7 -8
jakarta-turbine/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java
Index: TemplateSecureSessionValidator.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TemplateSecureSessionValidator.java 2001/07/10 01:03:34 1.10
+++ TemplateSecureSessionValidator.java 2001/07/12 23:42:40 1.11
@@ -56,7 +56,6 @@
import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
-import org.apache.turbine.services.resources.TurbineResources;
/**
* SessionValidator that requires login for use with the WebMacroSite
@@ -78,7 +77,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">John D. McNally</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Dave Bryson</a>
- * @version $Id: TemplateSecureSessionValidator.java,v 1.10 2001/07/10 01:03:34
jvanzyl Exp $
+ * @version $Id: TemplateSecureSessionValidator.java,v 1.11 2001/07/12 23:42:40
jvanzyl Exp $
*/
public class TemplateSecureSessionValidator
extends SessionValidator
@@ -112,7 +111,7 @@
*/
if (data.getMessage() == null)
{
- data.setMessage(TurbineResources.getString(
+ data.setMessage(Turbine.getConfiguration().getString(
Turbine.LOGIN_MESSAGE));
}
@@ -120,7 +119,7 @@
* Set the screen template to the login page.
*/
data.getTemplateInfo().setScreenTemplate(
- TurbineResources.getString(Turbine.TEMPLATE_LOGIN) );
+ Turbine.getConfiguration().getString(Turbine.TEMPLATE_LOGIN) );
/*
* We're not doing any actions buddy! (except action.login which
@@ -135,7 +134,7 @@
if ( !data.hasScreen() &&
data.getTemplateInfo().getScreenTemplate() == null )
{
- String template = TurbineResources.getString(
+ String template = Turbine.getConfiguration().getString(
Turbine.TEMPLATE_HOMEPAGE);
if (template != null)
@@ -144,7 +143,7 @@
}
else
{
- data.setScreen(TurbineResources.getString(
+ data.setScreen(Turbine.getConfiguration().getString(
Turbine.SCREEN_HOMEPAGE));
}
}
@@ -167,7 +166,7 @@
if (data.getTemplateInfo().getScreenTemplate() != null)
{
data.getTemplateInfo().setScreenTemplate(
- TurbineResources.getString(
+ Turbine.getConfiguration().getString(
Turbine.TEMPLATE_INVALID_STATE) );
data.getUser().setTemp( "prev_template",
@@ -175,7 +174,7 @@
}
else
{
- data.setScreen( TurbineResources.getString(
+ data.setScreen( Turbine.getConfiguration().getString(
Turbine.SCREEN_INVALID_STATE) );
data.getUser().setTemp( "prev_screen", data.getScreen() );
}
1.13 +5 -6
jakarta-turbine/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java
Index: TemplateSessionValidator.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TemplateSessionValidator.java 2001/07/12 20:21:44 1.12
+++ TemplateSessionValidator.java 2001/07/12 23:42:42 1.13
@@ -56,7 +56,6 @@
import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
-import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.services.security.TurbineSecurity;
/**
@@ -71,7 +70,7 @@
* @see TemplateSecureSessionValidator
* @author <a href="mailto:[EMAIL PROTECTED]">John D. McNally</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Dave Bryson</a>
- * @version $Id: TemplateSessionValidator.java,v 1.12 2001/07/12 20:21:44 jvanzyl
Exp $
+ * @version $Id: TemplateSessionValidator.java,v 1.13 2001/07/12 23:42:42 jvanzyl
Exp $
*/
public class TemplateSessionValidator
extends SessionValidator
@@ -105,7 +104,7 @@
if ( !data.hasScreen() &&
data.getTemplateInfo().getScreenTemplate() == null )
{
- String template = TurbineResources.getString(
+ String template = Turbine.getConfiguration().getString(
Turbine.TEMPLATE_HOMEPAGE);
if (template != null)
@@ -114,7 +113,7 @@
}
else
{
- data.setScreen(TurbineResources.getString(
+ data.setScreen(Turbine.getConfiguration().getString(
Turbine.SCREEN_HOMEPAGE));
}
}
@@ -127,14 +126,14 @@
if (data.getTemplateInfo().getScreenTemplate() != null)
{
data.getTemplateInfo().setScreenTemplate(
- TurbineResources.getString(
+ Turbine.getConfiguration().getString(
Turbine.TEMPLATE_INVALID_STATE) );
data.getUser().setTemp( "prev_template",
data.getTemplateInfo().getScreenTemplate() );
}
else
{
- data.setScreen( TurbineResources.getString(
+ data.setScreen( Turbine.getConfiguration().getString(
Turbine.SCREEN_INVALID_STATE) );
data.getUser().setTemp( "prev_screen", data.getScreen() );
}
1.8 +3 -3
jakarta-turbine/src/java/org/apache/turbine/modules/screens/Error.java
Index: Error.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/screens/Error.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Error.java 2001/07/10 01:03:48 1.7
+++ Error.java 2001/07/12 23:42:44 1.8
@@ -54,8 +54,8 @@
* <http://www.apache.org/>.
*/
+import org.apache.turbine.Turbine;
import org.apache.turbine.RunData;
-import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.TemplateContext;
/**
@@ -63,7 +63,7 @@
* error template defined in template.error.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Gonzalo Diethelm</a>
- * @version $Id: Error.java,v 1.7 2001/07/10 01:03:48 jvanzyl Exp $
+ * @version $Id: Error.java,v 1.8 2001/07/12 23:42:44 jvanzyl Exp $
*/
public class Error
extends TemplateScreen
@@ -82,7 +82,7 @@
context.put("processingException",data.getStackTraceException().toString());
context.put("stackTrace", data.getStackTrace());
String errorTemplate =
- TurbineResources.getString("template.error","/error.vm");
+ Turbine.getConfiguration().getString("template.error","/Error.vm");
setTemplate(data, errorTemplate);
}
}
1.5 +9 -5
jakarta-turbine/src/java/org/apache/turbine/om/security/TurbineUserPeer.java
Index: TurbineUserPeer.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/om/security/TurbineUserPeer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TurbineUserPeer.java 2001/07/02 00:43:48 1.4
+++ TurbineUserPeer.java 2001/07/12 23:42:45 1.5
@@ -57,8 +57,8 @@
import java.util.Vector;
import org.apache.turbine.services.db.om.peer.BasePeer;
import org.apache.turbine.services.db.pool.DBConnection;
-import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.services.db.util.Criteria;
+import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.util.security.DataBackendException;
/**
@@ -69,7 +69,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">John D. McNally</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Brett McLaughlin</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
- * @version $Id: TurbineUserPeer.java,v 1.4 2001/07/02 00:43:48 jon Exp $
+ * @version $Id: TurbineUserPeer.java,v 1.5 2001/07/12 23:42:45 jvanzyl Exp $
*/
public class TurbineUserPeer
extends org.apache.turbine.om.security.BaseTurbineUserPeer
@@ -84,15 +84,19 @@
* The class that the Peer will make instances of.
* If the BO is abstract then you must implement this method
* in the BO.
+ *
+ * !! This is duplicated. This method is available in
+ * the DBSecurityService???
*/
public static Class getOMClass()
throws Exception
{
if ( userClass == null )
{
- // !FIXME! this should come from the security service
- String className =
TurbineResources.getString("services.SecurityService.user.class",
- "org.apache.turbine.om.security.TurbineUser");
+ String className = TurbineSecurity.getService()
+ .getConfiguration().getString("user.class",
+ "org.apache.turbine.om.security.TurbineUser");
+
userClass = Class.forName(className);
}
1.16 +1 -21
jakarta-turbine/src/java/org/apache/turbine/services/BaseService.java
Index: BaseService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseService.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- BaseService.java 2001/06/25 06:12:41 1.15
+++ BaseService.java 2001/07/12 23:42:47 1.16
@@ -73,7 +73,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Leonard Richardson</a>
- * @version $Id: BaseService.java,v 1.15 2001/06/25 06:12:41 jvanzyl Exp $
+ * @version $Id: BaseService.java,v 1.16 2001/07/12 23:42:47 jvanzyl Exp $
*/
public class BaseService implements Service
{
@@ -211,26 +211,6 @@
public ServiceBroker getServiceBroker()
{
return serviceBroker;
- }
-
- /**
- * Returns the properties of this Service.
- *
- * @return The Properties of this Service.
- * @deprecated
- */
- public Properties getProperties()
- {
- if (name == null)
- {
- return null;
- }
-
- if (properties == null)
- {
- properties = getServiceBroker().getProperties(name);
- }
- return properties;
}
/**
1.41 +1 -15
jakarta-turbine/src/java/org/apache/turbine/services/BaseServiceBroker.java
Index: BaseServiceBroker.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseServiceBroker.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- BaseServiceBroker.java 2001/07/10 01:03:57 1.40
+++ BaseServiceBroker.java 2001/07/12 23:42:48 1.41
@@ -96,7 +96,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: BaseServiceBroker.java,v 1.40 2001/07/10 01:03:57 jvanzyl Exp $
+ * @version $Id: BaseServiceBroker.java,v 1.41 2001/07/12 23:42:48 jvanzyl Exp $
*/
public abstract class BaseServiceBroker implements ServiceBroker
{
@@ -726,20 +726,6 @@
}
return service;
- }
-
- /**
- * Returns the properites of a specific service.
- *
- * Generic ServiceBroker returns empty set of Properties.
- *
- * @param name The name of the service.
- * @return Properties of requested Service.
- * @deprecated
- */
- public Properties getProperties(String name)
- {
- return new Properties();
}
/**
1.11 +1 -44
jakarta-turbine/src/java/org/apache/turbine/services/BaseUnicastRemoteService.java
Index: BaseUnicastRemoteService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseUnicastRemoteService.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- BaseUnicastRemoteService.java 2001/06/25 06:12:42 1.10
+++ BaseUnicastRemoteService.java 2001/07/12 23:42:48 1.11
@@ -1,10 +1,8 @@
package org.apache.turbine.services;
-import java.util.Properties;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import javax.servlet.ServletConfig;
-
import org.apache.log4j.Category;
import org.apache.velocity.runtime.configuration.Configuration;
@@ -19,17 +17,13 @@
{
protected Configuration configuration;
private boolean isInitialized;
- //private InitableBroker initableBroker;
private String name;
- private Properties properties;
private ServiceBroker serviceBroker;
public BaseUnicastRemoteService()
throws RemoteException
{
isInitialized = false;
- //initableBroker = null;
- properties = null;
name = null;
serviceBroker = null;
}
@@ -55,35 +49,12 @@
}
}
- public void init(ServletConfig config)
+ public void init()
throws InitializationException
{
setInit(true);
}
- /*
- public void setInitableBroker(InitableBroker broker)
- {
- this.initableBroker = broker;
- }
-
- public InitableBroker getInitableBroker()
- {
- return initableBroker;
- }
- */
-
- public void init(Object data)
- throws InitializationException
- {
- init((ServletConfig) data);
- }
-
- public void init() throws InitializationException
- {
- setInit(true);
- }
-
protected void setInit(boolean value)
{
isInitialized = value;
@@ -100,20 +71,6 @@
public void shutdown()
{
setInit(false);
- }
-
- public Properties getProperties()
- {
- if (name == null)
- {
- return null;
- }
-
- if (properties == null)
- {
- properties = getServiceBroker().getProperties(name);
- }
- return properties;
}
public void setName(String name)
1.17 +1 -13
jakarta-turbine/src/java/org/apache/turbine/services/Service.java
Index: Service.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/Service.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Service.java 2001/06/25 06:12:42 1.16
+++ Service.java 2001/07/12 23:42:49 1.17
@@ -54,7 +54,6 @@
* <http://www.apache.org/>.
*/
-import java.util.Properties;
import org.apache.log4j.Category;
import org.apache.velocity.runtime.configuration.Configuration;
@@ -68,7 +67,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Service.java,v 1.16 2001/06/25 06:12:42 jvanzyl Exp $
+ * @version $Id: Service.java,v 1.17 2001/07/12 23:42:49 jvanzyl Exp $
*/
public interface Service
{
@@ -125,17 +124,6 @@
* @param name The name of this Service.
*/
public void setName( String name );
-
- /**
- * Returns the Properties of this Service. Every Service has at
- * least one property, which is "classname", containing the name
- * of the class implementing this service. Note that the service
- * may chose to alter its properties, therefore they may be
- * different from those returned by ServiceBroker.
- *
- * @return The properties of this Service.
- */
- public Properties getProperties();
/**
* Returns the Configuration of this Service. Every Service has at
1.14 +1 -11
jakarta-turbine/src/java/org/apache/turbine/services/ServiceBroker.java
Index: ServiceBroker.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/ServiceBroker.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ServiceBroker.java 2001/06/27 23:31:29 1.13
+++ ServiceBroker.java 2001/07/12 23:42:49 1.14
@@ -80,7 +80,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: ServiceBroker.java,v 1.13 2001/06/27 23:31:29 jvanzyl Exp $
+ * @version $Id: ServiceBroker.java,v 1.14 2001/07/12 23:42:49 jvanzyl Exp $
*/
public interface ServiceBroker
{
@@ -160,16 +160,6 @@
*/
public Service getService( String name )
throws InstantiationException;
-
- /**
- * Returns the properites of a specific service. Services use
- * this method to retrieve their properties.
- *
- * @param name The name of the service.
- * @return Properties of requested Service.
- * @deprecated use getConfiguration()
- */
- public Properties getProperties( String name );
/**
* Returns the configuration of a specific service. Services
1.33 +1 -57
jakarta-turbine/src/java/org/apache/turbine/services/TurbineServices.java
Index: TurbineServices.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/TurbineServices.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- TurbineServices.java 2001/06/25 05:40:21 1.32
+++ TurbineServices.java 2001/07/12 23:42:51 1.33
@@ -70,7 +70,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: TurbineServices.java,v 1.32 2001/06/25 05:40:21 jvanzyl Exp $
+ * @version $Id: TurbineServices.java,v 1.33 2001/07/12 23:42:51 jvanzyl Exp $
*/
public class TurbineServices
extends BaseServiceBroker
@@ -95,61 +95,5 @@
public static ServiceBroker getInstance()
{
return instance;
- }
-
- /**
- * Returns the properites of a specific service. Properties are
- * retrieved from TurbineResources.properties provided that you
- * have the following entries:
- *
- * <br>
- *
- * services.MyService.greeting=Hello\, I'm Jan B.
- *
- * <br>
- *
- * services.MyService.defaultAction=beep
- *
- * <br>
- *
- * Service "MyService" will get a set of two properites:
- * "greeting" = "Hello, I'm Jan B." and "defaultAction" = "beep".
- *
- * <p> Note that this way you will receive a 'collapsed' version
- * of your resources - multiple entries with the same key will
- * have only one value stored. Use the {@link #getConfiguration}
- * or {@link #getResources} method to take advantage of the capabilities
- * of the {@link org.apache.turbine.services.resources.TurbineResources}
- * class.
- *
- * @param name The name of the service.
- * @return Properties of requested Service.
- * @deprecated
- */
- public Properties getProperties( String name )
- {
- Properties properties = new Properties();
-
- String servicePrefix = SERVICE_PREFIX + name + '.';
- Iterator keys = configuration.getKeys(servicePrefix);
-
- while(keys.hasNext())
- {
- String key = (String)keys.next();
- String value;
- try
- {
- value = configuration.getString(key);
- }
- catch (ClassCastException propIsArray)
- {
- String[] values = configuration.getStringArray(key);
- value = values[values.length - 1];
- }
- properties.setProperty(key.substring(servicePrefix.length()),
- value);
- }
-
- return properties;
}
}
1.10 +7 -5
jakarta-turbine/src/java/org/apache/turbine/services/security/db/DBSecurityService.java
Index: DBSecurityService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/security/db/DBSecurityService.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DBSecurityService.java 2001/06/27 00:31:19 1.9
+++ DBSecurityService.java 2001/07/12 23:42:55 1.10
@@ -58,7 +58,6 @@
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import java.util.Vector;
import org.apache.turbine.services.db.om.BaseObject;
@@ -95,9 +94,10 @@
* An implementation of SecurityService that uses a database as backend.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
- * @version $Id: DBSecurityService.java,v 1.9 2001/06/27 00:31:19 mpoeschl Exp $
+ * @version $Id: DBSecurityService.java,v 1.10 2001/07/12 23:42:55 jvanzyl Exp $
*/
-public class DBSecurityService extends BaseSecurityService
+public class DBSecurityService
+ extends BaseSecurityService
{
/**
* The key within services's properties for user implementation
@@ -1141,10 +1141,12 @@
* @throws UnknownEntityException if the system's implementation of UserPeer
* interface could not be determined.
*/
- public Class getUserPeerClass() throws UnknownEntityException
+ public Class getUserPeerClass()
+ throws UnknownEntityException
{
- String userPeerClassName = getProperties().getProperty(
+ String userPeerClassName = getConfiguration().getString(
USER_PEER_CLASS_KEY, USER_PEER_CLASS_DEFAULT);
+
try
{
return Class.forName(userPeerClassName);
1.15 +6 -18
jakarta-turbine/src/java/org/apache/turbine/services/upload/TurbineUpload.java
Index: TurbineUpload.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/upload/TurbineUpload.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- TurbineUpload.java 2001/06/27 18:53:53 1.14
+++ TurbineUpload.java 2001/07/12 23:42:56 1.15
@@ -55,13 +55,9 @@
*/
import java.util.ArrayList;
-import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import org.apache.turbine.services.InstantiationException;
-import org.apache.turbine.services.Service;
-import org.apache.turbine.services.ServiceBroker;
import org.apache.turbine.services.TurbineServices;
-import org.apache.turbine.util.ParameterParser;
import org.apache.turbine.util.TurbineException;
/**
@@ -74,7 +70,7 @@
* the service's properties and default values for them.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
- * @version $Id: TurbineUpload.java,v 1.14 2001/06/27 18:53:53 jvanzyl Exp $
+ * @version $Id: TurbineUpload.java,v 1.15 2001/07/12 23:42:56 jvanzyl Exp $
*/
public abstract class TurbineUpload
{
@@ -110,19 +106,11 @@
// can't be used for automatic uploading.
return false;
}
- String auto = upload.getProperties()
- .getProperty(UploadService.AUTOMATIC_KEY,
- UploadService.AUTOMATIC_DEFAULT.toString())
- .toLowerCase();
- if(auto.equals("true") || auto.equals("yes") || auto.equals("1"))
- {
- return true;
- }
- if(auto.equals("false") || auto.equals("no") || auto.equals("0"))
- {
- return false;
- }
- return UploadService.AUTOMATIC_DEFAULT.booleanValue();
+
+ boolean auto = upload.getConfiguration().getBoolean(
+ UploadService.AUTOMATIC_KEY,UploadService.AUTOMATIC_DEFAULT);
+
+ return auto;
}
/**
1.15 +5 -8
jakarta-turbine/src/java/org/apache/turbine/services/upload/UploadService.java
Index: UploadService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/upload/UploadService.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- UploadService.java 2001/06/27 18:53:55 1.14
+++ UploadService.java 2001/07/12 23:42:57 1.15
@@ -55,9 +55,8 @@
*/
import java.util.ArrayList;
-import javax.servlet.http.HttpServletRequest;
import org.apache.turbine.services.Service;
-import org.apache.turbine.util.ParameterParser;
+import javax.servlet.http.HttpServletRequest;
import org.apache.turbine.util.TurbineException;
/**
@@ -69,7 +68,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: UploadService.java,v 1.14 2001/06/27 18:53:55 jvanzyl Exp $
+ * @version $Id: UploadService.java,v 1.15 2001/07/12 23:42:57 jvanzyl Exp $
*/
public interface UploadService
extends Service
@@ -131,7 +130,7 @@
* request by calling {@link #parseRequest(HttpServletRequest,
* ParameterParser, String) parseRequest} manually.
*/
- public static final Boolean AUTOMATIC_DEFAULT = Boolean.FALSE;
+ public static final boolean AUTOMATIC_DEFAULT = false;
/**
* The request parameter name for overriding 'repository' property
@@ -154,8 +153,8 @@
public static final String REPOSITORY_DEFAULT = ".";
/**
- *w The key in UploadService properties in
- * TurbineResources.properties 'size.max' property.
+ * w The key in UploadService properties in
+ * service configuration 'size.max' property.
*/
public static final String SIZE_MAX_KEY = "size.max";
@@ -167,7 +166,6 @@
* value, and use an action + no auto upload to enforce limits.
*
*/
- //public static final Integer SIZE_MAX_DEFAULT = new Integer(1048576);
public static final int SIZE_MAX_DEFAULT = 1048576;
/**
@@ -182,7 +180,6 @@
* request that will have it's components stored temporarily in
* memory, instead of disk.
*/
- //public static final Integer SIZE_THRESHOLD_DEFAULT = new Integer(10240);
public static final int SIZE_THRESHOLD_DEFAULT = 10240;
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]