You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(17) |
Jul
(13) |
Aug
(17) |
Sep
(25) |
Oct
(19) |
Nov
|
Dec
|
|---|
|
From: <ja...@us...> - 2006-09-20 13:41:49
|
Revision: 66
http://svn.sourceforge.net/surveyforge/?rev=66&view=rev
Author: javism
Date: 2006-09-20 06:41:39 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
Added some tests
Added Paths:
-----------
trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/DataElementTest.java
trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/RegisterTest.java
Added: trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/DataElementTest.java
===================================================================
--- trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/DataElementTest.java (rev 0)
+++ trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/DataElementTest.java 2006-09-20 13:41:39 UTC (rev 66)
@@ -0,0 +1,83 @@
+/**
+ *
+ */
+package org.surveyforge.core.metadata;
+
+import org.surveyforge.core.metadata.domain.LogicalValueDomain;
+import org.surveyforge.core.metadata.domain.StringValueDomain;
+import org.surveyforge.core.metadata.domain.StructuredValueDomain;
+import org.testng.Assert;
+import org.testng.annotations.ExpectedExceptions;
+import org.testng.annotations.Test;
+
+/**
+ * @author jsegura
+ */
+public class DataElementTest
+ {
+
+ @Test
+ public void RegisterDataElementWithEmptyKey( )
+ {
+ Register register = new Register( "register" );
+ StructuredValueDomain upperVD = new StructuredValueDomain( );
+ RegisterDataElement upperRDE = new RegisterDataElement( "upperRDE", upperVD );
+ register.addComponentElement( upperRDE );
+
+ Assert.assertEquals( 1, register.getComponentElements( ).size( ) );
+
+ StringValueDomain svd = new StringValueDomain( 0, 10 );
+ RegisterDataElement subRDE1 = new RegisterDataElement( "sub1", svd );
+ upperRDE.addComponentElement( subRDE1 );
+
+ Assert.assertEquals( 1, upperRDE.getComponentElements( ).size( ) );
+ Assert.assertEquals( 1, ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).size( ) );
+ RegisterDataElement subRDE2 = new RegisterDataElement( "sub2", new LogicalValueDomain( ) );
+ upperRDE.addComponentElement( subRDE2 );
+ Assert.assertEquals( 2, upperRDE.getComponentElements( ).size( ) );
+ Assert.assertEquals( 2, ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).size( ) );
+ Assert.assertEquals( subRDE1.getValueDomain( ), ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).get( 0 ) );
+ Assert.assertEquals( subRDE2.getValueDomain( ), ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).get( 1 ) );
+ Assert.assertEquals( 2, upperRDE.getComponentElements( ).size( ) );
+
+ upperRDE.removeComponentElement( subRDE1 ); //
+ Assert.assertEquals( 1, upperRDE.getComponentElements( ).size( ) );
+ Assert.assertEquals( 1, ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).size( ) );
+ Assert.assertEquals( subRDE2.getValueDomain( ), ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).get( 0 ) );
+ upperRDE.removeComponentElement( subRDE2 );
+ Assert.assertEquals( 0, upperRDE.getComponentElements( ).size( ) );
+ Assert.assertEquals( 0, ((StructuredValueDomain) upperRDE.getValueDomain( )).getSubDomains( ).size( ) );
+
+ }
+
+ @Test
+ public void RegisterDataElementCreation( )
+ {
+ String id = "id";
+ LogicalValueDomain lvd = new LogicalValueDomain( );
+ RegisterDataElement rde = new RegisterDataElement( id, lvd );
+ Assert.assertTrue( rde.getIdentifier( ).compareTo( id ) == 0 );
+ Assert.assertEquals( lvd, rde.getValueDomain( ) );
+
+ }
+
+ @Test
+ @ExpectedExceptions( {NullPointerException.class})
+ public void RegisterDataElementCreationWithNullIdentifier( )
+ {
+ LogicalValueDomain lvd = new LogicalValueDomain( );
+ RegisterDataElement rde = new RegisterDataElement( null, lvd );
+
+ }
+
+ @Test
+ @ExpectedExceptions( {NullPointerException.class})
+ public void RegisterCreationWithNullDomain( )
+ {
+ LogicalValueDomain lvd = null;
+ RegisterDataElement rde = new RegisterDataElement( "id", lvd );
+
+ }
+
+
+ }
Property changes on: trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/DataElementTest.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Added: trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/RegisterTest.java
===================================================================
--- trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/RegisterTest.java (rev 0)
+++ trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/RegisterTest.java 2006-09-20 13:41:39 UTC (rev 66)
@@ -0,0 +1,41 @@
+/**
+ *
+ */
+package org.surveyforge.core.metadata;
+
+import org.surveyforge.core.metadata.domain.StructuredValueDomain;
+import org.testng.Assert;
+import org.testng.annotations.ExpectedExceptions;
+import org.testng.annotations.Test;
+
+/**
+ * @author jsegura
+ */
+public class RegisterTest
+ {
+ @Test
+ public void RegisterCreation( )
+ {
+ Register register = new Register( "register" );
+ Assert.assertTrue( register.getValueDomain( ) instanceof StructuredValueDomain );
+ Assert.assertEquals( 0, register.getComponentElements( ).size( ) );
+ Assert.assertEquals( 0, register.getComponentElements( ).size( ) );
+ Assert.assertEquals( 0, register.getKey( ).size( ) );
+ }
+
+ @Test
+ @ExpectedExceptions( {NullPointerException.class})
+ public void RegisterCreationWithNullIdentifier( )
+ {
+ Register register = new Register( null );
+ }
+
+ @Test
+ @ExpectedExceptions( {NullPointerException.class})
+ public void RegisterCreationWithEmptyIdentifier( )
+ {
+ Register register = new Register( "" );
+ }
+
+
+ }
Property changes on: trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/RegisterTest.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-20 13:39:29
|
Revision: 65
http://svn.sourceforge.net/surveyforge/?rev=65&view=rev
Author: javism
Date: 2006-09-20 06:39:13 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
- Resolved some bugs in DataElement
- Added some Tests
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
trunk/surveyforge-core/src/test/resources/testng.xml
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-20 10:58:39 UTC (rev 64)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-20 13:39:13 UTC (rev 65)
@@ -196,15 +196,15 @@
/**
* @param variableStructure The variableStructure to set.
*/
- public void setVariableStructure( DataElement variableStructure )
+ protected void setVariableStructure( DataElement variableStructure )
{
- if( (variableStructure == null && this.getVariableStructure( ) != null)
- || !variableStructure.equals( this.getVariableStructure( ) ) )
- {
- if( this.getVariableStructure( ) != null ) this.getVariableStructure( ).removeElement( this );
- this.variableStructure = variableStructure;
- if( this.getVariableStructure( ) != null ) this.getVariableStructure( ).addElement( this );
- }
+ // if( (variableStructure == null && this.getVariableStructure( ) != null)
+ // || !variableStructure.equals( this.getVariableStructure( ) ) )
+ // {
+ if( this.getVariableStructure( ) != null ) this.getVariableStructure( ).removeElement( this );
+ this.variableStructure = variableStructure;
+ if( this.getVariableStructure( ) != null ) this.getVariableStructure( ).addElement( this );
+ // }
}
/**
@@ -247,12 +247,10 @@
{
if( componentElement != null )
{
- if( !this.getComponentElements( ).contains( componentElement ) )
+ if( !this.getComponentElements( ).contains( componentElement ) && this.getValueDomain( ) instanceof StructuredValueDomain )
{
- if( componentElement.getVariableStructure( ) != null && !componentElement.getVariableStructure( ).equals( this ) )
- componentElement.getVariableStructure( ).removeElement( componentElement );
- componentElement.variableStructure = this;
- this.componentElements.add( componentElement );
+ componentElement.setVariableStructure( this );
+ // ((StructuredValueDomain) this.getValueDomain( )).addSubDomain( componentElement.getValueDomain( ) );
}
else
throw new IllegalArgumentException( );
@@ -266,10 +264,14 @@
*/
protected void addElement( DataElement componentElement )
{
- if( !this.getNameToElementMap( ).containsKey( componentElement.getIdentifier( ) ) )
+ if( !this.getNameToElementMap( ).containsKey( componentElement.getIdentifier( ) )
+ && this.getValueDomain( ) instanceof StructuredValueDomain )
{
this.componentElements.add( componentElement );
+ componentElement.variableStructure = this;
this.getNameToElementMap( ).put( componentElement.getIdentifier( ), componentElement );
+ ((StructuredValueDomain) this.getValueDomain( )).addSubDomain( componentElement.getValueDomain( ) );
+
}
else
throw new IllegalArgumentException( );
@@ -283,7 +285,7 @@
if( componentElement != null )
{
this.removeElement( componentElement );
- componentElement.variableStructure = null;
+ componentElement.setVariableStructure( null );
}
else
throw new NullPointerException( );
@@ -294,10 +296,13 @@
*/
protected void removeElement( DataElement componentElement )
{
- if( this.getNameToElementMap( ).containsKey( componentElement.getIdentifier( ) ) )
+ if( this.getNameToElementMap( ).containsKey( componentElement.getIdentifier( ) )
+ && this.getValueDomain( ) instanceof StructuredValueDomain )
{
this.componentElements.remove( componentElement );
this.getNameToElementMap( ).remove( componentElement.getIdentifier( ) );
+ componentElement.variableStructure = null;
+ ((StructuredValueDomain) this.getValueDomain( )).removeSubDomain( componentElement.getValueDomain( ) );
}
else
throw new IllegalArgumentException( );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-09-20 10:58:39 UTC (rev 64)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-09-20 13:39:13 UTC (rev 65)
@@ -226,8 +226,13 @@
@Override
public boolean equals( Object object )
{
- Register otherRegister = (Register) object;
- return this.getIdentifier( ).equals( otherRegister.getIdentifier( ) );
+ if( object instanceof Register )
+ {
+ Register otherRegister = (Register) object;
+ return this.getIdentifier( ).equals( otherRegister.getIdentifier( ) );
+ }
+ else
+ return false;
}
@Override
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-09-20 10:58:39 UTC (rev 64)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-09-20 13:39:13 UTC (rev 65)
@@ -129,7 +129,8 @@
@Override
public void removeComponentElement( DataElement componentElement )
{
- if( ((Register) this.getRootDataElement( )).getRegisterData( ).getObjectData( ).size( ) > 0 )
+ if( !(this.getRootDataElement( ) instanceof Register)
+ || ((Register) this.getRootDataElement( )).getRegisterData( ).getObjectData( ).size( ) > 0 )
throw new IllegalStateException( );
else
super.removeComponentElement( componentElement );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-20 10:58:39 UTC (rev 64)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-20 13:39:13 UTC (rev 65)
@@ -13,7 +13,6 @@
import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.data.ObjectData;
-import org.surveyforge.core.metadata.ValueDomain;
@Entity
public class StructuredValueDomain extends AbstractValueDomain
Modified: trunk/surveyforge-core/src/test/resources/testng.xml
===================================================================
--- trunk/surveyforge-core/src/test/resources/testng.xml 2006-09-20 10:58:39 UTC (rev 64)
+++ trunk/surveyforge-core/src/test/resources/testng.xml 2006-09-20 13:39:13 UTC (rev 65)
@@ -4,6 +4,7 @@
<test name="All">
<packages>
<package name="org.surveyforge.core.metadata" />
+ <package name="org.surveyforge.core.metadata.domain" />
<package name="org.surveyforge.core.data" />
<package name="org.surveyforge.core.survey" />
</packages>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-20 10:58:49
|
Revision: 64
http://svn.sourceforge.net/surveyforge/?rev=64&view=rev
Author: javism
Date: 2006-09-20 03:58:39 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
Some changes in database functionality.
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java 2006-09-20 10:58:27 UTC (rev 63)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java 2006-09-20 10:58:39 UTC (rev 64)
@@ -21,15 +21,10 @@
*/
package org.surveyforge.core.data;
-import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
-import org.hibernate.annotations.GenericGenerator;
-
/**
* @author jsegura
*/
@@ -38,17 +33,6 @@
{
private static final long serialVersionUID = 6601926722422919229L;
- @SuppressWarnings("unused")
- @Id
- @Column(length = 50)
- @GeneratedValue(generator = "system-uuid")
- @GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
- /** Version for optimistic locking. */
- @SuppressWarnings("unused")
- @javax.persistence.Version
- private int lockingVersion;
-
@ManyToOne(optional = true)
@JoinColumn(name = "registerData_id", insertable = false, updatable = false)
private RegisterData registerData;
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-09-20 10:58:27 UTC (rev 63)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-09-20 10:58:39 UTC (rev 64)
@@ -60,7 +60,7 @@
@javax.persistence.Version
private int lockingVersion;
- @OneToOne(optional = true)
+ @OneToOne
private Register register;
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-20 10:58:27 UTC (rev 63)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-20 10:58:39 UTC (rev 64)
@@ -45,13 +45,13 @@
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.metadata.domain.AbstractValueDomain;
+import org.surveyforge.core.metadata.domain.StructuredValueDomain;
// TODO Elaborate on comments
/**
* @author jsegura
*/
@Entity
-@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "register_id"})})
public abstract class DataElement implements Serializable
{
private static final long serialVersionUID = 0L;
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-09-20 10:58:27 UTC (rev 63)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-09-20 10:58:39 UTC (rev 64)
@@ -30,16 +30,14 @@
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
-import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.data.RegisterData;
+import org.surveyforge.core.metadata.domain.StructuredValueDomain;
import org.surveyforge.core.survey.Questionnaire;
// TODO Elaborate on comments
@@ -51,24 +49,8 @@
{
private static final long serialVersionUID = 0L;
- @SuppressWarnings("unused")
- @Id
- @Column(length = 50)
- @GeneratedValue(generator = "system-uuid")
- @GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
- /** Version for optimistic locking. */
- @SuppressWarnings("unused")
- @javax.persistence.Version
- private int lockingVersion;
/**
- * The name of the register is either a systematic name according to the naming conventions in the organisation or a human language
- * name that reflects the idea or concept of the cube or register.
- */
- @Column(unique = true, length = 50)
- private String identifier;
- /**
* When defining hierarchical registers the hierarchy is expressed as master/detail relationship. The master register defines the
* objects that consist of the details.
*/
@@ -93,7 +75,7 @@
private List<RegisterDataElement> key = new ArrayList<RegisterDataElement>( );
/** */
- @OneToOne(optional = false, cascade = {CascadeType.ALL})
+ @OneToOne(cascade = {CascadeType.ALL})
private RegisterData registerData;
/** */
@@ -114,29 +96,10 @@
{
this.setIdentifier( identifier );
this.registerData = new RegisterData( this );
+ this.setValueDomain( new StructuredValueDomain( ) );
}
/**
- * @return Returns the identifier.
- */
- public String getIdentifier( )
- {
- return this.identifier;
- }
-
- /**
- * @param identifier The identifier to set.
- */
- public void setIdentifier( String identifier )
- {
- if( identifier != null && !identifier.equals( "" ) )
- this.identifier = identifier;
- else
- throw new NullPointerException( );
- }
-
-
- /**
* @return Returns the masterRegister.
*/
public Register getMasterRegister( )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-20 10:58:34
|
Revision: 63
http://svn.sourceforge.net/surveyforge/?rev=63&view=rev
Author: javism
Date: 2006-09-20 03:58:27 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
Some changes in database functionality.
Modified Paths:
--------------
trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml
Modified: trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml
===================================================================
--- trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml 2006-09-20 09:38:12 UTC (rev 62)
+++ trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml 2006-09-20 10:58:27 UTC (rev 63)
@@ -36,20 +36,25 @@
<mapping class="org.surveyforge.core.metadata.Register" />
<mapping class="org.surveyforge.core.metadata.RegisterDataElement" />
<mapping class="org.surveyforge.core.metadata.ConceptualDataElement" />
+ <mapping class="org.surveyforge.core.metadata.QuestionDataElement" />
<mapping class="org.surveyforge.core.metadata.DataElement" />
<mapping class="org.surveyforge.core.metadata.ValueDomain" />
<mapping class="org.surveyforge.core.metadata.ObjectVariable" />
<mapping class="org.surveyforge.core.metadata.GlobalVariable" />
<mapping class="org.surveyforge.core.metadata.VariableFamily" />
<mapping class="org.surveyforge.core.metadata.StatisticalObjectType" />
+
+ <!-- package org.surveyforge.core.metadata.domain -->
<mapping class="org.surveyforge.core.metadata.domain.ClassificationValueDomain" />
<mapping class="org.surveyforge.core.metadata.domain.LogicalValueDomain" />
<mapping class="org.surveyforge.core.metadata.domain.QuantityValueDomain" />
<mapping class="org.surveyforge.core.metadata.domain.StringValueDomain" />
+ <mapping class="org.surveyforge.core.metadata.domain.AbstractValueDomain" />
+ <mapping class="org.surveyforge.core.metadata.domain.StructuredValueDomain" />
<!-- package org.surveyforge.core.data -->
<mapping class="org.surveyforge.core.data.RegisterData" />
- <mapping class="org.surveyforge.core.data.Row" />
- <mapping class="org.surveyforge.core.data.RowData" />
+ <mapping class="org.surveyforge.core.data.Data" />
+ <mapping class="org.surveyforge.core.data.ObjectData" />
</session-factory>
</hibernate-configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jg...@us...> - 2006-09-20 09:38:42
|
Revision: 62
http://svn.sourceforge.net/surveyforge/?rev=62&view=rev
Author: jgongo
Date: 2006-09-20 02:38:12 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
First test version of runner with almost no functionality
Modified Paths:
--------------
trunk/pom.xml
Added Paths:
-----------
trunk/surveyforge-runner/
trunk/surveyforge-runner/pom.xml
trunk/surveyforge-runner/src/
trunk/surveyforge-runner/src/main/
trunk/surveyforge-runner/src/main/aspect/
trunk/surveyforge-runner/src/main/aspect/org/
trunk/surveyforge-runner/src/main/aspect/org/surveyforge/
trunk/surveyforge-runner/src/main/aspect/org/surveyforge/runner/
trunk/surveyforge-runner/src/main/aspect/org/surveyforge/runner/ObjectDataBeanAspect.aj
trunk/surveyforge-runner/src/main/java/
trunk/surveyforge-runner/src/main/java/org/
trunk/surveyforge-runner/src/main/java/org/surveyforge/
trunk/surveyforge-runner/src/main/java/org/surveyforge/core/
trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/
trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataDynamicPropertyHandler.java
trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataXBeanInfo.java
trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/ObjectDataXBeanInfo.java
trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/
trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireFrame.java
trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireRunner.java
trunk/surveyforge-runner/src/main/resources/
trunk/surveyforge-runner/src/test/
trunk/surveyforge-runner/src/test/java/
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2006-09-20 09:33:34 UTC (rev 61)
+++ trunk/pom.xml 2006-09-20 09:38:12 UTC (rev 62)
@@ -159,7 +159,7 @@
<module>surveyforge-classification</module>
<module>surveyforge-core</module>
<module>surveyforge-db</module>
- <!-- <module>surveyforge-runner</module> -->
+ <module>surveyforge-runner</module>
</modules>
<repositories>
<repository>
Property changes on: trunk/surveyforge-runner
___________________________________________________________________
Name: bugtraq:url
+ http://sourceforge.net/tracker/index.php?func=detail&aid=%BUGID%&group_id=169885&atid=852142
Name: bugtraq:message
+ Issue: %BUGID%
Name: svn:ignore
+ target
.project
.classpath
.settings
.wtpmodules
.springBeans
Added: trunk/surveyforge-runner/pom.xml
===================================================================
--- trunk/surveyforge-runner/pom.xml (rev 0)
+++ trunk/surveyforge-runner/pom.xml 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <parent>
+ <groupId>org.surveyforge</groupId>
+ <artifactId>surveyforge</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>surveyforge-runner</artifactId>
+ <name>SurveyForge questionnaire runner</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <configuration>
+ <aspectLibraries>
+ <aspectLibrary>
+ <groupId>org.surveyforge</groupId>
+ <artifactId>surveyforge-util</artifactId>
+ </aspectLibrary>
+ </aspectLibraries>
+ <weaveDependencies>
+ <weaveDependency>
+ <groupId>org.surveyforge</groupId>
+ <artifactId>surveyforge-core</artifactId>
+ </weaveDependency>
+ <weaveDependency>
+ <groupId>org.surveyforge</groupId>
+ <artifactId>surveyforge-util</artifactId>
+ </weaveDependency>
+ </weaveDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.surveyforge</groupId>
+ <artifactId>surveyforge-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>looks</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>forms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Property changes on: trunk/surveyforge-runner/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Added: trunk/surveyforge-runner/src/main/aspect/org/surveyforge/runner/ObjectDataBeanAspect.aj
===================================================================
--- trunk/surveyforge-runner/src/main/aspect/org/surveyforge/runner/ObjectDataBeanAspect.aj (rev 0)
+++ trunk/surveyforge-runner/src/main/aspect/org/surveyforge/runner/ObjectDataBeanAspect.aj 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,56 @@
+/*
+ * surveyforge-util - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id: InternationalizedString.java 40 2006-08-07 10:11:36Z jgongo $
+ */
+package org.surveyforge.runner;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeListenerProxy;
+
+import org.apache.commons.jxpath.JXPathContext;
+import org.surveyforge.core.data.ObjectData;
+import org.surveyforge.util.beans.Observable;
+
+public aspect ObjectDataBeanAspect
+ {
+ declare @type : ObjectData : @Observable;
+
+ pointcut valueChange( JXPathContext jxpathContext, String propertyName, Object newValue ) : call( void JXPathContext.setValue(String, Object) ) && target( jxpathContext ) && args(propertyName, newValue);
+
+ void around( JXPathContext jxpathContext, String propertyName, Object newValue ) : valueChange( jxpathContext, propertyName, newValue )
+ {
+ ObjectData objectData = (ObjectData) jxpathContext.getContextBean( );
+ Object oldValue = jxpathContext.getValue( propertyName );
+ proceed( jxpathContext, propertyName, newValue );
+
+ PropertyChangeEvent event = new PropertyChangeEvent( objectData, propertyName, oldValue, newValue );
+ for( PropertyChangeListener propertyChangeListener : objectData.getPropertyChangeListeners( ) )
+ {
+ if( propertyChangeListener instanceof PropertyChangeListenerProxy )
+ {
+ if( ((PropertyChangeListenerProxy) propertyChangeListener).getPropertyName( ).equals( propertyName ) )
+ propertyChangeListener.propertyChange( event );
+ }
+ else
+ propertyChangeListener.propertyChange( event );
+ }
+ }
+ }
Added: trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataDynamicPropertyHandler.java
===================================================================
--- trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataDynamicPropertyHandler.java (rev 0)
+++ trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataDynamicPropertyHandler.java 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,72 @@
+/*
+ * surveyforge-runner - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.jxpath.DynamicPropertyHandler;
+
+/**
+ * @author jgonzalez
+ */
+public class DataDynamicPropertyHandler implements DynamicPropertyHandler
+ {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.commons.jxpath.DynamicPropertyHandler#getProperty(java.lang.Object, java.lang.String)
+ */
+ public Object getProperty( Object object, String propertyName )
+ {
+ Data data = (Data) object;
+ return data.getComponentData( propertyName ).getData( );
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.commons.jxpath.DynamicPropertyHandler#getPropertyNames(java.lang.Object)
+ */
+ public String[] getPropertyNames( Object object )
+ {
+ Data data = (Data) object;
+ List<String> propertyNames = new ArrayList<String>( );
+ for( Data componentData : data.getComponentData( ) )
+ {
+ propertyNames.add( componentData.getIdentifier( ) );
+ }
+ return propertyNames.toArray( new String[] {} );
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.commons.jxpath.DynamicPropertyHandler#setProperty(java.lang.Object, java.lang.String, java.lang.Object)
+ */
+ public void setProperty( Object object, String propertyName, Object value )
+ {
+ Data data = (Data) object;
+ data.getComponentData( propertyName ).setData( (Serializable) value );
+ }
+ }
Property changes on: trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataDynamicPropertyHandler.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Added: trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataXBeanInfo.java
===================================================================
--- trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataXBeanInfo.java (rev 0)
+++ trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataXBeanInfo.java 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,57 @@
+/*
+ * surveyforge-runner - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.data;
+
+import java.beans.PropertyDescriptor;
+
+import org.apache.commons.jxpath.JXPathBeanInfo;
+
+/**
+ * @author jgonzalez
+ */
+public class DataXBeanInfo implements JXPathBeanInfo
+ {
+ public Class getDynamicPropertyHandlerClass( )
+ {
+ return DataDynamicPropertyHandler.class;
+ }
+
+ public PropertyDescriptor getPropertyDescriptor( String propertyName )
+ {
+ return null;
+ }
+
+ public PropertyDescriptor[] getPropertyDescriptors( )
+ {
+ return null;
+ }
+
+ public boolean isAtomic( )
+ {
+ return false;
+ }
+
+ public boolean isDynamic( )
+ {
+ return true;
+ }
+ }
Property changes on: trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/DataXBeanInfo.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Added: trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/ObjectDataXBeanInfo.java
===================================================================
--- trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/ObjectDataXBeanInfo.java (rev 0)
+++ trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/ObjectDataXBeanInfo.java 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,57 @@
+/*
+ * surveyforge-runner - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.data;
+
+import java.beans.PropertyDescriptor;
+
+import org.apache.commons.jxpath.JXPathBeanInfo;
+
+/**
+ * @author jgonzalez
+ */
+public class ObjectDataXBeanInfo implements JXPathBeanInfo
+ {
+ public Class getDynamicPropertyHandlerClass( )
+ {
+ return DataDynamicPropertyHandler.class;
+ }
+
+ public PropertyDescriptor getPropertyDescriptor( String propertyName )
+ {
+ return null;
+ }
+
+ public PropertyDescriptor[] getPropertyDescriptors( )
+ {
+ return null;
+ }
+
+ public boolean isAtomic( )
+ {
+ return false;
+ }
+
+ public boolean isDynamic( )
+ {
+ return true;
+ }
+ }
Property changes on: trunk/surveyforge-runner/src/main/java/org/surveyforge/core/data/ObjectDataXBeanInfo.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Added: trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireFrame.java
===================================================================
--- trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireFrame.java (rev 0)
+++ trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireFrame.java 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,324 @@
+/*
+ * surveyforge-runner - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.runner;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Toolkit;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.BorderFactory;
+import javax.swing.BoxLayout;
+import javax.swing.InputVerifier;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextField;
+import javax.swing.border.TitledBorder;
+
+import org.surveyforge.classification.Item;
+import org.surveyforge.classification.Level;
+import org.surveyforge.core.data.ObjectData;
+import org.surveyforge.core.metadata.DataElement;
+import org.surveyforge.core.metadata.RegisterDataElement;
+import org.surveyforge.core.metadata.ValueDomain;
+import org.surveyforge.core.metadata.domain.ClassificationValueDomain;
+import org.surveyforge.core.metadata.domain.QuantityValueDomain;
+import org.surveyforge.core.survey.Feed;
+import org.surveyforge.core.survey.Questionnaire;
+import org.surveyforge.core.survey.QuestionnaireElement;
+import org.surveyforge.core.survey.SectionFeed;
+import org.surveyforge.util.jgoodies.JXPathPresentationModel;
+
+import com.jgoodies.binding.PresentationModel;
+import com.jgoodies.binding.adapter.BasicComponentFactory;
+import com.jgoodies.binding.adapter.ComboBoxAdapter;
+import com.jgoodies.binding.value.AbstractConverter;
+import com.jgoodies.binding.value.ValueModel;
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.FormLayout;
+
+/**
+ * @author jgonzalez
+ */
+public class QuestionnaireFrame extends JFrame
+ {
+ private static final long serialVersionUID = -2135625525102812393L;
+
+ private Questionnaire questionnaire;
+ private Map<QuestionnaireElement, Component> questionnaireComponents = new HashMap<QuestionnaireElement, Component>( );
+ private ObjectData objectData;
+ private PresentationModel dataModel;
+
+ public QuestionnaireFrame( Questionnaire questionnaire )
+ {
+ super( "QuestionnaireRunner" );
+
+ this.questionnaire = questionnaire;
+ this.setObjectData( questionnaire.getRegister( ).getRegisterData( ).createEmptyObjectData( ) );
+
+ JTabbedPane pagesPane = new JTabbedPane( );
+ this.getContentPane( ).add( pagesPane );
+
+ for( Feed pageFeed : questionnaire.getPageFeeds( ) )
+ {
+ pagesPane.addTab( "Page", this.createPagePanel( questionnaire, pageFeed ) );
+ }
+ }
+
+ protected ObjectData getObjectData( )
+ {
+ return this.objectData;
+ }
+
+ protected void setObjectData( ObjectData objectData )
+ {
+ this.objectData = objectData;
+ this.dataModel = new JXPathPresentationModel( this.objectData );
+ }
+
+ protected PresentationModel getDataModel( )
+ {
+ return this.dataModel;
+ }
+
+ private JScrollPane createPagePanel( Questionnaire questionnaire, Feed pageFeed )
+ {
+ JScrollPane pageScrollPane = new JScrollPane( );
+ JPanel pagePanel = new JPanel( );
+ pageScrollPane.setViewportView( pagePanel );
+ pagePanel.setLayout( new BoxLayout( pagePanel, BoxLayout.PAGE_AXIS ) );
+
+ for( SectionFeed sectionFeed : questionnaire.getSectionsInPage( pageFeed ) )
+ {
+ pagePanel.add( this.createSectionPanel( questionnaire, pageFeed, sectionFeed ) );
+ }
+
+ return pageScrollPane;
+ }
+
+ private JPanel createSectionPanel( Questionnaire questionnaire, Feed pageFeed, SectionFeed sectionFeed )
+ {
+ StringBuffer rowSpecification = new StringBuffer( );
+ for( int elementIndex = 0; elementIndex <= questionnaire.getElements( ).size( ); elementIndex++ )
+ rowSpecification.append( "3dlu, top:pref, 3dlu, pref, " );
+ FormLayout sectionLayout = new FormLayout( "3dlu, pref, 5dlu, left:pref, 3dlu:grow", rowSpecification.toString( ) );
+
+ PanelBuilder pageSectionPanelBuilder = new PanelBuilder( sectionLayout );
+ pageSectionPanelBuilder.setBorder( BorderFactory.createTitledBorder( BorderFactory.createLineBorder( Color.DARK_GRAY, 1 ),
+ sectionFeed.getTitle( ), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, Color.DARK_GRAY ) );
+
+ boolean firstElement = true;
+ for( QuestionnaireElement element : questionnaire.getElementsInPageAndSection( pageFeed, sectionFeed ) )
+ {
+ if( !firstElement )
+ {
+ pageSectionPanelBuilder.nextLine( 2 );
+ pageSectionPanelBuilder.addSeparator( "" );
+ pageSectionPanelBuilder.nextLine( 2 );
+ }
+ else
+ {
+ pageSectionPanelBuilder.nextLine( );
+ firstElement = false;
+ }
+
+ pageSectionPanelBuilder.nextColumn( ); // Needed to place cursor in correct column
+ pageSectionPanelBuilder.addLabel( element.getQuestion( ).getText( ) );
+ pageSectionPanelBuilder.nextColumn( 2 );
+ pageSectionPanelBuilder.add( this.createDataEntryComponent( element ) );
+ }
+
+ // JButton cambioModelo = new JButton( "Cambio" );
+ // cambioModelo.addActionListener( new ActionListener( )
+ // {
+ // public void actionPerformed( ActionEvent e )
+ // {
+ // QuestionnaireRunner.TempQuestionnaire newData = new QuestionnaireRunner.TempQuestionnaire( );
+ // newData.setAnyoNacimiento( 1950 );
+ // newData.setMesNacimiento( 8 );
+ // QuestionnaireFrame.this.dataModel.setBean( newData );
+ // }
+ // } );
+ // pageSectionPanelBuilder.nextLine( );
+ // pageSectionPanelBuilder.nextLine( );
+ // pageSectionPanelBuilder.nextColumn( 3 );
+ // pageSectionPanelBuilder.add( cambioModelo );
+
+ return pageSectionPanelBuilder.getPanel( );
+ }
+
+ private JComponent createDataEntryComponent( QuestionnaireElement element )
+ {
+ if( element.getRegisterDataElement( ).getComponentElements( ).isEmpty( ) )
+ {
+ // Simple question
+ String propertyName = QuestionnaireFrame.computePropertyName( element.getRegisterDataElement( ) );
+ ValueDomain valueDomain = element.getRegisterDataElement( ).getValueDomain( );
+ if( valueDomain instanceof QuantityValueDomain )
+ {
+ QuantityValueDomain quantityValueDomain = (QuantityValueDomain) valueDomain;
+ // JTextField field = new JTextField( quantityValueDomain.getPrecision( ) );
+ JTextField field = BasicComponentFactory.createIntegerField( this.getDataModel( ).getModel( propertyName ) );
+ field.setColumns( quantityValueDomain.getPrecision( ) );
+ this.questionnaireComponents.put( element, field );
+ return field;
+ }
+ else if( valueDomain instanceof ClassificationValueDomain )
+ {
+ final ClassificationValueDomain classificationValueDomain = (ClassificationValueDomain) valueDomain;
+ JPanel classificationPanel = new JPanel( new FlowLayout( FlowLayout.LEFT ) );
+ // JComboBox classificationCombo = new JComboBox( classificationValueDomain.getLevel( ).getItems( ).toArray( ) );
+ JComboBox classificationCombo = new JComboBox(
+ new ComboBoxAdapter( classificationValueDomain.getLevel( ).getItems( ), new QuestionnaireFrame.ClassificationConverter(
+ classificationValueDomain.getLevel( ), this.dataModel.getModel( propertyName ) ) ) );
+
+ // JTextField classificationCode = new JTextField( 5 );
+ final JTextField classificationCode = BasicComponentFactory.createTextField( this.dataModel.getModel( propertyName ) );
+ classificationCode.setColumns( 5 );
+ classificationCode.setInputVerifier( new InputVerifier( )
+ {
+ Color defaultBackground = classificationCode.getBackground( );
+
+ @Override
+ public boolean verify( JComponent component )
+ {
+ if( classificationValueDomain.getLevel( ).includes( classificationCode.getText( ), false ) )
+ {
+ classificationCode.setBackground( defaultBackground );
+ return true;
+ }
+ else
+ {
+ classificationCode.setBackground( Color.RED );
+ Toolkit.getDefaultToolkit( ).beep( );
+ JOptionPane.showMessageDialog( classificationCode.getRootPane( ),
+ "El c\u00f3digo introducido no se encuentra entre las opciones disponibles.", "C\u00f3digo err\u00f3neo",
+ JOptionPane.ERROR_MESSAGE );
+ return false;
+ }
+ }
+
+ @Override
+ public boolean shouldYieldFocus( JComponent input )
+ {
+ return verify( input );
+ }
+ } );
+ // JFormattedTextField classificationCode = new JFormattedTextField( new QuestionnaireFrame.ClassificationFormatter(
+ // classificationValueDomain.getLevel( ) ) );
+ // PropertyConnector propertyConnector = new PropertyConnector( this.dataModel.getModel( "sexo" ), "value", classificationCode,
+ // "value" );
+
+ classificationPanel.add( classificationCombo );
+ classificationPanel.add( classificationCode );
+ this.questionnaireComponents.put( element, classificationPanel );
+ return classificationPanel;
+ }
+ else
+ {
+ // TODO: Throw an exception?
+ return new JTextField( "TODO", 10 );
+ }
+ }
+ else
+ {
+ // Compuond question
+ return new JTextField( "TODO", 10 );
+ }
+ }
+
+ private static String computePropertyName( RegisterDataElement registerDataElement )
+ {
+ List<String> identifiers = new LinkedList<String>( );
+
+ DataElement root = registerDataElement.getRootDataElement( );
+ DataElement currentDataElement = registerDataElement;
+ while( !currentDataElement.equals( root ) )
+ {
+ identifiers.add( 0, currentDataElement.getIdentifier( ) );
+ currentDataElement = currentDataElement.getVariableStructure( );
+ }
+
+ StringBuffer propertyName = new StringBuffer( identifiers.get( 0 ) );
+ for( String identifier : identifiers.subList( 1, identifiers.size( ) ) )
+ {
+ propertyName.append( "/" );
+ propertyName.append( identifier );
+ }
+
+ return propertyName.toString( );
+ }
+
+ // public static class ClassificationFormatter extends JFormattedTextField.AbstractFormatter
+ // {
+ // private Level level;
+ //
+ // public ClassificationFormatter( Level level )
+ // {
+ // this.level = level;
+ // }
+ //
+ // @Override
+ // public Object stringToValue( String text ) throws ParseException
+ // {
+ // // TODO Auto-generated method stub
+ // return this.level.getItem( text, false );
+ // }
+ //
+ // @Override
+ // public String valueToString( Object value ) throws ParseException
+ // {
+ // return value != null ? ((Item) value).getCode( ) : null;
+ // }
+ // }
+ //
+ public static class ClassificationConverter extends AbstractConverter
+ {
+ private Level level;
+
+ public ClassificationConverter( Level level, ValueModel subject )
+ {
+ super( subject );
+ this.level = level;
+ }
+
+ @Override
+ public Object convertFromSubject( Object subjectValue )
+ {
+ return this.level.getItem( (String) subjectValue, false );
+ }
+
+ public void setValue( Object value )
+ {
+ this.subject.setValue( value != null ? ((Item) value).getCode( ) : null );
+ }
+ }
+ }
Property changes on: trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireFrame.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Added: trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireRunner.java
===================================================================
--- trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireRunner.java (rev 0)
+++ trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireRunner.java 2006-09-20 09:38:12 UTC (rev 62)
@@ -0,0 +1,205 @@
+/*
+ * surveyforge-runner - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.runner;
+
+import java.util.Arrays;
+import java.util.GregorianCalendar;
+
+import javax.swing.JFrame;
+import javax.swing.UIManager;
+
+import org.surveyforge.classification.Classification;
+import org.surveyforge.classification.Family;
+import org.surveyforge.classification.Item;
+import org.surveyforge.classification.Level;
+import org.surveyforge.classification.Version;
+import org.surveyforge.core.metadata.Register;
+import org.surveyforge.core.metadata.RegisterDataElement;
+import org.surveyforge.core.metadata.domain.AbstractValueDomain;
+import org.surveyforge.core.metadata.domain.ClassificationValueDomain;
+import org.surveyforge.core.metadata.domain.QuantityValueDomain;
+import org.surveyforge.core.metadata.domain.StructuredValueDomain;
+import org.surveyforge.core.survey.Question;
+import org.surveyforge.core.survey.Questionnaire;
+import org.surveyforge.core.survey.QuestionnaireElement;
+import org.surveyforge.core.survey.Study;
+
+/**
+ * @author jgonzalez
+ */
+public class QuestionnaireRunner
+ {
+ public static Classification SEXO;
+
+ static
+ {
+ GregorianCalendar calendar = new GregorianCalendar( );
+ calendar.clear( );
+ calendar.set( 2006, 0, 1 );
+
+ Family ceescat_hivudvp = new Family( "ceescat-hivudvp" );
+
+ QuestionnaireRunner.SEXO = new Classification( ceescat_hivudvp, "hivudvp-sexo" );
+ Version sexoV = new Version( QuestionnaireRunner.SEXO, "sexo V1", calendar.getTime( ) );
+ Level sexoL = new Level( sexoV, "sexo L1" );
+ new Item( sexoL, null, "1", "Hombre" );
+ new Item( sexoL, null, "2", "Mujer" );
+ new Item( sexoL, null, "3", "Transexual" );
+ }
+
+ public static void main( String[] args )
+ {
+ try
+ {
+ // PlasticLookAndFeel.setPlasticTheme( new com.jgoodies.looks.plastic.theme.DesertBlue( ) );
+ UIManager.setLookAndFeel( "com.jgoodies.looks.plastic.Plastic3DLookAndFeel" );
+ }
+ catch( Exception e )
+ {
+ // Likely PlasticXP is not in the class path; ignore.
+ }
+
+ QuestionnaireFrame questionnaireFrame = new QuestionnaireFrame( QuestionnaireRunner.getQuestionnaire( ) );
+ questionnaireFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
+ questionnaireFrame.pack( );
+ questionnaireFrame.setVisible( true );
+ }
+
+ public static Questionnaire getQuestionnaire( )
+ {
+ Level sexoL = QuestionnaireRunner.SEXO.getCurrentVersion( ).getLevels( ).get( 0 );
+
+ Register register = new Register( "register" );
+ register.setIdentifier( "registroPrueba" );
+
+ AbstractValueDomain mesNacimientoValueDomain = new QuantityValueDomain( 2, 0 );
+ AbstractValueDomain anyoNacimientoValueDomain = new QuantityValueDomain( 4, 0 );
+ StructuredValueDomain fechaNacimientoValueDomain = new StructuredValueDomain( );
+ fechaNacimientoValueDomain.addSubDomain( mesNacimientoValueDomain );
+ fechaNacimientoValueDomain.addSubDomain( anyoNacimientoValueDomain );
+
+ RegisterDataElement mesNacimiento = new RegisterDataElement( "mesNacimiento", mesNacimientoValueDomain );
+ RegisterDataElement anyoNacimiento = new RegisterDataElement( "anyoNacimiento", anyoNacimientoValueDomain );
+// RegisterDataElement fechaNacimiento = new RegisterDataElement( "fechaNacimiento", fechaNacimientoValueDomain );
+// fechaNacimiento.addComponentElement( mesNacimiento );
+// fechaNacimiento.addComponentElement( anyoNacimiento );
+ RegisterDataElement sexo = new RegisterDataElement( "sexo", new ClassificationValueDomain( sexoL ) );
+
+// register.setComponentElements( Arrays.asList( new RegisterDataElement[] {fechaNacimiento, sexo} ) );
+ register.setComponentElements( Arrays.asList( new RegisterDataElement[] {mesNacimiento, anyoNacimiento, sexo} ) );
+
+ Study study = new Study( "study" );
+ Questionnaire questionnaire = new Questionnaire( study, register, "questionnaire" );
+
+ Question pMesNacimiento = new Question( "pMesNacimiento" );
+ pMesNacimiento.setText( "En qué mes naciste?" );
+ QuestionnaireElement qMesNacimiento = new QuestionnaireElement( mesNacimiento );
+ qMesNacimiento.setQuestion( pMesNacimiento );
+ questionnaire.addElement( qMesNacimiento );
+
+ Question pAnyoNacimiento = new Question( "pAnyoNacimiento" );
+ pAnyoNacimiento.setText( "En qué año naciste?" );
+ QuestionnaireElement qAnyoNacimiento = new QuestionnaireElement( anyoNacimiento );
+ qAnyoNacimiento.setQuestion( pAnyoNacimiento );
+ questionnaire.addElement( qAnyoNacimiento );
+
+ Question pSexo = new Question( "pSexo" );
+ pSexo.setText( "Sexo" );
+ QuestionnaireElement qSexo = new QuestionnaireElement( sexo );
+ qSexo.setQuestion( pSexo );
+ questionnaire.addElement( qSexo );
+
+ return questionnaire;
+ }
+
+ public static class TempQuestionnaire
+ {
+ private int mesNacimiento = 1;
+ private int anyoNacimiento = 1985;
+ // private QuestionnaireRunner.TempSexo sexo = new QuestionnaireRunner.TempSexo( );
+
+ private String sexo = QuestionnaireRunner.SEXO.getCurrentVersion( ).getLevels( ).get( 0 ).getItems( ).get( 2 ).getCode( );
+
+ public String getSexo( )
+ {
+ System.out.println( "Devolviendo valor sexo: " + sexo );
+ return sexo;
+ }
+
+ public void setSexo( String sexo )
+ {
+ System.out.println( "Nuevo valor sexo: " + sexo );
+ this.sexo = sexo;
+ }
+
+ public int getMesNacimiento( )
+ {
+ System.out.println( "Devolviendo valor mes: " + mesNacimiento );
+ return mesNacimiento;
+ }
+
+ public void setMesNacimiento( int mesNacimiento )
+ {
+ System.out.println( "Nuevo valor mes: " + mesNacimiento );
+ this.mesNacimiento = mesNacimiento;
+ }
+
+ public int getAnyoNacimiento( )
+ {
+ System.out.println( "Devolviendo valor anyo: " + anyoNacimiento );
+ return anyoNacimiento;
+ }
+
+ public void setAnyoNacimiento( int anyoNacimiento )
+ {
+ System.out.println( "Nuevo valor anyo: " + anyoNacimiento );
+ this.anyoNacimiento = anyoNacimiento;
+ }
+
+ // public QuestionnaireRunner.TempSexo getSexo( )
+ // {
+ // return sexo;
+ // }
+ //
+ // public void setSexo( QuestionnaireRunner.TempSexo sexo )
+ // {
+ // this.sexo = sexo;
+ // }
+ }
+
+ public static class TempSexo
+ {
+ private String sexo = QuestionnaireRunner.SEXO.getCurrentVersion( ).getLevels( ).get( 0 ).getItems( ).get( 2 ).getCode( );
+
+ public String getSexo( )
+ {
+ System.out.println( "Devolviendo valor sexo: " + sexo );
+ return sexo;
+ }
+
+ public void setSexo( String sexo )
+ {
+ System.out.println( "Nuevo valor sexo: " + sexo );
+ this.sexo = sexo;
+ }
+ }
+ }
Property changes on: trunk/surveyforge-runner/src/main/java/org/surveyforge/runner/QuestionnaireRunner.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jg...@us...> - 2006-09-20 09:33:45
|
Revision: 61
http://svn.sourceforge.net/surveyforge/?rev=61&view=rev
Author: jgongo
Date: 2006-09-20 02:33:34 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
Added toString method
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-20 09:32:53 UTC (rev 60)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-20 09:33:34 UTC (rev 61)
@@ -80,7 +80,7 @@
/** */
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "valueDomain_id")
- private AbstractValueDomain valueDomain;
+ private AbstractValueDomain valueDomain;
/** */
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "variableStructure_id", insertable = false, updatable = false)
@@ -250,10 +250,8 @@
if( !this.getComponentElements( ).contains( componentElement ) )
{
if( componentElement.getVariableStructure( ) != null && !componentElement.getVariableStructure( ).equals( this ) )
- {
componentElement.getVariableStructure( ).removeElement( componentElement );
- componentElement.variableStructure = this;
- }
+ componentElement.variableStructure = this;
this.componentElements.add( componentElement );
}
else
@@ -362,4 +360,21 @@
{
return this.getIdentifier( ).hashCode( ) ^ (this.getVariableStructure( ) == null ? 0 : this.getVariableStructure( ).hashCode( ));
}
+
+ @Override
+ public String toString( )
+ {
+ StringBuffer dataElementString = new StringBuffer( );
+ dataElementString.append( '|' ).append( this.getIdentifier( ) );
+ if( !this.getComponentElements( ).isEmpty( ) )
+ {
+ dataElementString.append( ':' );
+ for( DataElement componentElement : this.getComponentElements( ) )
+ dataElementString.append( componentElement.toString( ) );
+ }
+
+ dataElementString.append( "|" );
+
+ return dataElementString.toString( );
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jg...@us...> - 2006-09-20 09:33:01
|
Revision: 60
http://svn.sourceforge.net/surveyforge/?rev=60&view=rev
Author: jgongo
Date: 2006-09-20 02:32:53 -0700 (Wed, 20 Sep 2006)
Log Message:
-----------
equals properly implemented
Modified Paths:
--------------
trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java
Modified: trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java
===================================================================
--- trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java 2006-09-19 13:15:22 UTC (rev 59)
+++ trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java 2006-09-20 09:32:53 UTC (rev 60)
@@ -473,8 +473,13 @@
@Override
public boolean equals( Object object )
{
- Item otherItem = (Item) object;
- return this.getVersion( ).equals( otherItem.getVersion( ) ) && this.getCode( ).equals( otherItem.getCode( ) );
+ if( object instanceof Item )
+ {
+ Item otherItem = (Item) object;
+ return this.getVersion( ).equals( otherItem.getVersion( ) ) && this.getCode( ).equals( otherItem.getCode( ) );
+ }
+ else
+ return false;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jg...@us...> - 2006-09-19 13:15:38
|
Revision: 59
http://svn.sourceforge.net/surveyforge/?rev=59&view=rev
Author: jgongo
Date: 2006-09-19 06:15:22 -0700 (Tue, 19 Sep 2006)
Log Message:
-----------
Line delimiters
Modified Paths:
--------------
trunk/surveyforge-util/pom.xml
Modified: trunk/surveyforge-util/pom.xml
===================================================================
--- trunk/surveyforge-util/pom.xml 2006-09-19 11:22:29 UTC (rev 58)
+++ trunk/surveyforge-util/pom.xml 2006-09-19 13:15:22 UTC (rev 59)
@@ -1,46 +1,46 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <parent>
- <artifactId>surveyforge</artifactId>
- <groupId>org.surveyforge</groupId>
- <version>0.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>surveyforge-util</artifactId>
- <name>SurveyForge support classes</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>aspectj-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- </dependency>
- <dependency>
- <groupId>aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- </dependency>
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <parent>
+ <artifactId>surveyforge</artifactId>
+ <groupId>org.surveyforge</groupId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>surveyforge-util</artifactId>
+ <name>SurveyForge support classes</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
<dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ </dependency>
+ <dependency>
<groupId>com.jgoodies</groupId>
<artifactId>binding</artifactId>
</dependency>
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-19 11:22:45
|
Revision: 58
http://svn.sourceforge.net/surveyforge/?rev=58&view=rev
Author: javism
Date: 2006-09-19 04:22:29 -0700 (Tue, 19 Sep 2006)
Log Message:
-----------
Changes in constructors to fit the logical behaviour
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java
trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/GlobalVariableTest.java
trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/VariableFamilyTest.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java 2006-09-18 15:18:08 UTC (rev 57)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java 2006-09-19 11:22:29 UTC (rev 58)
@@ -84,7 +84,7 @@
* @param variableFamily The Variable Family where the GlobalVariable will be placed.
* @throws NullPointerException If the identifier is <code>null</code> or is empty.
*/
- public GlobalVariable( VariableFamily variableFamily, String identifier )
+ public GlobalVariable( String identifier, VariableFamily variableFamily )
{
this.setIdentifier( identifier );
this.setVariableFamily( variableFamily );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java 2006-09-18 15:18:08 UTC (rev 57)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java 2006-09-19 11:22:29 UTC (rev 58)
@@ -111,7 +111,7 @@
this.setIdentifier( registerDataElement.getIdentifier( ) );
}
- public QuestionnaireElement( QuestionnaireElement upperElement, RegisterDataElement registerDataElement )
+ public QuestionnaireElement( RegisterDataElement registerDataElement, QuestionnaireElement upperElement )
{
this( registerDataElement );
this.setUpperQuestionnaireElement( upperElement );
Modified: trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/GlobalVariableTest.java
===================================================================
--- trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/GlobalVariableTest.java 2006-09-18 15:18:08 UTC (rev 57)
+++ trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/GlobalVariableTest.java 2006-09-19 11:22:29 UTC (rev 58)
@@ -35,7 +35,7 @@
@ExpectedExceptions( {NullPointerException.class})
public void globalVariableCreationWithNullIdentifier( )
{
- new GlobalVariable( new VariableFamily( "family" ), null );
+ new GlobalVariable( null, new VariableFamily( "family" ) );
}
@@ -43,20 +43,20 @@
@ExpectedExceptions( {NullPointerException.class})
public void globalVariableCreationWithEmptyIdentifier( )
{
- new GlobalVariable( new VariableFamily( "family" ), "" );
+ new GlobalVariable( "", new VariableFamily( "family" ) );
}
@Test
public void globalVariableCreation( )
{
- new GlobalVariable( new VariableFamily( "family" ), "GlobalVariable" );
+ new GlobalVariable( "GlobalVariable", new VariableFamily( "family" ) );
}
@Test
public void globalVariableGetIdentifier( )
{
String id = "id";
- GlobalVariable globalVariable = new GlobalVariable( new VariableFamily( "family" ), id );
+ GlobalVariable globalVariable = new GlobalVariable( id, new VariableFamily( "family" ) );
Assert.assertTrue( globalVariable.getIdentifier( ).equals( id ) );
Assert.assertFalse( globalVariable.getIdentifier( ).equals( "test" ) );
}
@@ -65,14 +65,14 @@
@ExpectedExceptions( {NullPointerException.class})
public void globalVariableSetNullName( )
{
- new GlobalVariable( new VariableFamily( "family" ), "id" ).setName( null );
+ new GlobalVariable( "id", new VariableFamily( "family" ) ).setName( null );
}
@Test
public void globalVariableSetName( )
{
String name = "name";
- GlobalVariable gb = new GlobalVariable( new VariableFamily( "family" ), "id" );
+ GlobalVariable gb = new GlobalVariable( "id", new VariableFamily( "family" ) );
gb.setName( name );
Assert.assertTrue( gb.getName( ).equals( name ) );
}
@@ -81,7 +81,7 @@
@ExpectedExceptions( {NullPointerException.class})
public void globalVariableSetNullDescription( )
{
- new GlobalVariable( new VariableFamily( "family" ), "id" ).setDescription( null );
+ new GlobalVariable( "id", new VariableFamily( "family" ) ).setDescription( null );
}
@Test
@@ -89,7 +89,7 @@
{
String empty = "";
String desc = "desc";
- GlobalVariable obj = new GlobalVariable( new VariableFamily( "family" ), "id" );
+ GlobalVariable obj = new GlobalVariable( "id", new VariableFamily( "family" ) );
obj.setDescription( desc );
Assert.assertTrue( obj.getDescription( ).equals( desc ) );
Assert.assertFalse( obj.getDescription( ).equals( "test" ) );
@@ -102,7 +102,7 @@
public void globalVariableGetFamily( )
{
VariableFamily family = new VariableFamily( "family" );
- GlobalVariable gb = new GlobalVariable( family, "id" );
+ GlobalVariable gb = new GlobalVariable( "id", family );
gb.setVariableFamily( family );
Assert.assertEquals( gb.getVariableFamily( ), family );
}
Modified: trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/VariableFamilyTest.java
===================================================================
--- trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/VariableFamilyTest.java 2006-09-18 15:18:08 UTC (rev 57)
+++ trunk/surveyforge-core/src/test/java/org/surveyforge/core/metadata/VariableFamilyTest.java 2006-09-19 11:22:29 UTC (rev 58)
@@ -88,8 +88,8 @@
{
Assert.assertEquals( new ArrayList<GlobalVariable>( ), new VariableFamily( "id" ).getGlobalVariables( ) );
VariableFamily family = new VariableFamily( "family" );
- GlobalVariable gb1 = new GlobalVariable( family, "gb1" );
- GlobalVariable gb2 = new GlobalVariable( family, "gb2" );
+ GlobalVariable gb1 = new GlobalVariable( "gb1", family );
+ GlobalVariable gb2 = new GlobalVariable( "gb2", family );
// VariableFamily family2 = new VariableFamily( "vf" );
gb1.setVariableFamily( family );
Assert.assertTrue( family.getGlobalVariables( ).contains( gb1 ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jg...@us...> - 2006-09-18 15:19:04
|
Revision: 57
http://svn.sourceforge.net/surveyforge/?rev=57&view=rev
Author: jgongo
Date: 2006-09-18 08:18:08 -0700 (Mon, 18 Sep 2006)
Log Message:
-----------
Major revamp of core and util classes to include support for runner
Modified Paths:
--------------
trunk/pom.xml
trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Level.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionTest.java
trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionnaireElementTest.java
trunk/surveyforge-util/pom.xml
trunk/surveyforge-util/src/test/resources/testng.xml
Added Paths:
-----------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Data.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java
trunk/surveyforge-util/src/main/aspect/
trunk/surveyforge-util/src/main/aspect/org/
trunk/surveyforge-util/src/main/aspect/org/surveyforge/
trunk/surveyforge-util/src/main/aspect/org/surveyforge/util/
trunk/surveyforge-util/src/main/aspect/org/surveyforge/util/beans/
trunk/surveyforge-util/src/main/aspect/org/surveyforge/util/beans/JavaBeanAspect.aj
trunk/surveyforge-util/src/main/aspect/org/surveyforge/util/beans/Observable.java
trunk/surveyforge-util/src/main/java/org/surveyforge/util/jgoodies/
trunk/surveyforge-util/src/main/java/org/surveyforge/util/jgoodies/JXPathBeanAdapter.java
trunk/surveyforge-util/src/main/java/org/surveyforge/util/jgoodies/JXPathBeanUtils.java
trunk/surveyforge-util/src/main/java/org/surveyforge/util/jgoodies/JXPathPresentationModel.java
Removed Paths:
-------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/pom.xml 2006-09-18 15:18:08 UTC (rev 57)
@@ -108,6 +108,24 @@
</outputDirectory>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <!--<version>1.0-beta-1</version>-->
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <!-- <goal>test-compile</goal> -->
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -141,6 +159,7 @@
<module>surveyforge-classification</module>
<module>surveyforge-core</module>
<module>surveyforge-db</module>
+ <!-- <module>surveyforge-runner</module> -->
</modules>
<repositories>
<repository>
@@ -286,6 +305,36 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>looks</artifactId>
+ <version>2.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>forms</artifactId>
+ <version>1.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>binding</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>validation</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.2</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<distributionManagement>
@@ -302,4 +351,4 @@
</site>
<downloadUrl>http://sourceforge.net/project/showfiles.php?group_id=169885</downloadUrl>
</distributionManagement>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Level.java
===================================================================
--- trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Level.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Level.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -362,7 +362,7 @@
* @param searchSublevels whether to search in levels under this level.
* @return <code>true</code> if the provided code is included in this level or levels under this level.
*/
- public boolean isIncludedInLevel( String code, boolean searchSublevels )
+ public boolean includes( String code, boolean searchSublevels )
{
if( this.getCodeToItemMapping( ).containsKey( code ) )
return true;
@@ -370,12 +370,34 @@
{
List<Level> levelsInVersion = this.getVersion( ).getLevels( );
if( searchSublevels && this.getNumber( ) < levelsInVersion.size( ) )
- return levelsInVersion.get( this.getNumber( ) ).isIncludedInLevel( code, searchSublevels );
+ return levelsInVersion.get( this.getNumber( ) ).includes( code, searchSublevels );
else
return false;
}
}
+ /**
+ * Returns the item with the specified code if the provided code is included in this level or levels under this level. Levels under
+ * this level will only be searched if <code>searchSublevels</code> is true.
+ *
+ * @param code the code to search.
+ * @param searchSublevels whether to search in levels under this level.
+ * @return the item with the specified code, <code>null</code> if no item with that code is found.
+ */
+ public Item getItem( String code, boolean searchSublevels )
+ {
+ if( this.getCodeToItemMapping( ).containsKey( code ) )
+ return this.getCodeToItemMapping( ).get( code );
+ else
+ {
+ List<Level> levelsInVersion = this.getVersion( ).getLevels( );
+ if( searchSublevels && this.getNumber( ) < levelsInVersion.size( ) )
+ return levelsInVersion.get( this.getNumber( ) ).getItem( code, searchSublevels );
+ else
+ return null;
+ }
+ }
+
@Override
public boolean equals( Object object )
{
Copied: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Data.java (from rev 51, trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java)
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Data.java (rev 0)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Data.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -0,0 +1,357 @@
+/*
+ * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Transient;
+
+import org.hibernate.annotations.GenericGenerator;
+import org.hibernate.annotations.IndexColumn;
+
+// TODO: Elaborate on comments
+/**
+ * @author jsegura
+ */
+@Entity
+public class Data implements Serializable
+ {
+ private static final long serialVersionUID = 0L;
+
+ @SuppressWarnings("unused")
+ @Id
+ @Column(length = 50)
+ @GeneratedValue(generator = "system-uuid")
+ @GenericGenerator(name = "system-uuid", strategy = "uuid")
+ private String id;
+ /** Version for optimistic locking. */
+ @SuppressWarnings("unused")
+ @javax.persistence.Version
+ private int lockingVersion;
+
+ /**
+ * This is a unique and language independent identifier for the data element. The identifier is unique among all other data elements
+ * for an object variable (standard data element) or within the scope of a statistical activity.
+ */
+ @Column(length = 50)
+ private String identifier;
+
+ private Serializable data;
+
+ private boolean answered;
+ private boolean applicable;
+
+ @ManyToOne(cascade = {CascadeType.ALL})
+ @JoinColumn(name = "enclosingData_id", insertable = false, updatable = false)
+ private Data enclosingData;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
+ @IndexColumn(name = "componentDataIndex")
+ @JoinColumn(name = "enclosingData_id")
+ private List<Data> componentData = new ArrayList<Data>( );
+ @Transient
+ private Map<String, Data> nameToDataMap;
+
+ protected Data( )
+ {}
+
+ /**
+ * @param valueDomain
+ * @param identifier
+ */
+ public Data( String identifier )
+ {
+ this.setIdentifier( identifier );
+ }
+
+ /**
+ * @return Returns the identifier.
+ */
+ public String getIdentifier( )
+ {
+ return this.identifier;
+ }
+
+ /**
+ * @param identifier The identifier to set.
+ */
+ public void setIdentifier( String identifier )
+ {
+ if( identifier != null && !identifier.trim( ).equals( "" ) )
+ this.identifier = identifier;
+ else
+ throw new NullPointerException( );
+ }
+
+ /**
+ * @return Returns the data.
+ */
+ public Serializable getData( )
+ {
+ if( this.getComponentData( ).isEmpty( ) )
+ return this.data;
+ else
+ return this;
+ }
+
+ /**
+ * @param data The data to set.
+ */
+ public void setData( Serializable data )
+ {
+ this.data = data;
+ }
+
+ /**
+ * @return Returns the answered.
+ */
+ public boolean isAnswered( )
+ {
+ return this.answered;
+ }
+
+ /**
+ * @param answered The answered to set.
+ */
+ public void setAnswered( boolean answered )
+ {
+ this.answered = answered;
+ }
+
+ /**
+ * @return Returns the applicable.
+ */
+ public boolean isApplicable( )
+ {
+ return this.applicable;
+ }
+
+ /**
+ * @param applicable The applicable to set.
+ */
+ public void setApplicable( boolean applicable )
+ {
+ this.applicable = applicable;
+ }
+
+ /**
+ * @return Returns the enclosingData.
+ */
+ public Data getEnclosingData( )
+ {
+ return this.enclosingData;
+ }
+
+ /**
+ * @return
+ */
+ public Data getRootData( )
+ {
+ if( this.getEnclosingData( ) == null )
+ return this;
+ else
+ return this.getEnclosingData( ).getRootData( );
+ }
+
+ /**
+ * @param enclosingData The enclosingData to set.
+ */
+ public void setEnclosingData( Data enclosingData )
+ {
+ if( (enclosingData == null && this.getEnclosingData( ) != null) || !enclosingData.equals( this.getEnclosingData( ) ) )
+ {
+ if( this.getEnclosingData( ) != null ) this.getEnclosingData( ).removeElement( this );
+ this.enclosingData = enclosingData;
+ if( this.getEnclosingData( ) != null ) this.getEnclosingData( ).addElement( this );
+ }
+ }
+
+ /**
+ * @return Returns the componentData.
+ */
+ public List<? extends Data> getComponentData( )
+ {
+ return Collections.unmodifiableList( this.componentData );
+ }
+
+ /**
+ * @param identifier
+ * @return
+ */
+ public Data getComponentData( String identifier )
+ {
+ return this.getNameToDataMap( ).get( identifier );
+ }
+
+ /**
+ * @param componentData
+ */
+ public void setComponentData( List<? extends Data> componentData )
+ {
+ this.clearComponentData( );
+ for( Data data : componentData )
+ this.addComponentData( data );
+ }
+
+ /**
+ *
+ */
+ protected void clearComponentData( )
+ {
+ Iterator<? extends Data> componentDataIterator = this.getComponentData( ).iterator( );
+
+ while( componentDataIterator.hasNext( ) )
+ {
+ Data data = (Data) componentDataIterator.next( );
+ data.enclosingData = null;
+ componentDataIterator.remove( );
+ }
+ }
+
+ /**
+ * @param componentData The componentData to set.
+ */
+ public void addComponentData( Data componentData )
+ {
+ if( componentData != null )
+ {
+ if( !this.getComponentData( ).contains( componentData ) )
+ {
+ if( componentData.getEnclosingData( ) != null && !componentData.getEnclosingData( ).equals( this ) )
+ {
+ componentData.getEnclosingData( ).removeElement( componentData );
+ componentData.enclosingData = this;
+ }
+ this.componentData.add( componentData );
+ }
+ else
+ throw new IllegalArgumentException( );
+ }
+ else
+ throw new NullPointerException( );
+ }
+
+ /**
+ * @param componentData
+ */
+ protected void addElement( Data componentData )
+ {
+ if( !this.getNameToDataMap( ).containsKey( componentData.getIdentifier( ) ) )
+ {
+ this.componentData.add( componentData );
+ this.getNameToDataMap( ).put( componentData.getIdentifier( ), componentData );
+ }
+ else
+ throw new IllegalArgumentException( );
+ }
+
+ /**
+ * @param componentData The componentData to set.
+ */
+ public void removeComponentData( Data componentData )
+ {
+ if( componentData != null )
+ {
+ this.removeElement( componentData );
+ componentData.enclosingData = null;
+ }
+ else
+ throw new NullPointerException( );
+ }
+
+ /**
+ * @param componentData
+ */
+ protected void removeElement( Data componentData )
+ {
+ if( this.getNameToDataMap( ).containsKey( componentData.getIdentifier( ) ) )
+ {
+ this.componentData.remove( componentData );
+ this.getNameToDataMap( ).remove( componentData.getIdentifier( ) );
+ }
+ else
+ throw new IllegalArgumentException( );
+ }
+
+ /**
+ * @return
+ */
+ protected Map<String, Data> getNameToDataMap( )
+ {
+ if( this.nameToDataMap == null )
+ {
+ Map<String, Data> nameToDataMap = new HashMap<String, Data>( );
+
+ for( Data data : this.getComponentData( ) )
+ {
+ nameToDataMap.put( data.getIdentifier( ), data );
+ }
+
+ this.nameToDataMap = nameToDataMap;
+ }
+
+ return this.nameToDataMap;
+ }
+
+ @Override
+ public String toString( )
+ {
+ StringBuffer dataString = new StringBuffer( );
+ dataString.append( this.getIdentifier( ) );
+ dataString.append( " => " );
+ if( this.getComponentData( ).isEmpty( ) )
+ {
+ dataString.append( this.getData( ) );
+ }
+ else
+ {
+ dataString.append( "[" );
+ boolean first = true;
+ for( Data data : this.getComponentData( ) )
+ {
+ if( !first )
+ dataString.append( ", " );
+ else
+ first = false;
+ dataString.append( data.toString( ) );
+ }
+ dataString.append( "]" );
+ }
+
+ return dataString.toString( );
+ }
+ }
Copied: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java (from rev 51, trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java)
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java (rev 0)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/ObjectData.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -0,0 +1,85 @@
+/*
+ * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+import org.hibernate.annotations.GenericGenerator;
+
+/**
+ * @author jsegura
+ */
+@Entity
+public class ObjectData extends Data
+ {
+ private static final long serialVersionUID = 6601926722422919229L;
+
+ @SuppressWarnings("unused")
+ @Id
+ @Column(length = 50)
+ @GeneratedValue(generator = "system-uuid")
+ @GenericGenerator(name = "system-uuid", strategy = "uuid")
+ private String id;
+ /** Version for optimistic locking. */
+ @SuppressWarnings("unused")
+ @javax.persistence.Version
+ private int lockingVersion;
+
+ @ManyToOne(optional = true)
+ @JoinColumn(name = "registerData_id", insertable = false, updatable = false)
+ private RegisterData registerData;
+
+ protected ObjectData( )
+ {};
+
+ public ObjectData( RegisterData registerData )
+ {
+ this.setRegisterData( registerData );
+ }
+
+ /**
+ * @return Returns the registerData.
+ */
+ public RegisterData getRegisterData( )
+ {
+ return this.registerData;
+ }
+
+ /**
+ * @param registerData The registerData to set.
+ */
+ public void setRegisterData( RegisterData registerData )
+ {
+ if( registerData != null )
+ {
+ this.registerData = registerData;
+ this.registerData.addObjectData( this );
+ }
+ else
+ throw new NullPointerException( );
+ }
+ }
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -39,6 +39,7 @@
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.metadata.Register;
+import org.surveyforge.core.metadata.RegisterDataElement;
/**
* @author jsegura
@@ -63,9 +64,9 @@
private Register register;
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- @IndexColumn(name = "rowsIndex")
+ @IndexColumn(name = "objectDataIndex")
@JoinColumn(name = "registerData_id")
- private List<Row> rows = new ArrayList<Row>( );
+ private List<ObjectData> objectData = new ArrayList<ObjectData>( );
protected RegisterData( )
{}
@@ -88,35 +89,35 @@
return this.register;
}
-
/**
- * @return Returns the rows.
+ * @return Returns the objectData.
*/
- public List<Row> getRows( )
+ public List<ObjectData> getObjectData( )
{
- return Collections.unmodifiableList( this.rows );
+ return Collections.unmodifiableList( this.objectData );
}
/**
- * @param rows The rows to .
+ * @param objectData The objectData to .
*/
- protected void addRow( Row row )
+ protected void addObjectData( ObjectData objectData )
{
- if( row != null )
+ if( objectData != null )
{
if( this.register.getKey( ).size( ) == 0 ) throw new IllegalArgumentException( );
ArrayList<Integer> illegalList = new ArrayList<Integer>( );
// TODO: Check validation rules and throw Exceptions if needed
- if( this.register.getRegisterDataElements( ).size( ) != row.getRowDatas( ).size( ) ) throw new IllegalArgumentException( );
+ if( this.register.getComponentElements( ).size( ) != objectData.getComponentData( ).size( ) )
+ throw new IllegalArgumentException( );
int index = 0;
- for( RowData rowData : row.getRowDatas( ) )
+ for( Data data : objectData.getComponentData( ) )
{
- if( !this.register.getRegisterDataElements( ).get( index ).getValueDomain( ).isValid( rowData.getData( ) ) )
+ if( !this.register.getComponentElements( ).get( index ).getValueDomain( ).isValid( data.getData( ) ) )
illegalList.add( index ); // TODO: Elaborate on this Exception
index++;
}
- if( illegalList.size( ) == 0 ) this.rows.add( row );
+ if( illegalList.size( ) == 0 ) this.objectData.add( objectData );
}
else
@@ -124,13 +125,31 @@
}
/**
- * @param rows The rows to .
+ * @param objectData The objectData to .
*/
- protected void removeRows( Row row )
+ protected void removeObjectData( ObjectData objectData )
{
- if( row != null )
- this.rows.remove( row );
+ if( objectData != null )
+ this.objectData.remove( objectData );
else
throw new NullPointerException( );
}
+
+ // TODO: Maybe this could be joined in only a method?
+ public ObjectData createEmptyObjectData( )
+ {
+ ObjectData objectData = new ObjectData( );
+ objectData.setIdentifier( this.getRegister( ).getIdentifier( ) );
+ for( RegisterDataElement componentDataElement : this.getRegister( ).getComponentElements( ) )
+ objectData.addComponentData( RegisterData.createEmptyData( componentDataElement ) );
+ return objectData;
+ }
+
+ protected static Data createEmptyData( RegisterDataElement registerDataElement )
+ {
+ Data data = new Data( registerDataElement.getIdentifier( ) );
+ for( RegisterDataElement componentDataElement : registerDataElement.getComponentElements( ) )
+ data.addComponentData( RegisterData.createEmptyData( componentDataElement ) );
+ return data;
+ }
}
Deleted: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -1,117 +0,0 @@
-/*
- * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to
- * the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- *
- * $Id$
- */
-package org.surveyforge.core.data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-
-import org.hibernate.annotations.GenericGenerator;
-import org.hibernate.annotations.IndexColumn;
-
-/**
- * @author jsegura
- */
-@Entity
-public class Row implements Serializable
- {
- private static final long serialVersionUID = 6601926722422919229L;
-
- @SuppressWarnings("unused")
- @Id
- @Column(length = 50)
- @GeneratedValue(generator = "system-uuid")
- @GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
- /** Version for optimistic locking. */
- @SuppressWarnings("unused")
- @javax.persistence.Version
- private int lockingVersion;
-
- @ManyToOne(optional = true)
- @JoinColumn(name = "registerData_id", insertable = false, updatable = false)
- private RegisterData registerData;
-
- @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- @IndexColumn(name = "rowDatasIndex")
- @JoinColumn(name = "row_id", nullable = false)
- private List<RowData> rowDatas = new ArrayList<RowData>( );
-
- protected Row( )
- {};
-
- public Row( RegisterData registerData )
- {
- this.setRegisterData( registerData );
- }
-
- /**
- * @return Returns the registerData.
- */
- public RegisterData getRegisterData( )
- {
- return this.registerData;
- }
-
- /**
- * @param registerData The registerData to set.
- */
- public void setRegisterData( RegisterData registerData )
- {
- if( registerData != null )
- {
- this.registerData = registerData;
- this.registerData.addRow( this );
- }
- else
- throw new NullPointerException( );
- }
-
- public void setField( String elementIdentifier, RowData rowData )
- {
- int fieldIndex = this.registerData.getRegister( ).getElementIndex( elementIdentifier );
- if( fieldIndex != -1 )
- {
- this.rowDatas.set( fieldIndex, rowData );
- }
- else
- throw new NoSuchElementException( );
- }
-
- public List<RowData> getRowDatas( )
- {
- return Collections.unmodifiableList( this.rowDatas );
- }
-
- }
Deleted: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -1,171 +0,0 @@
-/*
- * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to
- * the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- *
- * $Id$
- */
-package org.surveyforge.core.data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-
-import org.hibernate.annotations.GenericGenerator;
-import org.hibernate.annotations.IndexColumn;
-
-// TODO: Elaborate on comments
-/**
- * @author jsegura
- */
-@Entity
-public class RowData implements Serializable
- {
- private static final long serialVersionUID = 0L;
-
- @SuppressWarnings("unused")
- @Id
- @Column(length = 50)
- @GeneratedValue(generator = "system-uuid")
- @GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
- /** Version for optimistic locking. */
- @SuppressWarnings("unused")
- @javax.persistence.Version
- private int lockingVersion;
-
- private Serializable data;
-
- private boolean answered;
- private boolean applicable;
-
- @ManyToOne(cascade = {CascadeType.ALL})
- @JoinColumn(name = "upperRowData_id", insertable = false, updatable = false)
- private RowData upperRowData;
-
- @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- @IndexColumn(name = "subRowDatasIndex")
- @JoinColumn(name = "upperRowData_id")
- private List<RowData> subRowDatas = new ArrayList<RowData>( );
-
- protected RowData( )
- {}
-
- /**
- * @return Returns the data.
- */
- public Serializable getData( )
- {
- return this.data;
- }
-
- /**
- * @param data The data to set.
- */
- public void setData( Serializable data )
- {
- this.data = data;
- }
-
- /**
- * @return Returns the answered.
- */
- public boolean isAnswered( )
- {
- return this.answered;
- }
-
- /**
- * @param answered The answered to set.
- */
- public void setAnswered( boolean answered )
- {
- this.answered = answered;
- }
-
- /**
- * @return Returns the applicable.
- */
- public boolean isApplicable( )
- {
- return this.applicable;
- }
-
- /**
- * @param applicable The applicable to set.
- */
- public void setApplicable( boolean applicable )
- {
- this.applicable = applicable;
- }
-
- /**
- * @return the upperRowData
- */
- public RowData getUpperRowData( )
- {
- return upperRowData;
- }
-
- /**
- * @param upperRowData the upperRowData to set
- */
- public void setUpperRowData( RowData upperRowData )
- {
- if( this.upperRowData != null ) this.upperRowData.removeSubRowData( this );
- this.upperRowData = upperRowData;
- if( this.upperRowData != null ) this.upperRowData.addSubRowData( this );
- }
-
- private void removeSubRowData( RowData rowData )
- {
- if( rowData != null )
- this.subRowDatas.remove( rowData );
- else
- throw new NullPointerException( );
- }
-
- private void addSubRowData( RowData rowData )
- {
- if( rowData != null )
- this.subRowDatas.add( rowData );
- else
- throw new NullPointerException( );
- }
-
-
- /**
- * @return the subRowDatas
- */
- public List<RowData> getSubRowDatas( )
- {
- return Collections.unmodifiableList( this.subRowDatas );
- }
-
-
- }
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -53,9 +53,9 @@
* @param valueDomain
* @param identifier
*/
- public ConceptualDataElement( AbstractValueDomain valueDomain, ObjectVariable objectVariable, String identifier )
+ public ConceptualDataElement( String identifier, AbstractValueDomain valueDomain, ObjectVariable objectVariable )
{
- super( valueDomain, identifier );
+ super( identifier, valueDomain );
this.setObjectVariable( objectVariable );
}
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -24,7 +24,10 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -36,6 +39,7 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
+import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;
@@ -50,29 +54,29 @@
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "register_id"})})
public abstract class DataElement implements Serializable
{
- private static final long serialVersionUID = 0L;
+ private static final long serialVersionUID = 0L;
@SuppressWarnings("unused")
@Id
@Column(length = 50)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
+ private String id;
/** Version for optimistic locking. */
@SuppressWarnings("unused")
@javax.persistence.Version
- private int lockingVersion;
+ private int lockingVersion;
/**
* This is a unique and language independent identifier for the data element. The identifier is unique among all other data elements
* for an object variable (standard data element) or within the scope of a statistical activity.
*/
@Column(length = 50)
- private String identifier;
+ private String identifier;
/** */
- private boolean multiple = false;
+ private boolean multiple = false;
/** */
- private int maxResponses = 1;
+ private int maxResponses = 1;
/** */
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "valueDomain_id")
@@ -80,12 +84,14 @@
/** */
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "variableStructure_id", insertable = false, updatable = false)
- private DataElement variableStructure;
+ private DataElement variableStructure;
/** */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "componentElementsIndex")
@JoinColumn(name = "variableStructure_id")
- private List<DataElement> componentElements = new ArrayList<DataElement>( );
+ private List<DataElement> componentElements = new ArrayList<DataElement>( );
+ @Transient
+ private Map<String, DataElement> nameToElementMap = new HashMap<String, DataElement>( );
protected DataElement( )
@@ -100,10 +106,10 @@
* @param valueDomain
* @param identifier
*/
- public DataElement( AbstractValueDomain valueDomain, String identifier )
+ public DataElement( String identifier, AbstractValueDomain valueDomain )
{
+ this.setIdentifier( identifier );
this.setValueDomain( valueDomain );
- this.setIdentifier( identifier );
}
/**
@@ -119,7 +125,7 @@
*/
public void setIdentifier( String identifier )
{
- if( identifier != null && !identifier.equals( "" ) )
+ if( identifier != null && !identifier.trim( ).equals( "" ) )
this.identifier = identifier;
else
throw new NullPointerException( );
@@ -179,7 +185,6 @@
throw new NullPointerException( );
}
-
/**
* @return Returns the variableStructure.
*/
@@ -193,52 +198,168 @@
*/
public void setVariableStructure( DataElement variableStructure )
{
- if( this.variableStructure != null ) this.variableStructure.removeComponentElement( this );
- this.variableStructure = variableStructure;
- if( this.variableStructure != null ) this.variableStructure.addComponentElement( this );
+ if( (variableStructure == null && this.getVariableStructure( ) != null)
+ || !variableStructure.equals( this.getVariableStructure( ) ) )
+ {
+ if( this.getVariableStructure( ) != null ) this.getVariableStructure( ).removeElement( this );
+ this.variableStructure = variableStructure;
+ if( this.getVariableStructure( ) != null ) this.getVariableStructure( ).addElement( this );
+ }
}
/**
* @return Returns the componentElements.
*/
- public List<DataElement> getComponentElements( )
+ public List<? extends DataElement> getComponentElements( )
{
return Collections.unmodifiableList( this.componentElements );
}
/**
+ * @param componentElements
+ */
+ public void setComponentElements( List<? extends DataElement> componentElements )
+ {
+ this.clearComponentElements( );
+ for( DataElement dataElement : componentElements )
+ this.addComponentElement( dataElement );
+ }
+
+ /**
+ *
+ */
+ protected void clearComponentElements( )
+ {
+ Iterator<? extends DataElement> componentElementIterator = this.getComponentElements( ).iterator( );
+
+ while( componentElementIterator.hasNext( ) )
+ {
+ DataElement dataElement = (DataElement) componentElementIterator.next( );
+ dataElement.variableStructure = null;
+ componentElementIterator.remove( );
+ }
+ }
+
+ /**
* @param componentElements The componentElements to set.
*/
- private void addComponentElement( DataElement componentElement )
+ public void addComponentElement( DataElement componentElement )
{
if( componentElement != null )
- this.componentElements.add( componentElement );
+ {
+ if( !this.getComponentElements( ).contains( componentElement ) )
+ {
+ if( componentElement.getVariableStructure( ) != null && !componentElement.getVariableStructure( ).equals( this ) )
+ {
+ componentElement.getVariableStructure( ).removeElement( componentElement );
+ componentElement.variableStructure = this;
+ }
+ this.componentElements.add( componentElement );
+ }
+ else
+ throw new IllegalArgumentException( );
+ }
else
throw new NullPointerException( );
}
/**
+ * @param componentElement
+ */
+ protected void addElement( DataElement componentElement )
+ {
+ if( !this.getNameToElementMap( ).containsKey( componentElement.getIdentifier( ) ) )
+ {
+ this.componentElements.add( componentElement );
+ this.getNameToElementMap( ).put( componentElement.getIdentifier( ), componentElement );
+ }
+ else
+ throw new IllegalArgumentException( );
+ }
+
+ /**
* @param componentElements The componentElements to set.
*/
- private void removeComponentElement( DataElement componentElement )
+ public void removeComponentElement( DataElement componentElement )
{
if( componentElement != null )
- this.componentElements.remove( componentElement );
+ {
+ this.removeElement( componentElement );
+ componentElement.variableStructure = null;
+ }
else
throw new NullPointerException( );
}
+ /**
+ * @param componentElement
+ */
+ protected void removeElement( DataElement componentElement )
+ {
+ if( this.getNameToElementMap( ).containsKey( componentElement.getIdentifier( ) ) )
+ {
+ this.componentElements.remove( componentElement );
+ this.getNameToElementMap( ).remove( componentElement.getIdentifier( ) );
+ }
+ else
+ throw new IllegalArgumentException( );
+ }
+
+ /**
+ * @return
+ */
+ protected Map<String, DataElement> getNameToElementMap( )
+ {
+ if( this.nameToElementMap == null )
+ {
+ Map<String, DataElement> nameToElementMap = new HashMap<String, DataElement>( );
+
+ for( DataElement dataElement : this.getComponentElements( ) )
+ {
+ nameToElementMap.put( dataElement.getIdentifier( ), dataElement );
+ }
+
+ this.nameToElementMap = nameToElementMap;
+ }
+
+ return this.nameToElementMap;
+ }
+
+ /**
+ * @param identifier
+ * @return
+ */
+ public DataElement getDataElement( String identifier )
+ {
+ return this.getNameToElementMap( ).get( identifier );
+ }
+
+ public DataElement getRootDataElement( )
+ {
+ if( this.getVariableStructure( ) == null )
+ return this;
+ else
+ return this.getVariableStructure( ).getRootDataElement( );
+ }
+
@Override
public boolean equals( Object object )
{
- DataElement other = (DataElement) object;
- return this.getIdentifier( ).equals( other.getIdentifier( ) );
+ if( object instanceof DataElement )
+ {
+ DataElement otherDataElement = (DataElement) object;
+
+ return this.getIdentifier( ).equals( otherDataElement.getIdentifier( ) )
+ && (this.getVariableStructure( ) == null ? otherDataElement.getVariableStructure( ) == null : this.getVariableStructure( )
+ .equals( otherDataElement.getVariableStructure( ) ));
+ }
+ else
+ return false;
}
@Override
public int hashCode( )
{
- return this.getIdentifier( ).hashCode( );
+ return this.getIdentifier( ).hashCode( ) ^ (this.getVariableStructure( ) == null ? 0 : this.getVariableStructure( ).hashCode( ));
}
-
}
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -48,9 +48,9 @@
protected QuestionDataElement( )
{}
- public QuestionDataElement( AbstractValueDomain valueDomain, String identifier )
+ public QuestionDataElement( String identifier, AbstractValueDomain valueDomain )
{
- super( valueDomain, identifier );
+ super( identifier, valueDomain );
}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -22,11 +22,9 @@
package org.surveyforge.core.metadata;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -38,10 +36,9 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
-import org.hibernate.annotations.CollectionOfElements;
+
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
-import org.hibernate.annotations.MapKey;
import org.surveyforge.core.data.RegisterData;
import org.surveyforge.core.survey.Questionnaire;
@@ -50,9 +47,9 @@
* @author jsegura
*/
@Entity
-public class Register implements Serializable
+public class Register extends DataElement implements Serializable
{
- private static final long serialVersionUID = 0L;
+ private static final long serialVersionUID = 0L;
@SuppressWarnings("unused")
@Id
@@ -77,7 +74,7 @@
*/
@ManyToOne
@JoinColumn(name = "masterRegister_id", insertable = false, updatable = false)
- private Register masterRegister = null;
+ private Register masterRegister = null;
/**
* When defining hierarchical registers the hierarchy is expressed as master/detail relationship. The detail registers defines the
@@ -86,34 +83,16 @@
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "detailRegistersIndex")
@JoinColumn(name = "masterRegister_id")
- private List<Register> detailRegisters = new ArrayList<Register>( );
+ private List<Register> detailRegisters = new ArrayList<Register>( );
/** */
- @CollectionOfElements
- @MapKey(columns = {@Column(name = "elementMapKey", length = 50)})
- @Column(name = "index", length = 10)
- private Map<String, Integer> indexes = new HashMap<String, Integer>( );
-
/** */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- @IndexColumn(name = "registerDataElementsIndex")
- // @JoinColumn(name = "register_id", nullable = false)
- @JoinColumn(name = "register_id")
- private List<RegisterDataElement> registerDataElements = new ArrayList<RegisterDataElement>( );
-
- /** */
- @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "keyIndex")
@JoinColumn(name = "registerKey_id")
- private List<RegisterDataElement> key = new ArrayList<RegisterDataElement>( );
+ private List<RegisterDataElement> key = new ArrayList<RegisterDataElement>( );
/** */
- @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- @IndexColumn(name = "validationRulesIndex")
- @JoinColumn(name = "register_id")
- private List<ValidationRule> validationRules = new ArrayList<ValidationRule>( );
-
- /** */
@OneToOne(optional = false, cascade = {CascadeType.ALL})
private RegisterData registerData;
@@ -170,7 +149,7 @@
*/
public void setMasterRegister( Register masterRegister )
{
- if( this.masterRegister != null ) this.masterRegister.delDetailRegister( this );
+ if( this.masterRegister != null ) this.masterRegister.removeDetailRegister( this );
this.masterRegister = masterRegister;
if( this.masterRegister != null ) this.masterRegister.addDetailRegister( this );
@@ -195,62 +174,51 @@
/**
* @param detailRegister The detailRegister to set.
*/
- protected void delDetailRegister( Register detailRegister )
+ protected void removeDetailRegister( Register detailRegister )
{
if( detailRegister != null ) this.detailRegisters.remove( detailRegister );
}
- /**
- * @return Returns the registerDataElements.
- */
- public List<RegisterDataElement> getRegisterDataElements( )
+ @Override
+ public List<? extends RegisterDataElement> getComponentElements( )
{
- return Collections.unmodifiableList( this.registerDataElements );
+ List<RegisterDataElement> componentElements = new ArrayList<RegisterDataElement>( );
+ for( DataElement dataElement : super.getComponentElements( ) )
+ componentElements.add( (RegisterDataElement) dataElement );
+ return componentElements;
}
-
- protected void addRegisterDataElement( RegisterDataElement registerDataElement )
+ @Override
+ public void addComponentElement( DataElement componentElement )
{
- if( registerDataElement == null )
- throw new NullPointerException( );
- else if( this.registerData.getRows( ).size( ) > 0 )
+ if( !(componentElement instanceof RegisterDataElement) )
+ throw new IllegalArgumentException( );
+ else if( this.registerData.getObjectData( ).size( ) > 0 )
throw new IllegalStateException( );
else
- {
- this.registerDataElements.add( registerDataElement );
- // this.updateElements( );
- }
+ super.addComponentElement( componentElement );
}
- protected void removeRegisterDataElement( RegisterDataElement registerDataElement )
+ @Override
+ public void removeComponentElement( DataElement componentElement )
{
- if( registerDataElement == null )
- throw new NullPointerException( );
- else if( this.registerData.getRows( ).size( ) > 0 )
+ if( this.registerData.getObjectData( ).size( ) > 0 )
throw new IllegalStateException( );
else
- {
- this.registerDataElements.remove( registerDataElement );
- this.updateElements( );
- }
+ super.removeComponentElement( componentElement );
}
- /**
- * @param registerDataElements
- */
- public void setRegisterDataElements( List<RegisterDataElement> registerDataElements )
+ @Override
+ public void setComponentElements( List<? extends DataElement> componentElements )
{
- if( registerDataElements == null )
+ if( componentElements == null )
throw new NullPointerException( );
- else if( this.registerData.getRows( ).size( ) > 0 )
+ else if( this.registerData.getObjectData( ).size( ) > 0 )
throw new IllegalStateException( );
- else if( this.key != null && !registerDataElements.containsAll( this.key ) )
+ else if( this.key != null && !componentElements.containsAll( this.key ) )
throw new IllegalArgumentException( );
else
- {
- this.registerDataElements = registerDataElements;
- this.updateElements( );
- }
+ super.setComponentElements( componentElements );
}
/**
@@ -268,54 +236,13 @@
{
if( key == null )
throw new NullPointerException( );
- else if( this.registerDataElements.containsAll( key ) )
+ else if( this.getComponentElements( ).containsAll( key ) )
this.key = key;
else
throw new IllegalArgumentException( );
}
/**
- * @return Returns the validationRules.
- */
- public List<ValidationRule> getValidationRules( )
- {
- return Collections.unmodifiableList( this.validationRules );
- }
-
- /**
- * @param validationRules The validationRules to set.
- */
- public void setValidationRules( List<ValidationRule> validationRules )
- {
- if( validationRules != null )
- this.validationRules = validationRules;
- else
- throw new NullPointerException( );
- }
-
- /**
- * @param validationRule
- */
- public void addValidationRule( ValidationRule validationRule )
- {
- if( validationRule != null )
- this.validationRules.add( validationRule );
- else
- throw new NullPointerException( );
- }
-
- /**
- * @param validationRule
- */
- public void delValidationRule( ValidationRule validationRule )
- {
- if( validationRule != null )
- this.validationRules.remove( validationRule );
- else
- throw new NullPointerException( );
- }
-
- /**
* @return Returns the registerData.
*/
public RegisterData getRegisterData( )
@@ -323,46 +250,11 @@
return this.registerData;
}
-
- private void updateElements( )
- {
- HashMap<String, Integer> fieldIndexes = new HashMap<String, Integer>( );
- int index = 0;
- for( RegisterDataElement currentRegisterDataElement : this.registerDataElements )
- {
- fieldIndexes.put( currentRegisterDataElement.getIdentifier( ), index );
- index++;
- }
-
- if( this.registerDataElements.size( ) == fieldIndexes.size( ) )
- {
- this.indexes = fieldIndexes;
- }
- else
- {
- throw new IllegalArgumentException( );
- }
- }
-
- // TODO Hardwritted -1
- public int getElementIndex( String elementIdentifier )
- {
- Integer index = this.indexes.get( elementIdentifier );
- return (index != null) ? index : -1;
- }
-
- public List<String> getElementIdentifiers( )
- {
- return new ArrayList<String>( this.indexes.keySet( ) );
- }
-
-
public Questionnaire getQuestionnaire( )
{
return this.questionnaire;
}
-
public void setQuestionnaire( Questionnaire questionnaire )
{
this.questionnaire = questionnaire;
@@ -380,5 +272,4 @@
{
return this.getIdentifier( ).hashCode( );
}
-
}
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -21,6 +21,9 @@
*/
package org.surveyforge.core.metadata;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
@@ -64,7 +67,7 @@
* @throws NullPointerException If the ValueDomain or the identifier or the ConceptualDataElements are <code>null</code> or the
* identifier is empty.
*/
- public RegisterDataElement( ConceptualDataElement conceptualDataElement, String identifier )
+ public RegisterDataElement( String identifier, ConceptualDataElement conceptualDataElement )
{
super( identifier );
this.setConceptualDataElement( conceptualDataElement );
@@ -73,9 +76,9 @@
/**
* Creates a new instance of ConceptualDataElement linked with a {@link ConceptualDataElement}.
*/
- public RegisterDataElement( AbstractValueDomain valueDomain, String identifier )
+ public RegisterDataElement( String identifier, AbstractValueDomain valueDomain )
{
- super( valueDomain, identifier );
+ super( identifier, valueDomain );
}
/**
@@ -99,6 +102,50 @@
this.conceptualDataElement = conceptualDataElement;
}
+ @Override
+ public List<? extends RegisterDataElement> getComponentElements( )
+ {
+ List<RegisterDataElement> componentElements = new ArrayList<RegisterDataElement>( );
+ for( DataElement dataElement : super.getComponentElements( ) )
+ componentElements.add( (RegisterDataElement) dataElement );
+ return componentElements;
+ }
+
+ @Override
+ public void addComponentElement( DataElement componentElement )
+ {
+ if( !(componentElement instanceof RegisterDataElement) )
+ throw new IllegalArgumentException( );
+ else
+ {
+ DataElement root = this.getRootDataElement( );
+ if( root instanceof Register && ((Register) root).getRegisterData( ).getObjectData( ).size( ) > 0 )
+ throw new IllegalStateException( );
+ else
+ super.addComponentElement( componentElement );
+ }
+ }
+
+ @Override
+ public void removeComponentElement( DataElement componentElement )
+ {
+ if( ((Register) this.getRootDataElement( )).getRegisterData( ).getObjectData( ).size( ) > 0 )
+ throw new IllegalStateException( );
+ else
+ super.removeComponentElement( componentElement );
+ }
+
+ @Override
+ public void setComponentElements( List<? extends DataElement> componentElements )
+ {
+ if( componentElements == null )
+ throw new NullPointerException( );
+ else if( ((Register) this.getRootDataElement( )).getRegisterData( ).getObjectData( ).size( ) > 0 )
+ throw new IllegalStateException( );
+ else
+ super.setComponentElements( componentElements );
+ }
+
/**
* @return the optional
*/
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -83,7 +83,7 @@
if( object instanceof String )
{
String code = (String) object;
- return this.getLevel( ).isIncludedInLevel( code, this.isSublevelsAllowed( ) );
+ return this.getLevel( ).includes( code, this.isSublevelsAllowed( ) );
}
else
return false;
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -12,13 +12,13 @@
import javax.persistence.OneToMany;
import org.hibernate.annotations.IndexColumn;
-import org.surveyforge.core.data.RowData;
+import org.surveyforge.core.data.ObjectData;
import org.surveyforge.core.metadata.ValueDomain;
@Entity
public class StructuredValueDomain extends AbstractValueDomain
{
- private static final long serialVersionUID = -3340195650321504136L;
+ private static final long serialVersionUID = -3340195650321504136L;
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "subDomainsIndex")
@@ -42,18 +42,18 @@
if( object != null )
{
- if( !(object instanceof RowData) ) throw new IllegalArgumentException( );
- if( this.getSubDomains( ).size( ) != ((RowData) object).getSubRowDatas( ).size( ) ) { return false; }
+ if( !(object instanceof ObjectData) ) throw new IllegalArgumentException( );
+ if( this.getSubDomains( ).size( ) != ((ObjectData) object).getComponentData( ).size( ) ) { return false; }
for( int i = 0; i < this.getSubDomains( ).size( ); i++ )
{
if( this.getSubDomains( ).get( i ) instanceof StructuredValueDomain )
{
- if( !this.getSubDomains( ).get( i ).isValid( ((RowData) object).getSubRowDatas( ).get( i ) ) ) return false;
+ if( !this.getSubDomains( ).get( i ).isValid( ((ObjectData) object).getComponentData( ).get( i ) ) ) return false;
}
else
{
- if( !this.getSubDomains( ).get( i ).isValid( ((RowData) object).getSubRowDatas( ).get( i ).getData( ) ) ) return false;
+ if( !this.getSubDomains( ).get( i ).isValid( ((ObjectData) object).getComponentData( ).get( i ).getData( ) ) ) return false;
}
}
Modified: trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionTest.java
===================================================================
--- trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionTest.java 2006-09-13 11:52:33 UTC (rev 56)
+++ trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionTest.java 2006-09-18 15:18:08 UTC (rev 57)
@@ -89,36 +89,4 @@
Assert.assertTrue( obj.getDescription( ).equals( empty ) );
Assert.assertFalse( obj.getDescription( ).equals( "test" ) );
}
-
- @Test
- public void questionGetNullUpperQuestion( )
- {
- Assert.assertNull( new Question( "id" ).getUpperQuestion( ) );
- }
-
- @Test
- public void questionSetUpperQuestion( )
- {
- Quest...
[truncated message content] |
|
From: <ja...@us...> - 2006-09-13 11:52:50
|
Revision: 56
http://svn.sourceforge.net/surveyforge/?rev=56&view=rev
Author: javism
Date: 2006-09-13 04:52:33 -0700 (Wed, 13 Sep 2006)
Log Message:
-----------
* Core restructuring to support AbstractValueDomains
* new concept of ConceptualDataElement and QuestionDataElement
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
Added Paths:
-----------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -35,6 +35,7 @@
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
+
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.metadata.Register;
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -22,12 +22,10 @@
package org.surveyforge.core.metadata;
import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
-import org.surveyforge.core.survey.Question;
+import org.surveyforge.core.metadata.domain.AbstractValueDomain;
-// TODO: Measure unit?
// TODO: Elaborate on comments
/**
* Conceptual data elements define conceptual standards for data elements. Conceptual data elements have a context independent
@@ -37,14 +35,10 @@
* @author jsegura
*/
@Entity
-public class ConceptualDataElement extends DataElement
+public class ConceptualDataElement extends QuestionDataElement
{
private static final long serialVersionUID = -6880246451318487216L;
- /** */
- @ManyToOne(optional = true)
- @JoinColumn(name = "question_id")
- private Question question;
/** */
@ManyToOne
private ObjectVariable objectVariable;
@@ -59,28 +53,14 @@
* @param valueDomain
* @param identifier
*/
- public ConceptualDataElement( ValueDomain valueDomain, String identifier )
+ public ConceptualDataElement( AbstractValueDomain valueDomain, ObjectVariable objectVariable, String identifier )
{
super( valueDomain, identifier );
+ this.setObjectVariable( objectVariable );
}
- /**
- * @return Returns the question.
- */
- public Question getQuestion( )
- {
- return this.question;
- }
/**
- * @param question The question to set.
- */
- public void setQuestion( Question question )
- {
- this.question = question;
- }
-
- /**
* @return Returns the objectVariable.
*/
public ObjectVariable getObjectVariable( )
@@ -111,4 +91,4 @@
{
return this.getIdentifier( ).hashCode( );
}
- }
+ }
\ No newline at end of file
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -40,6 +40,7 @@
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
+import org.surveyforge.core.metadata.domain.AbstractValueDomain;
// TODO Elaborate on comments
/**
@@ -75,7 +76,7 @@
/** */
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "valueDomain_id")
- private ValueDomain valueDomain;
+ private AbstractValueDomain valueDomain;
/** */
@ManyToOne(cascade = {CascadeType.ALL})
@JoinColumn(name = "variableStructure_id", insertable = false, updatable = false)
@@ -99,7 +100,7 @@
* @param valueDomain
* @param identifier
*/
- public DataElement( ValueDomain valueDomain, String identifier )
+ public DataElement( AbstractValueDomain valueDomain, String identifier )
{
this.setValueDomain( valueDomain );
this.setIdentifier( identifier );
@@ -162,7 +163,7 @@
/**
* @return Returns the valueDomain.
*/
- public ValueDomain getValueDomain( )
+ public AbstractValueDomain getValueDomain( )
{
return this.valueDomain;
}
@@ -170,7 +171,7 @@
/**
* @param valueDomain The valueDomain to set.
*/
- public void setValueDomain( ValueDomain valueDomain )
+ public void setValueDomain( AbstractValueDomain valueDomain )
{
if( valueDomain != null )
this.valueDomain = valueDomain;
Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java (rev 0)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -0,0 +1,84 @@
+/*
+ * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.metadata;
+
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+import org.surveyforge.core.metadata.domain.AbstractValueDomain;
+import org.surveyforge.core.survey.Question;
+
+/**
+ * @author jsegura
+ */
+@Entity
+public class QuestionDataElement extends DataElement
+ {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5831283455803703349L;
+
+
+ @ManyToOne(optional = true)
+ @JoinColumn(name = "question_id")
+ private Question question;
+
+
+ protected QuestionDataElement( )
+ {}
+
+ public QuestionDataElement( AbstractValueDomain valueDomain, String identifier )
+ {
+ super( valueDomain, identifier );
+ }
+
+ /**
+ * @return Returns the question.
+ */
+ public Question getQuestion( )
+ {
+ return this.question;
+ }
+
+ /**
+ * @param question The question to set.
+ */
+ public void setQuestion( Question question )
+ {
+ this.question = question;
+ }
+
+ @Override
+ public boolean equals( Object object )
+ {
+ QuestionDataElement other = (QuestionDataElement) object;
+ return this.getIdentifier( ).equals( other.getIdentifier( ) );
+ }
+
+ @Override
+ public int hashCode( )
+ {
+ return this.getIdentifier( ).hashCode( );
+ }
+ }
Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/QuestionDataElement.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -26,7 +26,9 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
+import org.surveyforge.core.metadata.domain.AbstractValueDomain;
import org.surveyforge.core.survey.Question;
+import org.surveyforge.core.survey.QuestionnaireElement;
/**
* Register data elements define data elements for a register. In contrast to an abstract data element a register data element is
@@ -49,6 +51,9 @@
@ManyToOne(optional = true)
private Question question;
+ @OneToOne
+ private QuestionnaireElement questionnaireElement;
+
protected RegisterDataElement( )
{};
@@ -61,14 +66,14 @@
*/
public RegisterDataElement( ConceptualDataElement conceptualDataElement, String identifier )
{
- super( conceptualDataElement.getValueDomain( ).clone( ), identifier );
+ super( identifier );
this.setConceptualDataElement( conceptualDataElement );
}
/**
* Creates a new instance of ConceptualDataElement linked with a {@link ConceptualDataElement}.
*/
- public RegisterDataElement( ValueDomain valueDomain, String identifier )
+ public RegisterDataElement( AbstractValueDomain valueDomain, String identifier )
{
super( valueDomain, identifier );
}
@@ -89,12 +94,8 @@
* @param conceptualDataElement The conceptualDataElements to set.
* @throws NullPointerException If the conceptualDataElement is <code>null</code>.
*/
- public void setConceptualDataElement( ConceptualDataElement conceptualDataElement )
+ private void setConceptualDataElement( ConceptualDataElement conceptualDataElement )
{
- if( conceptualDataElement == null )
- {
- this.setValueDomain( conceptualDataElement.getValueDomain( ).clone( ) );
- }
this.conceptualDataElement = conceptualDataElement;
}
@@ -129,4 +130,25 @@
{
this.question = question;
}
+
+ /**
+ * @return the questionnaireElement
+ */
+ public QuestionnaireElement getQuestionnaireElement( )
+ {
+ return questionnaireElement;
+ }
+
+ /**
+ * @param questionnaireElement the questionnaireElement to set
+ */
+ public void setQuestionnaireElement( QuestionnaireElement questionnaireElement )
+ {
+ this.questionnaireElement = questionnaireElement;
+ }
+
+ public AbstractValueDomain getValueDomain( )
+ {
+ return (super.getValueDomain( ) != null ? super.getValueDomain( ) : this.getConceptualDataElement( ).getValueDomain( ));
+ }
}
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -273,7 +273,6 @@
throw new NullPointerException( );
}
- // TODO add subtypes to hashcode & equals
@Override
public boolean equals( Object object )
{
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -23,12 +23,11 @@
import java.io.Serializable;
+
/**
* @author jsegura
*/
public interface ValueDomain
{
public boolean isValid( Serializable object );
-
- public ValueDomain clone( );
}
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-13 10:49:44 UTC (rev 55)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-13 11:52:33 UTC (rev 56)
@@ -23,7 +23,7 @@
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "subDomainsIndex")
@JoinColumn(name = "upperDomain_id")
- private List<ValueDomain> subDomains = new ArrayList<ValueDomain>( );
+ private List<AbstractValueDomain> subDomains = new ArrayList<AbstractValueDomain>( );
public StructuredValueDomain( )
@@ -66,12 +66,12 @@
/**
* @return the subDomains
*/
- public List<ValueDomain> getSubDomains( )
+ public List<AbstractValueDomain> getSubDomains( )
{
return Collections.unmodifiableList( this.subDomains );
}
- public void addSubDomain( ValueDomain domain )
+ public void addSubDomain( AbstractValueDomain domain )
{
if( domain != null )
{
@@ -81,7 +81,7 @@
throw new NullPointerException( );
}
- public void removeSubDomain( ValueDomain domain )
+ public void removeSubDomain( AbstractValueDomain domain )
{
if( domain != null )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-13 10:49:54
|
Revision: 55
http://svn.sourceforge.net/surveyforge/?rev=55&view=rev
Author: javism
Date: 2006-09-13 03:49:44 -0700 (Wed, 13 Sep 2006)
Log Message:
-----------
* Upped the relations subElements to que QuestionnaireElement
* Some minor fixes in annotations
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java 2006-09-13 09:58:06 UTC (rev 54)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java 2006-09-13 10:49:44 UTC (rev 55)
@@ -22,22 +22,13 @@
package org.surveyforge.core.survey;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
import org.hibernate.annotations.GenericGenerator;
-import org.hibernate.annotations.IndexColumn;
/**
* The question contain the text for the question, with the sub questions being used to provide further information about the question.
@@ -73,17 +64,9 @@
/** The description contains explanatory notes to the question and/or an extended definition of the question's meaning. */
@Column(length = 500)
private String description = "";
- /** This is the question that acts as a frame for a number of sub questions. */
- @ManyToOne
- @JoinColumn(name = "upperQuestion_id", insertable = false, updatable = false)
- private Question upperQuestion = null;
- /** A question referring to a complex fact can be divided in a number of sub questions. */
- @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- @IndexColumn(name = "subQuestionsIndex")
- @JoinColumn(name = "upperQuestion_id")
- private List<Question> subQuestions = new ArrayList<Question>( );
+
protected Question( )
{}
@@ -184,66 +167,7 @@
throw new NullPointerException( );
}
- /**
- * Returns the Question that acts as a frame of the Question.
- *
- * @return Returns the upperQuestion.
- */
- public Question getUpperQuestion( )
- {
- return this.upperQuestion;
- }
- /**
- * Sets a new Question to act as a frame of the Question removing this one from the list of subQuestions of the old upperQuestion.
- *
- * @param upperQuestion The upperQuestion to set.
- */
- public void setUpperQuestion( Question upperQuestion )
- {
- if( this.upperQuestion != null ) this.upperQuestion.removeSubQuestion( this );
- this.upperQuestion = upperQuestion;
- if( this.upperQuestion != null ) this.upperQuestion.addSubQuestion( this );
- }
-
- /**
- * Returns the list of subQuestions of the Question.
- *
- * @return Returns the subQuestions.
- */
- public List<Question> getSubQuestions( )
- {
- return Collections.unmodifiableList( this.subQuestions );
- }
-
- /**
- * Add a new Question to the list of subQuestions.
- *
- * @param subQuestions The subQuestions to add.
- * @throws NullPointerException If the subquestion is <code>null</code>.
- */
- private void addSubQuestion( Question subQuestion )
- {
- if( subQuestion != null )
- this.subQuestions.add( subQuestion );
- else
- throw new NullPointerException( );
- }
-
- /**
- * Remove a Question from the list of subQuestions.
- *
- * @param subQuestion the subQuestion to remove.
- * @throws NullPointerException If the subquestion is <code>null</code>.
- */
- private void removeSubQuestion( Question subQuestion )
- {
- if( subQuestion != null )
- this.subQuestions.remove( subQuestion );
- else
- throw new NullPointerException( );
- }
-
@Override
public boolean equals( Object object )
{
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java 2006-09-13 09:58:06 UTC (rev 54)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java 2006-09-13 10:49:44 UTC (rev 55)
@@ -87,18 +87,18 @@
/** A questionnaire consists of a number of questionnaire elements. Each element refers to a question. */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "questionnairesIndex")
- @JoinColumn(name = "questionnaire_id", nullable = false)
+ @JoinColumn(name = "questionnaire_id")
private List<QuestionnaireElement> elements = new ArrayList<QuestionnaireElement>( );
/** A questionnaire may have its content organized in pages. */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "pageIndex")
- //@JoinColumn(name = "questionnaire_page_id")
- @JoinColumn(name = "questionnaire_page_id", nullable = false)
+ // @JoinColumn(name = "questionnaire_page_id")
+ @JoinColumn(name = "questionnaire_page_id")
private List<Feed> pageFeeds = new ArrayList<Feed>( );
/** A questionnaire may have its content organized in sections. */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "sectionIndex")
- @JoinColumn(name = "questionnaire_section_id", nullable = false)
+ @JoinColumn(name = "questionnaire_section_id")
private List<SectionFeed> sectionFeeds = new ArrayList<SectionFeed>( );
/** A questionnaire corresponds logically to a register, which describes the content of the data collection. */
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java 2006-09-13 09:58:06 UTC (rev 54)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java 2006-09-13 10:49:44 UTC (rev 55)
@@ -22,6 +22,9 @@
package org.surveyforge.core.survey;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -31,11 +34,13 @@
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;
+import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.metadata.RegisterDataElement;
@@ -49,35 +54,45 @@
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "questionnaire_id"})})
public class QuestionnaireElement implements Serializable
{
- private static final long serialVersionUID = 0L;
+ private static final long serialVersionUID = -5920656314181190011L;
+
@SuppressWarnings("unused")
@Id
@Column(length = 50)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
+ private String id;
/** Version for optimistic locking. */
@SuppressWarnings("unused")
@javax.persistence.Version
- private int lockingVersion;
+ private int lockingVersion;
/** A questionnaire element is identified by a unique identifier. */
@Column(unique = true, length = 50)
- private String identifier;
+ private String identifier;
/** Each questionnaire element has a {@link Question} that has the text and the structure of the question. */
@ManyToOne(optional = true, cascade = {CascadeType.ALL})
@JoinColumn(name = "question_id", insertable = false, updatable = false)
- private Question question = null;
+ private Question question = null;
/** A questionnaire element have a {@link RegisterDataElement} to have the info of the data. */
@OneToOne(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
- private RegisterDataElement registerDataElement;
+ private RegisterDataElement registerDataElement;
/** Default answer if the question is not applicable. */
@Column(length = 50)
- private String defaultNotApplicable = "";
+ private String defaultNotApplicable = "";
/** Default answer if the question is not answered. */
@Column(length = 50)
- private String defaultNotAnswered = "";
+ private String defaultNotAnswered = "";
+ /** This is the question that acts as a frame for a number of sub questions. */
+ @ManyToOne
+ @JoinColumn(name = "upperQuestionnaireElement_id", insertable = false, updatable = false)
+ private QuestionnaireElement upperQuestionnaireElement = null;
+ /** A question referring to a complex fact can be divided in a number of sub questions. */
+ @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
+ @IndexColumn(name = "subQuestionnaireElementsIndex")
+ @JoinColumn(name = "upperQuestionnaireElement_id")
+ private List<QuestionnaireElement> subQuestionnaireElements = new ArrayList<QuestionnaireElement>( );
protected QuestionnaireElement( )
@@ -90,12 +105,19 @@
* @param identifier The identifier of the questionnaire element.
* @throws NullPointerException If the registerDataElement or the identifier are <code>null</code> and if the identifier is empty.
*/
- public QuestionnaireElement( RegisterDataElement registerDataElement, String identifier )
+ public QuestionnaireElement( RegisterDataElement registerDataElement )
{
this.setRegisterDataElement( registerDataElement );
- this.setIdentifier( identifier );
+ this.setIdentifier( registerDataElement.getIdentifier( ) );
}
+ public QuestionnaireElement( QuestionnaireElement upperElement, RegisterDataElement registerDataElement )
+ {
+ this( registerDataElement );
+ this.setUpperQuestionnaireElement( upperElement );
+ }
+
+
/**
* Returns the identifier of the questionnaire element.
*
@@ -112,7 +134,7 @@
* @param identifier The identifier to set.
* @throws NullPointerException If the identifier is <code>null</code> and if the identifier is empty.
*/
- public void setIdentifier( String identifier )
+ protected void setIdentifier( String identifier )
{
if( identifier != null && !identifier.equals( "" ) )
this.identifier = identifier;
@@ -156,10 +178,19 @@
* @param registerDataElement The registerDataElement to set.
* @throws If the registerDataElement is <code>null</code>;
*/
- public void setRegisterDataElement( RegisterDataElement registerDataElement )
+ protected void setRegisterDataElement( RegisterDataElement registerDataElement )
{
if( registerDataElement != null )
+ {
+ // TODO remove old elements
this.registerDataElement = registerDataElement;
+ registerDataElement.setQuestionnaireElement( this );
+ for( int i = 0; i < registerDataElement.getComponentElements( ).size( ); i++ )
+ {
+ this.addSubQuestionnaireElement( new QuestionnaireElement( (RegisterDataElement) (registerDataElement.getComponentElements( )
+ .get( i )) ) );
+ }
+ }
else
throw new NullPointerException( );
}
@@ -212,6 +243,43 @@
throw new NullPointerException( );
}
+
+ public QuestionnaireElement getUpperQuestionnaireElement( )
+ {
+ return this.upperQuestionnaireElement;
+ }
+
+ public void setUpperQuestionnaireElement( QuestionnaireElement upperQuestionnaireElement )
+ {
+ if( this.upperQuestionnaireElement != null ) this.upperQuestionnaireElement.removeSubQuestionnaireElement( this );
+ this.upperQuestionnaireElement = upperQuestionnaireElement;
+ if( this.upperQuestionnaireElement != null ) this.upperQuestionnaireElement.addSubQuestionnaireElement( this );
+ }
+
+
+ private void removeSubQuestionnaireElement( QuestionnaireElement subQuestionnaireElement )
+ {
+ if( subQuestionnaireElement != null )
+ this.subQuestionnaireElements.remove( subQuestionnaireElement );
+ else
+ throw new NullPointerException( );
+ }
+
+ public List<QuestionnaireElement> getSubQuestionnaireElementss( )
+ {
+ return Collections.unmodifiableList( this.subQuestionnaireElements );
+ }
+
+
+ private void addSubQuestionnaireElement( QuestionnaireElement subQuestionnaireElement )
+ {
+ if( subQuestionnaireElement != null )
+ this.subQuestionnaireElements.add( subQuestionnaireElement );
+ else
+ throw new NullPointerException( );
+ }
+
+
// TODO : Equals+hashcode
// @Override
// public boolean equals( Object object )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-13 09:58:12
|
Revision: 54
http://svn.sourceforge.net/surveyforge/?rev=54&view=rev
Author: javism
Date: 2006-09-13 02:58:06 -0700 (Wed, 13 Sep 2006)
Log Message:
-----------
Converted to abstract and added a new Constructor for supporting the creation on RegisterDataElements linked to a ConceptualDataElement
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-13 06:58:55 UTC (rev 53)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-09-13 09:58:06 UTC (rev 54)
@@ -47,7 +47,7 @@
*/
@Entity
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "register_id"})})
-public class DataElement implements Serializable
+public abstract class DataElement implements Serializable
{
private static final long serialVersionUID = 0L;
@@ -90,6 +90,11 @@
protected DataElement( )
{}
+ protected DataElement( String identifier )
+ {
+ this.setIdentifier( identifier );
+ }
+
/**
* @param valueDomain
* @param identifier
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-13 06:59:03
|
Revision: 53
http://svn.sourceforge.net/surveyforge/?rev=53&view=rev
Author: javism
Date: 2006-09-12 23:58:55 -0700 (Tue, 12 Sep 2006)
Log Message:
-----------
new Valuedomain interface
Added Paths:
-----------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java (rev 0)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-09-13 06:58:55 UTC (rev 53)
@@ -0,0 +1,34 @@
+/*
+ * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.metadata;
+
+import java.io.Serializable;
+
+/**
+ * @author jsegura
+ */
+public interface ValueDomain
+ {
+ public boolean isValid( Serializable object );
+
+ public ValueDomain clone( );
+ }
Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-13 06:58:10
|
Revision: 52
http://svn.sourceforge.net/surveyforge/?rev=52&view=rev
Author: javism
Date: 2006-09-12 23:57:53 -0700 (Tue, 12 Sep 2006)
Log Message:
-----------
Updated ValueDomain related staff.
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java
Added Paths:
-----------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/AbstractValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
Removed Paths:
-------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
Deleted: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-09-12 09:25:58 UTC (rev 51)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -1,76 +0,0 @@
-/*
- * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to
- * the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- *
- * $Id$
- */
-package org.surveyforge.core.metadata;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-
-import org.hibernate.annotations.GenericGenerator;
-
-// TODO: Elaborate on comments
-/**
- * @author jsegura
- */
-@Entity
-@Inheritance(strategy = InheritanceType.JOINED)
-public abstract class ValueDomain implements Serializable, Cloneable
- {
- private static final long serialVersionUID = -83487445078388347L;
-
- @SuppressWarnings("unused")
- @Id
- @Column(length = 50)
- @GeneratedValue(generator = "system-uuid")
- @GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
- /** Version for optimistic locking. */
- @SuppressWarnings("unused")
- @javax.persistence.Version
- private int lockingVersion;
-
- protected ValueDomain( )
- {}
-
- public abstract boolean isValid( Serializable data );
-
- @Override
- public ValueDomain clone( )
- {
- try
- {
- ValueDomain copy = (ValueDomain) super.clone( );
- copy.id = null;
- copy.lockingVersion = 0;
- return copy;
- }
- catch( CloneNotSupportedException exc )
- {
- throw new InternalError( exc.getLocalizedMessage( ) );
- }
- }
- }
Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/AbstractValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/AbstractValueDomain.java (rev 0)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/AbstractValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -0,0 +1,78 @@
+/*
+ * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to
+ * the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+package org.surveyforge.core.metadata.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+
+import org.hibernate.annotations.GenericGenerator;
+import org.surveyforge.core.metadata.ValueDomain;
+
+// TODO: Elaborate on comments
+/**
+ * @author jsegura
+ */
+@Entity
+@Inheritance(strategy = InheritanceType.JOINED)
+public abstract class AbstractValueDomain implements Serializable, Cloneable, ValueDomain
+ {
+ private static final long serialVersionUID = -83487445078388347L;
+
+ @SuppressWarnings("unused")
+ @Id
+ @Column(length = 50)
+ @GeneratedValue(generator = "system-uuid")
+ @GenericGenerator(name = "system-uuid", strategy = "uuid")
+ protected String id;
+ /** Version for optimistic locking. */
+ @SuppressWarnings("unused")
+ @javax.persistence.Version
+ protected int lockingVersion;
+
+
+ protected AbstractValueDomain( )
+ {}
+
+
+
+ @Override
+ public AbstractValueDomain clone( )
+ {
+ try
+ {
+ AbstractValueDomain copy = (AbstractValueDomain) super.clone( );
+ copy.id = null;
+ copy.lockingVersion = 0;
+ return copy;
+ }
+ catch( CloneNotSupportedException exc )
+ {
+ throw new InternalError( exc.getLocalizedMessage( ) );
+ }
+ }
+ }
Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/AbstractValueDomain.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-09-12 09:25:58 UTC (rev 51)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -27,13 +27,12 @@
import javax.persistence.ManyToOne;
import org.surveyforge.classification.Level;
-import org.surveyforge.core.metadata.ValueDomain;
/**
* @author jgonzalez
*/
@Entity
-public class ClassificationValueDomain extends ValueDomain
+public class ClassificationValueDomain extends AbstractValueDomain
{
private static final long serialVersionUID = 2295375925240989153L;
@@ -78,7 +77,7 @@
this.sublevelsAllowed = sublevelsAllowed;
}
- @Override
+
public boolean isValid( Serializable object )
{
if( object instanceof String )
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-09-12 09:25:58 UTC (rev 51)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -25,13 +25,11 @@
import javax.persistence.Entity;
-import org.surveyforge.core.metadata.ValueDomain;
-
/**
* @author jsegura
*/
@Entity
-public class LogicalValueDomain extends ValueDomain
+public class LogicalValueDomain extends AbstractValueDomain
{
private static final long serialVersionUID = 2066579378848047283L;
@@ -43,7 +41,7 @@
return (Boolean.class.isInstance( object ));
}
- @Override
+
public LogicalValueDomain clone( )
{
return (LogicalValueDomain) super.clone( );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java 2006-09-12 09:25:58 UTC (rev 51)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -26,13 +26,11 @@
import javax.persistence.Entity;
-import org.surveyforge.core.metadata.ValueDomain;
-
/**
* @author jgonzalez
*/
@Entity
-public class QuantityValueDomain extends ValueDomain
+public class QuantityValueDomain extends AbstractValueDomain
{
private static final long serialVersionUID = 475119088217988415L;
@@ -131,7 +129,7 @@
throw new IllegalArgumentException( );
}
- @Override
+
public boolean isValid( Serializable object )
{
if( object instanceof BigDecimal )
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java 2006-09-12 09:25:58 UTC (rev 51)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -25,13 +25,11 @@
import javax.persistence.Entity;
-import org.surveyforge.core.metadata.ValueDomain;
-
/**
* @author jgonzalez
*/
@Entity
-public class StringValueDomain extends ValueDomain
+public class StringValueDomain extends AbstractValueDomain
{
private static final long serialVersionUID = -5056062679246063821L;
@@ -73,7 +71,6 @@
throw new IllegalArgumentException( );
}
- @Override
public boolean isValid( Serializable object )
{
if( object instanceof String )
@@ -85,6 +82,8 @@
return false;
}
+
+
@Override
public StringValueDomain clone( )
{
Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java (rev 0)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java 2006-09-13 06:57:53 UTC (rev 52)
@@ -0,0 +1,93 @@
+package org.surveyforge.core.metadata.domain;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+
+import org.hibernate.annotations.IndexColumn;
+import org.surveyforge.core.data.RowData;
+import org.surveyforge.core.metadata.ValueDomain;
+
+@Entity
+public class StructuredValueDomain extends AbstractValueDomain
+ {
+ private static final long serialVersionUID = -3340195650321504136L;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
+ @IndexColumn(name = "subDomainsIndex")
+ @JoinColumn(name = "upperDomain_id")
+ private List<ValueDomain> subDomains = new ArrayList<ValueDomain>( );
+
+
+ public StructuredValueDomain( )
+ {};
+
+
+ /**
+ * For validating an object with a StructuredValueDomain, the object has to be an instance of RowData.
+ *
+ * @param object The object to validate
+ */
+ public boolean isValid( Serializable object )
+ {
+ // In this case "object" is a RowData
+
+ if( object != null )
+ {
+
+ if( !(object instanceof RowData) ) throw new IllegalArgumentException( );
+ if( this.getSubDomains( ).size( ) != ((RowData) object).getSubRowDatas( ).size( ) ) { return false; }
+
+ for( int i = 0; i < this.getSubDomains( ).size( ); i++ )
+ {
+ if( this.getSubDomains( ).get( i ) instanceof StructuredValueDomain )
+ {
+ if( !this.getSubDomains( ).get( i ).isValid( ((RowData) object).getSubRowDatas( ).get( i ) ) ) return false;
+ }
+ else
+ {
+ if( !this.getSubDomains( ).get( i ).isValid( ((RowData) object).getSubRowDatas( ).get( i ).getData( ) ) ) return false;
+ }
+ }
+
+ return true;
+ }
+ else
+ throw new NullPointerException( );
+ }
+
+ /**
+ * @return the subDomains
+ */
+ public List<ValueDomain> getSubDomains( )
+ {
+ return Collections.unmodifiableList( this.subDomains );
+ }
+
+ public void addSubDomain( ValueDomain domain )
+ {
+ if( domain != null )
+ {
+ this.subDomains.add( domain );
+ }
+ else
+ throw new NullPointerException( );
+ }
+
+ public void removeSubDomain( ValueDomain domain )
+ {
+ if( domain != null )
+ {
+ this.subDomains.remove( domain );
+ }
+ else
+ throw new NullPointerException( );
+ }
+ }
Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StructuredValueDomain.java
___________________________________________________________________
Name: svn:keywords
+ Date Revision Author HeadURL Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-12 09:26:05
|
Revision: 51
http://svn.sourceforge.net/surveyforge/?rev=51&view=rev
Author: javism
Date: 2006-09-12 02:25:58 -0700 (Tue, 12 Sep 2006)
Log Message:
-----------
Added support for sub/upper elements
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java 2006-09-05 08:14:29 UTC (rev 50)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java 2006-09-12 09:25:58 UTC (rev 51)
@@ -22,15 +22,22 @@
package org.surveyforge.core.data;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
import org.hibernate.annotations.GenericGenerator;
+import org.hibernate.annotations.IndexColumn;
// TODO: Elaborate on comments
/**
@@ -52,16 +59,20 @@
@javax.persistence.Version
private int lockingVersion;
- @ManyToOne
- @JoinColumn(name = "row_id", insertable = false, updatable = false)
- private Row row;
- // TODO get/set of the row
-
private Serializable data;
private boolean answered;
private boolean applicable;
+ @ManyToOne(cascade = {CascadeType.ALL})
+ @JoinColumn(name = "upperRowData_id", insertable = false, updatable = false)
+ private RowData upperRowData;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
+ @IndexColumn(name = "subRowDatasIndex")
+ @JoinColumn(name = "upperRowData_id")
+ private List<RowData> subRowDatas = new ArrayList<RowData>( );
+
protected RowData( )
{}
@@ -113,5 +124,48 @@
this.applicable = applicable;
}
+ /**
+ * @return the upperRowData
+ */
+ public RowData getUpperRowData( )
+ {
+ return upperRowData;
+ }
+ /**
+ * @param upperRowData the upperRowData to set
+ */
+ public void setUpperRowData( RowData upperRowData )
+ {
+ if( this.upperRowData != null ) this.upperRowData.removeSubRowData( this );
+ this.upperRowData = upperRowData;
+ if( this.upperRowData != null ) this.upperRowData.addSubRowData( this );
+ }
+
+ private void removeSubRowData( RowData rowData )
+ {
+ if( rowData != null )
+ this.subRowDatas.remove( rowData );
+ else
+ throw new NullPointerException( );
+ }
+
+ private void addSubRowData( RowData rowData )
+ {
+ if( rowData != null )
+ this.subRowDatas.add( rowData );
+ else
+ throw new NullPointerException( );
+ }
+
+
+ /**
+ * @return the subRowDatas
+ */
+ public List<RowData> getSubRowDatas( )
+ {
+ return Collections.unmodifiableList( this.subRowDatas );
+ }
+
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-05 08:14:35
|
Revision: 50
http://svn.sourceforge.net/surveyforge/?rev=50&view=rev
Author: javism
Date: 2006-09-05 01:14:29 -0700 (Tue, 05 Sep 2006)
Log Message:
-----------
Changed the class hierarchy to fit the new model.
Modified Paths:
--------------
trunk/src/model/surveyforge.uml
Modified: trunk/src/model/surveyforge.uml
===================================================================
--- trunk/src/model/surveyforge.uml 2006-09-04 10:13:41 UTC (rev 49)
+++ trunk/src/model/surveyforge.uml 2006-09-05 08:14:29 UTC (rev 50)
@@ -27,7 +27,7 @@
<member type="todo" />
<historyfile name="" />
</argo>
- <XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Mon Sep 04 12:07:25 CEST 2006'>
+ <XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Tue Sep 05 10:00:46 CEST 2006'>
<XMI.header> <XMI.documentation>
<XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
<XMI.exporterVersion>0.20.x</XMI.exporterVersion>
@@ -312,7 +312,7 @@
</UML:Association.connection>
</UML:Association>
<UML:Class xmi.id = '.:0000000000000860' name = 'DataElement' visibility = 'public'
- isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'true'
isActive = 'false'>
<UML:Classifier.feature>
<UML:Attribute xmi.id = '.:000000000000085F' name = 'identifier' visibility = 'public'
@@ -598,6 +598,7 @@
</UML:ModelElement.comment>
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref = '.:0000000000000894'/>
+ <UML:Generalization xmi.idref = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000915'/>
</UML:GeneralizableElement.generalization>
</UML:Class>
<UML:Generalization xmi.id = '.:0000000000000894' isSpecification = 'false'>
@@ -778,7 +779,7 @@
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.participant>
- <UML:Class xmi.idref = '.:0000000000000893'/>
+ <UML:Class xmi.idref = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000912'/>
</UML:AssociationEnd.participant>
</UML:AssociationEnd>
<UML:AssociationEnd xmi.id = '.:0000000000000924' visibility = 'public'
@@ -1333,6 +1334,101 @@
</UML:AssociationEnd>
</UML:Association.connection>
</UML:Association>
+ <UML:Association xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:00000000000008FC'
+ name = '' isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:00000000000008FD'
+ name = 'subRowDatas' visibility = 'public' isSpecification = 'false' isNavigable = 'true'
+ ordering = 'unordered' aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000904'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000903'
+ lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008C8'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000900'
+ name = 'upperRowData' visibility = 'public' isSpecification = 'false' isNavigable = 'true'
+ ordering = 'unordered' aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000906'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000905'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008C8'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000907'
+ name = '' isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000908'
+ name = 'subDomains' visibility = 'public' isSpecification = 'false' isNavigable = 'true'
+ ordering = 'unordered' aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:000000000000090F'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:000000000000090E'
+ lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000874'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:000000000000090B'
+ name = 'upperDomain' visibility = 'public' isSpecification = 'false' isNavigable = 'true'
+ ordering = 'unordered' aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000911'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000910'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000874'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000912'
+ name = 'QuestionDataElement' visibility = 'public' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'>
+ <UML:GeneralizableElement.generalization>
+ <UML:Generalization xmi.idref = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000914'/>
+ </UML:GeneralizableElement.generalization>
+ </UML:Class>
+ <UML:Generalization xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000914'
+ isSpecification = 'false'>
+ <UML:Generalization.child>
+ <UML:Class xmi.idref = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000912'/>
+ </UML:Generalization.child>
+ <UML:Generalization.parent>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:Generalization.parent>
+ </UML:Generalization>
+ <UML:Generalization xmi.id = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000915'
+ isSpecification = 'false'>
+ <UML:Generalization.child>
+ <UML:Class xmi.idref = '.:0000000000000893'/>
+ </UML:Generalization.child>
+ <UML:Generalization.parent>
+ <UML:Class xmi.idref = '-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000912'/>
+ </UML:Generalization.parent>
+ </UML:Generalization>
</UML:Namespace.ownedElement>
</UML:Package>
</UML:Namespace.ownedElement>
@@ -2234,7 +2330,7 @@
/>
</group>
<group name="Fig6"
- description="org.argouml.uml.diagram.static_structure.ui.FigClass[848, 352, 73, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
+ description="org.argouml.uml.diagram.static_structure.ui.FigClass[824, 368, 73, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
href=".:0000000000000874"
fill="1"
fillcolor="white"
@@ -2245,8 +2341,8 @@
</private>
<rectangle name="Fig6.0"
- x="848"
- y="352"
+ x="824"
+ y="368"
width="73"
height="65"
fill="1"
@@ -2255,7 +2351,7 @@
strokecolor="black"
/>
<group name="Fig6.1"
- description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[848, 352, 73, 2]"
+ description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[824, 368, 73, 2]"
href=".:0000000000000874"
fill="1"
fillcolor="white"
@@ -2266,8 +2362,8 @@
</private>
<rectangle name="Fig6.1.0"
- x="848"
- y="352"
+ x="824"
+ y="368"
width="73"
height="2"
fill="1"
@@ -2277,8 +2373,8 @@
/>
</group>
<text name="Fig6.2"
- x="848"
- y="354"
+ x="824"
+ y="370"
fill="1"
fillcolor="white"
stroke="0"
@@ -2287,7 +2383,7 @@
textsize="10"
>ValueDomain</text>
<group name="Fig6.3"
- description="org.argouml.uml.diagram.ui.FigOperationsCompartment[849, 397, 72, 20]"
+ description="org.argouml.uml.diagram.ui.FigOperationsCompartment[825, 413, 72, 20]"
fill="1"
fillcolor="white"
stroke="0"
@@ -2297,8 +2393,8 @@
</private>
<rectangle name="Fig6.3.0"
- x="849"
- y="397"
+ x="825"
+ y="413"
width="72"
height="20"
fill="1"
@@ -2313,14 +2409,14 @@
stroke="1"
strokecolor="black"
>
- <moveto x="849"
- y="397" />
- <lineto x="921"
- y="397" />
+ <moveto x="825"
+ y="413" />
+ <lineto x="897"
+ y="413" />
</path>
</group>
<group name="Fig6.4"
- description="org.argouml.uml.diagram.ui.FigAttributesCompartment[849, 376, 72, 20]"
+ description="org.argouml.uml.diagram.ui.FigAttributesCompartment[825, 392, 72, 20]"
fill="1"
fillcolor="white"
stroke="0"
@@ -2330,8 +2426,8 @@
</private>
<rectangle name="Fig6.4.0"
- x="849"
- y="376"
+ x="825"
+ y="392"
width="72"
height="20"
fill="1"
@@ -2346,15 +2442,15 @@
stroke="1"
strokecolor="black"
>
- <moveto x="849"
- y="376" />
- <lineto x="921"
- y="376" />
+ <moveto x="825"
+ y="392" />
+ <lineto x="897"
+ y="392" />
</path>
</group>
<rectangle name="Fig6.5"
- x="848"
- y="352"
+ x="824"
+ y="368"
width="73"
height="65"
fill="0"
@@ -2920,37 +3016,6 @@
</group>
<group name="Fig12"
description="org.argouml.uml.diagram.ui.FigAssociation"
- href=".:0000000000000839"
- stroke="1"
- strokecolor="black"
- >
- <private>
- sourcePortFig="Fig1"
- destPortFig="Fig1"
- sourceFigNode="Fig1"
- destFigNode="Fig1"
- </private>
- <path name="Fig12.0"
- description="org.tigris.gef.presentation.FigPoly"
- fill="0"
- fillcolor="white"
- stroke="1"
- strokecolor="black"
- >
- <moveto x="128"
- y="584" />
- <lineto x="83"
- y="584" />
- <lineto x="83"
- y="664" />
- <lineto x="171"
- y="664" />
- <lineto x="171"
- y="617" />
- </path>
- </group>
- <group name="Fig13"
- description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:0000000000000841"
stroke="1"
strokecolor="black"
@@ -2961,7 +3026,7 @@
sourceFigNode="Fig0"
destFigNode="Fig2"
</private>
- <path name="Fig13.0"
+ <path name="Fig12.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -2974,7 +3039,7 @@
y="247" />
</path>
</group>
- <group name="Fig14"
+ <group name="Fig13"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:0000000000000854"
stroke="1"
@@ -2986,7 +3051,7 @@
sourceFigNode="Fig2"
destFigNode="Fig3"
</private>
- <path name="Fig14.0"
+ <path name="Fig13.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -2999,7 +3064,7 @@
y="392" />
</path>
</group>
- <group name="Fig15"
+ <group name="Fig14"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:000000000000085C"
stroke="1"
@@ -3011,7 +3076,7 @@
sourceFigNode="Fig2"
destFigNode="Fig3"
</private>
- <path name="Fig15.0"
+ <path name="Fig14.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3024,7 +3089,7 @@
y="392" />
</path>
</group>
- <group name="Fig16"
+ <group name="Fig15"
description="org.argouml.uml.diagram.ui.FigGeneralization"
href=".:0000000000000861"
stroke="1"
@@ -3036,7 +3101,7 @@
sourceFigNode="Fig3"
destFigNode="Fig4"
</private>
- <path name="Fig16.0"
+ <path name="Fig15.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3049,7 +3114,7 @@
y="408" />
</path>
</group>
- <group name="Fig17"
+ <group name="Fig16"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:0000000000000868"
stroke="1"
@@ -3061,7 +3126,7 @@
sourceFigNode="Fig10"
destFigNode="Fig3"
</private>
- <path name="Fig17.0"
+ <path name="Fig16.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3074,7 +3139,7 @@
y="415" />
</path>
</group>
- <group name="Fig18"
+ <group name="Fig17"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:000000000000087B"
stroke="1"
@@ -3086,7 +3151,7 @@
sourceFigNode="Fig4"
destFigNode="Fig6"
</private>
- <path name="Fig18.0"
+ <path name="Fig17.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3094,12 +3159,12 @@
strokecolor="black"
>
<moveto x="745"
- y="385" />
- <lineto x="848"
- y="385" />
+ y="384" />
+ <lineto x="824"
+ y="384" />
</path>
</group>
- <group name="Fig19"
+ <group name="Fig18"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:0000000000000889"
stroke="1"
@@ -3111,7 +3176,7 @@
sourceFigNode="Fig2"
destFigNode="Fig2"
</private>
- <path name="Fig19.0"
+ <path name="Fig18.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3130,7 +3195,7 @@
y="227" />
</path>
</group>
- <group name="Fig20"
+ <group name="Fig19"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:0000000000000890"
stroke="1"
@@ -3142,7 +3207,7 @@
sourceFigNode="Fig4"
destFigNode="Fig4"
</private>
- <path name="Fig20.0"
+ <path name="Fig19.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3161,34 +3226,7 @@
y="469" />
</path>
</group>
- <group name="Fig21"
- description="org.argouml.uml.diagram.ui.FigGeneralization"
- href=".:0000000000000894"
- stroke="1"
- strokecolor="black"
- >
- <private>
- sourcePortFig="Fig7"
- destPortFig="Fig4"
- sourceFigNode="Fig7"
- destFigNode="Fig4"
- </private>
- <path name="Fig21.0"
- description="org.tigris.gef.presentation.FigPoly"
- fill="0"
- fillcolor="white"
- stroke="1"
- strokecolor="black"
- >
- <moveto x="509"
- y="544" />
- <lineto x="578"
- y="420" />
- <lineto x="648"
- y="420" />
- </path>
- </group>
- <group name="Fig22"
+ <group name="Fig20"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:000000000000089E"
stroke="1"
@@ -3200,7 +3238,7 @@
sourceFigNode="Fig5"
destFigNode="Fig8"
</private>
- <path name="Fig22.0"
+ <path name="Fig20.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3213,7 +3251,7 @@
y="600" />
</path>
</group>
- <group name="Fig23"
+ <group name="Fig21"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:00000000000008B1"
stroke="1"
@@ -3225,7 +3263,7 @@
sourceFigNode="Fig9"
destFigNode="Fig9"
</private>
- <path name="Fig23.0"
+ <path name="Fig21.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3244,7 +3282,7 @@
y="755" />
</path>
</group>
- <group name="Fig24"
+ <group name="Fig22"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:00000000000008BF"
stroke="1"
@@ -3256,7 +3294,7 @@
sourceFigNode="Fig5"
destFigNode="Fig9"
</private>
- <path name="Fig24.0"
+ <path name="Fig22.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3269,7 +3307,7 @@
y="712" />
</path>
</group>
- <group name="Fig25"
+ <group name="Fig23"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:00000000000008DE"
stroke="1"
@@ -3281,7 +3319,7 @@
sourceFigNode="Fig3"
destFigNode="Fig7"
</private>
- <path name="Fig25.0"
+ <path name="Fig23.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3294,19 +3332,19 @@
y="544" />
</path>
</group>
- <group name="Fig26"
+ <group name="Fig24"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:0000000000000920"
stroke="1"
strokecolor="black"
>
<private>
- sourcePortFig="Fig7.0"
+ sourcePortFig="Fig42"
destPortFig="Fig1"
- sourceFigNode="Fig7"
+ sourceFigNode="Fig42"
destFigNode="Fig1"
</private>
- <path name="Fig26.0"
+ <path name="Fig24.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3314,12 +3352,12 @@
strokecolor="black"
>
<moveto x="384"
- y="574" />
+ y="760" />
<lineto x="214"
- y="574" />
+ y="617" />
</path>
</group>
- <group name="Fig27"
+ <group name="Fig25"
description="org.argouml.uml.diagram.ui.FigAssociation"
href=".:000000000000092F"
stroke="1"
@@ -3331,7 +3369,7 @@
sourceFigNode="Fig10"
destFigNode="Fig1"
</private>
- <path name="Fig27.0"
+ <path name="Fig25.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3344,7 +3382,7 @@
y="536" />
</path>
</group>
- <group name="Fig28"
+ <group name="Fig26"
description="org.argouml.uml.diagram.static_structure.ui.FigClass[144, 80, 90, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:000000000000088F"
fill="1"
@@ -3355,7 +3393,7 @@
<private>
</private>
- <rectangle name="Fig28.0"
+ <rectangle name="Fig26.0"
x="144"
y="80"
width="90"
@@ -3365,7 +3403,7 @@
stroke="0"
strokecolor="black"
/>
- <group name="Fig28.1"
+ <group name="Fig26.1"
description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[144, 80, 90, 2]"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:000000000000088F"
fill="1"
@@ -3376,7 +3414,7 @@
<private>
</private>
- <rectangle name="Fig28.1.0"
+ <rectangle name="Fig26.1.0"
x="144"
y="80"
width="90"
@@ -3387,7 +3425,7 @@
strokecolor="black"
/>
</group>
- <text name="Fig28.2"
+ <text name="Fig26.2"
x="144"
y="82"
fill="1"
@@ -3397,7 +3435,7 @@
font="Dialog"
textsize="10"
>Study</text>
- <group name="Fig28.3"
+ <group name="Fig26.3"
description="org.argouml.uml.diagram.ui.FigOperationsCompartment[145, 125, 89, 20]"
fill="1"
fillcolor="255 255 200"
@@ -3407,7 +3445,7 @@
<private>
</private>
- <rectangle name="Fig28.3.0"
+ <rectangle name="Fig26.3.0"
x="145"
y="125"
width="89"
@@ -3417,7 +3455,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig28.3.1"
+ <path name="Fig26.3.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="255 255 200"
@@ -3430,7 +3468,7 @@
y="125" />
</path>
</group>
- <group name="Fig28.4"
+ <group name="Fig26.4"
description="org.argouml.uml.diagram.ui.FigAttributesCompartment[145, 104, 89, 20]"
fill="1"
fillcolor="255 255 200"
@@ -3440,7 +3478,7 @@
<private>
</private>
- <rectangle name="Fig28.4.0"
+ <rectangle name="Fig26.4.0"
x="145"
y="104"
width="89"
@@ -3450,7 +3488,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig28.4.1"
+ <path name="Fig26.4.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="255 255 200"
@@ -3463,7 +3501,7 @@
y="104" />
</path>
</group>
- <rectangle name="Fig28.5"
+ <rectangle name="Fig26.5"
x="144"
y="80"
width="90"
@@ -3474,19 +3512,19 @@
strokecolor="black"
/>
</group>
- <group name="Fig29"
+ <group name="Fig27"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:0000000000000891"
stroke="1"
strokecolor="black"
>
<private>
- sourcePortFig="Fig28.0"
+ sourcePortFig="Fig26.0"
destPortFig="Fig0.0"
- sourceFigNode="Fig28"
+ sourceFigNode="Fig26"
destFigNode="Fig0"
</private>
- <path name="Fig29.0"
+ <path name="Fig27.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3499,7 +3537,7 @@
y="232" />
</path>
</group>
- <group name="Fig30"
+ <group name="Fig28"
description="org.argouml.uml.diagram.static_structure.ui.FigClass[976, 264, 106, 95]pathVisible=false;operationsVisible=true;attributesVisible=true"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008C8"
fill="1"
@@ -3510,7 +3548,7 @@
<private>
</private>
- <rectangle name="Fig30.0"
+ <rectangle name="Fig28.0"
x="976"
y="264"
width="106"
@@ -3520,7 +3558,7 @@
stroke="0"
strokecolor="black"
/>
- <group name="Fig30.1"
+ <group name="Fig28.1"
description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[976, 264, 106, 2]"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008C8"
fill="1"
@@ -3531,7 +3569,7 @@
<private>
</private>
- <rectangle name="Fig30.1.0"
+ <rectangle name="Fig28.1.0"
x="976"
y="264"
width="106"
@@ -3542,7 +3580,7 @@
strokecolor="black"
/>
</group>
- <text name="Fig30.2"
+ <text name="Fig28.2"
x="976"
y="266"
fill="1"
@@ -3552,7 +3590,7 @@
font="Dialog"
textsize="10"
>RowData</text>
- <group name="Fig30.3"
+ <group name="Fig28.3"
description="org.argouml.uml.diagram.ui.FigOperationsCompartment[977, 339, 105, 20]"
fill="1"
fillcolor="200 255 200"
@@ -3562,7 +3600,7 @@
<private>
</private>
- <rectangle name="Fig30.3.0"
+ <rectangle name="Fig28.3.0"
x="977"
y="339"
width="105"
@@ -3572,7 +3610,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig30.3.1"
+ <path name="Fig28.3.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="200 255 200"
@@ -3585,7 +3623,7 @@
y="339" />
</path>
</group>
- <group name="Fig30.4"
+ <group name="Fig28.4"
description="org.argouml.uml.diagram.ui.FigAttributesCompartment[977, 288, 105, 50]"
fill="1"
fillcolor="200 255 200"
@@ -3595,7 +3633,7 @@
<private>
</private>
- <rectangle name="Fig30.4.0"
+ <rectangle name="Fig28.4.0"
x="977"
y="288"
width="105"
@@ -3605,7 +3643,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig30.4.1"
+ <path name="Fig28.4.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="200 255 200"
@@ -3617,7 +3655,7 @@
<lineto x="1082"
y="288" />
</path>
- <text name="Fig30.4.2"
+ <text name="Fig28.4.2"
x="977"
y="289"
fill="0"
@@ -3627,7 +3665,7 @@
font="Dialog"
textsize="10"
>data : Serializable</text>
- <text name="Fig30.4.3"
+ <text name="Fig28.4.3"
x="977"
y="303"
fill="0"
@@ -3637,7 +3675,7 @@
font="Dialog"
textsize="10"
>answered : boolean</text>
- <text name="Fig30.4.4"
+ <text name="Fig28.4.4"
x="977"
y="317"
fill="0"
@@ -3648,7 +3686,7 @@
textsize="10"
>applicable : boolean</text>
</group>
- <rectangle name="Fig30.5"
+ <rectangle name="Fig28.5"
x="976"
y="264"
width="106"
@@ -3659,7 +3697,7 @@
strokecolor="black"
/>
</group>
- <group name="Fig31"
+ <group name="Fig29"
description="org.argouml.uml.diagram.static_structure.ui.FigClass[984, 128, 90, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008DB"
fill="1"
@@ -3670,7 +3708,7 @@
<private>
</private>
- <rectangle name="Fig31.0"
+ <rectangle name="Fig29.0"
x="984"
y="128"
width="90"
@@ -3680,7 +3718,7 @@
stroke="0"
strokecolor="black"
/>
- <group name="Fig31.1"
+ <group name="Fig29.1"
description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[984, 128, 90, 2]"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008DB"
fill="1"
@@ -3691,7 +3729,7 @@
<private>
</private>
- <rectangle name="Fig31.1.0"
+ <rectangle name="Fig29.1.0"
x="984"
y="128"
width="90"
@@ -3702,7 +3740,7 @@
strokecolor="black"
/>
</group>
- <text name="Fig31.2"
+ <text name="Fig29.2"
x="984"
y="130"
fill="1"
@@ -3712,7 +3750,7 @@
font="Dialog"
textsize="10"
>Row</text>
- <group name="Fig31.3"
+ <group name="Fig29.3"
description="org.argouml.uml.diagram.ui.FigOperationsCompartment[985, 173, 89, 20]"
fill="1"
fillcolor="200 255 200"
@@ -3722,7 +3760,7 @@
<private>
</private>
- <rectangle name="Fig31.3.0"
+ <rectangle name="Fig29.3.0"
x="985"
y="173"
width="89"
@@ -3732,7 +3770,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig31.3.1"
+ <path name="Fig29.3.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="200 255 200"
@@ -3745,7 +3783,7 @@
y="173" />
</path>
</group>
- <group name="Fig31.4"
+ <group name="Fig29.4"
description="org.argouml.uml.diagram.ui.FigAttributesCompartment[985, 152, 89, 20]"
fill="1"
fillcolor="200 255 200"
@@ -3755,7 +3793,7 @@
<private>
</private>
- <rectangle name="Fig31.4.0"
+ <rectangle name="Fig29.4.0"
x="985"
y="152"
width="89"
@@ -3765,7 +3803,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig31.4.1"
+ <path name="Fig29.4.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="200 255 200"
@@ -3778,7 +3816,7 @@
y="152" />
</path>
</group>
- <rectangle name="Fig31.5"
+ <rectangle name="Fig29.5"
x="984"
y="128"
width="90"
@@ -3789,19 +3827,19 @@
strokecolor="black"
/>
</group>
- <group name="Fig32"
+ <group name="Fig30"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008DD"
stroke="1"
strokecolor="black"
>
<private>
- sourcePortFig="Fig31.0"
- destPortFig="Fig30.0"
- sourceFigNode="Fig31"
- destFigNode="Fig30"
+ sourcePortFig="Fig29.0"
+ destPortFig="Fig28.0"
+ sourceFigNode="Fig29"
+ destFigNode="Fig28"
</private>
- <path name="Fig32.0"
+ <path name="Fig30.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3814,7 +3852,7 @@
y="264" />
</path>
</group>
- <group name="Fig33"
+ <group name="Fig31"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008E4"
stroke="1"
@@ -3822,11 +3860,11 @@
>
<private>
sourcePortFig="Fig2"
- destPortFig="Fig34"
+ destPortFig="Fig32"
sourceFigNode="Fig2"
- destFigNode="Fig34"
+ destFigNode="Fig32"
</private>
- <path name="Fig33.0"
+ <path name="Fig31.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3841,7 +3879,7 @@
y="32" />
</path>
</group>
- <group name="Fig34"
+ <group name="Fig32"
description="org.argouml.uml.diagram.static_structure.ui.FigClass[984, 8, 90, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008EF"
fill="1"
@@ -3852,7 +3890,7 @@
<private>
</private>
- <rectangle name="Fig34.0"
+ <rectangle name="Fig32.0"
x="984"
y="8"
width="90"
@@ -3862,7 +3900,7 @@
stroke="0"
strokecolor="black"
/>
- <group name="Fig34.1"
+ <group name="Fig32.1"
description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[984, 8, 90, 2]"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008EF"
fill="1"
@@ -3873,7 +3911,7 @@
<private>
</private>
- <rectangle name="Fig34.1.0"
+ <rectangle name="Fig32.1.0"
x="984"
y="8"
width="90"
@@ -3884,7 +3922,7 @@
strokecolor="black"
/>
</group>
- <text name="Fig34.2"
+ <text name="Fig32.2"
x="984"
y="10"
fill="1"
@@ -3894,7 +3932,7 @@
font="Dialog"
textsize="10"
>RegisterData</text>
- <group name="Fig34.3"
+ <group name="Fig32.3"
description="org.argouml.uml.diagram.ui.FigOperationsCompartment[985, 53, 89, 20]"
fill="1"
fillcolor="200 255 200"
@@ -3904,7 +3942,7 @@
<private>
</private>
- <rectangle name="Fig34.3.0"
+ <rectangle name="Fig32.3.0"
x="985"
y="53"
width="89"
@@ -3914,7 +3952,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig34.3.1"
+ <path name="Fig32.3.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="200 255 200"
@@ -3927,7 +3965,7 @@
y="53" />
</path>
</group>
- <group name="Fig34.4"
+ <group name="Fig32.4"
description="org.argouml.uml.diagram.ui.FigAttributesCompartment[985, 32, 89, 20]"
fill="1"
fillcolor="200 255 200"
@@ -3937,7 +3975,7 @@
<private>
</private>
- <rectangle name="Fig34.4.0"
+ <rectangle name="Fig32.4.0"
x="985"
y="32"
width="89"
@@ -3947,7 +3985,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig34.4.1"
+ <path name="Fig32.4.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="200 255 200"
@@ -3960,7 +3998,7 @@
y="32" />
</path>
</group>
- <rectangle name="Fig34.5"
+ <rectangle name="Fig32.5"
x="984"
y="8"
width="90"
@@ -3971,19 +4009,19 @@
strokecolor="black"
/>
</group>
- <group name="Fig35"
+ <group name="Fig33"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008F1"
stroke="1"
strokecolor="black"
>
<private>
- sourcePortFig="Fig34.0"
- destPortFig="Fig31.0"
- sourceFigNode="Fig34"
- destFigNode="Fig31"
+ sourcePortFig="Fig32.0"
+ destPortFig="Fig29.0"
+ sourceFigNode="Fig32"
+ destFigNode="Fig29"
</private>
- <path name="Fig35.0"
+ <path name="Fig33.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -3996,7 +4034,7 @@
y="128" />
</path>
</group>
- <group name="Fig36"
+ <group name="Fig34"
description="org.argouml.uml.diagram.static_structure.ui.FigClass[392, 16, 90, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008FC"
fill="1"
@@ -4007,7 +4045,7 @@
<private>
</private>
- <rectangle name="Fig36.0"
+ <rectangle name="Fig34.0"
x="392"
y="16"
width="90"
@@ -4017,7 +4055,7 @@
stroke="0"
strokecolor="black"
/>
- <group name="Fig36.1"
+ <group name="Fig34.1"
description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[392, 16, 90, 2]"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008FC"
fill="1"
@@ -4028,7 +4066,7 @@
<private>
</private>
- <rectangle name="Fig36.1.0"
+ <rectangle name="Fig34.1.0"
x="392"
y="16"
width="90"
@@ -4039,7 +4077,7 @@
strokecolor="black"
/>
</group>
- <text name="Fig36.2"
+ <text name="Fig34.2"
x="392"
y="18"
fill="1"
@@ -4049,7 +4087,7 @@
font="Dialog"
textsize="10"
>ValidationRule</text>
- <group name="Fig36.3"
+ <group name="Fig34.3"
description="org.argouml.uml.diagram.ui.FigOperationsCompartment[393, 61, 89, 20]"
fill="1"
fillcolor="white"
@@ -4059,7 +4097,7 @@
<private>
</private>
- <rectangle name="Fig36.3.0"
+ <rectangle name="Fig34.3.0"
x="393"
y="61"
width="89"
@@ -4069,7 +4107,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig36.3.1"
+ <path name="Fig34.3.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="white"
@@ -4082,7 +4120,7 @@
y="61" />
</path>
</group>
- <group name="Fig36.4"
+ <group name="Fig34.4"
description="org.argouml.uml.diagram.ui.FigAttributesCompartment[393, 40, 89, 20]"
fill="1"
fillcolor="white"
@@ -4092,7 +4130,7 @@
<private>
</private>
- <rectangle name="Fig36.4.0"
+ <rectangle name="Fig34.4.0"
x="393"
y="40"
width="89"
@@ -4102,7 +4140,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig36.4.1"
+ <path name="Fig34.4.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="white"
@@ -4115,7 +4153,7 @@
y="40" />
</path>
</group>
- <rectangle name="Fig36.5"
+ <rectangle name="Fig34.5"
x="392"
y="16"
width="90"
@@ -4126,19 +4164,19 @@
strokecolor="black"
/>
</group>
- <group name="Fig37"
+ <group name="Fig35"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008FE"
stroke="1"
strokecolor="black"
>
<private>
- sourcePortFig="Fig36.0"
+ sourcePortFig="Fig34.0"
destPortFig="Fig2.0"
- sourceFigNode="Fig36"
+ sourceFigNode="Fig34"
destFigNode="Fig2"
</private>
- <path name="Fig37.0"
+ <path name="Fig35.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -4151,7 +4189,7 @@
y="192" />
</path>
</group>
- <group name="Fig38"
+ <group name="Fig36"
description="org.argouml.uml.diagram.static_structure.ui.FigClass[992, 528, 90, 65]pathVisible=false;operationsVisible=true;attributesVisible=true"
href="-64--88-1--49-26dbc34b:10c5c6d131b:-8000:00000000000008DF"
fill="1"
@@ -4162,7 +4200,7 @@
<private>
</private>
- <rectangle name="Fig38.0"
+ <rectangle name="Fig36.0"
x="992"
y="528"
width="90"
@@ -4172,7 +4210,7 @@
stroke="0"
strokecolor="black"
/>
- <group name="Fig38.1"
+ <group name="Fig36.1"
description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[992, 528, 90, 2]"
href="-64--88-1--49-26dbc34b:10c5c6d131b:-8000:00000000000008DF"
fill="1"
@@ -4183,7 +4221,7 @@
<private>
</private>
- <rectangle name="Fig38.1.0"
+ <rectangle name="Fig36.1.0"
x="992"
y="528"
width="90"
@@ -4194,7 +4232,7 @@
strokecolor="black"
/>
</group>
- <text name="Fig38.2"
+ <text name="Fig36.2"
x="992"
y="530"
fill="1"
@@ -4204,7 +4242,7 @@
font="Dialog"
textsize="10"
>VariableFamily</text>
- <group name="Fig38.3"
+ <group name="Fig36.3"
description="org.argouml.uml.diagram.ui.FigOperationsCompartment[993, 573, 89, 20]"
fill="1"
fillcolor="white"
@@ -4214,7 +4252,7 @@
<private>
</private>
- <rectangle name="Fig38.3.0"
+ <rectangle name="Fig36.3.0"
x="993"
y="573"
width="89"
@@ -4224,7 +4262,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig38.3.1"
+ <path name="Fig36.3.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="white"
@@ -4237,7 +4275,7 @@
y="573" />
</path>
</group>
- <group name="Fig38.4"
+ <group name="Fig36.4"
description="org.argouml.uml.diagram.ui.FigAttributesCompartment[993, 552, 89, 20]"
fill="1"
fillcolor="white"
@@ -4247,7 +4285,7 @@
<private>
</private>
- <rectangle name="Fig38.4.0"
+ <rectangle name="Fig36.4.0"
x="993"
y="552"
width="89"
@@ -4257,7 +4295,7 @@
stroke="0"
strokecolor="black"
/>
- <path name="Fig38.4.1"
+ <path name="Fig36.4.1"
description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
fill="1"
fillcolor="white"
@@ -4270,7 +4308,7 @@
y="552" />
</path>
</group>
- <rectangle name="Fig38.5"
+ <rectangle name="Fig36.5"
x="992"
y="528"
width="90"
@@ -4281,7 +4319,7 @@
strokecolor="black"
/>
</group>
- <group name="Fig39"
+ <group name="Fig37"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--49-26dbc34b:10c5c6d131b:-8000:00000000000008E8"
stroke="1"
@@ -4289,11 +4327,11 @@
>
<private>
sourcePortFig="Fig8.0"
- destPortFig="Fig38.0"
+ destPortFig="Fig36.0"
sourceFigNode="Fig8"
- destFigNode="Fig38"
+ destFigNode="Fig36"
</private>
- <path name="Fig39.0"
+ <path name="Fig37.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -4306,7 +4344,7 @@
y="569" />
</path>
</group>
- <group name="Fig40"
+ <group name="Fig38"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--49-4f0d3366:10d782a51df:-8000:00000000000008EE"
stroke="1"
@@ -4318,7 +4356,7 @@
sourceFigNode="Fig10"
destFigNode="Fig10"
</private>
- <path name="Fig40.0"
+ <path name="Fig38.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -4337,7 +4375,7 @@
y="465" />
</path>
</group>
- <group name="Fig41"
+ <group name="Fig39"
description="org.argouml.uml.diagram.ui.FigAssociation"
href="-64--88-1--49-4f0d3366:10d782a51df:-8000:00000000000008FB"
stroke="1"
@@ -4349,7 +4387,7 @@
sourceFigNode="Fig7"
destFigNode="Fig5"
</private>
- <path name="Fig41.0"
+ <path name="Fig39.0"
description="org.tigris.gef.presentation.FigPoly"
fill="0"
fillcolor="white"
@@ -4362,6 +4400,252 @@
y="600" />
</path>
</group>
+ <group name="Fig40"
+ description="org.argouml.uml.diagram.ui.FigAssociation"
+ href="-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:00000000000008FC"
+ stroke="1"
+ strokecolor="black"
+ >
+ <private>
+ sourcePortFig="Fig28.0"
+ destPortFig="Fig28.0"
+ sourceFigNode="Fig28"
+ destFigNode="Fig28"
+ </private>
+ <path name="Fig40.0"
+ description="org.tigris.gef.presentation.FigPoly"
+ fill="0"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <moveto x="1031"
+ y="359" />
+ <lineto x="1031"
+ y="402" />
+ <lineto x="1124"
+ y="402" />
+ <lineto x="1124"
+ y="315" />
+ <lineto x="1082"
+ y="315" />
+ </path>
+ </group>
+ <group name="Fig41"
+ description="org.argouml.uml.diagram.ui.FigAssociation"
+ href="-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000907"
+ stroke="1"
+ strokecolor="black"
+ >
+ <private>
+ sourcePortFig="Fig6.0"
+ destPortFig="Fig6.0"
+ sourceFigNode="Fig6"
+ destFigNode="Fig6"
+ </private>
+ <path name="Fig41.0"
+ description="org.tigris.gef.presentation.FigPoly"
+ fill="0"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <moveto x="864"
+ y="433" />
+ <lineto x="864"
+ y="472" />
+ <lineto x="928"
+ y="472" />
+ <lineto x="928"
+ y="408" />
+ <lineto x="897"
+ y="408" />
+ </path>
+ </group>
+ <group name="Fig42"
+ description="org.argouml.uml.diagram.static_structure.ui.FigClass[384, 760, 121, 83]pathVisible=false;operationsVisible=true;attributesVisible=true"
+ href="-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000912"
+ fill="1"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <private>
+ </private>
+
+ <rectangle name="Fig42.0"
+ x="384"
+ y="760"
+ width="121"
+ height="83"
+ fill="1"
+ fillcolor="white"
+ stroke="0"
+ strokecolor="0 255 255"
+ />
+ <group name="Fig42.1"
+ description="org.argouml.uml.diagram.ui.FigStereotypesCompartment[384, 760, 121, 2]"
+ href="-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000912"
+ fill="1"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <private>
+ </private>
+
+ <rectangle name="Fig42.1.0"
+ x="384"
+ y="760"
+ width="121"
+ height="2"
+ fill="1"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ />
+ </group>
+ <text name="Fig42.2"
+ x="384"
+ y="762"
+ fill="1"
+ fillcolor="white"
+ stroke="0"
+ strokecolor="red"
+ font="Dialog"
+ textsize="10"
+ >QuestionDataElement</text>
+ <group name="Fig42.3"
+ description="org.argouml.uml.diagram.ui.FigOperationsCompartment[385, 814, 120, 28]"
+ fill="1"
+ fillcolor="white"
+ stroke="0"
+ strokecolor="black"
+ >
+ <private>
+ </private>
+
+ <rectangle name="Fig42.3.0"
+ x="385"
+ y="814"
+ width="120"
+ height="28"
+ fill="1"
+ fillcolor="white"
+ stroke="0"
+ strokecolor="black"
+ />
+ <path name="Fig42.3.1"
+ description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
+ fill="1"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <moveto x="385"
+ y="814" />
+ <lineto x="505"
+ y="814" />
+ </path>
+ </group>
+ <group name="Fig42.4"
+ description="org.argouml.uml.diagram.ui.FigAttributesCompartment[385, 784, 120, 29]"
+ fill="1"
+ fillcolor="white"
+ stroke="0"
+ strokecolor="black"
+ >
+ <private>
+ </private>
+
+ <rectangle name="Fig42.4.0"
+ x="385"
+ y="784"
+ width="120"
+ height="29"
+ fill="1"
+ fillcolor="white"
+ stroke="0"
+ strokecolor="black"
+ />
+ <path name="Fig42.4.1"
+ description="org.argouml.uml.diagram.ui.FigFeaturesCompartment$FigSeperator"
+ fill="1"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <moveto x="385"
+ y="784" />
+ <lineto x="505"
+ y="784" />
+ </path>
+ </group>
+ <rectangle name="Fig42.5"
+ x="384"
+ y="760"
+ width="121"
+ height="83"
+ fill="0"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ />
+ </group>
+ <group name="Fig43"
+ description="org.argouml.uml.diagram.ui.FigGeneralization"
+ href="-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000914"
+ stroke="1"
+ strokecolor="black"
+ >
+ <private>
+ sourcePortFig="Fig42.0"
+ destPortFig="Fig4.0"
+ sourceFigNode="Fig42"
+ destFigNode="Fig4"
+ </private>
+ <path name="Fig43.0"
+ description="org.tigris.gef.presentation.FigPoly"
+ fill="0"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <moveto x="505"
+ y="792" />
+ <lineto x="552"
+ y="792" />
+ <lineto x="552"
+ y="424" />
+ <lineto x="648"
+ y="424" />
+ </path>
+ </group>
+ <group name="Fig44"
+ description="org.argouml.uml.diagram.ui.FigGeneralization"
+ href="-64--88-1--49--6b6e49d8:10d7cf224c3:-8000:0000000000000915"
+ stroke="1"
+ strokecolor="black"
+ >
+ <private>
+ sourcePortFig="Fig7.0"
+ destPortFig="Fig42.0"
+ sourceFigNode="Fig7"
+ destFigNode="Fig42"
+ </private>
+ <path name="Fig44.0"
+ description="org.tigris.gef.presentation.FigPoly"
+ fill="0"
+ fillcolor="white"
+ stroke="1"
+ strokecolor="black"
+ >
+ <moveto x="444"
+ y="611" />
+ <lineto x="444"
+ y="760" />
+ </path>
+ </group>
</pgml>
<todo>
<todolist>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-09-04 10:13:48
|
Revision: 49
http://svn.sourceforge.net/surveyforge/?rev=49&view=rev
Author: javism
Date: 2006-09-04 03:13:41 -0700 (Mon, 04 Sep 2006)
Log Message:
-----------
Added the design model
Added Paths:
-----------
trunk/src/model/
trunk/src/model/surveyforge.uml
Added: trunk/src/model/surveyforge.uml
===================================================================
--- trunk/src/model/surveyforge.uml (rev 0)
+++ trunk/src/model/surveyforge.uml 2006-09-04 10:13:41 UTC (rev 49)
@@ -0,0 +1,4372 @@
+<?xml version = "1.0" encoding = "UTF-8" ?>
+<uml version="5">
+ <argo version="5">
+ <documentation>
+ <authorname></authorname>
+ <authoremail></authoremail>
+ <version>0.22</version>
+ <description>
+
+ </description>
+ </documentation>
+ <settings>
+ <notationlanguage>UML 1.4</notationlanguage>
+ <useguillemots>false</useguillemots>
+ <showvisibility>false</showvisibility>
+ <showmultiplicity>false</showmultiplicity>
+ <showinitialvalue>false</showinitialvalue>
+ <showproperties>false</showproperties>
+ <showtypes>true</showtypes>
+ <showstereotypes>false</showstereotypes>
+ <defaultshadowwidth>3</defaultshadowwidth>
+ </settings>
+
+ <searchpath href="PROJECT_DIR" />
+ <member type="xmi" />
+ <member type="pgml" />
+ <member type="todo" />
+ <historyfile name="" />
+ </argo>
+ <XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Mon Sep 04 12:07:25 CEST 2006'>
+ <XMI.header> <XMI.documentation>
+ <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
+ <XMI.exporterVersion>0.20.x</XMI.exporterVersion>
+ </XMI.documentation>
+ <XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>
+ <XMI.content>
+ <UML:Model xmi.id = '.:00000000000008CE' name = 'Metanet' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Namespace.ownedElement>
+ <UML:Package xmi.id = '.:00000000000008C9' name = 'org' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Namespace.ownedElement>
+ <UML:Package xmi.id = '.:00000000000008C8' name = 'surveyforge' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Namespace.ownedElement>
+ <UML:Package xmi.id = '.:00000000000008C7' name = 'core' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Namespace.ownedElement>
+ <UML:Class xmi.id = '.:0000000000000824' name = 'Questionnaire' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '.:0000000000000823' name = 'identifier' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000822'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000821' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Class xmi.id = '.:000000000000082B' name = 'Question' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '.:0000000000000827' name = 'identifier' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000826'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000825' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ <UML:Attribute xmi.id = '.:000000000000082A' name = 'question' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000829'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000828' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Association xmi.id = '.:0000000000000832' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:000000000000082E' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49-12a23fb8:10caf627c83:-8000:00000000000008EF'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49-12a23fb8:10caf627c83:-8000:00000000000008EE'
+ lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000824'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000831' name = 'elements' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000830'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000082F' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000092D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:0000000000000839' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000835' name = 'upperQuestion'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000834'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000833' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000082B'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000838' name = 'subQuestions'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000837'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000836' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000082B'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:0000000000000841' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:000000000000083D' name = 'questionnaire'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000083C'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000083B' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000824'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000840' name = 'register' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000083F'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000083E' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000845'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:0000000000000845' name = 'Register' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '.:0000000000000844' name = 'identifier' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000843'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000842' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Class xmi.id = '.:000000000000084D' name = 'RegisterDataElement' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'>
+ <UML:GeneralizableElement.generalization>
+ <UML:Generalization xmi.idref = '.:0000000000000861'/>
+ </UML:GeneralizableElement.generalization>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008BF'
+ name = 'optional' visibility = 'public' isSpecification = 'false' ownerScope = 'instance'
+ changeability = 'changeable' targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008C0'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008C1'
+ lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:DataType xmi.idref = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008A3'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Association xmi.id = '.:0000000000000854' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000850' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000084F'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000084E' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000845'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000853' name = 'key' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000852'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000851' lower = '1' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000084D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:000000000000085C' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000858' name = 'registers' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49-12a23fb8:10caf627c83:-8000:000000000000097D'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49-12a23fb8:10caf627c83:-8000:000000000000097C'
+ lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000845'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:000000000000085B' name = 'registerDataElements'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000085A'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000859' lower = '1' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000084D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:0000000000000860' name = 'DataElement' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '.:000000000000085F' name = 'identifier' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000085E'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000085D' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ <UML:Attribute xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008A8'
+ name = 'multiple' visibility = 'public' isSpecification = 'false' ownerScope = 'instance'
+ changeability = 'changeable' targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008A9'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008AA'
+ lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:DataType xmi.idref = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008A3'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ <UML:Attribute xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008AB'
+ name = 'maxResponses' visibility = 'public' isSpecification = 'false' ownerScope = 'instance'
+ changeability = 'changeable' targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008AC'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008AD'
+ lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:DataType xmi.idref = '.:00000000000008CA'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Generalization xmi.id = '.:0000000000000861' isSpecification = 'false'>
+ <UML:Generalization.child>
+ <UML:Class xmi.idref = '.:000000000000084D'/>
+ </UML:Generalization.child>
+ <UML:Generalization.parent>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:Generalization.parent>
+ </UML:Generalization>
+ <UML:Association xmi.id = '.:0000000000000868' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000864' name = 'question' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000863'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000862' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000092D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000867' name = '' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000092A'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000929' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000084D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:000000000000086C' name = 'ObjectVariable' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '.:000000000000086B' name = 'identifier' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000086A'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000869' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Association xmi.id = '.:0000000000000873' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:000000000000086F' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000086E'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000086D' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000872' name = 'objectVariable'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000090A'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000909' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000086C'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:0000000000000874' name = 'ValueDomain' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'/>
+ <UML:Association xmi.id = '.:000000000000087B' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000877' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000876'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000875' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:000000000000087A' name = 'valueSet' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008DD'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008DC' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000874'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:0000000000000882' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:000000000000087E' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000087D'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000087C' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000084D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000881' name = 'originatingRegister'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000880'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000087F' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000845'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:0000000000000889' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000885' name = 'masterRegister'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000884'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000883' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000845'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000888' name = 'detailRegisters'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000887'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000886' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000845'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:0000000000000890' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:000000000000088C' name = 'variableStructure'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000088B'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000088A' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:000000000000088F' name = 'componentElements'
+ visibility = 'public' isSpecification = 'false' isNavigable = 'true' ordering = 'unordered'
+ aggregation = 'none' targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000088E'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000088D' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:0000000000000893' name = 'ConceptualDataElement'
+ visibility = 'public' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false' isActive = 'false'>
+ <UML:ModelElement.comment>
+ <UML:Comment xmi.idref = '-64--88-1--51--41759acd:10c335cdf1f:-8000:00000000000008A7'/>
+ </UML:ModelElement.comment>
+ <UML:GeneralizableElement.generalization>
+ <UML:Generalization xmi.idref = '.:0000000000000894'/>
+ </UML:GeneralizableElement.generalization>
+ </UML:Class>
+ <UML:Generalization xmi.id = '.:0000000000000894' isSpecification = 'false'>
+ <UML:Generalization.child>
+ <UML:Class xmi.idref = '.:0000000000000893'/>
+ </UML:Generalization.child>
+ <UML:Generalization.parent>
+ <UML:Class xmi.idref = '.:0000000000000860'/>
+ </UML:Generalization.parent>
+ </UML:Generalization>
+ <UML:Class xmi.id = '.:0000000000000897' name = 'GlobalVariable' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'/>
+ <UML:Association xmi.id = '.:000000000000089E' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:000000000000089A' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000899'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000898' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000086C'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:000000000000089D' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000089C'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000089B' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000897'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:00000000000008AA' name = 'StatisticalObjectType'
+ visibility = 'public' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false' isActive = 'false'>
+ <UML:Classifier.feature>
+ <UML:Attribute xmi.id = '.:00000000000008A9' name = 'identifier' visibility = 'public'
+ isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'
+ targetScope = 'instance'>
+ <UML:StructuralFeature.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008A8'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008A7' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:StructuralFeature.multiplicity>
+ <UML:StructuralFeature.type>
+ <UML:Class xmi.idref = '.:00000000000008CB'/>
+ </UML:StructuralFeature.type>
+ </UML:Attribute>
+ </UML:Classifier.feature>
+ </UML:Class>
+ <UML:Association xmi.id = '.:00000000000008B1' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:00000000000008AD' name = 'superType' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008AC'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008AB' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:00000000000008AA'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:00000000000008B0' name = 'subTypes' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008AF'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008AE' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:00000000000008AA'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:00000000000008BF' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:00000000000008BB' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008BA'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008B9' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000086C'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:00000000000008BE' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008BD'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008BC' lower = '1' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:00000000000008AA'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:00000000000008DE' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:00000000000008DF' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:00000000000008E6'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:00000000000008E5' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000084D'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:00000000000008E2' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '-64--88-1--49-4f0d3366:10d782a51df:-8000:0000000000000907'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '-64--88-1--49-4f0d3366:10d782a51df:-8000:0000000000000906'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000893'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Association xmi.id = '.:0000000000000920' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000921' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000928'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:0000000000000927' lower = '0' upper = '-1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:0000000000000893'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ <UML:AssociationEnd xmi.id = '.:0000000000000924' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:000000000000092C'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '.:000000000000092B' lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:AssociationEnd.multiplicity>
+ <UML:AssociationEnd.participant>
+ <UML:Class xmi.idref = '.:000000000000082B'/>
+ </UML:AssociationEnd.participant>
+ </UML:AssociationEnd>
+ </UML:Association.connection>
+ </UML:Association>
+ <UML:Class xmi.id = '.:000000000000092D' name = 'QuestionnaireElement' visibility = 'public'
+ isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+ isActive = 'false'/>
+ <UML:Association xmi.id = '.:000000000000092F' name = '' isSpecification = 'false'
+ isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+ <UML:Association.connection>
+ <UML:AssociationEnd xmi.id = '.:0000000000000930' visibility = 'public'
+ isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'none'
+ targetScope = 'instance' changeability = 'changeable'>
+ <UML:AssociationEnd.multiplicity>
+ <UML:Multiplicity xmi.id = '.:0000000000000937'>
+ ...
[truncated message content] |
|
From: <ja...@us...> - 2006-09-04 08:40:40
|
Revision: 48
http://svn.sourceforge.net/surveyforge/?rev=48&view=rev
Author: javism
Date: 2006-09-04 01:40:34 -0700 (Mon, 04 Sep 2006)
Log Message:
-----------
Changed the constructor type
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-08-31 12:55:46 UTC (rev 47)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-09-04 08:40:34 UTC (rev 48)
@@ -35,7 +35,7 @@
{
private static final long serialVersionUID = 2066579378848047283L;
- protected LogicalValueDomain( )
+ public LogicalValueDomain( )
{}
public boolean isValid( Serializable object )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ja...@us...> - 2006-08-31 12:56:29
|
Revision: 47
http://svn.sourceforge.net/surveyforge/?rev=47&view=rev
Author: javism
Date: 2006-08-31 05:55:46 -0700 (Thu, 31 Aug 2006)
Log Message:
-----------
Updated the default constructor to "protected" and made some improvements on foreign keys.
Modified Paths:
--------------
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ObjectVariable.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValidationRule.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/VariableFamily.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Feed.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/SectionFeed.java
trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Study.java
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RegisterData.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -66,7 +66,7 @@
@JoinColumn(name = "registerData_id")
private List<Row> rows = new ArrayList<Row>( );
- private RegisterData( )
+ protected RegisterData( )
{}
public RegisterData( Register register )
@@ -105,7 +105,7 @@
{
if( this.register.getKey( ).size( ) == 0 ) throw new IllegalArgumentException( );
ArrayList<Integer> illegalList = new ArrayList<Integer>( );
- // TODO: Check valiadation rules
+ // TODO: Check validation rules and throw Exceptions if needed
if( this.register.getRegisterDataElements( ).size( ) != row.getRowDatas( ).size( ) ) throw new IllegalArgumentException( );
int index = 0;
@@ -116,7 +116,6 @@
index++;
}
if( illegalList.size( ) == 0 ) this.rows.add( row );
- // TODO: else throw Exception
}
else
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/Row.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -47,27 +47,30 @@
public class Row implements Serializable
{
private static final long serialVersionUID = 6601926722422919229L;
-
+
@SuppressWarnings("unused")
@Id
@Column(length = 50)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
- private String id;
+ private String id;
/** Version for optimistic locking. */
@SuppressWarnings("unused")
@javax.persistence.Version
- private int lockingVersion;
+ private int lockingVersion;
@ManyToOne(optional = true)
@JoinColumn(name = "registerData_id", insertable = false, updatable = false)
- private RegisterData registerData;
+ private RegisterData registerData;
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "rowDatasIndex")
@JoinColumn(name = "row_id", nullable = false)
- private List<RowData> rowDatas = new ArrayList<RowData>( );
+ private List<RowData> rowDatas = new ArrayList<RowData>( );
+ protected Row( )
+ {};
+
public Row( RegisterData registerData )
{
this.setRegisterData( registerData );
@@ -103,14 +106,7 @@
this.rowDatas.set( fieldIndex, rowData );
}
else
- {
- // String errorMessage = MessageFormat.format( Record.messages.getString( "message.invalid.name" ), fieldName );
- // if( Record.log.isInfoEnabled( ) )
- // {
- // Record.log.info( Record.messages.getString( "exception.invalid.name" ) + errorMessage );
- // }
throw new NoSuchElementException( );
- }
}
public List<RowData> getRowDatas( )
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/data/RowData.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -62,6 +62,9 @@
private boolean answered;
private boolean applicable;
+ protected RowData( )
+ {}
+
/**
* @return Returns the data.
*/
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ConceptualDataElement.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -50,6 +50,9 @@
private ObjectVariable objectVariable;
+ protected ConceptualDataElement( )
+ {}
+
/**
* Creates a new ConceptualDataElement based on the params of a DataElement
*
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/DataElement.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -35,6 +35,9 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
@@ -43,6 +46,7 @@
* @author jsegura
*/
@Entity
+@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "register_id"})})
public class DataElement implements Serializable
{
private static final long serialVersionUID = 0L;
@@ -62,7 +66,7 @@
* This is a unique and language independent identifier for the data element. The identifier is unique among all other data elements
* for an object variable (standard data element) or within the scope of a statistical activity.
*/
- @Column(unique = true, length = 50)
+ @Column(length = 50)
private String identifier;
/** */
private boolean multiple = false;
@@ -83,7 +87,7 @@
private List<DataElement> componentElements = new ArrayList<DataElement>( );
- private DataElement( )
+ protected DataElement( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/GlobalVariable.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -74,7 +74,7 @@
private VariableFamily variableFamily;
- private GlobalVariable( )
+ protected GlobalVariable( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ObjectVariable.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ObjectVariable.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ObjectVariable.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -79,7 +79,7 @@
@JoinColumn(name = "globalVariable_id", insertable = false, updatable = false)
private GlobalVariable globalVariable;
- private ObjectVariable( )
+ protected ObjectVariable( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/Register.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -97,7 +97,8 @@
/** */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "registerDataElementsIndex")
- @JoinColumn(name = "register_id", nullable = false)
+ // @JoinColumn(name = "register_id", nullable = false)
+ @JoinColumn(name = "register_id")
private List<RegisterDataElement> registerDataElements = new ArrayList<RegisterDataElement>( );
/** */
@@ -122,7 +123,7 @@
private Questionnaire questionnaire;
- private Register( )
+ protected Register( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/RegisterDataElement.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -22,8 +22,9 @@
package org.surveyforge.core.metadata;
import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
+import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
import org.surveyforge.core.survey.Question;
@@ -37,18 +38,19 @@
// TODO: Improve javadocs
public class RegisterDataElement extends DataElement
{
- private static final long serialVersionUID = -8986375207717119033L;
+ private static final long serialVersionUID = -8986375207717119033L;
/** The context data element describes the basic properties of the register data element. */
- @ManyToOne
- @JoinColumn(name = "conceptualDataElement")
- private ConceptualDataElement conceptualDataElement;
+ @OneToOne(fetch = FetchType.LAZY)
+ private ConceptualDataElement conceptualDataElement = null;
/** */
- private boolean optional;
+ private boolean optional = true;
/** */
@ManyToOne(optional = true)
private Question question;
+ protected RegisterDataElement( )
+ {};
/**
* Creates a new instance of ConceptualDataElement linked with a {@link ConceptualDataElement}.
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -90,7 +90,7 @@
private List<ObjectVariable> objectVariables = new ArrayList<ObjectVariable>( );
- private StatisticalObjectType( )
+ protected StatisticalObjectType( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValidationRule.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValidationRule.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValidationRule.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -58,7 +58,7 @@
@JoinColumn(name = "register_id", insertable = false, updatable = false)
private Register register;
- public ValidationRule( )
+ protected ValidationRule( )
{}
// TODO hashcode + equals
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -53,7 +53,7 @@
@javax.persistence.Version
private int lockingVersion;
- public ValueDomain( )
+ protected ValueDomain( )
{}
public abstract boolean isValid( Serializable data );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/VariableFamily.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/VariableFamily.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/VariableFamily.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -75,7 +75,7 @@
@JoinColumn(name = "variableFamily_id", nullable = false)
private List<GlobalVariable> globalVariables = new ArrayList<GlobalVariable>( );
- private VariableFamily( )
+ protected VariableFamily( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -41,6 +41,9 @@
private Level level;
private boolean sublevelsAllowed = true;
+ protected ClassificationValueDomain( )
+ {};
+
public ClassificationValueDomain( Level level )
{
this( level, true );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -35,6 +35,9 @@
{
private static final long serialVersionUID = 2066579378848047283L;
+ protected LogicalValueDomain( )
+ {}
+
public boolean isValid( Serializable object )
{
return (Boolean.class.isInstance( object ));
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -42,6 +42,10 @@
private BigDecimal minimum = BigDecimal.valueOf( Integer.MIN_VALUE );
private BigDecimal maximum = BigDecimal.valueOf( Integer.MAX_VALUE ); ;
+
+ protected QuantityValueDomain( )
+ {}
+
/**
*
*/
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -38,6 +38,9 @@
private int minLength = 0;
private int maxLength = Integer.MAX_VALUE;
+ protected StringValueDomain( )
+ {};
+
public StringValueDomain( int minLength, int maxLength )
{
this.setMinLength( minLength );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Feed.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Feed.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Feed.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -58,10 +58,8 @@
@ManyToOne
private QuestionnaireElement firstElement;
- private Feed( )
- {
- // TODO Auto-generated constructor stub
- }
+ protected Feed( )
+ {}
public Feed( QuestionnaireElement firstElement )
{
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Question.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -80,11 +80,11 @@
/** A question referring to a complex fact can be divided in a number of sub questions. */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "subQuestionsIndex")
- @JoinColumn(name = "upperQuestion_id", nullable = false)
+ @JoinColumn(name = "upperQuestion_id")
private List<Question> subQuestions = new ArrayList<Question>( );
- private Question( )
+ protected Question( )
{}
/**
@@ -99,6 +99,20 @@
}
/**
+ * Creates a new Question with an identifier and a text.
+ *
+ * @param identifier The identifier of this Question.
+ * @param text The text of this question
+ * @throws NullPointerException if the identifier or the question are <code>null</code>.
+ */
+ public Question( String identifier, String text )
+ {
+ this( identifier );
+ this.setText( text );
+ }
+
+
+ /**
* Returns the identifier of the classification.
*
* @return Returns the identifier.
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Questionnaire.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -38,6 +38,9 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.IndexColumn;
import org.surveyforge.core.metadata.Register;
@@ -50,6 +53,7 @@
* @author jsegura
*/
@Entity
+@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "study_id"})})
public class Questionnaire implements Serializable
{
private static final long serialVersionUID = 6844066269698434310L;
@@ -69,7 +73,7 @@
* A questionnaire is identified by an identifier, which is unique in the context of a statistical activity. It may typically be an
* abbreviation of its title or a systematic number.
*/
- @Column(unique = true, nullable = false, length = 50)
+ @Column(nullable = false, length = 50)
private String identifier;
/** A questionnaire has a title as provided by the owner or maintenance unit. */
@Column(length = 250)
@@ -88,12 +92,13 @@
/** A questionnaire may have its content organized in pages. */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "pageIndex")
- @JoinColumn(name = "questionnaire_id", nullable = false)
+ //@JoinColumn(name = "questionnaire_page_id")
+ @JoinColumn(name = "questionnaire_page_id", nullable = false)
private List<Feed> pageFeeds = new ArrayList<Feed>( );
/** A questionnaire may have its content organized in sections. */
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@IndexColumn(name = "sectionIndex")
- @JoinColumn(name = "questionnaire_id", nullable = false)
+ @JoinColumn(name = "questionnaire_section_id", nullable = false)
private List<SectionFeed> sectionFeeds = new ArrayList<SectionFeed>( );
/** A questionnaire corresponds logically to a register, which describes the content of the data collection. */
@@ -106,7 +111,7 @@
private Study study;
- private Questionnaire( )
+ protected Questionnaire( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/QuestionnaireElement.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -26,10 +26,15 @@
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+
import org.hibernate.annotations.GenericGenerator;
import org.surveyforge.core.metadata.RegisterDataElement;
@@ -41,6 +46,7 @@
* @author jsegura
*/
@Entity
+@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"identifier", "questionnaire_id"})})
public class QuestionnaireElement implements Serializable
{
private static final long serialVersionUID = 0L;
@@ -64,18 +70,17 @@
@JoinColumn(name = "question_id", insertable = false, updatable = false)
private Question question = null;
/** A questionnaire element have a {@link RegisterDataElement} to have the info of the data. */
- @ManyToOne(optional = false)
- @JoinColumn(name = "registerDataElement_id", insertable = false, updatable = false)
+ @OneToOne(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
private RegisterDataElement registerDataElement;
/** Default answer if the question is not applicable. */
- @Column(nullable = false, length = 50)
+ @Column(length = 50)
private String defaultNotApplicable = "";
/** Default answer if the question is not answered. */
- @Column(nullable = false, length = 50)
+ @Column(length = 50)
private String defaultNotAnswered = "";
- private QuestionnaireElement( )
+ protected QuestionnaireElement( )
{}
/**
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/SectionFeed.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/SectionFeed.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/SectionFeed.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -40,6 +40,9 @@
@ManyToOne(cascade = {CascadeType.ALL})
private InternationalizedString title = new InternationalizedString( );
+ protected SectionFeed( )
+ {};
+
public SectionFeed( QuestionnaireElement firstElement )
{
this( firstElement, null );
Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Study.java
===================================================================
--- trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Study.java 2006-08-08 11:47:16 UTC (rev 46)
+++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/survey/Study.java 2006-08-31 12:55:46 UTC (rev 47)
@@ -83,8 +83,7 @@
@JoinColumn(name = "study_id", nullable = false)
private List<Questionnaire> questionnaires = new ArrayList<Questionnaire>( );
- /* TODO : elaborate on keywords? */
- private Study( )
+ protected Study( )
{}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jg...@us...> - 2006-08-08 11:47:28
|
Revision: 46 Author: jgongo Date: 2006-08-08 04:47:16 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/surveyforge/?rev=46&view=rev Log Message: ----------- LogicalDomainValue moved to domain package Modified Paths: -------------- trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionnaireElementTest.java Modified: trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionnaireElementTest.java =================================================================== --- trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionnaireElementTest.java 2006-08-08 11:46:32 UTC (rev 45) +++ trunk/surveyforge-core/src/test/java/org/surveyforge/core/survey/QuestionnaireElementTest.java 2006-08-08 11:47:16 UTC (rev 46) @@ -24,8 +24,8 @@ import java.lang.reflect.Method; import org.surveyforge.core.metadata.ConceptualDataElement; -import org.surveyforge.core.metadata.LogicalValueDomain; import org.surveyforge.core.metadata.RegisterDataElement; +import org.surveyforge.core.metadata.domain.LogicalValueDomain; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.ExpectedExceptions; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jg...@us...> - 2006-08-08 11:46:45
|
Revision: 45 Author: jgongo Date: 2006-08-08 04:46:32 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/surveyforge/?rev=45&view=rev Log Message: ----------- Moved to domain package Removed Paths: ------------- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/LogicalValueDomain.java Deleted: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/LogicalValueDomain.java =================================================================== --- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/LogicalValueDomain.java 2006-08-08 08:37:09 UTC (rev 44) +++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/LogicalValueDomain.java 2006-08-08 11:46:32 UTC (rev 45) @@ -1,52 +0,0 @@ -/* - * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/ - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to - * the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA - * - * $Id$ - */ -package org.surveyforge.core.metadata; - -import java.io.Serializable; - -/** - * @author jsegura - */ - -public class LogicalValueDomain extends ValueDomain - { - private static final long serialVersionUID = 2066579378848047283L; - - // @Id - // @Column(length = 50) - // @GeneratedValue(generator = "system-uuid") - // @GenericGenerator(name = "system-uuid", strategy = "uuid") - // private String id; - // /** Version for optimistic locking. */ - // @javax.persistence.Version - // private int lockingVersion; - - public boolean isValid( Serializable object ) - { - return (Boolean.class.isInstance( object )); - } -// -// public LogicalValueDomain clone( ) -// { -// return (LogicalValueDomain) super.clone( ); -// } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jg...@us...> - 2006-08-08 08:37:15
|
Revision: 44 Author: jgongo Date: 2006-08-08 01:37:09 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/surveyforge/?rev=44&view=rev Log Message: ----------- A few more classes added Modified Paths: -------------- trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml Modified: trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml =================================================================== --- trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml 2006-08-08 08:34:17 UTC (rev 43) +++ trunk/surveyforge-db/src/main/resources/hibernate.cfg.xml 2006-08-08 08:37:09 UTC (rev 44) @@ -28,6 +28,8 @@ <mapping class="org.surveyforge.core.survey.Study" /> <mapping class="org.surveyforge.core.survey.Questionnaire" /> <mapping class="org.surveyforge.core.survey.Question" /> + <mapping class="org.surveyforge.core.survey.Feed" /> + <mapping class="org.surveyforge.core.survey.SectionFeed" /> <!-- package org.surveyforge.core.metadata --> <mapping class="org.surveyforge.core.metadata.ValidationRule" /> @@ -40,6 +42,10 @@ <mapping class="org.surveyforge.core.metadata.GlobalVariable" /> <mapping class="org.surveyforge.core.metadata.VariableFamily" /> <mapping class="org.surveyforge.core.metadata.StatisticalObjectType" /> + <mapping class="org.surveyforge.core.metadata.domain.ClassificationValueDomain" /> + <mapping class="org.surveyforge.core.metadata.domain.LogicalValueDomain" /> + <mapping class="org.surveyforge.core.metadata.domain.QuantityValueDomain" /> + <mapping class="org.surveyforge.core.metadata.domain.StringValueDomain" /> <!-- package org.surveyforge.core.data --> <mapping class="org.surveyforge.core.data.RegisterData" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jg...@us...> - 2006-08-08 08:34:35
|
Revision: 43 Author: jgongo Date: 2006-08-08 01:34:17 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/surveyforge/?rev=43&view=rev Log Message: ----------- Initial set of value domain classes Modified Paths: -------------- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java Added Paths: ----------- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java Modified: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java =================================================================== --- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-08-07 12:59:49 UTC (rev 42) +++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/ValueDomain.java 2006-08-08 08:34:17 UTC (rev 43) @@ -27,6 +27,8 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; import org.hibernate.annotations.GenericGenerator; @@ -35,6 +37,7 @@ * @author jsegura */ @Entity +@Inheritance(strategy = InheritanceType.JOINED) public abstract class ValueDomain implements Serializable, Cloneable { private static final long serialVersionUID = -83487445078388347L; Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java =================================================================== --- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java (rev 0) +++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java 2006-08-08 08:34:17 UTC (rev 43) @@ -0,0 +1,96 @@ +/* + * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/ + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to + * the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * $Id$ + */ +package org.surveyforge.core.metadata.domain; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.ManyToOne; + +import org.surveyforge.classification.Level; +import org.surveyforge.core.metadata.ValueDomain; + +/** + * @author jgonzalez + */ +@Entity +public class ClassificationValueDomain extends ValueDomain + { + private static final long serialVersionUID = 2295375925240989153L; + + @ManyToOne + private Level level; + private boolean sublevelsAllowed = true; + + public ClassificationValueDomain( Level level ) + { + this( level, true ); + } + + public ClassificationValueDomain( Level level, boolean sublevelsAllowed ) + { + this.setLevel( level ); + this.setSublevelsAllowed( sublevelsAllowed ); + } + + public Level getLevel( ) + { + return this.level; + } + + public void setLevel( Level level ) + { + if( level != null ) + this.level = level; + else + throw new NullPointerException( ); + } + + public boolean isSublevelsAllowed( ) + { + return this.sublevelsAllowed; + } + + public void setSublevelsAllowed( boolean sublevelsAllowed ) + { + this.sublevelsAllowed = sublevelsAllowed; + } + + @Override + public boolean isValid( Serializable object ) + { + if( object instanceof String ) + { + String code = (String) object; + return this.getLevel( ).isIncludedInLevel( code, this.isSublevelsAllowed( ) ); + } + else + return false; + } + + @Override + public ClassificationValueDomain clone( ) + { + ClassificationValueDomain copy = (ClassificationValueDomain) super.clone( ); + return copy; + } + } Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/ClassificationValueDomain.java ___________________________________________________________________ Name: svn:keywords + Date Revision Author HeadURL Id Copied: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java (from rev 38, trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/LogicalValueDomain.java) =================================================================== --- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java (rev 0) +++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/LogicalValueDomain.java 2006-08-08 08:34:17 UTC (rev 43) @@ -0,0 +1,48 @@ +/* + * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/ + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to + * the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * $Id$ + */ +package org.surveyforge.core.metadata.domain; + +import java.io.Serializable; + +import javax.persistence.Entity; + +import org.surveyforge.core.metadata.ValueDomain; + +/** + * @author jsegura + */ +@Entity +public class LogicalValueDomain extends ValueDomain + { + private static final long serialVersionUID = 2066579378848047283L; + + public boolean isValid( Serializable object ) + { + return (Boolean.class.isInstance( object )); + } + + @Override + public LogicalValueDomain clone( ) + { + return (LogicalValueDomain) super.clone( ); + } + } Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java =================================================================== --- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java (rev 0) +++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java 2006-08-08 08:34:17 UTC (rev 43) @@ -0,0 +1,150 @@ +/* + * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/ + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to + * the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * $Id$ + */ +package org.surveyforge.core.metadata.domain; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Entity; + +import org.surveyforge.core.metadata.ValueDomain; + +/** + * @author jgonzalez + */ +@Entity +public class QuantityValueDomain extends ValueDomain + { + private static final long serialVersionUID = 475119088217988415L; + + private int precision = 1; + private int scale; + + private BigDecimal minimum = BigDecimal.valueOf( Integer.MIN_VALUE ); + private BigDecimal maximum = BigDecimal.valueOf( Integer.MAX_VALUE ); ; + + /** + * + */ + public QuantityValueDomain( int precision, int scale ) + { + this.setPrecision( precision ); + this.setScale( scale ); + } + + /** + * @return Returns the precision. + */ + public int getPrecision( ) + { + return precision; + } + + /** + * @param precision The precision to set. + */ + public void setPrecision( int precision ) + { + if( precision > 0 && precision >= this.getScale( ) ) + this.precision = precision; + else + throw new IllegalArgumentException( ); + } + + /** + * @return Returns the scale. + */ + public int getScale( ) + { + return scale; + } + + /** + * @param scale The scale to set. + */ + public void setScale( int scale ) + { + if( scale >= 0 && scale <= this.getPrecision( ) ) + this.scale = scale; + else + throw new IllegalArgumentException( ); + } + + /** + * @return Returns the minimum. + */ + public BigDecimal getMinimum( ) + { + return this.minimum; + } + + /** + * @param minimum The minimum to set. + */ + public void setMinimum( BigDecimal minimum ) + { + if( minimum.compareTo( this.getMaximum( ) ) < 0 ) + this.minimum = minimum; + else + throw new IllegalArgumentException( ); + } + + /** + * @return Returns the maximum. + */ + public BigDecimal getMaximum( ) + { + return this.maximum; + } + + /** + * @param maximum The maximum to set. + */ + public void setMaximum( BigDecimal maximum ) + { + if( this.getMinimum( ).compareTo( maximum ) < 0 ) + this.maximum = maximum; + else + throw new IllegalArgumentException( ); + } + + @Override + public boolean isValid( Serializable object ) + { + if( object instanceof BigDecimal ) + { + BigDecimal quantity = (BigDecimal) object; + return quantity.scale( ) <= this.getScale( ) + && (quantity.precision( ) - quantity.scale( )) <= (this.getPrecision( ) - this.getScale( )) + && this.getMinimum( ).compareTo( quantity ) <= 0 && quantity.compareTo( this.getMaximum( ) ) <= 0; + } + else + return false; + } + + @Override + public QuantityValueDomain clone( ) + { + QuantityValueDomain copy = (QuantityValueDomain) super.clone( ); + return copy; + } + } Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/QuantityValueDomain.java ___________________________________________________________________ Name: svn:keywords + Date Revision Author HeadURL Id Added: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java =================================================================== --- trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java (rev 0) +++ trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java 2006-08-08 08:34:17 UTC (rev 43) @@ -0,0 +1,91 @@ +/* + * surveyforge-core - Copyright (C) 2006 OPEN input - http://www.openinput.com/ + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to + * the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * $Id$ + */ +package org.surveyforge.core.metadata.domain; + +import java.io.Serializable; + +import javax.persistence.Entity; + +import org.surveyforge.core.metadata.ValueDomain; + +/** + * @author jgonzalez + */ +@Entity +public class StringValueDomain extends ValueDomain + { + private static final long serialVersionUID = -5056062679246063821L; + + private int minLength = 0; + private int maxLength = Integer.MAX_VALUE; + + public StringValueDomain( int minLength, int maxLength ) + { + this.setMinLength( minLength ); + this.setMaxLength( maxLength ); + } + + public int getMinLength( ) + { + return this.minLength; + } + + public void setMinLength( int minLength ) + { + if( minLength >= 0 && minLength <= this.getMaxLength( ) ) + this.minLength = minLength; + else + throw new IllegalArgumentException( ); + } + + public int getMaxLength( ) + { + return this.maxLength; + } + + public void setMaxLength( int maxLength ) + { + if( maxLength > 0 && maxLength >= this.getMinLength( ) ) + this.maxLength = maxLength; + else + throw new IllegalArgumentException( ); + } + + @Override + public boolean isValid( Serializable object ) + { + if( object instanceof String ) + { + String string = (String) object; + return this.getMinLength( ) <= string.length( ) && string.length( ) <= this.getMaxLength( ); + } + else + return false; + } + + @Override + public StringValueDomain clone( ) + { + StringValueDomain copy = (StringValueDomain) super.clone( ); + return copy; + } + } Property changes on: trunk/surveyforge-core/src/main/java/org/surveyforge/core/metadata/domain/StringValueDomain.java ___________________________________________________________________ Name: svn:keywords + Date Revision Author HeadURL Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <jg...@us...> - 2006-08-07 12:59:57
|
Revision: 42 Author: jgongo Date: 2006-08-07 05:59:49 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/surveyforge/?rev=42&view=rev Log Message: ----------- Added default toString implementation Modified Paths: -------------- trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java Modified: trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java =================================================================== --- trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java 2006-08-07 12:59:18 UTC (rev 41) +++ trunk/surveyforge-classification/src/main/java/org/surveyforge/classification/Item.java 2006-08-07 12:59:49 UTC (rev 42) @@ -126,6 +126,7 @@ // TODO: Index entries // TODO: Classification translations - Solved for the moment, we should change the way to access the strings to provide proper // control of languages + // TODO: Check for duplicated codes in constructors /** Constructor provided for persistence engine. */ private Item( ) @@ -481,4 +482,10 @@ { return this.getVersion( ).hashCode( ) ^ this.getCode( ).hashCode( ); } + + @Override + public String toString( ) + { + return this.getOficialTitle( ); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |