protected void prepLists(ActionContext actionContext, boolean reloaded) throws GTClientException { try { OperationContext opCon = OperationContext.getOperationContext(actionContext.getRequest()); List gridMasterList = (List) opCon.getAttribute(GRIDMASTER_LIST); if (reloaded || (gridMasterList == null)) { IGTConnectionSetupResultEntity result = (IGTConnectionSetupResultEntity) getEntity(actionContext); gridMasterList = (List) result.getFieldEntities(IGTConnectionSetupResultEntity.AVAILABLE_GRIDMASTERS); List routerList = (List) result.getFieldEntities(IGTConnectionSetupResultEntity.AVAILABLE_ROUTERS); if (gridMasterList == null) throw new NullPointerException("gridMasterList is null"); // 20030422AH if (routerList == null) throw new NullPointerException("routerList is null"); // 20030422AH opCon.setAttribute(GRIDMASTER_LIST, gridMasterList); opCon.setAttribute(ROUTER_LIST, routerList); ConnectionSetupResultAForm form = (ConnectionSetupResultAForm) actionContext.getActionForm(); String initRoutersOrder = StaticUtils.initialOrderString(routerList.size()); String initMastersOrder = StaticUtils.initialOrderString(gridMasterList.size()); form.setAvailableGridMastersOrder(initMastersOrder); form.setAvailableRoutersOrder(initRoutersOrder); } } catch (Throwable t) { throw new GTClientException( "Error prepping GridMaster and Router lists in OperationContext", t); } }
/** Override super class method to perform additional population for Operation Context */ @Override protected void processPreparedOperationContext( ActionContext actionContext, OperationContext opContext) throws GTClientException { try { IGTSchemaMappingFileEntity entity = null; String indexString = actionContext.getRequest().getParameter("index"); opContext.setAttribute(INDEX_KEY, indexString); // so that when we save the entity, // we can differentiate whether we are saving // a new entity or an existing entity. (see detail in saveWithManager) if (indexString != null) { if (!indexString.equals("new")) { try { int index = Integer.parseInt(indexString); IGTImportSchemaEntity importSchema = getImportSchema(actionContext); ArrayList schemaMappingList = (ArrayList) importSchema.getFieldValue(IGTImportSchemaEntity.SCHEMA_MAPPING); if (schemaMappingList == null) { throw new NullPointerException( "[SchemaMappingFileDispatchAction.processPreparedOperationContext] Null value for schemaMappingList."); } try { entity = (IGTSchemaMappingFileEntity) schemaMappingList.get(index); } catch (Throwable t) { throw new GTClientException( "[SchemaMappingFileDispatchAction.processPreparedOperationContext] Error retrieving schemaMappingFile entity from list at index " + index, t); } if (entity == null) { throw new java.lang.NullPointerException( "[SchemaMappingFileDispatchAction.processPreparedOperationContext] Null entity object at index " + index + " of schemaMappingList list retrieved from ImportSchema entity " + importSchema); } } catch (Throwable t) { throw new GTClientException( "[SchemaMappingFileDispatchAction.processPreparedOperationContext] Error retrieving schemaMappingFile entity object from" + " importSchema entity in parent OperationContext", t); } } else { entity = (IGTSchemaMappingFileEntity) getRequestedEntity(actionContext); } } else { throw new GTClientException( "[SchemaMappingFileDispatchAction.processPreparedOperationContext]No index specified"); } opContext.setAttribute(IOperationContextKeys.ENTITY, entity); ActionForward submitForward = actionContext.getMapping().findForward("submit"); opContext.setAttribute(IOperationContextKeys.FORM_SUBMIT_URL, submitForward.getPath()); } catch (Exception ex) { throw new GTClientException( "[SchemaMappingFileDispatchAction.processPreparedOperationContext] Error obtaining SchemaMappingFile entity object", ex); } }
protected void processPreparedOperationContext( ActionContext actionContext, OperationContext opContext) throws GTClientException { IGTConnectionSetupResultEntity entity = null; IGTSession gtasSession = getGridTalkSession(actionContext); IGTConnectionSetupResultManager manager = (IGTConnectionSetupResultManager) gtasSession.getManager(IGTManager.MANAGER_CONNECTION_SETUP_RESULT); entity = manager.getConnectionSetupResult(); if (entity == null) { throw new GTClientException("No connectionSetupResult entity to update"); } opContext.setAttribute(IOperationContextKeys.ENTITY, entity); ActionForward submitForward = actionContext.getMapping().findForward("submit"); opContext.setAttribute(IOperationContextKeys.FORM_SUBMIT_URL, submitForward.getPath()); }