public ActionForward update( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, GTClientException { // 20021202AH IGTSession gtasSession = getGridTalkSession(request); if (gtasSession.isRegistered()) { // If we have registered gtas then proceed as normal return super.update(mapping, actionForm, request, response); } else { // Otherwise redirect to the rego screen! return mapping.findForward("register"); } }
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()); }
protected void render() throws RenderingException { try { RenderingContext rContext = getRenderingContext(); // 20021216AH checkReloadHeader(rContext); // 20030704AH IGTRegistrationInfoEntity rego = (IGTRegistrationInfoEntity) getEntity(); // 20030115AH RegistrationInfoAForm form = (RegistrationInfoAForm) getActionForm(); renderCommonFormElements(IGTEntity.ENTITY_REGISTRATION_INFO, _edit); renderLabel("prodKey_label", "registrationInfo.prodKey", false); Short state = StaticUtils.shortValue(form.getRegistrationState()); BindingFieldPropertyRenderer bfpr = new BindingFieldPropertyRenderer(rContext); // 20030115AH if (IGTRegistrationInfoEntity.REG_STATE_NOT_REG.equals(state)) { removeNode("licDate_details", false); // 20030422 removeNode("category_details", false); // 20030422AH removeNode("security_details", false); // 20030422AH removeNode("bizConnections_details", false); // 20030422AH removeNode("cancel", false); // 20030422AH removeNode("button_divider_1", false); // 20030422AH removeNode("prodKey_details", false); // 20030416AH } else if (IGTRegistrationInfoEntity.REG_STATE_IN_PROGRESS.equals(state)) { if (_edit) { makeRegoReadOnly(); // 20030417AH } else { // 20030417AH - In progress in view mode Element stateLabel = getElementById("registrationState_value", false); if (stateLabel != null) { // Highlight the fact they havent finsihed yet! stateLabel.setAttribute("class", "errortext"); } renderLabelCarefully("edit", "registrationInfo.view.continue", false); } renderLabel("security_heading", "registrationInfo.security.heading", false); renderLabel("security_message", "registrationInfo.security.message", false); renderLabelCarefully("ok", "registrationInfo.edit.ok.confirm", false); // 20030326AH Element okIcon = getElementById("ok_icon", false); // 20030326AH if (okIcon != null) { // 20030326AH okIcon.setAttribute("src", REGISTER_IMAGE_SRC); } renderLabelCarefully( "cancel", "registrationInfo.edit.cancelRegistration", false); // 20030326AH renderLicencePeriod(form, bfpr, rego); // 20030115AH removeNode("licFile_details", false); // 20030417AH if (rego.getSession().isNoSecurity()) { // 20031105AH - HACK for GNDB00016109 removeNode("security_details"); } } else if (IGTRegistrationInfoEntity.REG_STATE_REG.equals(state) || IGTRegistrationInfoEntity.REG_STATE_EXPIRED.equals(state)) // 20030502AH { if (_edit) makeRegoReadOnly(); // 20030417AH if (_edit) removeNode("security_details", false); // 20030417AH // 20030417AH - removeNode("ok",false); // 20030417AH - removeNode("button_divider_1",false); if (!_edit) { // 20030417AH removeNode("cancel_button", false); // 20030417AH } renderLicencePeriod(form, bfpr, rego); // 20030115AH } ActionErrors actionErrors = getRenderingContext().getActionErrors(); bfpr = renderFields(bfpr, rego, _fields); // 20030416AH // 20031105 DDJ: GNDB00016116 - remove the cancel button id, so that it will // not be removed by CompanyProfileRenderer later // 20050324AH - Dont remove, but rather rename as I need to find it again later! Element cancelButton = getElementById("cancel_button", false); if (cancelButton != null) { // 20050324AH - co: cancelButton.removeAttribute("id"); cancelButton.setAttribute("id", "cancel_button_id"); // 20050324AH } renderEmbeddedProfile(); if (actionErrors != null) { ActionError prodKey = MessageUtils.getFirstError(actionErrors, "prodKey"); if (prodKey != null) { renderLabel("prodKey_error", prodKey.getKey()); } ActionError responseError = MessageUtils.getFirstError(actionErrors, "error"); if (responseError != null) { renderLabel("response_error", responseError.getKey()); } } renderTabs(rContext, "registrationTab", _tabs); // 20021217AH if (IGTRegistrationInfoEntity.REG_STATE_EXPIRED.equals(state)) { // 20030502AH renderLabelCarefully( "expired_message", "registrationInfo.registrationState.expired.message", false); // 20050324AH - Hide non editable fields from non-admin users IGTSession gtasSession = rego.getSession(); if (!gtasSession.isAdmin()) { removeNode("licFile_details", false); removeNode("ok_button", false); removeNode("help_button", false); removeNode("cancel_button_id", false); } // ... } else { removeNode("expired_message", false); } } catch (Throwable t) { throw new RenderingException("Error rendering registrationInfo screen", t); } }