Index: /VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDICreatorImpl.java
===================================================================
--- /VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDICreatorImpl.java	(revision 5589)
+++ /VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDICreatorImpl.java	(revision 5590)
@@ -2,4 +2,5 @@
 
 import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
 import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
 import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
@@ -11,4 +12,6 @@
 import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Creator.Organisation;
 import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Description;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.GeneratedBy.QueryProfile;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.GeneratedBy.QueryValue;
 import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Name;
 import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.ReproducabilityNotice;
@@ -169,8 +172,6 @@
         }
 
-        if (vc.getType() == VirtualCollection.Type.INTENSIONAL) {
-            final CMD.Components.VirtualCollection.GeneratedBy generatedBy = new CMD.Components.VirtualCollection.GeneratedBy();
-            //TODO: add 'generated by' values
-            virtualCollection.setGeneratedBy(generatedBy);
+        if (vc.getType() == VirtualCollection.Type.INTENSIONAL && vc.getGeneratedBy() != null) {
+            virtualCollection.setGeneratedBy(getGeneratedBy(vc.getGeneratedBy()));
         }
 
@@ -178,4 +179,38 @@
         components.setVirtualCollection(virtualCollection);
         return components;
+    }
+
+    private CMD.Components.VirtualCollection.GeneratedBy getGeneratedBy(GeneratedBy generatedBy) {
+        final CMD.Components.VirtualCollection.GeneratedBy component = new CMD.Components.VirtualCollection.GeneratedBy();
+
+        final String uri = generatedBy.getURI();
+        if (uri != null) {
+            component.setURI(uri);
+        }
+
+        final String description = generatedBy.getDescription();
+        if (description != null) {
+            final CMD.Components.VirtualCollection.GeneratedBy.Description descriptionElement = new CMD.Components.VirtualCollection.GeneratedBy.Description();
+            descriptionElement.setValue(description);
+            component.setDescription(descriptionElement);
+        }
+
+        if (generatedBy.getQuery() != null) {
+            final String profile = generatedBy.getQuery().getProfile();
+            if (profile != null) {
+                final QueryProfile profileElement = new QueryProfile();
+                profileElement.setValue(profile);
+                component.setQueryProfile(profileElement);
+            }
+
+            final String value = generatedBy.getQuery().getValue();
+            if (value != null) {
+                final QueryValue valueElement = new QueryValue();
+                valueElement.setValue(value);
+                component.setQueryValue(valueElement);
+            }
+        }
+
+        return component;
     }
 
Index: /VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/xsd/VirtualCollection.xsd
===================================================================
--- /VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/xsd/VirtualCollection.xsd	(revision 5589)
+++ /VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/xsd/VirtualCollection.xsd	(revision 5590)
@@ -2,3 +2,3 @@
                             instance (e.g. for grouping metadata descriptions into
                             collections)</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="Resource"><xs:annotation><xs:documentation>The ResourceProxy refers to a file that is not a metadata
