Commit 349ed645 authored by rahadi's avatar rahadi

Added external intent handlers

parent d542b9ff
......@@ -17,7 +17,8 @@ import java.util.List;
import id.ac.stis.capi.R;
import id.ac.stis.capi.collectiva.preferences.Constants;
import id.ac.stis.capi.lessthink.fragments.FormEntryDialogFragment;
import id.ac.stis.capi.lessthink.listeners.OnAddButtonClickListener;
import id.ac.stis.capi.lessthink.fragments.FormEntryRVDialogFragment;
import id.ac.stis.capi.lessthink.listeners.OnTableAddButtonClickListener;
import id.ac.stis.capi.lessthink.models.FormLabels;
import id.ac.stis.capi.lessthink.models.InstanceValues;
import id.ac.stis.capi.lessthink.utils.XmlUtils;
......@@ -31,6 +32,7 @@ import id.ac.stis.capi.odk.dto.Instance;
import id.ac.stis.capi.odk.provider.FormsProviderAPI;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.utilities.ApplicationConstants;
import timber.log.Timber;
public class ListingInstanceActivity extends AppCompatActivity {
......@@ -41,7 +43,8 @@ public class ListingInstanceActivity extends AppCompatActivity {
private TableRowView tableRowView;
private TableFooterView tableFooterView;
private String formId, formName;
private FormEntryDialogFragment entryDialogFragment;
// private FormEntryDialogFragment entryDialogFragment;
private FormEntryRVDialogFragment entryDialogFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -91,7 +94,9 @@ public class ListingInstanceActivity extends AppCompatActivity {
// Toast.makeText(ListingInstanceActivity.this, "Click : " + view.getTag(), Toast.LENGTH_LONG).show();
String instanceUuid = view.getTag().toString();
entryDialogFragment = FormEntryDialogFragment.newInstance(instanceUuid,
// entryDialogFragment = FormEntryDialogFragment.newInstance(instanceUuid,
// FormEntryDialogFragment.MODE_EDIT, false);
entryDialogFragment = FormEntryRVDialogFragment.newInstance(instanceUuid,
FormEntryDialogFragment.MODE_EDIT, false);
entryDialogFragment.show(getSupportFragmentManager(), instanceUuid);
//
......@@ -101,7 +106,7 @@ public class ListingInstanceActivity extends AppCompatActivity {
}
});
tableFooterView.setOnAddButtonClickListener(new OnAddButtonClickListener() {
tableFooterView.setOnTableAddButtonClickListener(new OnTableAddButtonClickListener() {
@Override
public void onAddButtonClick(View v) {
fillBlankForm();
......@@ -109,6 +114,14 @@ public class ListingInstanceActivity extends AppCompatActivity {
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, final Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
Timber.d("Activity Result : %s %s", requestCode, resultCode);
entryDialogFragment.onActivityResult(requestCode, resultCode, intent);
}
//todo: update yow
private void fillBlankForm() {
Cursor formslist = new FormsDao().getFormsCursor();
......
package id.ac.stis.capi.lessthink.adapters;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import java.util.List;
import id.ac.stis.capi.lessthink.models.BaseHierarchy;
import timber.log.Timber;
/**
* Author : Rahadi Jalu
* Email : 14.8325@stis.ac.id
* Company: Politeknik Statistika STIS
*/
public class HierarchyRVAdapter extends RecyclerView.Adapter<HierarchyRVAdapter.ViewHolder> {
private List<BaseHierarchy> hierarchies;
public HierarchyRVAdapter(List<BaseHierarchy> hierarchies) {
this.hierarchies = hierarchies;
}
public void setHierarchies(List<BaseHierarchy> hierarchies) {
this.hierarchies = hierarchies;
}
public BaseHierarchy getItem(int position) {
return hierarchies.get(position);
}
@Override
public int getItemViewType(int position) {
return position;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
Timber.d("Creating with type %s", viewType);
// BaseHierarchy hierarchy = hierarchies.get(viewType);
// if (hierarchy instanceof PromptHierarchy) {
// ((PromptHierarchy) hierarchy).setOnChangeListener(onChangeListener);
// return new PromptViewHolder(hierarchy.getView());
// } else if (hierarchy instanceof CaptionHierarchy) {
// return new CaptionViewHolder(hierarchy.getView());
// } else {
// // Should not be happening
// return new ViewHolder(hierarchy.getView());
// }
return new ViewHolder(new LinearLayout(parent.getContext()));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
// if (holder instanceof PromptViewHolder) {
// PromptHierarchy hierarchy = (PromptHierarchy) hierarchies.get(position);
// }
holder.bind(hierarchies.get(position));
}
@Override
public int getItemCount() {
return hierarchies.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View itemView) {
super(itemView);
}
void bind(BaseHierarchy hierarchy) {
ViewGroup parent = (ViewGroup) itemView;
if (parent != null) {
parent.removeAllViews();
parent.addView(hierarchy.getView());
}
}
}
}
package id.ac.stis.capi.lessthink.listeners;
import android.view.View;
import org.javarosa.core.model.FormIndex;
/**
* Author : Rahadi Jalu
* Email : 14.8325@stis.ac.id
* Company: Politeknik Statistika STIS
*/
public interface OnButtonHierarchyClickListener {
void onButtonClick(View v, FormIndex formIndex, int type);
}
......@@ -7,6 +7,6 @@ import android.view.View;
* Email : 14.8325@stis.ac.id
* Company: Politeknik Statistika STIS
*/
public interface OnAddButtonClickListener {
public interface OnTableAddButtonClickListener {
void onAddButtonClick(View v);
}
package id.ac.stis.capi.lessthink.models;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import org.javarosa.core.model.FormIndex;
import id.ac.stis.capi.R;
import id.ac.stis.capi.lessthink.listeners.OnButtonHierarchyClickListener;
import id.ac.stis.capi.odk.application.Collect;
/**
* Author : Rahadi Jalu
* Email : 14.8325@stis.ac.id
* Company: Politeknik Statistika STIS
*/
public class ButtonHierarchy extends BaseHierarchy {
public static int TYPE_NEW_REPEAT = 31;
public static int TYPE_MULTIPLICITY = 32;
private Context context;
private View buttonView;
private TextView textView;
private int type, prevType;
private FormIndex formIndex;
private OnButtonHierarchyClickListener onButtonHierarchyClickListener;
public ButtonHierarchy(Context context, FormIndex formIndex, int type, int prevType, int level, int prevLevel) {
super(level, prevLevel);
this.type = type;
this.prevType = prevType;
this.formIndex = formIndex;
this.context = context;
this.textView = new TextView(context);
textView.setGravity(Gravity.CENTER);
if (getType() == TYPE_NEW_REPEAT) {
textView.setText(context.getResources().getString(R.string.add_another));
textView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_add, 0, 0, 0);
int[] attrs = new int[]{R.attr.selectableItemBackground /* index 0 */};
TypedArray ta = context.obtainStyledAttributes(attrs);
Drawable drawable = ta.getDrawable(0 /* index */);
ta.recycle();
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Collect.getQuestionFontsize() - 1);
textView.setPadding(15, 45, 15, 45);
textView.setTextColor(ContextCompat.getColor(context, R.color.white));
textView.setBackground(drawable);
} else if (getType() == TYPE_MULTIPLICITY) {
textView.setText(String.valueOf(formIndex.getElementMultiplicity() + 1));
textView.setTextColor(ContextCompat.getColor(context, R.color.primary_dark));
textView.setBackground(ContextCompat.getDrawable(context, R.drawable.wb_circle_btn));
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Collect.getQuestionFontsize() - 3);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
75, 75);
params.topMargin = 26;
params.bottomMargin = 15;
textView.setLayoutParams(params);
}
textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onButtonHierarchyClickListener != null) {
onButtonHierarchyClickListener.onButtonClick(v, ButtonHierarchy.this.formIndex,
getType());
}
}
});
createWidgetView();
}
public void setOnButtonHierarchyClickListener(OnButtonHierarchyClickListener onButtonHierarchyClickListener) {
this.onButtonHierarchyClickListener = onButtonHierarchyClickListener;
}
private void createWidgetView() {
RelativeLayout container = new RelativeLayout(context);
container.setBackgroundColor(ContextCompat.getColor(context, R.color.primary));
LinearLayout widgetContainer = new LinearLayout(context);
widgetContainer.setOrientation(LinearLayout.VERTICAL);
widgetContainer.setGravity(Gravity.CENTER);
widgetContainer.setBackgroundColor(ContextCompat.getColor(context, R.color.primary_dark));
widgetContainer.addView(textView);
RelativeLayout.LayoutParams widgetContainerParams = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
widgetContainerParams.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
widgetContainerParams.rightMargin = 14 * getLevel();
widgetContainerParams.leftMargin = 14 * getLevel();
widgetContainer.setLayoutParams(widgetContainerParams);
container.addView(widgetContainer);
if (getLevel() != getPrevLevel()) {
View shadowView;
View protector;
RelativeLayout.LayoutParams protectorParams;
View shadow;
RelativeLayout.LayoutParams shadowParams;
if (getLevel() > getPrevLevel()) {
shadowView = LayoutInflater.from(context).inflate(R.layout.view_shadow_protector, null);
shadow = shadowView.findViewById(R.id.shadow);
shadowParams = (RelativeLayout.LayoutParams) shadow.getLayoutParams();
shadowParams.rightMargin = 14 * getPrevLevel();
shadowParams.leftMargin = 14 * getPrevLevel();
protector = shadowView.findViewById(R.id.protector);
protectorParams = (RelativeLayout.LayoutParams) protector.getLayoutParams();
protectorParams.rightMargin = 14 * getLevel();
protectorParams.leftMargin = 14 * getLevel();
} else {
shadowView = LayoutInflater.from(context).inflate(R.layout.view_shadow_inverted_protector, null);
shadow = shadowView.findViewById(R.id.shadow);
shadowParams = (RelativeLayout.LayoutParams) shadow.getLayoutParams();
shadowParams.rightMargin = 14 * getLevel();
shadowParams.leftMargin = 14 * getLevel();
protector = shadowView.findViewById(R.id.protector);
protectorParams = (RelativeLayout.LayoutParams) protector.getLayoutParams();
protectorParams.rightMargin = 14 * getPrevLevel();
protectorParams.leftMargin = 14 * getPrevLevel();
}
shadowView.setBackgroundColor(ContextCompat.getColor(context, R.color.primary));
protector.setLayoutParams(protectorParams);
shadow.setLayoutParams(shadowParams);
container.addView(shadowView);
}
this.buttonView = container;
}
public View getText() {
return textView;
}
@Override
public View getView() {
return buttonView;
}
@Override
public int getType() {
return type;
}
@Override
public int getPrevType() {
return prevType;
}
}
package id.ac.stis.capi.lessthink.models;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.TypedValue;
import android.view.Gravity;
......@@ -28,8 +26,6 @@ public class CaptionHierarchy extends BaseHierarchy {
public static int TYPE_GROUP = 10;
public static int TYPE_REPEAT = 11;
public static int TYPE_MULTIPLICITY = 12;
public static int TYPE_NEW_REPEAT = 13;
private Context context;
private View captionView;
......@@ -46,43 +42,10 @@ public class CaptionHierarchy extends BaseHierarchy {
this.textView = new TextView(context);
textView.setGravity(Gravity.CENTER);
if (getType() == TYPE_MULTIPLICITY) {
textView.setText(String.valueOf(caption.getMultiplicity() + 1));
textView.setTextColor(ContextCompat.getColor(context, R.color.primary_dark));
textView.setBackground(ContextCompat.getDrawable(context, R.drawable.wb_circle_btn));
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Collect.getQuestionFontsize() - 3);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
75, 75);
params.topMargin = 26;
params.bottomMargin = 15;
textView.setLayoutParams(params);
} else if (getType() == TYPE_NEW_REPEAT) {
textView.setText(context.getResources().getString(R.string.add_another));
textView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_add, 0, 0, 0);
int[] attrs = new int[]{R.attr.selectableItemBackground /* index 0 */};
TypedArray ta = context.obtainStyledAttributes(attrs);
Drawable drawable = ta.getDrawable(0 /* index */);
ta.recycle();
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Collect.getQuestionFontsize() - 1);
textView.setPadding(15, 45, 15, 45);
textView.setTextColor(ContextCompat.getColor(context, R.color.white));
textView.setBackground(drawable);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
} else {
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Collect.getQuestionFontsize() - 1);
textView.setText(caption.getLongText());
textView.setTextColor(ContextCompat.getColor(context, R.color.white));
textView.setPadding(15, 20, 15, 20);
}
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Collect.getQuestionFontsize() - 1);
textView.setText(caption.getLongText());
textView.setTextColor(ContextCompat.getColor(context, R.color.white));
textView.setPadding(15, 20, 15, 20);
textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
createWidgetView();
......
......@@ -8,13 +8,12 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import org.javarosa.core.model.FormIndex;
import org.javarosa.core.model.data.IAnswerData;
import org.javarosa.form.api.FormEntryPrompt;
import java.io.InvalidObjectException;
import id.ac.stis.capi.R;
import id.ac.stis.capi.lessthink.listeners.OnChangeListener;
import id.ac.stis.capi.lessthink.utils.ViewUtils;
import id.ac.stis.capi.lessthink.views.HierarchyErrorView;
import id.ac.stis.capi.odk.widgets.QuestionWidget;
......@@ -161,6 +160,10 @@ public class PromptHierarchy extends BaseHierarchy {
return widgetView;
}
public IAnswerData getAnswer() {
return widget.getAnswer();
}
@Override
public int getType() {
return type;
......
......@@ -20,6 +20,7 @@ import java.io.InvalidObjectException;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Handler;
import id.ac.stis.capi.lessthink.interfaces.UpdatingErrorInterface;
import id.ac.stis.capi.lessthink.listeners.OnChangeListener;
......@@ -205,10 +206,10 @@ public class ViewUtils {
onChangeListener.onChange(qw, index);
}
if (qw instanceof StringWidget)
((StringWidget) qw).getEditText().requestFocus();
else if (qw instanceof ExStringWidget)
((ExStringWidget) qw).getEditText().requestFocus();
// if (qw instanceof StringWidget)
// ((StringWidget) qw).getEditText().requestFocus();
// else if (qw instanceof ExStringWidget)
// ((ExStringWidget) qw).getEditText().requestFocus();
}
}, DELAY);
}
......@@ -217,7 +218,7 @@ public class ViewUtils {
}
throw new InvalidObjectException("Nothing available to handle instance of " + qw.getClass().getSimpleName());
}
}
/**
* A wrapper for UpdatingErrorInterface.setError(message).
......
......@@ -15,7 +15,7 @@ import android.widget.TextView;
import android.widget.Toast;
import id.ac.stis.capi.R;
import id.ac.stis.capi.lessthink.listeners.OnAddButtonClickListener;
import id.ac.stis.capi.lessthink.listeners.OnTableAddButtonClickListener;
import id.ac.stis.capi.lessthink.listeners.OnFooterNavigationListener;
/**
......@@ -30,7 +30,7 @@ public class TableFooterView extends RelativeLayout implements View.OnClickListe
private LinearLayout pageIndicator, navigationWrapper;
private int textSize, componentColor, footerColor, currentPage, pageCount;
private OnFooterNavigationListener onFooterNavigationListener;
private OnAddButtonClickListener onAddButtonClickListener;
private OnTableAddButtonClickListener onTableAddButtonClickListener;
public TableFooterView(Context context, AttributeSet attrs) {
super(context, attrs);
......@@ -176,8 +176,8 @@ public class TableFooterView extends RelativeLayout implements View.OnClickListe
this.onFooterNavigationListener = onFooterNavigationListener;
}
public void setOnAddButtonClickListener(OnAddButtonClickListener onAddButtonClickListener) {
this.onAddButtonClickListener = onAddButtonClickListener;
public void setOnTableAddButtonClickListener(OnTableAddButtonClickListener onTableAddButtonClickListener) {
this.onTableAddButtonClickListener = onTableAddButtonClickListener;
}
public int getTextSize() {
......@@ -214,8 +214,8 @@ public class TableFooterView extends RelativeLayout implements View.OnClickListe
public void onClick(View view) {
switch (view.getId()) {
case R.id.footer_view_add_button:
if (onAddButtonClickListener != null) {
onAddButtonClickListener.onAddButtonClick(view);
if (onTableAddButtonClickListener != null) {
onTableAddButtonClickListener.onAddButtonClick(view);
} else {
Toast.makeText(getContext(), "Add Button is Not Implemented Yet", Toast.LENGTH_LONG).show();
}
......
......@@ -61,6 +61,7 @@ import id.ac.stis.capi.R;
import id.ac.stis.capi.collectiva.loader.ErrorHierarchy;
import id.ac.stis.capi.collectiva.preferences.CapiInstancePreferences;
import id.ac.stis.capi.lessthink.models.BaseHierarchy;
import id.ac.stis.capi.lessthink.models.ButtonHierarchy;
import id.ac.stis.capi.lessthink.models.CaptionHierarchy;
import id.ac.stis.capi.lessthink.models.PromptHierarchy;
import id.ac.stis.capi.odk.application.Collect;
......@@ -1028,11 +1029,10 @@ public class FormController {
case FormEntryController.EVENT_PROMPT_NEW_REPEAT:
// this would display the 'add new repeat' dialog
// ignore it.
FormEntryCaption fcRep = getCaptionPrompt();
prompts.add(new CaptionHierarchy(context, fcRep, CaptionHierarchy.TYPE_NEW_REPEAT,
prompts.add(new ButtonHierarchy(context, getFormIndex(), ButtonHierarchy.TYPE_NEW_REPEAT,
prevType, currLevel, prevLevel));
prevType = CaptionHierarchy.TYPE_NEW_REPEAT;
prevType = ButtonHierarchy.TYPE_NEW_REPEAT;
prevLevel = currLevel;
break;
case FormEntryController.EVENT_REPEAT:
......@@ -1054,7 +1054,7 @@ public class FormController {
prevType, currLevel, prevLevel));
}
prompts.add(new CaptionHierarchy(context, fc, CaptionHierarchy.TYPE_MULTIPLICITY,
prompts.add(new ButtonHierarchy(context, getFormIndex(), ButtonHierarchy.TYPE_MULTIPLICITY,
prevType, currLevel, prevLevel));
prevType = CaptionHierarchy.TYPE_REPEAT;
......@@ -1518,7 +1518,7 @@ public class FormController {
public ArrayList<FailedConstraint> saveAllScreenAnswers(LinkedHashMap<FormIndex, IAnswerData> answers,
boolean evaluateConstraints) throws JavaRosaException {
ArrayList<FailedConstraint> failedConstraints = new ArrayList<>();
if (currentPromptIsQuestion()) {
// if (currentPromptIsQuestion()) {
Iterator<FormIndex> it = answers.keySet().iterator();
while (it.hasNext()) {
FormIndex index = it.next();
......@@ -1547,8 +1547,8 @@ public class FormController {
if (failedConstraints.size() > 0) {
return failedConstraints;
}
return null;
}
// return null;
// }
return null;
}
......
/*
* Copyright (C) 2009 University of Washington
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
......@@ -35,22 +35,6 @@ import java.util.Locale;
*/
public class DecimalWidget extends StringWidget {
private Double getDoubleAnswerValue() {
IAnswerData dataHolder = formEntryPrompt.getAnswerValue();
Double d = null;
if (dataHolder != null) {
Object dataValue = dataHolder.getValue();
if (dataValue != null) {
if (dataValue instanceof Integer) {
d = Double.valueOf(((Integer) dataValue).intValue());
} else {
d = (Double) dataValue;
}
}
}
return d;
}
public DecimalWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOverride) {
super(context, prompt, readOnlyOverride, true);
......@@ -96,6 +80,21 @@ public class DecimalWidget extends StringWidget {
setupChangeListener();
}
private Double getDoubleAnswerValue() {
IAnswerData dataHolder = formEntryPrompt.getAnswerValue();
Double d = null;
if (dataHolder != null) {
Object dataValue = dataHolder.getValue();
if (dataValue != null) {
if (dataValue instanceof Integer) {
d = Double.valueOf(((Integer) dataValue).intValue());
} else {
d = (Double) dataValue;
}
}
}
return d;
}
@Override
public IAnswerData getAnswer() {
......
/*
* Copyright (C) 2009 University of Washington
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
......@@ -34,22 +34,6 @@ import java.util.Locale;
*/
public class IntegerWidget extends StringWidget {
private Integer getIntegerAnswerValue() {
IAnswerData dataHolder = formEntryPrompt.getAnswerValue();
Integer d = null;
if (dataHolder != null) {
Object dataValue = dataHolder.getValue();
if (dataValue != null) {
if (dataValue instanceof Double) {
d = Integer.valueOf(((Double) dataValue).intValue());
} else {
d = (Integer) dataValue;
}
}
}
return d;
}
public IntegerWidget(Context context, FormEntryPrompt prompt, boolean readOnlyOverride) {
super(context, prompt, readOnlyOverride, true);
......@@ -84,6 +68,21 @@ public class IntegerWidget extends StringWidget {
setupChangeListener();
}
private Integer getIntegerAnswerValue() {
IAnswerData dataHolder = formEntryPrompt.getAnswerValue();
Integer d = null;
if (dataHolder != null) {
Object dataValue = dataHolder.getValue();
if (dataValue != null) {