Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-07-24 17:38:31 +0000
committerrbrooks2010-07-24 17:38:31 +0000
commit4081f04850d3eff9eb1bd7241763707bfbb43a45 (patch)
tree258620df94d4b24077ff103a6c4dea9cb78493fb /plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal
parent4ed8bddc791fda93940f238c5135556a07041dc0 (diff)
downloadorg.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.tar.gz
org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.tar.xz
org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.zip
applied Eclipse source cleanup
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java48
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeAccessModelInterpreter.java255
2 files changed, 151 insertions, 152 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java
index 197161e4490..fceb8cc910d 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java
@@ -6,32 +6,32 @@ import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
public class Activator implements BundleActivator {
- public static final String PLUGIN_ID = "org.eclipse.osee.framework.core.dsl.ui.integration";
- private static BundleContext context;
- private static Activator instance;
- private ServiceTracker cacheServiceTracker;
+ public static final String PLUGIN_ID = "org.eclipse.osee.framework.core.dsl.ui.integration";
+ private static BundleContext context;
+ private static Activator instance;
+ private ServiceTracker cacheServiceTracker;
- static BundleContext getContext() {
- return context;
- }
+ static BundleContext getContext() {
+ return context;
+ }
- @Override
- public void start(BundleContext bundleContext) throws Exception {
- Activator.instance = this;
- Activator.context = bundleContext;
- cacheServiceTracker = new ServiceTracker(context, IOseeCachingService.class.getName(), null);
- cacheServiceTracker.open(true);
- }
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.instance = this;
+ Activator.context = bundleContext;
+ cacheServiceTracker = new ServiceTracker(context, IOseeCachingService.class.getName(), null);
+ cacheServiceTracker.open(true);
+ }
- @Override
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- if (cacheServiceTracker != null) {
- cacheServiceTracker.close();
- }
- }
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ if (cacheServiceTracker != null) {
+ cacheServiceTracker.close();
+ }
+ }
- public static IOseeCachingService getOseeCacheService() {
- return (IOseeCachingService) Activator.instance.cacheServiceTracker.getService();
- }
+ public static IOseeCachingService getOseeCacheService() {
+ return (IOseeCachingService) Activator.instance.cacheServiceTracker.getService();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeAccessModelInterpreter.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeAccessModelInterpreter.java
index 423c848bc84..a7099bdaf38 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeAccessModelInterpreter.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeAccessModelInterpreter.java
@@ -26,7 +26,6 @@ import org.eclipse.osee.framework.core.dsl.oseeDsl.HierarchyRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.PermissionRule;
import org.eclipse.osee.framework.core.dsl.oseeDsl.RelationTypeRestriction;
-import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactRef;
import org.eclipse.osee.framework.core.dsl.oseeDsl.util.OseeDslSwitch;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
@@ -37,131 +36,131 @@ import org.eclipse.osee.framework.core.model.access.AccessDetail;
*/
public class OseeAccessModelInterpreter implements AccessModelInterpreter {
- public static interface ObjectDataAccessor {
-
- Collection<Identity> getHierarchy(Object object);
-
- Collection<IAttributeType> getAttributeTypes(Object object);
-
- Collection<IArtifactType> getArtifactSuperTypes(Object object);
- }
-
- public OseeAccessModelInterpreter() {
- }
-
- @Override
- public AccessContext getContext(Collection<AccessContext> contexts, AccessContextId contextId) {
- AccessContext toReturn = null;
- for (AccessContext accessContext : contexts) {
- if (contextId.equals(accessContext.getTypeGuid())) {
- toReturn = accessContext;
- }
- }
- return toReturn;
- }
-
- @Override
- public void computeAccessDetails(AccessContext context, Object objectToCheck, Collection<AccessDetail<?>> details) {
- computeAccess(context, objectToCheck, details);
- for (AccessContext superContext : context.getSuperAccessContexts()) {
- computeAccess(superContext, objectToCheck, details);
- }
- }
-
- private void computeAccess(AccessContext context, Object objectToCheck, Collection<AccessDetail<?>> details) {
- context.getAccessRules();
-
- Collection<HierarchyRestriction> restrictions = context.getHierarchyRestrictions();
- for (HierarchyRestriction restriction : restrictions) {
- XArtifactRef artifactRef = restriction.getArtifact();
- // Apply childrenOf Rule;
- boolean isApplicable = false;
- if (isApplicable) {
- restriction.getAccessRules();
- }
- }
-
- }
-
- private AccessPermissionEnum getLeastRestrictive(AccessPermissionEnum permission1, AccessPermissionEnum permission2) {
- if (permission1 == AccessPermissionEnum.ALLOW) {
-
- }
- return permission1;
- }
-
- public static void checkRuleConflict(Collection<PermissionRule> rules) throws OseeCoreException {
- ObjectRestrictionSwitch checker = new ObjectRestrictionSwitch();
- for (PermissionRule rule : rules) {
- ObjectRestriction restriction = rule.getObjectRestriction();
- checker.doSwitch(restriction);
- }
- if (checker.hasConflicts()) {
-
- }
- }
-
- public static PermissionEnum toCorePermission(AccessPermissionEnum modelPermission) {
- PermissionEnum toReturn = PermissionEnum.READ;
- if (modelPermission == AccessPermissionEnum.ALLOW) {
- toReturn = PermissionEnum.WRITE;
- }
- return toReturn;
- }
-
- private static final class ObjectRestrictionSwitch extends OseeDslSwitch<Object> {
- Collection<Identity> artifactInstances;
-
- // Collection<Identity>
- @Override
- public Object caseArtifactInstanceRestriction(ArtifactInstanceRestriction object) {
- return object;
- }
-
- @Override
- public Object caseArtifactTypeRestriction(ArtifactTypeRestriction object) {
- return object;
- }
-
- @Override
- public Object caseRelationTypeRestriction(RelationTypeRestriction object) {
- return object;
- }
-
- @Override
- public Object caseAttributeTypeRestriction(AttributeTypeRestriction object) {
- return object;
- }
-
- @Override
- public Object caseAttributeTypeOfArtifactTypeRestriction(AttributeTypeOfArtifactTypeRestriction object) {
- object.getArtifactType();
- object.getAttributeType();
-
- return object;
- }
-
- public boolean hasConflicts() {
- return false;
- }
- }
-
- //
- // RequirementFolder1 art
- //
- // art.getParent...
- // if not matches SoftwareRequirements --
- // PermissionEnum - Full --- Store what?
- // else
- // if ( art.getArtifactType isOfType("SoftwareRequirements")){
- // data.add(art, new Access<IAttributeType>(QualificationMethod), DENY);
- // } else {
- //
- // }
- // endif
- //
- // Branch allows Type
- // deny contextId "lba.requirementer" edit
- // attributeType "Qualification Method" of artifactType "Software Requirement"
- // under "Software Requirements"
+ public static interface ObjectDataAccessor {
+
+ Collection<Identity> getHierarchy(Object object);
+
+ Collection<IAttributeType> getAttributeTypes(Object object);
+
+ Collection<IArtifactType> getArtifactSuperTypes(Object object);
+ }
+
+ public OseeAccessModelInterpreter() {
+ }
+
+ @Override
+ public AccessContext getContext(Collection<AccessContext> contexts, AccessContextId contextId) {
+ AccessContext toReturn = null;
+ for (AccessContext accessContext : contexts) {
+ if (contextId.equals(accessContext.getTypeGuid())) {
+ toReturn = accessContext;
+ }
+ }
+ return toReturn;
+ }
+
+ @Override
+ public void computeAccessDetails(AccessContext context, Object objectToCheck, Collection<AccessDetail<?>> details) {
+ computeAccess(context, objectToCheck, details);
+ for (AccessContext superContext : context.getSuperAccessContexts()) {
+ computeAccess(superContext, objectToCheck, details);
+ }
+ }
+
+ private void computeAccess(AccessContext context, Object objectToCheck, Collection<AccessDetail<?>> details) {
+ context.getAccessRules();
+
+ Collection<HierarchyRestriction> restrictions = context.getHierarchyRestrictions();
+ for (HierarchyRestriction restriction : restrictions) {
+ restriction.getArtifact();
+ // Apply childrenOf Rule;
+ boolean isApplicable = false;
+ if (isApplicable) {
+ restriction.getAccessRules();
+ }
+ }
+
+ }
+
+ private AccessPermissionEnum getLeastRestrictive(AccessPermissionEnum permission1, AccessPermissionEnum permission2) {
+ if (permission1 == AccessPermissionEnum.ALLOW) {
+
+ }
+ return permission1;
+ }
+
+ public static void checkRuleConflict(Collection<PermissionRule> rules) throws OseeCoreException {
+ ObjectRestrictionSwitch checker = new ObjectRestrictionSwitch();
+ for (PermissionRule rule : rules) {
+ ObjectRestriction restriction = rule.getObjectRestriction();
+ checker.doSwitch(restriction);
+ }
+ if (checker.hasConflicts()) {
+
+ }
+ }
+
+ public static PermissionEnum toCorePermission(AccessPermissionEnum modelPermission) {
+ PermissionEnum toReturn = PermissionEnum.READ;
+ if (modelPermission == AccessPermissionEnum.ALLOW) {
+ toReturn = PermissionEnum.WRITE;
+ }
+ return toReturn;
+ }
+
+ private static final class ObjectRestrictionSwitch extends OseeDslSwitch<Object> {
+ Collection<Identity> artifactInstances;
+
+ // Collection<Identity>
+ @Override
+ public Object caseArtifactInstanceRestriction(ArtifactInstanceRestriction object) {
+ return object;
+ }
+
+ @Override
+ public Object caseArtifactTypeRestriction(ArtifactTypeRestriction object) {
+ return object;
+ }
+
+ @Override
+ public Object caseRelationTypeRestriction(RelationTypeRestriction object) {
+ return object;
+ }
+
+ @Override
+ public Object caseAttributeTypeRestriction(AttributeTypeRestriction object) {
+ return object;
+ }
+
+ @Override
+ public Object caseAttributeTypeOfArtifactTypeRestriction(AttributeTypeOfArtifactTypeRestriction object) {
+ object.getArtifactType();
+ object.getAttributeType();
+
+ return object;
+ }
+
+ public boolean hasConflicts() {
+ return false;
+ }
+ }
+
+ //
+ // RequirementFolder1 art
+ //
+ // art.getParent...
+ // if not matches SoftwareRequirements --
+ // PermissionEnum - Full --- Store what?
+ // else
+ // if ( art.getArtifactType isOfType("SoftwareRequirements")){
+ // data.add(art, new Access<IAttributeType>(QualificationMethod), DENY);
+ // } else {
+ //
+ // }
+ // endif
+ //
+ // Branch allows Type
+ // deny contextId "lba.requirementer" edit
+ // attributeType "Qualification Method" of artifactType "Software Requirement"
+ // under "Software Requirements"
}

Back to the top