-                            instance (e.g. a text document)</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="SearchService"><xs:annotation><xs:documentation>The ResourceProxy refers to a (SRU/CQL) web service that can be used to query the resource described in this file</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="SearchPage"><xs:annotation><xs:documentation>The ResourceProxy refers to a web page that can be used to query the resource described in this file</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="LandingPage"><xs:annotation><xs:documentation>The ResourceProxy refers to a web page that contains the "original context" of the resource described in this file (e.g. repository web page displaying the metadata).</xs:documentation></xs:annotation></xs:enumeration></xs:restriction></xs:simpleType><xs:complexType name="complextype-Status-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Status-1---"/></xs:simpleContent></xs:complexType><xs:complexType name="complextype-Reproducability-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Reproducability-1---"/></xs:simpleContent></xs:complexType><xs:complexType name="complextype-Purpose-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Purpose-1---"/></xs:simpleContent></xs:complexType><xs:element name="CMD"><xs:complexType><xs:sequence><xs:element name="Header"><xs:complexType><xs:sequence><xs:element name="MdCreator" type="xs:string" minOccurs="0" maxOccurs="unbounded"/><xs:element name="MdCreationDate" type="xs:date" minOccurs="0"/><xs:element name="MdSelfLink" type="xs:anyURI" minOccurs="0"/><xs:element name="MdProfile" type="xs:anyURI" minOccurs="0"/><xs:element name="MdCollectionDisplayName" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="Resources"><xs:complexType><xs:sequence><xs:element name="ResourceProxyList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceProxy"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="ResourceType"><xs:complexType><xs:simpleContent><xs:extension base="cmd:Resourcetype_simple"><xs:attribute name="mimetype" type="xs:string"/></xs:extension></xs:simpleContent></xs:complexType></xs:element><xs:element maxOccurs="1" minOccurs="1" name="ResourceRef" type="xs:anyURI"/></xs:sequence><xs:attribute name="id" type="xs:ID" use="required"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="JournalFileProxyList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="JournalFileProxy"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="JournalFileRef" type="xs:anyURI"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="ResourceRelationList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceRelation"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="RelationType"/><xs:element maxOccurs="1" minOccurs="1" name="Res1"><xs:complexType><xs:attribute name="ref" type="xs:IDREF"/></xs:complexType></xs:element><xs:element maxOccurs="1" minOccurs="1" name="Res2"><xs:complexType><xs:attribute name="ref" type="xs:IDREF"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element minOccurs="0" name="IsPartOfList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="IsPartOf" type="xs:anyURI"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="Components"><xs:complexType><xs:sequence><xs:element name="VirtualCollection" minOccurs="1" maxOccurs="1"><xs:complexType><xs:sequence><xs:element name="Name" dcr:datcat="http://www.isocat.org/datcat/DC-6119" minOccurs="1" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="CreationDate" dcr:datcat="http://www.isocat.org/datcat/DC-2510" type="xs:date" minOccurs="1" maxOccurs="1"/><xs:element name="Status" dcr:datcat="http://www.isocat.org/datcat/DC-3818" minOccurs="1" maxOccurs="1" type="cmd:complextype-Status-1---"/><xs:element name="Reproducability" minOccurs="0" maxOccurs="1" type="cmd:complextype-Reproducability-1---"/><xs:element name="Purpose" dcr:datcat="http://www.isocat.org/datcat/DC-6151" minOccurs="0" maxOccurs="1" type="cmd:complextype-Purpose-1---"/><xs:element name="ReproducabilityNotice" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Origin" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Creator" minOccurs="1" maxOccurs="unbounded" dcr:datcat="http://www.isocat.org/datcat/DC-6714"><xs:complexType><xs:sequence><xs:element name="Name" dcr:datcat="http://www.isocat.org/datcat/DC-2512" minOccurs="1" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Email" dcr:datcat="http://www.isocat.org/datcat/DC-2521" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Organisation" dcr:datcat="http://www.isocat.org/datcat/DC-2459" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element><xs:element name="Resource" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="Label" dcr:datcat="http://www.isocat.org/datcat/DC-2544" minOccurs="0" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element><xs:element name="GeneratedBy" minOccurs="0" maxOccurs="1"><xs:complexType><xs:sequence><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="1" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="URI" dcr:datcat="http://www.isocat.org/datcat/DC-5643" minOccurs="1" maxOccurs="1" ann:displaypriority="3"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="QueryProfile" minOccurs="1" maxOccurs="1" ann:documentation="Identifier of the mechanism, i.e. the protocol to be used, by which the members of the virtual collection should be retrieved. A application exploiting the query can use this to use a proper driver to talk to the service. Example: In case of CLARIN-FCS access the endpoint by FCS-compatible means." ann:displaypriority="2"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="QueryValue" minOccurs="1" maxOccurs="1" ann:documentation="The query that should be passed on to the service by which it can look up the items that are part of this collection. This value should be in the query language supported by the service. Example: In case of CLARIN-FCS, this value is the CQL query to be send to the endpoint." ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="CMDVersion" fixed="1.1" use="required"/></xs:complexType></xs:element></xs:schema>
+                            instance (e.g. a text document)</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="SearchService"><xs:annotation><xs:documentation>The ResourceProxy refers to a (SRU/CQL) web service that can be used to query the resource described in this file</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="SearchPage"><xs:annotation><xs:documentation>The ResourceProxy refers to a web page that can be used to query the resource described in this file</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="LandingPage"><xs:annotation><xs:documentation>The ResourceProxy refers to a web page that contains the "original context" of the resource described in this file (e.g. repository web page displaying the metadata).</xs:documentation></xs:annotation></xs:enumeration></xs:restriction></xs:simpleType><xs:complexType name="complextype-Status-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Status-1---"/></xs:simpleContent></xs:complexType><xs:complexType name="complextype-Reproducability-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Reproducability-1---"/></xs:simpleContent></xs:complexType><xs:complexType name="complextype-Purpose-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Purpose-1---"/></xs:simpleContent></xs:complexType><xs:element name="CMD"><xs:complexType><xs:sequence><xs:element name="Header"><xs:complexType><xs:sequence><xs:element name="MdCreator" type="xs:string" minOccurs="0" maxOccurs="unbounded"/><xs:element name="MdCreationDate" type="xs:date" minOccurs="0"/><xs:element name="MdSelfLink" type="xs:anyURI" minOccurs="0"/><xs:element name="MdProfile" type="xs:anyURI" minOccurs="0"/><xs:element name="MdCollectionDisplayName" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="Resources"><xs:complexType><xs:sequence><xs:element name="ResourceProxyList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceProxy"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="ResourceType"><xs:complexType><xs:simpleContent><xs:extension base="cmd:Resourcetype_simple"><xs:attribute name="mimetype" type="xs:string"/></xs:extension></xs:simpleContent></xs:complexType></xs:element><xs:element maxOccurs="1" minOccurs="1" name="ResourceRef" type="xs:anyURI"/></xs:sequence><xs:attribute name="id" type="xs:ID" use="required"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="JournalFileProxyList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="JournalFileProxy"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="JournalFileRef" type="xs:anyURI"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="ResourceRelationList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceRelation"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="RelationType"/><xs:element maxOccurs="1" minOccurs="1" name="Res1"><xs:complexType><xs:attribute name="ref" type="xs:IDREF"/></xs:complexType></xs:element><xs:element maxOccurs="1" minOccurs="1" name="Res2"><xs:complexType><xs:attribute name="ref" type="xs:IDREF"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element minOccurs="0" name="IsPartOfList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="IsPartOf" type="xs:anyURI"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="Components"><xs:complexType><xs:sequence><xs:element name="VirtualCollection" minOccurs="1" maxOccurs="1"><xs:complexType><xs:sequence><xs:element name="Name" dcr:datcat="http://www.isocat.org/datcat/DC-6119" minOccurs="1" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="CreationDate" dcr:datcat="http://www.isocat.org/datcat/DC-2510" type="xs:date" minOccurs="1" maxOccurs="1"/><xs:element name="Status" dcr:datcat="http://www.isocat.org/datcat/DC-3818" minOccurs="1" maxOccurs="1" type="cmd:complextype-Status-1---"/><xs:element name="Reproducability" minOccurs="0" maxOccurs="1" type="cmd:complextype-Reproducability-1---"/><xs:element name="Purpose" dcr:datcat="http://www.isocat.org/datcat/DC-6151" minOccurs="0" maxOccurs="1" type="cmd:complextype-Purpose-1---"/><xs:element name="ReproducabilityNotice" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Origin" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Creator" minOccurs="1" maxOccurs="unbounded" dcr:datcat="http://www.isocat.org/datcat/DC-6714"><xs:complexType><xs:sequence><xs:element name="Name" dcr:datcat="http://www.isocat.org/datcat/DC-2512" minOccurs="1" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Email" dcr:datcat="http://www.isocat.org/datcat/DC-2521" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Organisation" dcr:datcat="http://www.isocat.org/datcat/DC-2459" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element><xs:element name="Resource" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="Label" dcr:datcat="http://www.isocat.org/datcat/DC-2544" minOccurs="0" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element><xs:element name="GeneratedBy" minOccurs="0" maxOccurs="1"><xs:complexType><xs:sequence><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="1" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="URI" dcr:datcat="http://www.isocat.org/datcat/DC-5643" type="xs:anyURI" minOccurs="1" maxOccurs="1" ann:displaypriority="3"/><xs:element name="QueryProfile" minOccurs="1" maxOccurs="1" ann:documentation="Identifier of the mechanism, i.e. the protocol to be used, by which the members of the virtual collection should be retrieved. A application exploiting the query can use this to use a proper driver to talk to the service. Example: In case of CLARIN-FCS access the endpoint by FCS-compatible means." ann:displaypriority="2"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="QueryValue" minOccurs="1" maxOccurs="1" ann:documentation="The query that should be passed on to the service by which it can look up the items that are part of this collection. This value should be in the query language supported by the service. Example: In case of CLARIN-FCS, this value is the CQL query to be send to the endpoint." ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="CMDVersion" fixed="1.1" use="required"/></xs:complexType></xs:element></xs:schema>
