You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/01/22 15:19:36 UTC
svn commit: r1234515 [8/17] - in /incubator/isis/trunk/framework/viewer: ./
bdd/ bdd/common/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/
bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/components/
bdd/common/src/main/java/org...
Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/isis.properties
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/isis.properties?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/isis.properties (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/isis.properties Sun Jan 22 14:18:52 2012
@@ -1,62 +1,62 @@
-# 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.
-isis.services.prefix = org.apache.isis.tck.objstore.dflt
-isis.services =\
- scalars.ApplibValuedEntityRepositoryDefault,\
- scalars.JdkValuedEntityRepositoryDefault,\
- scalars.PrimitiveValuedEntityRepositoryDefault,\
- scalars.WrapperValuedEntityRepositoryDefault, \
- simples.SimpleEntityRepositoryDefault,\
- stables.StableEntityRepositoryDefault,\
- assocs.ParentEntityRepositoryDefault,\
- defaults.WithDefaultsEntityRepositoryDefault
-
-isis.fixtures.prefix= org.apache.isis.tck.fixture
-isis.fixtures=\
- LogonAsSvenFixture,\
- scalars.ApplibValuedEntityFixture,\
- scalars.JdkValuedEntityFixture,\
- scalars.PrimitiveValuedEntityFixture,\
- scalars.WrapperValuedEntityFixture,\
- simples.SimpleEntityFixture,\
- stables.StableEntityFixture,\
- assocs.ParentAndChildEntityFixture,\
- defaults.WithDefaultsEntityFixture
-
-
-isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.dflt.classsubstitutor.CglibClassSubstitutor
-#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.javassist.classsubstitutor.JavassistClassSubstitutor
-#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.identity.classsubstitutor.ClassSubstitutorIdentity
-
-isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.dflt.objectfactory.CglibObjectFactory
-#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.javassist.objectfactory.JavassistObjectFactory
-#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.identity.objectfactory.ObjectFactoryBasic
-
-
-isis.persistor.domain-object-container=org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault
-#isis.persistor.domain-object-container=org.apache.isis.progmodel.wrapper.metamodel.DomainObjectContainerWrapperFactory
-
-
-#isis.reflector.facets.include=org.apache.isis.runtimes.dflt.runtime.authorization.standard.AuthorizationFacetFactoryImpl
-#isis.authorization.learn=true
-
-isis.authentication=noop
-isis.authorization=noop
-
-isis.user-profile-store=in-memory
-isis.persistor=in-memory
+# 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.
+isis.services.prefix = org.apache.isis.tck.objstore.dflt
+isis.services =\
+ scalars.ApplibValuedEntityRepositoryDefault,\
+ scalars.JdkValuedEntityRepositoryDefault,\
+ scalars.PrimitiveValuedEntityRepositoryDefault,\
+ scalars.WrapperValuedEntityRepositoryDefault, \
+ simples.SimpleEntityRepositoryDefault,\
+ stables.StableEntityRepositoryDefault,\
+ assocs.ParentEntityRepositoryDefault,\
+ defaults.WithDefaultsEntityRepositoryDefault
+
+isis.fixtures.prefix= org.apache.isis.tck.fixture
+isis.fixtures=\
+ LogonAsSvenFixture,\
+ scalars.ApplibValuedEntityFixture,\
+ scalars.JdkValuedEntityFixture,\
+ scalars.PrimitiveValuedEntityFixture,\
+ scalars.WrapperValuedEntityFixture,\
+ simples.SimpleEntityFixture,\
+ stables.StableEntityFixture,\
+ assocs.ParentAndChildEntityFixture,\
+ defaults.WithDefaultsEntityFixture
+
+
+isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.dflt.classsubstitutor.CglibClassSubstitutor
+#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.javassist.classsubstitutor.JavassistClassSubstitutor
+#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.identity.classsubstitutor.ClassSubstitutorIdentity
+
+isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.dflt.objectfactory.CglibObjectFactory
+#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.javassist.objectfactory.JavassistObjectFactory
+#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.identity.objectfactory.ObjectFactoryBasic
+
+
+isis.persistor.domain-object-container=org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault
+#isis.persistor.domain-object-container=org.apache.isis.progmodel.wrapper.metamodel.DomainObjectContainerWrapperFactory
+
+
+#isis.reflector.facets.include=org.apache.isis.runtimes.dflt.runtime.authorization.standard.AuthorizationFacetFactoryImpl
+#isis.authorization.learn=true
+
+isis.authentication=noop
+isis.authorization=noop
+
+isis.user-profile-store=in-memory
+isis.persistor=in-memory
#isis.xmlos.dir=/tmp/xml
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/isis.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/logging.properties
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/logging.properties?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/logging.properties (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/logging.properties Sun Jan 22 14:18:52 2012
@@ -1,30 +1,30 @@
-# 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.
-# apache's log4j is used to provide system logging.
-log4j.rootCategory=INFO, Console
-
-# The console appender
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.target=System.out
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
-
-log4j.appender.File=org.apache.log4j.RollingFileAppender
-log4j.appender.File.file=isis.log
-log4j.appender.File.append=false
-log4j.appender.File.layout=org.apache.log4j.PatternLayout
-log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+# 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.
+# apache's log4j is used to provide system logging.
+log4j.rootCategory=INFO, Console
+
+# The console appender
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.target=System.out
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n
+
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.file=isis.log
+log4j.appender.File.append=false
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/logging.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/web.xml?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/web.xml Sun Jan 22 14:18:52 2012
@@ -1,126 +1,126 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<web-app id="WebApp_ID" version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>JSON Claims</display-name>
-
- <listener>
- <listener-class>org.apache.isis.runtimes.dflt.webapp.IsisWebAppBootstrapper</listener-class>
- </listener>
-
- <context-param>
- <param-name>isis.viewers</param-name>
- <param-value>json</param-value>
- </context-param>
-
- <context-param>
- <param-name>javax.ws.rs.Application</param-name>
- <param-value>org.apache.isis.viewer.json.viewer.JsonApplication</param-value>
- </context-param>
-
- <filter>
- <filter-name>IsisSessionFilter</filter-name>
- <filter-class>org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter</filter-class>
- <init-param>
- <!-- trusted client, so no authentication required -->
- <param-name>authenticationSessionLookupStrategy</param-name>
- <param-value>org.apache.isis.viewer.json.viewer.authentication.AuthenticationSessionLookupStrategyTrusted</param-value>
- </init-param>
- <init-param>
- <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
- <param-name>whenNoSession</param-name>
- <param-value>continue</param-value>
- </init-param>
- </filter>
-
- <filter>
- <filter-name>ResourceCachingFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
- <init-param>
- <param-name>CacheTime</param-name>
- <param-value>86400</param-value>
- </init-param>
- </filter>
-
- <filter-mapping>
- <filter-name>IsisSessionFilter</filter-name>
- <url-pattern>*</url-pattern>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.js</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.css</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.jpg</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.png</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.gif</url-pattern>
- </filter-mapping>
-
- <listener>
- <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
- </listener>
-
- <servlet>
- <servlet-name>RestEasy</servlet-name>
- <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
- </servlet>
-
- <servlet>
- <servlet-name>Resource</servlet-name>
- <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>RestEasy</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.js</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.gif</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.png</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.html</url-pattern>
- </servlet-mapping>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<web-app id="WebApp_ID" version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>JSON Claims</display-name>
+
+ <listener>
+ <listener-class>org.apache.isis.runtimes.dflt.webapp.IsisWebAppBootstrapper</listener-class>
+ </listener>
+
+ <context-param>
+ <param-name>isis.viewers</param-name>
+ <param-value>json</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.apache.isis.viewer.json.viewer.JsonApplication</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>IsisSessionFilter</filter-name>
+ <filter-class>org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter</filter-class>
+ <init-param>
+ <!-- trusted client, so no authentication required -->
+ <param-name>authenticationSessionLookupStrategy</param-name>
+ <param-value>org.apache.isis.viewer.json.viewer.authentication.AuthenticationSessionLookupStrategyTrusted</param-value>
+ </init-param>
+ <init-param>
+ <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
+ <param-name>whenNoSession</param-name>
+ <param-value>continue</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
+ <init-param>
+ <param-name>CacheTime</param-name>
+ <param-value>86400</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>IsisSessionFilter</filter-name>
+ <url-pattern>*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.jpg</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>RestEasy</servlet-name>
+ <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>Resource</servlet-name>
+ <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>RestEasy</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.js</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.gif</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.png</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.html</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/IsisWebServerRule.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/RepresentationMatchers.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_exceptionHandling.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/VersionResourceTest_accept.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/VersionResourceTest_representationAndHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_accept.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/object/DomainObjectResourceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/invoke/DomainServiceResourceTest_invokeAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_accept.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_notFound.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_xrofollowlinks.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_accept.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_xrofollowlinks.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_accept.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/stories/UserStoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/NOTICE
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/browser-support.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/browser.html
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/browser.html?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/browser.html (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/browser.html Sun Jan 22 14:18:52 2012
@@ -1,48 +1,48 @@
-<!-- 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. -->
-<html>
- <head>
- <title>JSON Objects</title>
- <script type="text/javascript" src="jquery-1.6.1.js"></script>
- <script type="text/javascript" src="browser-support.js"></script>
- </head>
- <body>
- <div id="services">
- <p>Services</p>
- <ul></ul>
- </div>
- <div id="breadcrumbs">
- <ul></ul>
- </div>
- <div id="current">
- <div id="object">
- <div id="summary">
- <ul></ul>
- </div>
- <div id="properties">
- <ul></ul>
- </div>
- <div id="collections">
- <ul></ul>
- </div>
- </div>
- <div id="collection">
- <ul></ul>
- </div>
- </div>
- <div id="actions">
- <ul></ul>
- </div>
- <script>
- bootstrap_app();
- </script>
- </body>
-</html>
+<!-- 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. -->
+<html>
+ <head>
+ <title>JSON Objects</title>
+ <script type="text/javascript" src="jquery-1.6.1.js"></script>
+ <script type="text/javascript" src="browser-support.js"></script>
+ </head>
+ <body>
+ <div id="services">
+ <p>Services</p>
+ <ul></ul>
+ </div>
+ <div id="breadcrumbs">
+ <ul></ul>
+ </div>
+ <div id="current">
+ <div id="object">
+ <div id="summary">
+ <ul></ul>
+ </div>
+ <div id="properties">
+ <ul></ul>
+ </div>
+ <div id="collections">
+ <ul></ul>
+ </div>
+ </div>
+ <div id="collection">
+ <ul></ul>
+ </div>
+ </div>
+ <div id="actions">
+ <ul></ul>
+ </div>
+ <script>
+ bootstrap_app();
+ </script>
+ </body>
+</html>
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/browser.html
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/index.html
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/index.html?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/index.html (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/index.html Sun Jan 22 14:18:52 2012
@@ -1,24 +1,24 @@
-<!-- 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. -->
-<html>
- <head>
- <title>JSON Objects</title>
- <script type="text/javascript" src="jquery-1.6.1.js"></script>
- <script type="text/javascript" src="isis-json-support.js"></script>
- </head>
- <body>
- <div id="services">
- </div>
- <script>
- bootstrap_app();
- </script>
- </body>
-</html>
+<!-- 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. -->
+<html>
+ <head>
+ <title>JSON Objects</title>
+ <script type="text/javascript" src="jquery-1.6.1.js"></script>
+ <script type="text/javascript" src="isis-json-support.js"></script>
+ </head>
+ <body>
+ <div id="services">
+ </div>
+ <script>
+ bootstrap_app();
+ </script>
+ </body>
+</html>
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/archived-json-browser/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/AbstractJaxRsApplication.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/Constants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/HasHttpStatusCode.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplication.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplicationException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplicationExceptionMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/ResourceContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/RuntimeExceptionMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/authentication/AuthenticationSessionStrategyBasicAuth.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/authentication/AuthenticationSessionStrategyHeader.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/authentication/AuthenticationSessionStrategyTrusted.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/embedded/EmbeddedWebViewerJson.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/embedded/JsonViewerInstaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/GraphUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java Sun Jan 22 14:18:52 2012
@@ -1,94 +1,94 @@
-/**
- * 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.json.viewer.representations;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.isis.viewer.json.applib.HttpMethod;
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.apache.isis.viewer.json.applib.links.Rel;
-import org.apache.isis.viewer.json.viewer.ResourceContext;
-
-public final class LinkBuilder {
-
- public static LinkBuilder newBuilder(final ResourceContext resourceContext, final Rel rel, final RepresentationType representationType, final String hrefFormat, final Object... hrefArgs) {
- return newBuilder(resourceContext, rel, representationType.getMediaType(), hrefFormat, hrefArgs);
- }
-
- public static LinkBuilder newBuilder(final ResourceContext resourceContext, final Rel rel, final MediaType mediaType, final String hrefFormat, final Object... hrefArgs) {
- return new LinkBuilder(resourceContext, rel, String.format(hrefFormat, hrefArgs), mediaType);
- }
-
- private final ResourceContext resourceContext;
- private final JsonRepresentation representation = JsonRepresentation.newMap();
-
- private final Rel rel;
- private final String href;
- private final MediaType mediaType;
-
- private HttpMethod method = HttpMethod.GET;
- private String title;
- private JsonRepresentation arguments;
- private JsonRepresentation value;
- private String id;
-
- protected LinkBuilder(final ResourceContext resourceContext, final Rel rel, final String href, final MediaType mediaType) {
- this.resourceContext = resourceContext;
- this.rel = rel;
- this.href = href;
- this.mediaType = mediaType;
- }
-
- public LinkBuilder withHttpMethod(final HttpMethod method) {
- this.method = method;
- return this;
- }
-
- public LinkBuilder withTitle(final String title) {
- this.title = title;
- return this;
- }
-
- public LinkBuilder withArguments(final JsonRepresentation arguments) {
- this.arguments = arguments;
- return this;
- }
-
- public LinkBuilder withId(final String id) {
- this.id = id;
- return this;
- }
-
- public LinkBuilder withValue(final JsonRepresentation value) {
- this.value = value;
- return this;
- }
-
- public JsonRepresentation build() {
- representation.mapPut("id", id);
- representation.mapPut("rel", rel.getName());
- representation.mapPut("href", resourceContext.urlFor(href));
- representation.mapPut("method", method);
- representation.mapPut("type", mediaType.toString());
- representation.mapPut("title", title);
- representation.mapPut("arguments", arguments);
- representation.mapPut("value", value);
- return representation;
- }
-
+/**
+ * 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.json.viewer.representations;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.isis.viewer.json.applib.HttpMethod;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.RepresentationType;
+import org.apache.isis.viewer.json.applib.links.Rel;
+import org.apache.isis.viewer.json.viewer.ResourceContext;
+
+public final class LinkBuilder {
+
+ public static LinkBuilder newBuilder(final ResourceContext resourceContext, final Rel rel, final RepresentationType representationType, final String hrefFormat, final Object... hrefArgs) {
+ return newBuilder(resourceContext, rel, representationType.getMediaType(), hrefFormat, hrefArgs);
+ }
+
+ public static LinkBuilder newBuilder(final ResourceContext resourceContext, final Rel rel, final MediaType mediaType, final String hrefFormat, final Object... hrefArgs) {
+ return new LinkBuilder(resourceContext, rel, String.format(hrefFormat, hrefArgs), mediaType);
+ }
+
+ private final ResourceContext resourceContext;
+ private final JsonRepresentation representation = JsonRepresentation.newMap();
+
+ private final Rel rel;
+ private final String href;
+ private final MediaType mediaType;
+
+ private HttpMethod method = HttpMethod.GET;
+ private String title;
+ private JsonRepresentation arguments;
+ private JsonRepresentation value;
+ private String id;
+
+ protected LinkBuilder(final ResourceContext resourceContext, final Rel rel, final String href, final MediaType mediaType) {
+ this.resourceContext = resourceContext;
+ this.rel = rel;
+ this.href = href;
+ this.mediaType = mediaType;
+ }
+
+ public LinkBuilder withHttpMethod(final HttpMethod method) {
+ this.method = method;
+ return this;
+ }
+
+ public LinkBuilder withTitle(final String title) {
+ this.title = title;
+ return this;
+ }
+
+ public LinkBuilder withArguments(final JsonRepresentation arguments) {
+ this.arguments = arguments;
+ return this;
+ }
+
+ public LinkBuilder withId(final String id) {
+ this.id = id;
+ return this;
+ }
+
+ public LinkBuilder withValue(final JsonRepresentation value) {
+ this.value = value;
+ return this;
+ }
+
+ public JsonRepresentation build() {
+ representation.mapPut("id", id);
+ representation.mapPut("rel", rel.getName());
+ representation.mapPut("href", resourceContext.urlFor(href));
+ representation.mapPut("method", method);
+ representation.mapPut("type", mediaType.toString());
+ representation.mapPut("title", title);
+ representation.mapPut("arguments", arguments);
+ representation.mapPut("value", value);
+ return representation;
+ }
+
}
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkFollower.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/RendererFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/RendererFactoryRegistry.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererAbstract.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererFactoryAbstract.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/WellKnownType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/ResourceAbstract.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java Sun Jan 22 14:18:52 2012
@@ -1,253 +1,253 @@
-/**
- * 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.json.viewer.resources.domainobjects;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.apache.isis.viewer.json.applib.links.Rel;
-import org.apache.isis.viewer.json.viewer.ResourceContext;
-import org.apache.isis.viewer.json.viewer.representations.LinkFollower;
-import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
-import org.codehaus.jackson.node.NullNode;
-
-public abstract class AbstractObjectMemberReprRenderer<R extends ReprRendererAbstract<R, ObjectAndMember<T>>, T extends ObjectMember> extends ReprRendererAbstract<R, ObjectAndMember<T>> {
-
- protected enum Mode {
- INLINE, FOLLOWED, STANDALONE, MUTATED, ARGUMENTS;
-
- public boolean isInline() {
- return this == INLINE;
- }
-
- public boolean isFollowed() {
- return this == FOLLOWED;
- }
-
- public boolean isStandalone() {
- return this == STANDALONE;
- }
-
- public boolean isMutated() {
- return this == MUTATED;
- }
-
- public boolean isArguments() {
- return this == ARGUMENTS;
- }
- }
-
- protected ObjectAdapterLinkTo linkTo;
-
- protected ObjectAdapter objectAdapter;
- protected MemberType memberType;
- protected T objectMember;
- protected Mode mode = Mode.INLINE; // unless we determine otherwise
-
- public AbstractObjectMemberReprRenderer(final ResourceContext resourceContext, final LinkFollower linkFollower, final RepresentationType representationType, final JsonRepresentation representation) {
- super(resourceContext, linkFollower, representationType, representation);
- }
-
- @Override
- public R with(final ObjectAndMember<T> objectAndMember) {
- this.objectAdapter = objectAndMember.getObjectAdapter();
- this.objectMember = objectAndMember.getMember();
- this.memberType = MemberType.determineFrom(objectMember);
- usingLinkTo(new DomainObjectLinkTo());
-
- // done eagerly so can use as criteria for x-ro-follow-links
- representation.mapPut(memberType.getJsProp(), objectMember.getId());
- representation.mapPut("memberType", memberType.getName());
-
- return cast(this);
- }
-
- /**
- * Must be called after {@link #with(ObjectAndMember)} (which provides the
- * {@link #objectAdapter}).
- */
- public R usingLinkTo(final ObjectAdapterLinkTo linkTo) {
- this.linkTo = linkTo.usingResourceContext(resourceContext).with(objectAdapter);
- return cast(this);
- }
-
- /**
- * Indicate that this is a standalone representation.
- */
- public R asStandalone() {
- mode = Mode.STANDALONE;
- return cast(this);
- }
-
- /**
- * Indicate that this is a representation to include as the result of a
- * followed link.
- */
- public R asFollowed() {
- mode = Mode.FOLLOWED;
- return cast(this);
- }
-
- /**
- * Indicates that the representation was produced as the result of a
- * resource that mutated the state.
- *
- * <p>
- * The effect of this is to suppress the link to self.
- */
- public R asMutated() {
- mode = Mode.MUTATED;
- return cast(this);
- }
-
- public R asArguments() {
- mode = Mode.ARGUMENTS;
- return cast(this);
- }
-
- /**
- * For subclasses to call from their {@link #render()} method.
- */
- protected void renderMemberContent() {
- if (mode.isInline()) {
- addDetailsLinkIfPersistent();
- }
-
- if (mode.isStandalone()) {
- addLinkToSelf();
- }
-
- if (mode.isStandalone() || mode.isMutated()) {
- addLinkToUp();
- }
-
- if (mode.isFollowed() || mode.isStandalone() || mode.isMutated()) {
- addMutatorsIfEnabled();
-
- putExtensionsIsisProprietary();
- addLinksToFormalDomainModel();
- addLinksIsisProprietary();
- }
- }
-
- private void addLinkToSelf() {
- getLinks().arrayAdd(linkTo.memberBuilder(Rel.SELF, memberType, objectMember).build());
- }
-
- private void addLinkToUp() {
- getLinks().arrayAdd(linkTo.builder(Rel.UP).build());
- }
-
- protected abstract void addMutatorsIfEnabled();
-
- /**
- * For subclasses to call back to when {@link #addMutatorsIfEnabled() adding
- * mutators}.
- */
- protected void addLinkFor(final MutatorSpec mutatorSpec) {
- if (!hasMemberFacet(mutatorSpec.mutatorFacetType)) {
- return;
- }
- final JsonRepresentation arguments = mutatorArgs(mutatorSpec);
- final RepresentationType representationType = memberType.getRepresentationType();
- final JsonRepresentation mutatorLink = linkToForMutatorInvoke().memberBuilder(mutatorSpec.rel, memberType, objectMember, representationType, mutatorSpec.suffix).withHttpMethod(mutatorSpec.httpMethod).withArguments(arguments).build();
- getLinks().arrayAdd(mutatorLink);
- }
-
- /**
- * Hook to allow actions to render invoke links that point to the
- * contributing service.
- */
- protected ObjectAdapterLinkTo linkToForMutatorInvoke() {
- return linkTo;
- }
-
- /**
- * Default implementation (common to properties and collections) that can be
- * overridden (ie by actions) if required.
- */
- protected JsonRepresentation mutatorArgs(final MutatorSpec mutatorSpec) {
- if (mutatorSpec.arguments.isNone()) {
- return null;
- }
- if (mutatorSpec.arguments.isOne()) {
- final JsonRepresentation repr = JsonRepresentation.newMap();
- repr.mapPut("value", NullNode.getInstance()); // force a null into
- // the map
- return repr;
- }
- // overridden by actions
- throw new UnsupportedOperationException("override mutatorArgs() to populate for many arguments");
- }
-
- private void addDetailsLinkIfPersistent() {
- if (!objectAdapter.isPersistent()) {
- return;
- }
- final JsonRepresentation link = linkTo.memberBuilder(Rel.DETAILS, memberType, objectMember).build();
- getLinks().arrayAdd(link);
-
- final LinkFollower membersLinkFollower = getLinkFollower();
- final LinkFollower detailsLinkFollower = membersLinkFollower.follow("links[rel=%s]", Rel.DETAILS.getName());
- if (membersLinkFollower.matches(representation) && detailsLinkFollower.matches(link)) {
- followDetailsLink(link);
- }
- return;
- }
-
- protected abstract void followDetailsLink(JsonRepresentation detailsLink);
-
- protected final void putDisabledReasonIfDisabled() {
- final String disabledReasonRep = usability().getReason();
- representation.mapPut("disabledReason", disabledReasonRep);
- }
-
- protected abstract void putExtensionsIsisProprietary();
-
- protected abstract void addLinksToFormalDomainModel();
-
- protected abstract void addLinksIsisProprietary();
-
- /**
- * Convenience method.
- */
- public boolean isMemberVisible() {
- return visibility().isAllowed();
- }
-
- protected <F extends Facet> F getMemberSpecFacet(final Class<F> facetType) {
- final ObjectSpecification otoaSpec = objectMember.getSpecification();
- return otoaSpec.getFacet(facetType);
- }
-
- protected boolean hasMemberFacet(final Class<? extends Facet> facetType) {
- return objectMember.getFacet(facetType) != null;
- }
-
- protected Consent usability() {
- return objectMember.isUsable(getSession(), objectAdapter);
- }
-
- protected Consent visibility() {
- return objectMember.isVisible(getSession(), objectAdapter);
- }
-
+/**
+ * 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.json.viewer.resources.domainobjects;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.RepresentationType;
+import org.apache.isis.viewer.json.applib.links.Rel;
+import org.apache.isis.viewer.json.viewer.ResourceContext;
+import org.apache.isis.viewer.json.viewer.representations.LinkFollower;
+import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
+import org.codehaus.jackson.node.NullNode;
+
+public abstract class AbstractObjectMemberReprRenderer<R extends ReprRendererAbstract<R, ObjectAndMember<T>>, T extends ObjectMember> extends ReprRendererAbstract<R, ObjectAndMember<T>> {
+
+ protected enum Mode {
+ INLINE, FOLLOWED, STANDALONE, MUTATED, ARGUMENTS;
+
+ public boolean isInline() {
+ return this == INLINE;
+ }
+
+ public boolean isFollowed() {
+ return this == FOLLOWED;
+ }
+
+ public boolean isStandalone() {
+ return this == STANDALONE;
+ }
+
+ public boolean isMutated() {
+ return this == MUTATED;
+ }
+
+ public boolean isArguments() {
+ return this == ARGUMENTS;
+ }
+ }
+
+ protected ObjectAdapterLinkTo linkTo;
+
+ protected ObjectAdapter objectAdapter;
+ protected MemberType memberType;
+ protected T objectMember;
+ protected Mode mode = Mode.INLINE; // unless we determine otherwise
+
+ public AbstractObjectMemberReprRenderer(final ResourceContext resourceContext, final LinkFollower linkFollower, final RepresentationType representationType, final JsonRepresentation representation) {
+ super(resourceContext, linkFollower, representationType, representation);
+ }
+
+ @Override
+ public R with(final ObjectAndMember<T> objectAndMember) {
+ this.objectAdapter = objectAndMember.getObjectAdapter();
+ this.objectMember = objectAndMember.getMember();
+ this.memberType = MemberType.determineFrom(objectMember);
+ usingLinkTo(new DomainObjectLinkTo());
+
+ // done eagerly so can use as criteria for x-ro-follow-links
+ representation.mapPut(memberType.getJsProp(), objectMember.getId());
+ representation.mapPut("memberType", memberType.getName());
+
+ return cast(this);
+ }
+
+ /**
+ * Must be called after {@link #with(ObjectAndMember)} (which provides the
+ * {@link #objectAdapter}).
+ */
+ public R usingLinkTo(final ObjectAdapterLinkTo linkTo) {
+ this.linkTo = linkTo.usingResourceContext(resourceContext).with(objectAdapter);
+ return cast(this);
+ }
+
+ /**
+ * Indicate that this is a standalone representation.
+ */
+ public R asStandalone() {
+ mode = Mode.STANDALONE;
+ return cast(this);
+ }
+
+ /**
+ * Indicate that this is a representation to include as the result of a
+ * followed link.
+ */
+ public R asFollowed() {
+ mode = Mode.FOLLOWED;
+ return cast(this);
+ }
+
+ /**
+ * Indicates that the representation was produced as the result of a
+ * resource that mutated the state.
+ *
+ * <p>
+ * The effect of this is to suppress the link to self.
+ */
+ public R asMutated() {
+ mode = Mode.MUTATED;
+ return cast(this);
+ }
+
+ public R asArguments() {
+ mode = Mode.ARGUMENTS;
+ return cast(this);
+ }
+
+ /**
+ * For subclasses to call from their {@link #render()} method.
+ */
+ protected void renderMemberContent() {
+ if (mode.isInline()) {
+ addDetailsLinkIfPersistent();
+ }
+
+ if (mode.isStandalone()) {
+ addLinkToSelf();
+ }
+
+ if (mode.isStandalone() || mode.isMutated()) {
+ addLinkToUp();
+ }
+
+ if (mode.isFollowed() || mode.isStandalone() || mode.isMutated()) {
+ addMutatorsIfEnabled();
+
+ putExtensionsIsisProprietary();
+ addLinksToFormalDomainModel();
+ addLinksIsisProprietary();
+ }
+ }
+
+ private void addLinkToSelf() {
+ getLinks().arrayAdd(linkTo.memberBuilder(Rel.SELF, memberType, objectMember).build());
+ }
+
+ private void addLinkToUp() {
+ getLinks().arrayAdd(linkTo.builder(Rel.UP).build());
+ }
+
+ protected abstract void addMutatorsIfEnabled();
+
+ /**
+ * For subclasses to call back to when {@link #addMutatorsIfEnabled() adding
+ * mutators}.
+ */
+ protected void addLinkFor(final MutatorSpec mutatorSpec) {
+ if (!hasMemberFacet(mutatorSpec.mutatorFacetType)) {
+ return;
+ }
+ final JsonRepresentation arguments = mutatorArgs(mutatorSpec);
+ final RepresentationType representationType = memberType.getRepresentationType();
+ final JsonRepresentation mutatorLink = linkToForMutatorInvoke().memberBuilder(mutatorSpec.rel, memberType, objectMember, representationType, mutatorSpec.suffix).withHttpMethod(mutatorSpec.httpMethod).withArguments(arguments).build();
+ getLinks().arrayAdd(mutatorLink);
+ }
+
+ /**
+ * Hook to allow actions to render invoke links that point to the
+ * contributing service.
+ */
+ protected ObjectAdapterLinkTo linkToForMutatorInvoke() {
+ return linkTo;
+ }
+
+ /**
+ * Default implementation (common to properties and collections) that can be
+ * overridden (ie by actions) if required.
+ */
+ protected JsonRepresentation mutatorArgs(final MutatorSpec mutatorSpec) {
+ if (mutatorSpec.arguments.isNone()) {
+ return null;
+ }
+ if (mutatorSpec.arguments.isOne()) {
+ final JsonRepresentation repr = JsonRepresentation.newMap();
+ repr.mapPut("value", NullNode.getInstance()); // force a null into
+ // the map
+ return repr;
+ }
+ // overridden by actions
+ throw new UnsupportedOperationException("override mutatorArgs() to populate for many arguments");
+ }
+
+ private void addDetailsLinkIfPersistent() {
+ if (!objectAdapter.isPersistent()) {
+ return;
+ }
+ final JsonRepresentation link = linkTo.memberBuilder(Rel.DETAILS, memberType, objectMember).build();
+ getLinks().arrayAdd(link);
+
+ final LinkFollower membersLinkFollower = getLinkFollower();
+ final LinkFollower detailsLinkFollower = membersLinkFollower.follow("links[rel=%s]", Rel.DETAILS.getName());
+ if (membersLinkFollower.matches(representation) && detailsLinkFollower.matches(link)) {
+ followDetailsLink(link);
+ }
+ return;
+ }
+
+ protected abstract void followDetailsLink(JsonRepresentation detailsLink);
+
+ protected final void putDisabledReasonIfDisabled() {
+ final String disabledReasonRep = usability().getReason();
+ representation.mapPut("disabledReason", disabledReasonRep);
+ }
+
+ protected abstract void putExtensionsIsisProprietary();
+
+ protected abstract void addLinksToFormalDomainModel();
+
+ protected abstract void addLinksIsisProprietary();
+
+ /**
+ * Convenience method.
+ */
+ public boolean isMemberVisible() {
+ return visibility().isAllowed();
+ }
+
+ protected <F extends Facet> F getMemberSpecFacet(final Class<F> facetType) {
+ final ObjectSpecification otoaSpec = objectMember.getSpecification();
+ return otoaSpec.getFacet(facetType);
+ }
+
+ protected boolean hasMemberFacet(final Class<? extends Facet> facetType) {
+ return objectMember.getFacet(facetType) != null;
+ }
+
+ protected Consent usability() {
+ return objectMember.isUsable(getSession(), objectAdapter);
+ }
+
+ protected Consent visibility() {
+ return objectMember.isVisible(getSession(), objectAdapter);
+ }
+
}
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ActionResultReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ActionResultReprRenderer.java?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ActionResultReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ActionResultReprRenderer.java Sun Jan 22 14:18:52 2012
@@ -1,184 +1,184 @@
-/**
- * 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.json.viewer.resources.domainobjects;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
-import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.apache.isis.viewer.json.applib.domainobjects.ActionResultRepresentation.ResultType;
-import org.apache.isis.viewer.json.applib.links.Rel;
-import org.apache.isis.viewer.json.viewer.ResourceContext;
-import org.apache.isis.viewer.json.viewer.representations.LinkBuilder;
-import org.apache.isis.viewer.json.viewer.representations.LinkFollower;
-import org.apache.isis.viewer.json.viewer.representations.RendererFactory;
-import org.apache.isis.viewer.json.viewer.representations.RendererFactoryRegistry;
-import org.apache.isis.viewer.json.viewer.representations.ReprRenderer;
-import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
-import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;
-
-public class ActionResultReprRenderer extends ReprRendererAbstract<ActionResultReprRenderer, ObjectAndActionInvocation> {
-
- private ObjectAdapterLinkTo adapterLinkTo = new DomainObjectLinkTo();
-
- private ObjectAdapter objectAdapter;
- private ObjectAction action;
- private JsonRepresentation arguments;
- private ObjectAdapter returnedAdapter;
-
- public static class Factory extends ReprRendererFactoryAbstract {
-
- public Factory() {
- super(RepresentationType.ACTION_RESULT);
- }
-
- @Override
- public ReprRenderer<?, ?> newRenderer(final ResourceContext resourceContext, final LinkFollower linkFollower, final JsonRepresentation representation) {
- return new ActionResultReprRenderer(resourceContext, linkFollower, getRepresentationType(), representation);
- }
- }
-
- private ActionResultReprRenderer(final ResourceContext resourceContext, final LinkFollower linkFollower, final RepresentationType representationType, final JsonRepresentation representation) {
- super(resourceContext, linkFollower, representationType, representation);
- }
-
- @Override
- public ActionResultReprRenderer with(final ObjectAndActionInvocation objectAndActionInvocation) {
-
- objectAdapter = objectAndActionInvocation.getObjectAdapter();
- action = objectAndActionInvocation.getAction();
- arguments = objectAndActionInvocation.getArguments();
- returnedAdapter = objectAndActionInvocation.getReturnedAdapter();
-
- adapterLinkTo.with(returnedAdapter);
-
- return this;
- }
-
- public void using(final ObjectAdapterLinkTo adapterLinkTo) {
- this.adapterLinkTo = adapterLinkTo.with(objectAdapter);
- }
-
- @Override
- public JsonRepresentation render() {
-
- representationWithSelfFor(action, arguments);
-
- addResult(representation);
-
- addExtensionsIsisProprietaryChangedObjects();
-
- return representation;
- }
-
- private void addResult(final JsonRepresentation representation) {
- final JsonRepresentation result = JsonRepresentation.newMap();
- final ResultType resultType = addResultTo(result);
-
- if (!resultType.isVoid()) {
- putResultType(representation, resultType);
- representation.mapPut("result", result);
- }
- }
-
- private ResultType addResultTo(final JsonRepresentation result) {
-
- final ObjectSpecification returnType = this.action.getReturnType();
-
- if (returnType.getCorrespondingClass() == void.class) {
- // void
- return ResultType.VOID;
- }
-
- final CollectionFacet collectionFacet = returnType.getFacet(CollectionFacet.class);
- if (collectionFacet != null) {
- // collection
-
- final Collection<ObjectAdapter> collectionAdapters = collectionFacet.collection(returnedAdapter);
-
- final RendererFactory factory = getRendererFactoryRegistry().find(RepresentationType.LIST);
- final ListReprRenderer renderer = (ListReprRenderer) factory.newRenderer(resourceContext, null, result);
- renderer.with(collectionAdapters).withReturnType(action.getReturnType()).withElementType(returnedAdapter.getElementSpecification());
-
- renderer.render();
- return ResultType.LIST;
- }
-
- final EncodableFacet encodableFacet = returnType.getFacet(EncodableFacet.class);
- if (encodableFacet != null) {
- // scalar
-
- final RendererFactory factory = getRendererFactoryRegistry().find(RepresentationType.SCALAR_VALUE);
-
- final ScalarValueReprRenderer renderer = (ScalarValueReprRenderer) factory.newRenderer(resourceContext, null, result);
- renderer.with(returnedAdapter).withReturnType(action.getReturnType());
-
- renderer.render();
- return ResultType.SCALAR_VALUE;
-
- }
-
- {
- // object
- final RendererFactory factory = getRendererFactoryRegistry().find(RepresentationType.DOMAIN_OBJECT);
- final DomainObjectReprRenderer renderer = (DomainObjectReprRenderer) factory.newRenderer(resourceContext, null, result);
-
- renderer.with(returnedAdapter).includesSelf();
-
- renderer.render();
- return ResultType.DOMAIN_OBJECT;
- }
- }
-
- private void putResultType(final JsonRepresentation representation, final ResultType resultType) {
- representation.mapPut("resulttype", resultType.getValue());
- }
-
- private JsonRepresentation representationWithSelfFor(final ObjectAction action, final JsonRepresentation bodyArgs) {
- final JsonRepresentation links = JsonRepresentation.newArray();
- representation.mapPut("links", links);
-
- final LinkBuilder selfLinkBuilder = adapterLinkTo.memberBuilder(Rel.SELF, MemberType.ACTION, action, RepresentationType.ACTION_RESULT, "invoke");
-
- // TODO: remove duplication with AbstractObjectMember#addLinkTo
- final MemberType memberType = MemberType.of(action);
- final Map<String, MutatorSpec> mutators = memberType.getMutators();
-
- final ActionSemantics semantics = ActionSemantics.determine(getResourceContext(), action);
- final String mutator = semantics.getInvokeKey();
- final MutatorSpec mutatorSpec = mutators.get(mutator);
- selfLinkBuilder.withHttpMethod(mutatorSpec.httpMethod);
-
- final JsonRepresentation selfLink = selfLinkBuilder.build();
-
- links.arrayAdd(selfLink);
- selfLink.mapPut("args", bodyArgs);
- return representation;
- }
-
- protected RendererFactoryRegistry getRendererFactoryRegistry() {
- // TODO: yuck
- return RendererFactoryRegistry.instance;
- }
-
+/**
+ * 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.json.viewer.resources.domainobjects;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
+import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.RepresentationType;
+import org.apache.isis.viewer.json.applib.domainobjects.ActionResultRepresentation.ResultType;
+import org.apache.isis.viewer.json.applib.links.Rel;
+import org.apache.isis.viewer.json.viewer.ResourceContext;
+import org.apache.isis.viewer.json.viewer.representations.LinkBuilder;
+import org.apache.isis.viewer.json.viewer.representations.LinkFollower;
+import org.apache.isis.viewer.json.viewer.representations.RendererFactory;
+import org.apache.isis.viewer.json.viewer.representations.RendererFactoryRegistry;
+import org.apache.isis.viewer.json.viewer.representations.ReprRenderer;
+import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
+import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;
+
+public class ActionResultReprRenderer extends ReprRendererAbstract<ActionResultReprRenderer, ObjectAndActionInvocation> {
+
+ private ObjectAdapterLinkTo adapterLinkTo = new DomainObjectLinkTo();
+
+ private ObjectAdapter objectAdapter;
+ private ObjectAction action;
+ private JsonRepresentation arguments;
+ private ObjectAdapter returnedAdapter;
+
+ public static class Factory extends ReprRendererFactoryAbstract {
+
+ public Factory() {
+ super(RepresentationType.ACTION_RESULT);
+ }
+
+ @Override
+ public ReprRenderer<?, ?> newRenderer(final ResourceContext resourceContext, final LinkFollower linkFollower, final JsonRepresentation representation) {
+ return new ActionResultReprRenderer(resourceContext, linkFollower, getRepresentationType(), representation);
+ }
+ }
+
+ private ActionResultReprRenderer(final ResourceContext resourceContext, final LinkFollower linkFollower, final RepresentationType representationType, final JsonRepresentation representation) {
+ super(resourceContext, linkFollower, representationType, representation);
+ }
+
+ @Override
+ public ActionResultReprRenderer with(final ObjectAndActionInvocation objectAndActionInvocation) {
+
+ objectAdapter = objectAndActionInvocation.getObjectAdapter();
+ action = objectAndActionInvocation.getAction();
+ arguments = objectAndActionInvocation.getArguments();
+ returnedAdapter = objectAndActionInvocation.getReturnedAdapter();
+
+ adapterLinkTo.with(returnedAdapter);
+
+ return this;
+ }
+
+ public void using(final ObjectAdapterLinkTo adapterLinkTo) {
+ this.adapterLinkTo = adapterLinkTo.with(objectAdapter);
+ }
+
+ @Override
+ public JsonRepresentation render() {
+
+ representationWithSelfFor(action, arguments);
+
+ addResult(representation);
+
+ addExtensionsIsisProprietaryChangedObjects();
+
+ return representation;
+ }
+
+ private void addResult(final JsonRepresentation representation) {
+ final JsonRepresentation result = JsonRepresentation.newMap();
+ final ResultType resultType = addResultTo(result);
+
+ if (!resultType.isVoid()) {
+ putResultType(representation, resultType);
+ representation.mapPut("result", result);
+ }
+ }
+
+ private ResultType addResultTo(final JsonRepresentation result) {
+
+ final ObjectSpecification returnType = this.action.getReturnType();
+
+ if (returnType.getCorrespondingClass() == void.class) {
+ // void
+ return ResultType.VOID;
+ }
+
+ final CollectionFacet collectionFacet = returnType.getFacet(CollectionFacet.class);
+ if (collectionFacet != null) {
+ // collection
+
+ final Collection<ObjectAdapter> collectionAdapters = collectionFacet.collection(returnedAdapter);
+
+ final RendererFactory factory = getRendererFactoryRegistry().find(RepresentationType.LIST);
+ final ListReprRenderer renderer = (ListReprRenderer) factory.newRenderer(resourceContext, null, result);
+ renderer.with(collectionAdapters).withReturnType(action.getReturnType()).withElementType(returnedAdapter.getElementSpecification());
+
+ renderer.render();
+ return ResultType.LIST;
+ }
+
+ final EncodableFacet encodableFacet = returnType.getFacet(EncodableFacet.class);
+ if (encodableFacet != null) {
+ // scalar
+
+ final RendererFactory factory = getRendererFactoryRegistry().find(RepresentationType.SCALAR_VALUE);
+
+ final ScalarValueReprRenderer renderer = (ScalarValueReprRenderer) factory.newRenderer(resourceContext, null, result);
+ renderer.with(returnedAdapter).withReturnType(action.getReturnType());
+
+ renderer.render();
+ return ResultType.SCALAR_VALUE;
+
+ }
+
+ {
+ // object
+ final RendererFactory factory = getRendererFactoryRegistry().find(RepresentationType.DOMAIN_OBJECT);
+ final DomainObjectReprRenderer renderer = (DomainObjectReprRenderer) factory.newRenderer(resourceContext, null, result);
+
+ renderer.with(returnedAdapter).includesSelf();
+
+ renderer.render();
+ return ResultType.DOMAIN_OBJECT;
+ }
+ }
+
+ private void putResultType(final JsonRepresentation representation, final ResultType resultType) {
+ representation.mapPut("resulttype", resultType.getValue());
+ }
+
+ private JsonRepresentation representationWithSelfFor(final ObjectAction action, final JsonRepresentation bodyArgs) {
+ final JsonRepresentation links = JsonRepresentation.newArray();
+ representation.mapPut("links", links);
+
+ final LinkBuilder selfLinkBuilder = adapterLinkTo.memberBuilder(Rel.SELF, MemberType.ACTION, action, RepresentationType.ACTION_RESULT, "invoke");
+
+ // TODO: remove duplication with AbstractObjectMember#addLinkTo
+ final MemberType memberType = MemberType.of(action);
+ final Map<String, MutatorSpec> mutators = memberType.getMutators();
+
+ final ActionSemantics semantics = ActionSemantics.determine(getResourceContext(), action);
+ final String mutator = semantics.getInvokeKey();
+ final MutatorSpec mutatorSpec = mutators.get(mutator);
+ selfLinkBuilder.withHttpMethod(mutatorSpec.httpMethod);
+
+ final JsonRepresentation selfLink = selfLinkBuilder.build();
+
+ links.arrayAdd(selfLink);
+ selfLink.mapPut("args", bodyArgs);
+ return representation;
+ }
+
+ protected RendererFactoryRegistry getRendererFactoryRegistry() {
+ // TODO: yuck
+ return RendererFactoryRegistry.instance;
+ }
+
}
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ActionResultReprRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ActionSemantics.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/BodyArgs.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/BodyArgs.java?rev=1234515&r1=1234514&r2=1234515&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/BodyArgs.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/BodyArgs.java Sun Jan 22 14:18:52 2012
@@ -1,41 +1,41 @@
-/**
- * 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.json.viewer.resources.domainobjects;
-
-public enum BodyArgs {
- /**
- * eg property clear
- */
- NONE,
- /**
- * eg property modify, collection addto/remove
- */
- ONE,
- /**
- * eg action invoke
- */
- MANY;
-
- public boolean isOne() {
- return this == ONE;
- }
-
- public boolean isNone() {
- return this == NONE;
- }
-
-}
+/**
+ * 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.json.viewer.resources.domainobjects;
+
+public enum BodyArgs {
+ /**
+ * eg property clear
+ */
+ NONE,
+ /**
+ * eg property modify, collection addto/remove
+ */
+ ONE,
+ /**
+ * eg action invoke
+ */
+ MANY;
+
+ public boolean isOne() {
+ return this == ONE;
+ }
+
+ public boolean isNone() {
+ return this == NONE;
+ }
+
+}
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/BodyArgs.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/CollectionSemantics.java
------------------------------------------------------------------------------
svn:eol-style = native