|
From: <bri...@us...> - 2008-11-13 09:38:24
|
Revision: 862
http://equanda.svn.sourceforge.net/equanda/?rev=862&view=rev
Author: brian_reynolds
Date: 2008-11-13 09:38:19 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Added delete binding
Modified Paths:
--------------
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java
Added Paths:
-----------
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/AuthDeleteFactory.java
Added: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/AuthDeleteFactory.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/AuthDeleteFactory.java (rev 0)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/AuthDeleteFactory.java 2008-11-13 09:38:19 UTC (rev 862)
@@ -0,0 +1,70 @@
+/**
+ * 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.bindings;
+
+import org.apache.tapestry5.Binding;
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.ioc.Location;
+import org.apache.tapestry5.services.BindingFactory;
+import org.equanda.client.AuthAndConfigProvider;
+import org.equanda.t5gui.services.LoginInfoService;
+
+/**
+ * Binding prefix factory for "equanda-delete".
+ *
+ * @author <a href="mailto:bri...@ri...">Brian Reynolds</a>
+ */
+public class AuthDeleteFactory
+ implements BindingFactory
+{
+ LoginInfoService loginInfo;
+
+ public AuthDeleteFactory( LoginInfoService loginInfo )
+ {
+ this.loginInfo = loginInfo;
+ }
+
+ /**
+ * Creates new manifest binding
+ *
+ * @param description of the binding
+ * @param container the component, as represented by its resources, for which a binding is to be created.
+ * @param componentResources the component whose parameter is to be bound by the resulting binding (rarely used)
+ * @param expression expression
+ * @param location from which the binding was generate, or null if not known
+ * @return the new equanda message binding instance
+ */
+ public Binding newBinding( String description, ComponentResources container, ComponentResources componentResources,
+ String expression, Location location )
+ {
+ return new AuthAndConfigBinding( loginInfo, expression )
+ {
+ public boolean get( AuthAndConfigProvider aac, String expression )
+ {
+ return aac.isDelete( expression );
+ }
+ };
+ }
+}
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 2008-11-12 16:41:43 UTC (rev 861)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java 2008-11-13 09:38:19 UTC (rev 862)
@@ -265,6 +265,7 @@
configuration.add( "has-equanda-message", new HasEquandaMessageBindingFactory( messagesSource ) );
configuration.add( "equanda-readable", new AuthReadableFactory( loginInfo ) );
configuration.add( "equanda-writable", new AuthWritableFactory( loginInfo ) );
+ configuration.add( "equanda-delete", new AuthDeleteFactory( loginInfo ) );
configuration.add( "equanda-summary", new DisplaySummaryFactory( loginInfo ) );
configuration.add( "equanda-list", new DisplayListFactory( loginInfo ) );
configuration.add( "equanda-print", new DisplayPrintFactory( loginInfo ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|