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 2015/11/25 14:47:08 UTC
[2/2] isis git commit: ISIS-1117: remove the requirement for an
entity to have any properties when rendered by the Wicket viewer ...
ISIS-1117: remove the requirement for an entity to have any properties when rendered by the Wicket viewer ...
... because there might be a custom component to render said object
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/06bbb1e4
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/06bbb1e4
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/06bbb1e4
Branch: refs/heads/master
Commit: 06bbb1e4289bd5fb1520612ea5f9512e72182175
Parents: 9211732
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Nov 25 13:46:40 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Nov 25 13:46:40 2015 +0000
----------------------------------------------------------------------
.../wicket/ui/pages/entity/EntityPage.java | 21 --------------------
1 file changed, 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/06bbb1e4/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
index 9716a19..dbc1f7d 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
@@ -19,7 +19,6 @@
package org.apache.isis.viewer.wicket.ui.pages.entity;
-import java.util.List;
import org.apache.wicket.Application;
import org.apache.wicket.RestartResponseException;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
@@ -31,9 +30,7 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.string.Strings;
import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
@@ -43,9 +40,6 @@ import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
import org.apache.isis.core.metamodel.interactions.InteractionUtils;
import org.apache.isis.core.metamodel.interactions.ObjectVisibilityContext;
import org.apache.isis.core.metamodel.interactions.VisibilityContext;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.context.IsisContext;
@@ -140,21 +134,6 @@ public class EntityPage extends PageAbstract {
throw new ObjectMember.AuthorizationException();
}
- // belt-n-braces: check that at least one property of the entity can be viewed.
- final AuthenticationSession session = getAuthenticationSession();
- final ObjectSpecification specification = objectAdapter.getSpecification();
- final List<ObjectAssociation> visibleAssociation = specification.getAssociations(Contributed.INCLUDED, ObjectAssociation.Filters.dynamicallyVisible(
- objectAdapter, InteractionInitiatedBy.USER, Where.NOWHERE));
-
- if(visibleAssociation.isEmpty()) {
- final List<ObjectAssociation> anyAssociations = specification.getAssociations(Contributed.INCLUDED);
- if(anyAssociations.isEmpty()) {
- throw new NonRecoverableException(String.format(
- "No properties are defined for this entity type (%s); this is probably a programming error", specification.getFullIdentifier()));
- }
- throw new ObjectMember.AuthorizationException();
- }
-
// the next bit is a work-around for JRebel integration...
// ... even though the IsisJRebelPlugin calls invalidateCache, it seems that there is