public class ContactStorage extends AbstractMemStorage
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Initialization
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* Creates a new instance of ContactStorage
.
*/
public ContactStorage()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Abstract methods implementation
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public RowDefinition getRowDefinition() throws ModelException
{
RowDefinition rdef = new RowDefinition();
rdef.addColumnDefinition(new ColumnDefinition("ID", new BigDecimalDataType()));
rdef.addColumnDefinition(new ColumnDefinition("FIRST"));
rdef.addColumnDefinition(new ColumnDefinition("LAST"));
rdef.setPrimaryKeyColumnNames(new String[] {"ID"});
rdef.setColumnView(null, new ColumnView(rdef));
return rdef;
}
@Override
public void loadData(MemDataBook pBook, ICondition pCondition) throws ModelException
{
pBook.close();
pBook.open();
ClientResource cres = new ClientResource("https://cloud.sibvisions.com/demoerp/services/rest/DemoERP/Customers/data/customer/");
cres.setChallengeResponse(ChallengeScheme.HTTP_BASIC, "manager", "manager");
try
{
List