Skip to content

Instantly share code, notes, and snippets.

View esaounkine's full-sized avatar

Ilya Saunkin esaounkine

View GitHub Profile
@esaounkine
esaounkine / Msg103.java
Last active August 29, 2015 13:57
build MT103 using additional methods (more examples at http://wiki.datamation.gr/x/OIBH)
public SwiftMessage buildMT103() {
SwiftMessage message = new SwiftMessage();
// Set Tags for block1
message.setArgApplid("F");
message.setArgServid("01");
message.setArgLTaddrBlk1("COPZBEB0AXXX");
// Set Tags for block2
message.setArgInoutind("O");
@esaounkine
esaounkine / Msg103.java
Created March 10, 2014 09:08
build MT103 using bare methods (more examples at http://wiki.datamation.gr/x/OIBH)
public SwiftMessage buildMT103() {
SwiftMessage message = new SwiftMessage();
// Set Tags for block1
message.setArgApplid("F");
message.setArgServid("01");
message.setArgLTaddrBlk1("COPZBEB0AXXX");
// Set Tags for block2
message.setArgInoutind("O");
@esaounkine
esaounkine / ValidateMTTest.java
Created March 14, 2014 08:16
parsing and validation an MT (more examples http://wiki.datamation.gr/x/OIBH)
protected void testMessage(String messageContent) throws InvalidMessageFormatException {
//parse message string to the SwiftMessage object
SwiftMessage message = new SwiftMsgProcessor().ParseMsgStringToObject(messageContent);
//validate SwiftMessage (parsed from String or built programmatically)
SwiftMsgValidator validator = new SwiftMsgValidator();
SwiftValidObj validation = validator.validateMsg(message);
//swift mt text
String mtMessageText = validation.getMessage();
//obtain list of errors from the validation object
@esaounkine
esaounkine / SilentPrint.java
Created April 29, 2011 07:50
Silent Print with Jasper class
import net.sf.jasperreports.engine.JRExporter;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
public class SilentPrint {
@esaounkine
esaounkine / gist:948008
Created April 29, 2011 07:56
Clear an iterator in ADF 10g - definition
<iterator id="City1Iterator" RangeSize="-1"
Binds="City1" Refresh="always"
DataControl="AppModuleDataControl"/>
@esaounkine
esaounkine / gist:948009
Created April 29, 2011 07:58
Clear an iterator in ADF 10g - backing bean
javax.faces.context.FacesContext ctx = javax.faces.context.FacesContext.getCurrentInstance();
javax.faces.el.ValueBinding bind = ctx.getApplication().createValueBinding("#{data}");
oracle.adf.model.BindingContext bindingContext = (oracle.adf.model.BindingContext) bind.getValue(ctx); //resolve binding context
oracle.adf.model.binding.DCDataControl dataControl = bindingContext.findDataControl("AppModuleDataControl");//find data control by name (defined in DataBindings.cpx) from BindingContext
/*
* finally get the View Object instance which the iterator is bound to (see the attribute Binds in the iterator definition in the pageDef)
* then invoke the magic method executeEmptyRowSet on it
*/
((AppModuleImpl) dataControl.getDataProvider()).getCity1().executeEmptyRowSet();
@esaounkine
esaounkine / gist:948033
Created April 29, 2011 08:13
Accumulative sorting in ADF 10g tables - ADF
<table value="#{bindings.CustomerSearch.collectionModel}" var="row"
rows="#{bindings.CustomerSearch.rangeSize}"
first="#{bindings.CustomerSearch.rangeStart}" banding="row"
bandinginterval="1"
emptytext="#{bindings.CustomerSearch.viewable ? 'No rows yet.' : 'Access denied.'}"
sortlistener="#{CustomersBean.onSort}">
<column sortproperty="Customerid" sortable="true"
headertext="#{bindings.CustomerSearch.labels.Customerid}">
<commandlink text="#{row.Customerid}"
onclick="return initiateReplacement(#{row.Customerid});"
@esaounkine
esaounkine / gist:948016
Created April 29, 2011 08:05
add showPopupBehavior to an ADF Rich Faces table column - ADF
<af:panelGroupLayout halign="center" layout="horizontal">
<af:panelFormLayout rows="1">
<af:commandButton text="#{msg.ADD}" id="add"
actionListener="#{CorpinfoBean.onAddAction}"
disabled="#{not empty CorpinfoBean.dirtyRows}"/>
<af:commandButton text="#{msg.DELETE}" id="delete">
<af:showPopupBehavior popupId="confirmDelete"
triggerType="action" align="afterStart"/>
</af:commandButton>
<af:commandButton text="#{msg.COMMIT}" id="commit"
@esaounkine
esaounkine / gist:948020
Created April 29, 2011 08:07
add showPopupBehavior to an ADF Rich Faces table column - snippet
<table varstatus="rowStat" value="#{SchedulerBean.localCollectionModel}"
fetchsize="25" contentdelivery="immediate"
rows="#{SchedulerBean.localCollectionModel.rowCount}"
emptytext="#{msg.SCHED_EMPTY_TABLE}" rowselection="single" width="100%"
var="row" rowbandinginterval="0" binding="#{SchedulerBean.schedTable}"
id="schedTable">
<column headertext="#{msg.ACTIONS}" sortable="false"
inlinestyle="background-color:#{(not empty row[SchedulerBean.columns[6].label] and row[SchedulerBean.columns[6].label] eq 'RUNNING'? '#00ff00' :'')};"
width="#{set.ACTIONS_COLUMN_WIDTH}">
<panelformlayout rows="1">
@esaounkine
esaounkine / gist:948025
Created April 29, 2011 08:09
add showPopupBehavior to an ADF Rich Faces table column - backing
public void onDeleteConfirmation(oracle.adf.view.rich.event.DialogEvent de) {
if(de.getOutcome().equals(oracle.adf.view.rich.event.DialogEvent.Outcome.ok)) {
deleteSelectedRow();
FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(FacesContext.getCurrentInstance(), "", "scheduler");
}
}