use of org.akaza.openclinica.web.pform.widget.Widget in project OpenClinica by OpenClinica.
the class OpenRosaXmlGenerator method setSectionWidget.
/**
* @param section
* @param crfVersion
* @param sectionExpression
* @param bindList
* @param factory
* @param singleSection
*/
private void setSectionWidget(SectionBean section, CRFVersionBean crfVersion, String sectionExpression, ArrayList<Bind> bindList, WidgetFactory factory, Group singleSection) {
Widget sectionWidget = factory.getSectionWidget(section, crfVersion, sectionExpression);
bindList.add(sectionWidget.getBinding());
if (section.getTitle() != null && !section.getTitle().equals("")) {
Label sectionLabel = new Label();
sectionLabel.setLabel(section.getTitle());
singleSection.setLabel(sectionLabel);
}
singleSection.setGroup(new ArrayList<Group>());
Widget subtitle = factory.getSectionTextWidget(crfVersion.getOid(), WidgetFactory.SECTION_TEXT_TYPE_SUBTITLE, section);
Widget instructions = factory.getSectionTextWidget(crfVersion.getOid(), WidgetFactory.SECTION_TEXT_TYPE_INSTRUCTIONS, section);
if (subtitle != null) {
singleSection.getUsercontrol().add(subtitle.getUserControl());
bindList.add(subtitle.getBinding());
}
if (instructions != null) {
singleSection.getUsercontrol().add(instructions.getUserControl());
bindList.add(instructions.getBinding());
}
}
use of org.akaza.openclinica.web.pform.widget.Widget in project OpenClinica by OpenClinica.
the class OpenRosaXmlGenerator method setGroupWidget.
/**
* @param section
* @param crfVersion
* @param groupExpression
* @param bindList
* @param factory
* @param itemGroupBean
* @param group
* @param repeat
* @param isGroupRepeating
* @param groupHeader
*/
private void setGroupWidget(SectionBean section, CRFVersionBean crfVersion, String groupExpression, ArrayList<Bind> bindList, WidgetFactory factory, ItemGroupBean itemGroupBean, Group group, Repeat repeat, boolean isGroupRepeating, Label groupHeader) {
Widget groupWidget = factory.getGroupWidget(itemGroupBean, crfVersion, groupExpression);
bindList.add(groupWidget.getBinding());
if (groupWidget != null) {
if (isGroupRepeating) {
repeat.setLabel(groupHeader);
} else {
group.setLabel(groupHeader);
}
}
}
use of org.akaza.openclinica.web.pform.widget.Widget in project OpenClinica by OpenClinica.
the class OpenRosaXmlGenerator method setItemWidget.
/**
* @param item
* @param responseTypeId
* @param itemFormMetadataBean
* @param itemGroupBean
* @param bindList
* @param factory
* @param isGroupRepeating
* @param repeat
* @param group
* @param isItemRequired
* @param responseLayout
* @param itemExpression
*/
private void setItemWidget(ItemBean item, int responseTypeId, ItemFormMetadataBean itemFormMetadataBean, ItemGroupBean itemGroupBean, ArrayList<Bind> bindList, WidgetFactory factory, boolean isGroupRepeating, Repeat repeat, Group group, boolean isItemRequired, String responseLayout, String itemExpression) {
Widget widget = factory.getItemWidget(item, responseTypeId, itemGroupBean, itemFormMetadataBean, isItemRequired, responseLayout, itemExpression);
if (widget != null) {
bindList.add(widget.getBinding());
if (isGroupRepeating) {
repeat.getUsercontrol().add(widget.getUserControl());
group.setRepeat(repeat);
} else {
group.getUsercontrol().add(widget.getUserControl());
}
} else {
log.debug("Unsupported datatype encountered while loading PForm (" + item.getDataType().getName() + "). Skipping.");
}
}