Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
added XSD and ECore for access controls
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjan committed Mar 23, 2011
1 parent be21c4a commit 9b6502d
Show file tree
Hide file tree
Showing 24 changed files with 2,930 additions and 0 deletions.
7 changes: 7 additions & 0 deletions access-control/.classpath
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions access-control/.project
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>access-control</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
16 changes: 16 additions & 0 deletions access-control/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: access-control;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: edu.unc.lib.schemas.acl,
edu.unc.lib.schemas.acl.impl,
edu.unc.lib.schemas.acl.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport
Bundle-ActivationPolicy: lazy
14 changes: 14 additions & 0 deletions access-control/build.properties
@@ -0,0 +1,14 @@

# <copyright>
# </copyright>
#
# $Id$

bin.includes = .,\
model/,\
META-INF/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/
output.. = bin/
88 changes: 88 additions & 0 deletions access-control/model/acl.ecore
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="acl"
nsURI="http://lib.unc.edu/schemas/acl" nsPrefix="acl">
<eClassifiers xsi:type="ecore:EClass" name="AccessControlType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="accessControl_._type"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="grant" upperBound="-1"
eType="#//GrantType" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="grant"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="embargoUntil" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Date">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="embargo-until"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="inherit" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"
defaultValueLiteral="true" unsettable="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="inherit"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=""/>
<details key="kind" value="mixed"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="elementWildcard"/>
<details key="name" value=":mixed"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
transient="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="xmlns:prefix"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
transient="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="xsi:schemaLocation"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="accessControl" upperBound="-2"
eType="#//AccessControlType" volatile="true" transient="true" derived="true"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="accessControl"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GrantType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="grant_._type"/>
<details key="kind" value="empty"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="group" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//AnySimpleType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="group"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="role" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//AnySimpleType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="role"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>
26 changes: 26 additions & 0 deletions access-control/model/acl.genmodel
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/access-control/src"
modelPluginID="access-control" modelName="Acl" importerID="org.eclipse.xsd.ecore.importer"
complianceLevel="6.0" copyrightFields="false">
<foreignModel>../../curators-workbench/etc/acl.xsd</foreignModel>
<genPackages prefix="Acl" basePackage="edu.unc.lib.schemas" resource="XML" disposableProviderFactory="true"
ecorePackage="acl.ecore#/">
<genClasses ecoreClass="acl.ecore#//AccessControlType">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acl.ecore#//AccessControlType/grant"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute acl.ecore#//AccessControlType/embargoUntil"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute acl.ecore#//AccessControlType/inherit"/>
</genClasses>
<genClasses ecoreClass="acl.ecore#//DocumentRoot">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute acl.ecore#//DocumentRoot/mixed"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference acl.ecore#//DocumentRoot/xMLNSPrefixMap"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference acl.ecore#//DocumentRoot/xSISchemaLocation"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference acl.ecore#//DocumentRoot/accessControl"/>
</genClasses>
<genClasses ecoreClass="acl.ecore#//GrantType">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute acl.ecore#//GrantType/group"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute acl.ecore#//GrantType/role"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
29 changes: 29 additions & 0 deletions access-control/model/acl.xsd2ecore
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="ASCII"?>
<xsd2ecore:XSD2EcoreMappingRoot xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsd2ecore="http://www.eclipse.org/emf/2002/XSD2Ecore" inputs="../../curators-workbench/etc/acl.xsd#/"
outputs="acl.ecore#/" topToBottom="true">
<nested inputs="bundleentry://902.fwk20324370/cache/www.w3.org/2001/MagicXMLSchema.xsd#//anySimpleType;XSDSimpleTypeDefinition=1"
outputs="http://www.eclipse.org/emf/2003/XMLType#//AnySimpleType"/>
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle/grant;XSDElementDeclaration/XSDComplexTypeDefinition"
outputs="acl.ecore#//GrantType">
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle/grant;XSDElementDeclaration/XSDComplexTypeDefinition/XSDAttributeUse=1"
outputs="acl.ecore#//GrantType/group"/>
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle/grant;XSDElementDeclaration/XSDComplexTypeDefinition/XSDAttributeUse"
outputs="acl.ecore#//GrantType/role"/>
</nested>
<nested inputs="bundleentry://902.fwk20324370/cache/www.w3.org/2001/XMLSchema.xsd#//date;XSDSimpleTypeDefinition=17"
outputs="http://www.eclipse.org/emf/2003/XMLType#//Date"/>
<nested inputs="bundleentry://902.fwk20324370/cache/www.w3.org/2001/XMLSchema.xsd#//boolean;XSDSimpleTypeDefinition=10"
outputs="http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition"
outputs="acl.ecore#//AccessControlType">
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
outputs="acl.ecore#//AccessControlType/grant"/>
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition/XSDAttributeUse=1"
outputs="acl.ecore#//AccessControlType/embargoUntil"/>
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration/XSDComplexTypeDefinition/XSDAttributeUse"
outputs="acl.ecore#//AccessControlType/inherit"/>
</nested>
<nested inputs="../../curators-workbench/etc/acl.xsd#//accessControl;XSDElementDeclaration"
outputs="acl.ecore#//DocumentRoot/accessControl"/>
</xsd2ecore:XSD2EcoreMappingRoot>
8 changes: 8 additions & 0 deletions access-control/plugin.properties
@@ -0,0 +1,8 @@

