Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
iperdomo committed Jul 14, 2014
2 parents 675aef2 + 45d72dd commit c07c8b5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
3 changes: 2 additions & 1 deletion GAE/src/com/gallatinsystems/common/Constants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2012 Stichting Akvo (Akvo Foundation)
* Copyright (C) 2010-2014 Stichting Akvo (Akvo Foundation)
*
* This file is part of Akvo FLOW.
*
Expand All @@ -26,5 +26,6 @@ public class Constants {
"createdDateTime", "lastUpdateDateTime", "lastUpdateUserId",
"createUserId"
};
public final static int MAX_LENGTH = 500;

}
23 changes: 20 additions & 3 deletions GAE/src/com/gallatinsystems/surveyal/domain/SurveyalValue.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2012 Stichting Akvo (Akvo Foundation)
* Copyright (C) 2010-2014 Stichting Akvo (Akvo Foundation)
*
* This file is part of Akvo FLOW.
*
Expand All @@ -20,7 +20,9 @@

import javax.jdo.annotations.PersistenceCapable;

import com.gallatinsystems.common.Constants;
import com.gallatinsystems.framework.domain.BaseDomain;
import com.google.appengine.api.datastore.Text;

/**
* domain structure to represent the value of an surveyed metric for one surveyed locale at a given
Expand Down Expand Up @@ -54,6 +56,7 @@ public class SurveyalValue extends BaseDomain {
private Double score;
private String valueType;
private String stringValue;
private Text stringValueText;
private Double numericValue;
private String organization;
private String countryCode;
Expand Down Expand Up @@ -252,11 +255,25 @@ public void setValueType(String valueType) {
}

public String getStringValue() {
return stringValue;
if (stringValue != null) {
return stringValue;
}

if (stringValueText != null) {
return stringValueText.getValue();
}

return null;
}

public void setStringValue(String stringValue) {
this.stringValue = stringValue;
if (stringValue != null && stringValue.length() > Constants.MAX_LENGTH) {
this.stringValue = null;
this.stringValueText = new Text(stringValue);
} else {
this.stringValue = stringValue;
this.stringValueText = null;
}
}

public Double getNumericValue() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2012 Stichting Akvo (Akvo Foundation)
* Copyright (C) 2010-2014 Stichting Akvo (Akvo Foundation)
*
* This file is part of Akvo FLOW.
*
Expand All @@ -23,13 +23,13 @@
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

import com.gallatinsystems.common.Constants;
import com.gallatinsystems.framework.domain.BaseDomain;
import com.google.appengine.api.datastore.Text;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class QuestionAnswerStore extends BaseDomain {
private static final long serialVersionUID = 3726562582080475960L;
private static final int MAX_LENGTH = 500;

@Persistent
private Long arbitratyNumber;
Expand Down Expand Up @@ -120,7 +120,7 @@ public String getValue() {
public void setValue(String value) {
// Explicitly set the non used property to null
// to avoid problems when reading the value
if (value != null && value.length() > MAX_LENGTH) {
if (value != null && value.length() > Constants.MAX_LENGTH) {
this.value = null;
this.valueText = new Text(value);
} else {
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Read more about the [Akvo Platform](http://www.akvo.org/blog/?p=4822).

Akvo FLOW Dashboard release notes
----
#1.7.0.2

## Resolved issues

* Survey response values longer than 500 characters cannot be stored [#656]

#1.7.0.1

## Resolved issues
Expand Down

0 comments on commit c07c8b5

Please sign in to comment.