Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Context bean
- private int lastSelectedWbsId = 0;
- private int lastSelectedPoiId = 0;
- private PointOfInterest lastSelectedPoi;
- public void setLastSelectedPoiId(int lastSelectedPoiId) {
- AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
- if (lastSelectedPoiId == this.lastSelectedPoiId)
- return;
- log.debug("Last selected POI : " + lastSelectedPoiId);
- this.lastSelectedPoiId = lastSelectedPoiId;
- if (this.lastSelectedPoiId != 0) {
- ViewObjectImpl poiVo = am.getEditPoiView1();
- poiVo.setWhereClause("OcPoi.POI_ID = " + lastSelectedPoiId);
- poiVo.executeQuery();
- log.debug("Found selected POI : " + poiVo.getRowCount());
- if (poiVo.getRowCount() > 0) {
- Row poiRow = poiVo.first();
- lastSelectedPoi = new PointOfInterest(poiRow);
- this.setLastSelectedWbsId((Integer)poiRow.getAttribute("WbsId"));
- }
- } else {
- ViewObjectImpl poiListView = am.getUserPoiListView1();
- if (poiListView.getRowCount() > 0) {
- Row currentRow = poiListView.first();
- Integer currentRowPoiId = (Integer)currentRow.getAttribute("PoiId");
- ViewObjectImpl poiVo = am.getEditPoiView1();
- poiVo.setWhereClause("OcPoi.POI_ID = " + currentRowPoiId);
- poiVo.executeQuery();
- if (poiVo.getRowCount() > 0) {
- Row poiRow = poiVo.first();
- lastSelectedPoi = new PointOfInterest(poiRow);
- this.setLastSelectedWbsId((Integer)poiRow.getAttribute("WbsId"));
- } else {
- lastSelectedPoi = null;
- }
- }
- }
- }
- public void setLastSelectedPoi(PointOfInterest lastSelectedPoi) {
- this.lastSelectedPoi = lastSelectedPoi;
- }
- public PointOfInterest getLastSelectedPoi() {
- return lastSelectedPoi;
- }
- public void setLastSelectedWbsId(Integer lastSelectedWbsId) {
- this.lastSelectedWbsId = (lastSelectedWbsId == null) ? 0 : lastSelectedWbsId;
- }
- public int getLastSelectedWbsId() {
- return lastSelectedWbsId;
- }
- public int getLastSelectedPoiId() {
- return lastSelectedPoiId;
- }
- -- POI list manager
- ContextBean.getCurrent().setSelectedPoiId((Integer)ADFUtils.findIterator("PoiView1Iterator").getCurrentRow().getAttribute("PoiId"));
- ContextBean.getCurrent().setLastSelectedPoiId((Integer)ADFUtils.findIterator("PoiView1Iterator").getCurrentRow().getAttribute("PoiId"));
- ContextBean.getCurrent().setSelectedWbsId((Integer)ADFUtils.findIterator("PoiView1Iterator").getCurrentRow().getAttribute("WbsId"));
- ContextBean.getCurrent().setLastSelectedWbsId((Integer)ADFUtils.findIterator("PoiView1Iterator").getCurrentRow().getAttribute("WbsId"));
- -- Attach Doc manager
- public String viewPoiRegistrationHistory() {
- AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
- ViewObjectImpl docs = am.getAttachDocView3();
- Row row = docs.getCurrentRow();
- if (row != null) {
- Integer currentPoi = (Integer)row.getAttribute("PoiId");
- if (null != currentPoi) {
- // ContextBean.getCurrent().setSelectedPoiId(currentPoi);
- ContextBean.getCurrent().setSelectedPoiId(ContextBean.getCurrent().getLastSelectedPoiId());
- }
- }
- return PoiRegistrationBean.getInstance().viewPoiRegistrationHistory();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement