cancel
Showing results for 
Search instead for 
Did you mean: 

Retreiving Data is not posible from MI client

Former Member
0 Kudos

Hi,

I have created syncBo's in the MI Client.

The fields are entered in the front end are saved .. And data is syncronised in the table ...

But i am not able to retrieve the data ...from the server

Because of this

<b><Property name="DATA_VISIBLE_SHARED" /></b>

I have just one table in the backend ZBPSYNC1 with some fields.

this is the code function i have writen to retrieve the data from the MI Server.

<?xml version="1.0" encoding="utf-8" ?>

- <MeRepApplication schemaVersion="1.1" id="PROFESSIONAL03" version="01">

<Property name="CLIENT.BUILDNUMBER">01</Property>

<Property name="C_APPLRESOLVE" />

<Property name="DATA_VISIBLE_SHARED" />

<Property name="E_APPLRESOLVE" />

<Property name="FACADE_C_CLIENT">X</Property>

<Property name="FACADE_E_CLIENT">X</Property>

<Property name="HOMEPAGE.INVISIBLE" />

<Property name="INITVALUE" />

<Property name="RUNTIME">JSP</Property>

<Property name="TYPE">APPLICATION</Property>

- <SyncBO id="ZBPSYNC1" version="1" type="twoWay" allowCreate="true" allowModify="false" allowDelete="false" reqDirectSync="false" downloadOrder="1">

- <TopStructure name="TOP">

- <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="SEARCHTERM1" type="C" length="20" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="SEARCHTERM2" type="C" length="20" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="TITLELETTER" type="C" length="50" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="FIRSTNAME" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="LASTNAME" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="BIRTHNAME" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="MIDDLENAME" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="SECONDNAME" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="TITLE_ACA1" type="C" length="4" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="NICKNAME" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="INITIALS" type="C" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="FULLNAME" type="C" length="80" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <ChildStructure name="030">

- <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="FAX" type="C" length="30" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="FAX_NO" type="C" length="30" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

</ChildStructure>

- <ChildStructure name="170">

- <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="TELEPHONE" type="C" length="30" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

- <Field name="TEL_NO" type="C" length="30" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="modify">false</Input>

</Field>

</ChildStructure>

</TopStructure>

</SyncBO>

</MeRepApplication>

public static DataHandler instance( int start, int count, int sortIndex, boolean sort_type, String filter_string) {

try

{

if (bdh == null) bdh = new DataHandler();

if (db == null) db = new Sync();

rows_in_dataset = db.getNumberOfSyncBos();

//System.out.println("SS"+rows_in_dataset);

rows = db.readEntities(start, count, sortIndex, sort_type, filter_string);

setColumns(db.getColumns());

sort_ascending = sort_type;

sort_index = sortIndex;

return bdh;

}

catch(Exception e)

{

System.out.println(e.getMessage());

return null;

}

}

public MeIterator readEntities(int start, int count, int sortIndex, boolean sort_ascending, String filter_string)

{

try

{

Vector lineVector = new Vector();

tableHeaderNames = getHeaderFieldNames(SYNCBO_NAME_PROFESSIONAL);

setColumns(tableHeaderNames.length);

return getRowInstances(SYNCBO_NAME_PROFESSIONAL, start, count, sortIndex, sort_ascending, filter_string);

}

public MeIterator getRowInstances(String syncBoName, int start, int count, int sortIndex, boolean sortOrder, String filter) {

try {

SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);

MeIterator iteratorRows = null;

System.out.println("Size ===" + sbd.getAllRowDescriptors().size());

SmartSyncQueryFactory queryFactory = SmartSyncRuntime.getInstance().getQueryFactory();

RowDescriptor rd = sbd.getTopRowDescriptor();

FieldDescriptor fd = rd.getFieldDescriptor(THNames[sortIndex]);

Condition cond = queryFactory.createCondition(fd, RelationalOperatorType.STARTS_WITH, filter);

SortOrder singleSortOrder = queryFactory.createSortOrder(fd, sortOrder);

Query rowQuery = queryFactory.createQuery(rd, cond, singleSortOrder, start, count);

// Query rowQuery = queryFactory.createQuery(sbd,singleSortOrder, start, count);

iteratorRows = dataFacade.getRows(rowQuery).iterator();

System.out.println(dataFacade.getRows(rowQuery).size());

return iteratorRows;

} catch (PersistenceException pex) {

System.out.println("EXception Handling");

System.out.println(pex.getMessage());

System.out.println("EXception Handled");

return null;

}

}

System.out.println("Size ===" + sbd.getAllRowDescriptors().size()); = 2

System.out.println(dataFacade.getRows(rowQuery).size()); === 0

The iterator variable returns 0 always

provide solution with alernate code

thnks in advance

Saravana

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Saravana,

I am not sure whether this would be a solution. But you can try anyways.

In the middleware, go to transaction MI_MCD, enter your Mobile Component, then in the SyncBO tab, there is a checkbox called "Data visible to all". This should be unchecked. Check out what value it has.

Regards,

Nameeta