Release Engineering Documentation > Technical Writer's Guide > Examples

Embedding XML Snippets

 

XML Example with a Callout
XMI Example

1  XML Example with a Callout

cdo-server.xml  
 
<?xml version='1.0' encoding='UTF-8'?>
<cdoServer>

  <!-- ============================================================== -->
  <!-- See http://wiki.eclipse.org/CDO/Server_Configuration_Reference -->
  <!-- ============================================================== -->

  <acceptor type="tcp" listenAddr="0.0.0.0" port="2036"/>

  <!-- Examples:
   <acceptor type="ssl" listenAddr="0.0.0.0" port="2036"/>
   <acceptor type="http"/>
  -->


  <repository name="repo1">

    <property name="overrideUUID" value=""/>
    <property name="supportingAudits" value="true"/>
    <property name="supportingBranches" value="true"/>
    <property name="ensureReferentialIntegrity" value="false"/>
    <property name="allowInterruptRunningQueries" value="true"/>
    <property name="idGenerationLocation" value="STORE"/> <!-- Possible values: STORE | CLIENT -->
    <property name="serializeCommits" value="false"/>
    <property name="optimisticLockingTimeout" value="10000"/>

    <!-- Example http://wiki.eclipse.org/CDO/Security_Manager
  <securityManager type="default" description="/security:annotation:home(/home)"/>
    -->


    <!-- Example http://bugs.eclipse.org/302775
<authenticator type="file" description="_database/repo1.users"/>
    -->


    <!-- Example http://bugs.eclipse.org/345431
<initialPackage nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0"/>
    -->


    <store type="db">

      <!-- Example http://bugs.eclipse.org/396379 (if idGenerationLocation == CLIENT)
      <property name="idColumnLength" value="34"/>
-->


      <!-- Period at which to execute an SQL statement to keep DB connection alive, in minutes -->
      <property name="connectionKeepAlivePeriod" value="60"/>

      <!-- Maximum number of store accessors (JDBC connections) to keep in the reader pool. The default value is 15.  -->
      <property name="readerPoolCapacity" value="20"/>

      <!-- Maximum number of store accessors (JDBC connections) to keep in the writer pool. The default value is 15.  -->
      <property name="writerPoolCapacity" value="20"/>

      <mappingStrategy type="horizontal">  
        <property name="qualifiedNames" value="true"/>

        <!--
          Per default, the objectTypeCache is in-memory and contains
          100,000 cache entries. If you want to change the size,
          uncomment the following line and set the desired size.
          The cache can be disabled by setting a size of 0.
        -->


        <!-- Optional:
        <property name="objectTypeCacheSize" value="100000"/>
        -->


      </mappingStrategy>

      <dbAdapter name="h2"/>
      <dataSource class="org.h2.jdbcx.JdbcDataSource" URL="jdbc:h2:database/repo1"/>

      <!-- Example:
      <dbAdapter name="derby-embedded"/>
      <dataSource class="org.apache.derby.jdbc.EmbeddedDataSource"
        databaseName="/temp/repo1"
        createDatabase="create"/>
      -->


      <!-- Example:
      <dbAdapter name="hsqldb"/>
      <dataSource class="org.eclipse.net4j.db.hsqldb.HSQLDBDataSource"
        database="jdbc:hsqldb:file:/temp/repo1"
        user="sa"/>
      -->


      <!-- Example:
      <dbAdapter name="mysql"/>
      <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
        url="jdbc:mysql://localhost/repo1"
        user="sa"/>
      -->


      <!-- Example:
      <dbAdapter name="postgresql"/>
<dataSource class="org.postgresql.ds.PGSimpleDataSource"
serverName="localhost"
portNumber="5432"
databaseName="repo1"
user="postgres"
password="postgres"/>
      -->


      <!-- Example:
<dbAdapter name="oracle"/>
<dataSource class="oracle.jdbc.pool.OracleDataSource"
driverType="thin"
serverName="localhost"
portNumber="1521"
databaseName="TEST"
user="cdotest"
password="oracle"/>
-->


    </store>

    <!-- ONLY THE FIRST CONFIGURED STORE IS USED FOR THE REPOSITORY!!! -->

    <store type="mongodb">
      <property name="uri" value="mongodb://localhost"/>
      <property name="db" value="cdodb"/>
      <!-- Optional:
      <property name="drop" value="true"/>
      -->

    </store>

  </repository>

  <!-- Example of a DB4O repo/store:
  <repository name="repo1">
    <property name="supportingAudits" value="false"/>
    <property name="supportingBranches" value="false"/>
    <store type="db4o">
      <property name="path" value="/tmp/cdodb4.db4o"/>
      <property name="port" value="50032"/>
    </store>
  </repository>
  -->


</cdoServer>
 
 

 The mapping strategy "horizontal" delegates to a mapping strategy chosen to match the repository properties supportingAudits and supportingBranches.

2  XMI Example

company.ecore  
 
<?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="company" nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0" nsPrefix="company">
  <eAnnotations source="teneo.jpa">
    <details key="value" value="@hbGenericGenerators({@GenericGenerator(name="system-uuid", strategy = "org.eclipse.emf.cdo.examples.hibernate.server.CDOExampleUUIDHexGenerator")})"/>
  </eAnnotations>
  <eClassifiers xsi:type="ecore:EClass" name="Addressable" abstract="true">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="street" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="city" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Company" eSuperTypes="#//Addressable">
    <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1" eType="#//Category" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="suppliers" upperBound="-1" eType="#//Supplier" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1" eType="#//Customer" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1" eType="#//PurchaseOrder" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1" eType="#//SalesOrder" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Supplier" eSuperTypes="#//Addressable">
    <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1" eType="#//PurchaseOrder" eOpposite="#//PurchaseOrder/supplier"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="preferred" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="#//Addressable">
    <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1" eType="#//SalesOrder" eOpposite="#//SalesOrder/customer"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Order">
    <eAnnotations source="teneo.jpa">
      <details key="value" value="@Entity(name="BaseOrder")"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1" eType="#//OrderDetail" containment="true" eOpposite="#//OrderDetail/order"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="OrderDetail">
    <eStructuralFeatures xsi:type="ecore:EReference" name="order" lowerBound="1" eType="#//Order" eOpposite="#//Order/orderDetails"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="product" eType="#//Product" eOpposite="#//Product/orderDetails"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="PurchaseOrder" eSuperTypes="#//Order">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="supplier" lowerBound="1" eType="#//Supplier" eOpposite="#//Supplier/purchaseOrders"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="SalesOrder" eSuperTypes="#//Order">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="customer" lowerBound="1" eType="#//Customer" eOpposite="#//Customer/salesOrders"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Category">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
      <eAnnotations source="teneo.jpa">
        <details key="value" value="@Id @GeneratedValue(generator="system-uuid")"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1" eType="#//Category" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="products" upperBound="-1" eType="#//Product" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Product">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
      <eAnnotations source="teneo.jpa">
        <details key="value" value="@Id"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1" eType="#//OrderDetail" eOpposite="#//OrderDetail/product"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="vat" eType="#//VAT" defaultValueLiteral="vat15">
      <eAnnotations source="teneo.jpa">
        <details key="value" value="@Basic(optional=false) @Column(nullable=false)"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" transient="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EEnum" name="VAT">
    <eLiterals name="vat0"/>
    <eLiterals name="vat7" value="7"/>
    <eLiterals name="vat15" value="15"/>
  </eClassifiers>
</ecore:EPackage>
 
 

 


Copyright (c) 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.