# <copyright>
# </copyright>
#
# $Id$

pluginName = Acl Model
providerName = www.example.org
26 changes: 26 additions & 0 deletions access-control/plugin.xml
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
<copyright>
</copyright>
$Id$
-->

<plugin>

<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri="http://lib.unc.edu/schemas/acl"
class="edu.unc.lib.schemas.acl.AclPackage"
genModel="model/acl.genmodel"/>
</extension>

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="acl"
class="edu.unc.lib.schemas.acl.util.AclResourceFactoryImpl"/>
</extension>

</plugin>
133 changes: 133 additions & 0 deletions access-control/src/edu/unc/lib/schemas/acl/AccessControlType.java
@@ -0,0 +1,133 @@
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package edu.unc.lib.schemas.acl;

import javax.xml.datatype.XMLGregorianCalendar;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Access Control Type</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link edu.unc.lib.schemas.acl.AccessControlType#getGrant <em>Grant</em>}</li>
* <li>{@link edu.unc.lib.schemas.acl.AccessControlType#getEmbargoUntil <em>Embargo Until</em>}</li>
* <li>{@link edu.unc.lib.schemas.acl.AccessControlType#isInherit <em>Inherit</em>}</li>
* </ul>
* </p>
*
* @see edu.unc.lib.schemas.acl.AclPackage#getAccessControlType()
* @model extendedMetaData="name='accessControl_._type' kind='elementOnly'"
* @generated
*/
public interface AccessControlType extends EObject {
/**
* Returns the value of the '<em><b>Grant</b></em>' containment reference list.
* The list contents are of type {@link edu.unc.lib.schemas.acl.GrantType}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Grant</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Grant</em>' containment reference list.
* @see edu.unc.lib.schemas.acl.AclPackage#getAccessControlType_Grant()
* @model containment="true"
* extendedMetaData="kind='element' name='grant'"
* @generated
*/
EList<GrantType> getGrant();

/**
* Returns the value of the '<em><b>Embargo Until</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Embargo Until</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Embargo Until</em>' attribute.
* @see #setEmbargoUntil(XMLGregorianCalendar)
* @see edu.unc.lib.schemas.acl.AclPackage#getAccessControlType_EmbargoUntil()
* @model dataType="org.eclipse.emf.ecore.xml.type.Date"
* extendedMetaData="kind='attribute' name='embargo-until'"
* @generated
*/
XMLGregorianCalendar getEmbargoUntil();

/**
* Sets the value of the '{@link edu.unc.lib.schemas.acl.AccessControlType#getEmbargoUntil <em>Embargo Until</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Embargo Until</em>' attribute.
* @see #getEmbargoUntil()
* @generated
*/
void setEmbargoUntil(XMLGregorianCalendar value);

/**
* Returns the value of the '<em><b>Inherit</b></em>' attribute.
* The default value is <code>"true"</code>.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Inherit</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Inherit</em>' attribute.
* @see #isSetInherit()
* @see #unsetInherit()
* @see #setInherit(boolean)
* @see edu.unc.lib.schemas.acl.AclPackage#getAccessControlType_Inherit()
* @model default="true" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean"
* extendedMetaData="kind='attribute' name='inherit'"
* @generated
*/
boolean isInherit();

/**
* Sets the value of the '{@link edu.unc.lib.schemas.acl.AccessControlType#isInherit <em>Inherit</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Inherit</em>' attribute.
* @see #isSetInherit()
* @see #unsetInherit()
* @see #isInherit()
* @generated
*/
void setInherit(boolean value);

/**
* Unsets the value of the '{@link edu.unc.lib.schemas.acl.AccessControlType#isInherit <em>Inherit</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetInherit()
* @see #isInherit()
* @see #setInherit(boolean)
* @generated
*/
void unsetInherit();

/**
* Returns whether the value of the '{@link edu.unc.lib.schemas.acl.AccessControlType#isInherit <em>Inherit</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Inherit</em>' attribute is set.
* @see #unsetInherit()
* @see #isInherit()
* @see #setInherit(boolean)
* @generated
*/
boolean isSetInherit();

} // AccessControlType

0 comments on commit 9b6502d

Please sign in to comment.