You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by rm...@apache.org on 2012/10/17 15:49:24 UTC

svn commit: r1399262 - in /incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher: debug/DebugWriter.java view/simple/CookieValue.java

Author: rmatthews
Date: Wed Oct 17 13:49:24 2012
New Revision: 1399262

URL: http://svn.apache.org/viewvc?rev=1399262&view=rev
Log:
ISIS-162 - Added element to get cookie value

Added:
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/CookieValue.java   (with props)
Removed:
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/DebugWriter.java

Added: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/CookieValue.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/CookieValue.java?rev=1399262&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/CookieValue.java (added)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/CookieValue.java Wed Oct 17 13:49:24 2012
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.viewer.scimpi.dispatcher.view.simple;
+
+import org.apache.isis.viewer.scimpi.dispatcher.AbstractElementProcessor;
+import org.apache.isis.viewer.scimpi.dispatcher.context.RequestContext;
+import org.apache.isis.viewer.scimpi.dispatcher.context.RequestContext.Scope;
+import org.apache.isis.viewer.scimpi.dispatcher.processor.Request;
+
+public class CookieValue extends AbstractElementProcessor {
+
+    @Override
+    public void process(final Request request) {
+        String name = request.getRequiredProperty(NAME);
+        String resultName = request.getOptionalProperty(RESULT_NAME, name);
+        final String scopeName = request.getOptionalProperty(SCOPE);
+        final Scope scope = RequestContext.scope(scopeName, Scope.REQUEST);
+        
+        String cookieString = request.getContext().getCookie(name);
+        
+        request.appendDebug("    " + resultName + " (" + scope + ") set to " + cookieString + " from cookie " + name);
+        request.getContext().addVariable(resultName, cookieString, scope);
+    }
+
+    @Override
+    public String getName() {
+        return "cookie-value";
+    }
+}

Propchange: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/CookieValue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain