|
From: <tri...@us...> - 2010-03-03 21:53:33
|
Revision: 1205
http://equanda.svn.sourceforge.net/equanda/?rev=1205&view=rev
Author: triathlon98
Date: 2010-03-03 21:53:26 +0000 (Wed, 03 Mar 2010)
Log Message:
-----------
EQ-375 refactor EquandaMessages in a "normal" service, making it 5.2 compatible
Modified Paths:
--------------
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBinding.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBindingFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBinding.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBindingFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessages.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesImpl.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslator.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslatorImpl.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java
Removed Paths:
-------------
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesInjectionProvider.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSource.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBinding.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBinding.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBinding.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -25,10 +25,9 @@
package org.equanda.t5gui.bindings;
import org.apache.tapestry5.Binding;
-import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.ioc.BaseLocatable;
import org.apache.tapestry5.ioc.Location;
-import org.equanda.t5gui.services.EquandaMessagesSource;
+import org.equanda.t5gui.services.EquandaMessages;
import java.lang.annotation.Annotation;
@@ -42,24 +41,20 @@
implements Binding
{
private String expression;
- private ComponentResources componentResources;
- private EquandaMessagesSource messagesSource;
+ private EquandaMessages messages;
/**
* Creates Equanda Message Binding
*
- * @param componentResources component resources
* @param expression message expression
* @param location location
- * @param messagesSource equanda message source
+ * @param messages equanda message source
*/
- public EquandaMessageBinding( ComponentResources componentResources, String expression, Location location,
- EquandaMessagesSource messagesSource )
+ public EquandaMessageBinding( String expression, Location location, EquandaMessages messages )
{
super( location );
- this.componentResources = componentResources;
this.expression = expression;
- this.messagesSource = messagesSource;
+ this.messages = messages;
}
/**
@@ -68,7 +63,7 @@
public Object get()
{
String key = expression != null ? expression.trim() : expression;
- return messagesSource.getMessages( componentResources ).get( key );
+ return messages.get( key );
}
@SuppressWarnings( "unchecked" )
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBindingFactory.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBindingFactory.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/EquandaMessageBindingFactory.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -28,7 +28,7 @@
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.ioc.Location;
import org.apache.tapestry5.services.BindingFactory;
-import org.equanda.t5gui.services.EquandaMessagesSource;
+import org.equanda.t5gui.services.EquandaMessages;
/**
* Factory for Equanda Message Binding
@@ -39,16 +39,16 @@
implements BindingFactory
{
- private EquandaMessagesSource messagesSource;
+ private EquandaMessages messages;
/**
* Creates Equanda Message Binding Factory
*
- * @param messagesSource equanda message source
+ * @param messages equanda message source
*/
- public EquandaMessageBindingFactory( EquandaMessagesSource messagesSource )
+ public EquandaMessageBindingFactory( EquandaMessages messages )
{
- this.messagesSource = messagesSource;
+ this.messages = messages;
}
/**
@@ -64,7 +64,7 @@
public Binding newBinding( String description, ComponentResources container, ComponentResources componentResources,
String expression, Location location )
{
- return new EquandaMessageBinding( componentResources, expression, location, messagesSource );
+ return new EquandaMessageBinding( expression, location, messages );
}
}
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBinding.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBinding.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBinding.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -25,10 +25,9 @@
package org.equanda.t5gui.bindings;
import org.apache.tapestry5.Binding;
-import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.ioc.BaseLocatable;
import org.apache.tapestry5.ioc.Location;
-import org.equanda.t5gui.services.EquandaMessagesSource;
+import org.equanda.t5gui.services.EquandaMessages;
import java.lang.annotation.Annotation;
@@ -42,24 +41,20 @@
implements Binding
{
private String expression;
- private ComponentResources componentResources;
- private EquandaMessagesSource messagesSource;
+ private EquandaMessages messages;
/**
* Creates HasEquandaMessage Binding
*
- * @param componentResources component resources
* @param expression message expression
* @param location location
- * @param messagesSource equanda message source
+ * @param messages equanda message source
*/
- public HasEquandaMessageBinding( ComponentResources componentResources, String expression, Location location,
- EquandaMessagesSource messagesSource )
+ public HasEquandaMessageBinding( String expression, Location location, EquandaMessages messages )
{
super( location );
- this.componentResources = componentResources;
this.expression = expression;
- this.messagesSource = messagesSource;
+ this.messages = messages;
}
/**
@@ -68,7 +63,7 @@
public Object get()
{
String key = expression != null ? expression.trim() : expression;
- String msg = messagesSource.getMessages( componentResources ).get( key );
+ String msg = messages.get( key );
return msg != null && msg.length() > 0 && msg.charAt( 0 ) != '[';
}
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBindingFactory.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBindingFactory.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/HasEquandaMessageBindingFactory.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -28,7 +28,7 @@
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.ioc.Location;
import org.apache.tapestry5.services.BindingFactory;
-import org.equanda.t5gui.services.EquandaMessagesSource;
+import org.equanda.t5gui.services.EquandaMessages;
/**
* Factory to figure out if there is a message for a string
@@ -39,16 +39,16 @@
implements BindingFactory
{
- private EquandaMessagesSource messagesSource;
+ private EquandaMessages messages;
/**
* Creates Equanda Message Binding Factory
*
- * @param messagesSource equanda message source
+ * @param messages equanda message source
*/
- public HasEquandaMessageBindingFactory( EquandaMessagesSource messagesSource )
+ public HasEquandaMessageBindingFactory( EquandaMessages messages )
{
- this.messagesSource = messagesSource;
+ this.messages = messages;
}
/**
@@ -64,7 +64,7 @@
public Binding newBinding( String description, ComponentResources container, ComponentResources componentResources,
String expression, Location location )
{
- return new HasEquandaMessageBinding( componentResources, expression, location, messagesSource );
+ return new HasEquandaMessageBinding( expression, location, messages );
}
}
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessages.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessages.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessages.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -35,20 +35,6 @@
extends Messages
{
/**
- * Sets language for translation
- *
- * @param language language
- */
- void setLanguage( String language );
-
- /**
- * Sets page name
- *
- * @param page page name
- */
- void setPage( String page );
-
- /**
* Sets message groups
*
* @param messagesGroups message groups
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesImpl.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesImpl.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesImpl.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -25,6 +25,8 @@
package org.equanda.t5gui.services;
import org.apache.tapestry5.ioc.MessageFormatter;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.services.ThreadLocale;
/**
* Equanda Message implementation
@@ -34,11 +36,17 @@
public class EquandaMessagesImpl
implements EquandaMessages
{
- private String language;
- private String page;
- private EquandaMessagesTranslator equandaMessageTranslator;
- private String[] messagesGroups;
+ @Inject
+ private ThreadLocale threadLocale;
+ private EquandaMessagesTranslator equandaMessageTranslator;
+ private String[] messagesGroups = {
+ "equanda-table",
+ "equanda-fixed",
+ "equanda-exceptions",
+ "app",
+ "app-exceptions",
+ };
/**
* Creates Equanda Messages
*
@@ -54,7 +62,7 @@
*/
public boolean contains( String key )
{
- return equandaMessageTranslator.hasTranslation( language, key, page, messagesGroups );
+ return equandaMessageTranslator.hasTranslation( threadLocale.getLocale().getLanguage(), key, messagesGroups );
}
/**
@@ -70,7 +78,7 @@
*/
public String get( String key )
{
- return equandaMessageTranslator.getTranslation( language, key, page, messagesGroups );
+ return equandaMessageTranslator.getTranslation( threadLocale.getLocale().getLanguage(), key, messagesGroups );
}
public MessageFormatter getFormatter( final String key )
@@ -84,16 +92,6 @@
};
}
- public void setLanguage( String language )
- {
- this.language = language;
- }
-
- public void setPage( String page )
- {
- this.page = page;
- }
-
public void setMessagesGroups( String[] messagesGroups )
{
this.messagesGroups = messagesGroups;
Deleted: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesInjectionProvider.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesInjectionProvider.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesInjectionProvider.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -1,59 +0,0 @@
-/**
- * This file is part of the equanda project.
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
- * ANY KIND, either express or implied. See the License for the specific language governing rights and
- * limitations under the License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- */
-
-package org.equanda.t5gui.services;
-
-import org.apache.tapestry5.ioc.ObjectLocator;
-import org.apache.tapestry5.model.MutableComponentModel;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.InjectionProvider;
-import org.apache.tapestry5.services.TransformConstants;
-
-/**
- * Performs injection of translated messages
- *
- * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
- */
-public class EquandaMessagesInjectionProvider
- implements InjectionProvider
-{
- @SuppressWarnings( "unchecked" )
- public boolean provideInjection( String fieldName, Class fieldType, ObjectLocator locator,
- ClassTransformation transformation, MutableComponentModel componentModel )
- {
-
- if ( fieldType.equals( EquandaMessages.class ) )
- {
- String msgSourceField = transformation.addInjectedField( EquandaMessagesSource.class,
- "equandaMessagesSource", locator.getService( EquandaMessagesSource.class ) );
- String body = String.format( "%s = %s.%s( %s );", fieldName, msgSourceField, "getMessages", transformation
- .getResourcesFieldName() );
- transformation.makeReadOnly( fieldName );
- transformation.extendMethod( TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE, body );
- return true;
- }
- return false;
- }
-
-}
Deleted: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSource.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSource.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSource.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -1,43 +0,0 @@
-/**
- * This file is part of the equanda project.
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
- * ANY KIND, either express or implied. See the License for the specific language governing rights and
- * limitations under the License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- */
-
-package org.equanda.t5gui.services;
-
-import org.apache.tapestry5.ComponentResources;
-
-/**
- * Message source for translation
- *
- * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
- */
-public interface EquandaMessagesSource
-{
- /**
- * Gets equanda messages for specified component
- *
- * @param componentResources component resources
- * @return messages
- */
- EquandaMessages getMessages( ComponentResources componentResources );
-}
Deleted: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -1,75 +0,0 @@
-/**
- * This file is part of the equanda project.
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
- * ANY KIND, either express or implied. See the License for the specific language governing rights and
- * limitations under the License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- */
-
-package org.equanda.t5gui.services;
-
-import org.apache.tapestry5.ComponentResources;
-
-/**
- * Equanda Message Source implementation
- *
- * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
- */
-public class EquandaMessagesSourceImpl
- implements EquandaMessagesSource
-{
- private static final String[] DEFAULT_GROUPS = {
- "equanda-table",
- "equanda-fixed",
- "equanda-exceptions",
- "app",
- "app-exceptions",
- };
-
- private EquandaMessagesTranslator equandaMessageTranslator;
-
- /**
- * Creates message source
- *
- * @param equandaMessageTranslator message translator
- */
- public EquandaMessagesSourceImpl( EquandaMessagesTranslator equandaMessageTranslator )
- {
- this.equandaMessageTranslator = equandaMessageTranslator;
- }
-
- public EquandaMessages getMessages( ComponentResources componentResources )
- {
- EquandaMessages messages = new EquandaMessagesImpl( equandaMessageTranslator );
- messages.setLanguage( componentResources.getLocale().getLanguage() );
- messages.setPage( componentResources.getPageName() );
-
- if ( componentResources.getPage() instanceof EquandaMessagesGroup )
- {
- messages.setMessagesGroups( ( (EquandaMessagesGroup) componentResources.getPage() ).getMessagesGroups() );
- }
- else
- {
- messages.setMessagesGroups( DEFAULT_GROUPS );
- }
-
- return messages;
- }
-
-}
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslator.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslator.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslator.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -36,20 +36,18 @@
*
* @param language language
* @param strKey message key
- * @param page page name
* @param messagesGroups array of message groups
* @return translated message
*/
- String getTranslation( String language, String strKey, String page, String[] messagesGroups );
+ String getTranslation( String language, String strKey, String[] messagesGroups );
/**
* Gets translation for specified key
*
* @param language language
* @param strKey message key
- * @param page page name
* @param messagesGroups array of message groups
* @return translated message
*/
- boolean hasTranslation( String language, String strKey, String page, String[] messagesGroups );
+ boolean hasTranslation( String language, String strKey, String[] messagesGroups );
}
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslatorImpl.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslatorImpl.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslatorImpl.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -156,7 +156,7 @@
return null;
}
- public String getTranslation( String language, String strKey, String page, String[] messagesGroups )
+ public String getTranslation( String language, String strKey, String[] messagesGroups )
{
String res = translate( language, strKey, messagesGroups );
if ( null == res )
@@ -170,7 +170,7 @@
return res;
}
- public boolean hasTranslation( String language, String strKey, String page, String[] messagesGroups )
+ public boolean hasTranslation( String language, String strKey, String[] messagesGroups )
{
return null != translate( language, strKey, messagesGroups );
}
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java 2010-02-21 12:25:38 UTC (rev 1204)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java 2010-03-03 21:53:26 UTC (rev 1205)
@@ -33,12 +33,24 @@
import org.apache.tapestry5.ioc.annotations.InjectService;
import org.apache.tapestry5.ioc.services.Coercion;
import org.apache.tapestry5.ioc.services.CoercionTuple;
-import org.apache.tapestry5.services.*;
+import org.apache.tapestry5.services.BindingFactory;
+import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.RequestFilter;
+import org.apache.tapestry5.services.RequestHandler;
+import org.apache.tapestry5.services.Response;
+import org.apache.tapestry5.services.Session;
import org.equanda.persistence.InvalidUoidException;
import org.equanda.persistence.SelectorsState;
import org.equanda.persistence.SelectorsStateType;
import org.equanda.persistence.Uoid;
-import org.equanda.t5gui.bindings.*;
+import org.equanda.t5gui.bindings.AuthDeletableFactory;
+import org.equanda.t5gui.bindings.AuthReadableFactory;
+import org.equanda.t5gui.bindings.AuthWritableFactory;
+import org.equanda.t5gui.bindings.DisplayListFactory;
+import org.equanda.t5gui.bindings.DisplayPrintFactory;
+import org.equanda.t5gui.bindings.DisplaySummaryFactory;
+import org.equanda.t5gui.bindings.EquandaMessageBindingFactory;
+import org.equanda.t5gui.bindings.HasEquandaMessageBindingFactory;
import org.equanda.t5gui.translators.UoidTranslator;
import org.slf4j.Logger;
@@ -65,6 +77,8 @@
public static void bind( ServiceBinder binder )
{
binder.bind( LoginInfoService.class, LoginInfoServiceImpl.class );
+ binder.bind( EquandaMessages.class, EquandaMessagesImpl.class );
+ binder.bind( EquandaMessagesTranslator.class, EquandaMessagesTranslatorImpl.class );
// Make bind() calls on the binder object to define most IoC services.
// Use service builder methods (example below) when the implementation
@@ -220,27 +234,6 @@
}
/**
- * Building Equanda Messages Source
- *
- * @param equandaMessageTranslator Equanda Message Translator
- * @return new Messages Source
- */
- public static EquandaMessagesSource build( EquandaMessagesTranslator equandaMessageTranslator )
- {
- return new EquandaMessagesSourceImpl( equandaMessageTranslator );
- }
-
- /**
- * Building Equanda Message Translator
- *
- * @return new Message Translator
- */
- public static EquandaMessagesTranslator build()
- {
- return new EquandaMessagesTranslatorImpl();
- }
-
- /**
* Building Equanda Setter Cache
*
* @return new EquandaSetterCache
@@ -251,27 +244,17 @@
}
/**
- * Contributes the injection providers
- *
- * @param configuration configuration
- */
- public static void contributeInjectionProvider( OrderedConfiguration<InjectionProvider> configuration )
- {
- configuration.add( "EquandaMessages", new EquandaMessagesInjectionProvider() );
- }
-
- /**
* Contributes the factory for equanda binding prefixes
*
* @param configuration configuration to add to
- * @param messagesSource Equanda Message Source
+ * @param messages Equanda Messages
* @param loginInfo login info service
*/
public static void contributeBindingSource( MappedConfiguration<String, BindingFactory> configuration,
- EquandaMessagesSource messagesSource, LoginInfoService loginInfo )
+ EquandaMessages messages, LoginInfoService loginInfo )
{
- configuration.add( "equanda-message", new EquandaMessageBindingFactory( messagesSource ) );
- configuration.add( "has-equanda-message", new HasEquandaMessageBindingFactory( messagesSource ) );
+ configuration.add( "equanda-message", new EquandaMessageBindingFactory( messages ) );
+ configuration.add( "has-equanda-message", new HasEquandaMessageBindingFactory( messages ) );
configuration.add( "equanda-readable", new AuthReadableFactory( loginInfo ) );
configuration.add( "equanda-writable", new AuthWritableFactory( loginInfo ) );
configuration.add( "equanda-deletable", new AuthDeletableFactory( loginInfo ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|