protected UIDisplayObject uiDisplayObject = null;
public UIFieldInfo(GenericValue uiScreenSectionInfoGV,
GenericDelegator delegator, UICache uiCache)
throws GenericEntityException {
UtilTimer timer = new UtilTimer();
if (TIMER) {
timer.timerString(1, "[UIFieldInfo.UIFieldInfo] Start");
}
setSectionId(uiScreenSectionInfoGV.getString("sectionId"));
setPartyId(uiScreenSectionInfoGV.getString("partyId"));
setAttributeId(uiScreenSectionInfoGV.getString("attributeId"));
setDisplayObjectId(uiScreenSectionInfoGV.getString("displayObjectId"));
setMaxLength(uiScreenSectionInfoGV.getString("maxLength"));
setIsMandatory(uiScreenSectionInfoGV.getString("isMandatory"));
setIsReadOnly(uiScreenSectionInfoGV.getString("isReadOnly"));
setIsVisible(uiScreenSectionInfoGV.getString("isVisible"));
setIsSearchable(uiScreenSectionInfoGV.getString("isSearchable"));
setDisplayOrder(uiScreenSectionInfoGV.getString("displayOrder"));
setDisplayLabel(uiScreenSectionInfoGV.getString("displayLabel"));
setDisplayLength(uiScreenSectionInfoGV.getString("displayLength"));
setColSpan(uiScreenSectionInfoGV.getString("colSpan"));
setRowSpan(uiScreenSectionInfoGV.getString("rowSpan"));
setStartOnNewRow(uiScreenSectionInfoGV.getString("startOnNewRow"));
// Get the UIDisplayObject.
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Looking for UIDisplayObject in cache.");
}
String displayObjectId = getDisplayObjectId();
UIDisplayObject uiDisplayObject = uiCache.getUiDisplayObject(displayObjectId);
if (uiDisplayObject == null) {
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] UIDisplayObject not found in cache. Creating a new one.");
}
uiDisplayObject = new UIDisplayObject(displayObjectId, delegator);
uiCache.putUiDisplayObject(displayObjectId, uiDisplayObject);
} else {
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Found UIDisplayObject in cache.");
}
}
setUiDisplayObject(uiDisplayObject);
if (TIMER) {
timer.timerString(2, "[UIFieldInfo.UIFieldInfo] Got UIDisplayObject");
}
// Get the UIAttribute object.
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Looking for UIAttribute " +
attributeId + " in cache.");
}
String attributeId = getAttributeId();
UIAttribute uiAttribute = uiCache.getUiAttribute(attributeId);
if (uiAttribute == null) {
throw new GenericEntityException("Attribute " + attributeId +
" does not appear in any of the entities for this screen section.");
} else {
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Found UIAttribute in cache.");
}
}
setUiAttribute(uiAttribute);
if (TIMER) {
timer.timerString(2, "[UIFieldInfo.UIFieldInfo] Got UIAttribute");
}
// Get the UIScreenSectionEntity object.
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Looking for UIScreenSectionEntity in cache.");
}
String sectionId = getSectionId();
String entityId = getUiAttribute().getEntityId();
UIScreenSectionEntity uiScreenSectionEntity = uiCache.getUiScreenSectionEntity(sectionId,
entityId);
if (uiScreenSectionEntity == null) {
throw new GenericEntityException("Attribute '" +
getUiAttribute().getAttributeName() +
"' does not appear in any of the entities for this screen section.");
} else {
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Found UIScreenSectionEntity in cache.");
}
}
setUiScreenSectionEntity(uiScreenSectionEntity);
if (TIMER) {
timer.timerString(2,
"[UIFieldInfo.UIFieldInfo] Got UIScreenSectionEntity");
}
if (TIMER) {
timer.timerString(1, "[UIFieldInfo.UIFieldInfo] End");
}
}