Debug.logVerbose( "-->[UIScreenSection.UIScreenSection] screenName: " + screenName, module);
Debug.logVerbose( "-->[UIScreenSection.UIScreenSection] sectionName: " + sectionName, module);
if (userInfo == null) {
throw new GenericEntityException(
"UserInfo passed in was null for UIScreenSection.");
} else {
setUserInfo(userInfo);
}
if (delegator == null) {
throw new GenericEntityException(
"GenericDelegator passed in was null for UIScreenSection.");
} else {
setDelegator(delegator);
}
if (screenName == null) {
throw new GenericEntityException(
"ScreenName passed in was null for UIScreenSection.");
}
if (sectionName == null) {
throw new GenericEntityException(
"SectionName passed in was null for UIScreenSection.");
}
// Get the uiScreen object.
if (TIMER) {
timer.timerString(1,
"[UIScreenSection.UIScreenSection] Looking for UIScreen in cache.");
}
UIScreen uiScreen = uiCache.getUiScreen(screenName);
if (uiScreen == null) {
if (TIMER) {
timer.timerString(1,
"[UIScreenSection.UIScreenSection] UIScreen not found in cache. Creating a new one.");
}
uiScreen = new UIScreen(screenName, delegator);
uiCache.putUiScreen(screenName, uiScreen);
} else {
if (TIMER) {
timer.timerString(1,
"[UIScreenSection.UIScreenSection] Found UIScreen in cache.");
}
}
setUiScreen(uiScreen);
if (TIMER) {
timer.timerString(1, "[UIScreenSection.UIScreenSection] Got screen");
}
// Get the uiScreenSection object.
HashMap findHashMap = new HashMap();
findHashMap.put("screenId", getUiScreen().getScreenId());
findHashMap.put("sectionName", sectionName);
List uiScreenSectionGVL = delegator.findByAnd("UiScreenSection",
findHashMap, null);
if (uiScreenSectionGVL.size() == 0) {
throw new GenericEntityException("No screen section with name \"" +
sectionName + "\" for screen \"" + screenName +
"\" was found in database.");
}
if (uiScreenSectionGVL.size() > 1) {
throw new GenericEntityException(
"More than one screen section found with name \"" +
sectionName + "\" for screen \"" + screenName + "\".");
}
Iterator uiScreenSectionGVI = uiScreenSectionGVL.iterator();
GenericValue uiScreenSectionGV = (GenericValue) uiScreenSectionGVI.next();
if (uiScreenSectionGV.get("layoutTypeId") == null) {
throw new GenericEntityException(
"Layout type not set for screen section \"" + sectionName +
"\".");
}
setSectionId(uiScreenSectionGV.getString("sectionId"));
setScreenId(uiScreenSectionGV.getString("screenId"));
setSectionName(uiScreenSectionGV.getString("sectionName"));
setSectionDescription(uiScreenSectionGV.getString("sectionDescription"));
setLayoutTypeId(uiScreenSectionGV.getString("layoutTypeId"));
setDisplayOrder(uiScreenSectionGV.getString("displayOrder"));
setColumnCount(uiScreenSectionGV.getString("columnCount"));
setRowCount(uiScreenSectionGV.getString("rowCount"));
setButtonKeys(uiScreenSectionGV.getString("buttonKeys"));
setTitleDef(uiScreenSectionGV.getString("titleDef"));
setSortDef(uiScreenSectionGV.getString("sortDef"));
setSearchAttributeId(uiScreenSectionGV.getString("searchAttributeId"));
setButtonAction(uiScreenSectionGV.getString("buttonAction"));
setButtonTarget(uiScreenSectionGV.getString("buttonTarget"));
setDetailButtonAction(uiScreenSectionGV.getString("detailButtonAction"));
setDetailButtonTarget(uiScreenSectionGV.getString("detailButtonTarget"));
setSearchAction(uiScreenSectionGV.getString("searchAction"));
setSearchTarget(uiScreenSectionGV.getString("searchTarget"));
setNewButtonAction(uiScreenSectionGV.getString("newButtonAction"));
setNewButtonTarget(uiScreenSectionGV.getString("newButtonTarget"));
setEditButtonAction(uiScreenSectionGV.getString("editButtonAction"));
setEditButtonTarget(uiScreenSectionGV.getString("editButtonTarget"));
setHideButtons(uiScreenSectionGV.getString("hideButtons"));
setSelectNameDef(uiScreenSectionGV.getString("selectNameDef"));
setSendQueryParameterList(uiScreenSectionGV.getString("sendQueryParameterList"));
setUseQueryParameterList(uiScreenSectionGV.getString("useQueryParameterList"));
/* add after value added to screen settings
setRowsPerPage(uiScreenSectionGV.getString("rowsPerPage"));
*/
rowsPerPage = 0;
uiScreenSectionGVI = null;
if (TIMER) {
timer.timerString(1, "[UIScreenSection.UIScreenSection] Got section");
}
// if rowsPerPage = 0, then use the global prefernece ROWS_PER_PAGE.
if (rowsPerPage <= 0) {
Preference pref = Preference.getInstance(delegator);
rowsPerPage = pref.getPreference(userInfo.getPartyId(),
userInfo.getAccountId(), PREFERENCE_ROWS_PER_PAGE, 20);
}
// Get the uiScreenSectionEntity entities.
findHashMap = new HashMap();
findHashMap.put("sectionId", getSectionId());
ArrayList orderBy = new ArrayList();
orderBy.add("retrieveOrder");
List uiScreenSectionEntityGVL = delegator.findByAnd("UiScreenSectionEntity",
findHashMap, orderBy);
if ((uiScreenSectionEntityGVL == null) ||
(uiScreenSectionEntityGVL.size() == 0)) {
throw new GenericEntityException(
"No screen section entities were found in database for screen section \"" +
sectionName + "\" and screen \"" + screenName + "\".");
}
Iterator uiScreenSectionEntityGVI = uiScreenSectionEntityGVL.iterator();