<signInOp.xml> <operation id="signInOp" context="signInCtx" implClass="com.ibm.btt.sample.operation.SignInOp"> <refFormat name="csReplyFormat" refId="signInSendFmt" /> </operation> </signInOp.xml>
<context id="signInCtx" type="op"> <refKColl refId="signInData" /> </context>
<kColl id="signInData"> <refData refId="userId" /> <refData refId="pw" /> <refData refId="locale" /> <refData refId="dse_errorMessages" /> <field id="dse_replyPage" /> <field id="outcome" /> <field id="errorCode" /> </kColl>
<fmtDef id="signInSendFmt"> <record> <constant value="Tx01" /> <fString dataName="dse_errorMessages" /> <delim delimChar="#" /> </record> </fmtDef> <fmtDef id="signInRecFmt"> <record> <fString dataName="userId" /> <delim delimChar="#" /> <fString dataName="pw" /> <delim delimChar="#" /> <fString dataName="locale" /> </record> </fmtDef>
<fmtDef id="SignInXMLFmt"> <fXML dataName="signInData"> <fString dataName="userId" /> <fString dataName="pw" /> <fString dataName="locale" /> </fXML> </fmtDef>
<EJB id="logoninvoker" jNDI="ejb/com/ibm/btt/e2e/business/SignInBeanHome" beanName="com.ibm.btt.e2e.business.SignInBean" method="execute"> <parameters> <parameter id="ctx" type="com.ibm.btt.base.Context" /> </parameters> </EJB>
//Set the page to display for HTML channel getContext().setValueAt(HtmlConstants.REPLYPAGE, "signin.jsp"); setValueAt("errorCode", HtmlException.OK); Context sessionCtx=getContext().getParent(); if (signIn(getValueAt("userId").toString(), getValueAt("pw").toString(), getValueAt("locale").toString())) { Invoker invoker = (Invoker) InvokerFactory.getDefaultInvokerFactory().createInvoker("logoninvoker"); getContext().unchain(); Object[] params ={getContext()}; Context invokerResult=(Context)invoker.execute(params); getContext().setKeyedCollection(invokerResult.getKeyedCollection()); getContext().chainTo(sessionCtx); updateSessionContext(sessionCtx); if("zh_CN".equals((String)getContext().getValueAt("locale"))){ getParent().setValueAt("dse_locale",Locale.CHINA); }else{ getParent().setValueAt("dse_locale",Locale.US); } getParent().setValueAt("locale", getContext().getValueAt("locale")); getParent().setValueAt("locale", getContext().getValueAt("locale")); getParent().setValueAt("userId", getContext().getValueAt("userId")); }
public Context execute(Context ctx) throws BTTSAEException, Exception{ ctx.setValueAt("outcome","succcess"); return ctx; }