Author Topic: Issue in retrieving date fields  (Read 8206 times)

Sowmya Jayaprakash

  • Guest
Issue in retrieving date fields
« on: September 02, 2013, 09:23:19 PM »
Hi,
I am new to ODWEK JAVA API. I am trying to create a web viewer using ODWEK APIs with login/search/retrieval screens.
Based on the selection of the folder, search criteria defined for that folder will be displayed. Here the issue I am facing is - if the criteria is of ?date? type, the default values are not retrieved. This works perfectly for all other type of data.

Code snapshot:
Enumeration<ODCriteria> enum_crit = odFolder.getCriteria();
while (enum_crit.hasMoreElements()) {
   searchListMap = new HashMap<String, Object>();
   ODCriteria odCrit = enum_crit.nextElement();
   operators = odCrit.getValidOperators();
            
             String defFormat= odCrit.getDefaultFmt();
   String displayFormat = odCrit.getDisplayFmt();            
                        
   //To get default values
   String[] defaultValues = odCrit.getSearchValues();
   String[] fixedValues = odCrit.getFixedValues();
             boolean isDefaultValueFixed = dCrit.isDefaultValueFixed();
:
:
}



Searched documents will be displayed in a separate table with columns document name, hold details on the document (whether the document is locked or not) and other search criteria values. In this case also, the date field values are not displayed. This works perfectly for all other type of data.

Code snapshot:
List<ODHit> searchResults = odFolder.search();
:
:
:
if ((searchCritList != null) && !(searchCritList.isEmpty())) {
   Iterator<String> searchIter = searchCritList.iterator();
   while (searchIter.hasNext()) {
       String searchCritname = searchIter.next()                  
                          String searchValue = odHit.getDisplayValue(searchCritname);
       docMap.put(searchCritname, searchValue);
   }
}

docList.add(docMap);

I am using Tomcat as my deployment server.

Any suggestions?


Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #1 on: September 03, 2013, 03:51:56 AM »
Hi,
I am new to ODWEK JAVA API. I am trying to create a web viewer using ODWEK APIs with login/search/retrieval screens.
Based on the selection of the folder, search criteria defined for that folder will be displayed. Here the issue I am facing is - if the criteria is of ?date? type, the default values are not retrieved. This works perfectly for all other type of data.

Code snapshot:
Code: [Select]
Enumeration<ODCriteria> enum_crit = odFolder.getCriteria();
while (enum_crit.hasMoreElements()) {
searchListMap = new HashMap<String, Object>();
  ODCriteria odCrit = enum_crit.nextElement();
  operators = odCrit.getValidOperators();

        String defFormat= odCrit.getDefaultFmt();
        String displayFormat = odCrit.getDisplayFmt();

  //To get default values
  String[] defaultValues = odCrit.getSearchValues();
String[] fixedValues = odCrit.getFixedValues();
        boolean isDefaultValueFixed = odCrit.isDefaultValueFixed();
:
:
}

Hi Sowmya,

I'm trying your code snapshot in my environment, with a date field that has a default values for the last 3 month.
After running it, I get in the following values in the defaultValues array: 06/03/13 and 09/03/13.

I'm running it with ODWEK 9.0.0.1.

With which version of ODWEK are you trying to run it?

Just for info, here is the source I've created to test it:

Code: [Select]
package com.ibm.ch.swg.ecm.od.testing;

import com.ibm.edms.od.*;
import java.util.*;

class TestDefaultDate {

public void testODServerConnect(String server, int port, String user, String password, String folder) throws Exception {
ODServer odServer;

ODConfig odConfig = new ODConfig();
odServer = new ODServer(odConfig);
odServer.setServerName(server);
odServer.setPort(port);
odServer.setUserId(user);
odServer.setPassword(password);
odServer.initialize("");

odServer.logon();
ODFolder odFolder = odServer.openFolder(folder);
System.out.println("List of folder fields:");
ArrayList<ODCriteria> critQueryOrder = odFolder.getCriteriaQueryOrder();
for (ODCriteria crit : critQueryOrder) {
if (crit.isQueryable()) {
System.out.println(" - " + crit.getName());
}
if (crit.isDefaultValueAvailable()) {
System.out.println("\tDefault value");
String[] defaultValues = crit.getSearchValues();
for (String defaultValue : defaultValues) {
System.out.println("\t\t"+defaultValue);
}
}
if (crit.isDefaultValueFixed()) {
System.out.println("\tDefault fixed value");
String[] fixedValues = crit.getFixedValues();
for (String fixedValue : fixedValues) {
System.out.println("\t\t"+fixedValue);
}
}
}
odFolder.close();
odServer.logoff();
odServer.terminate();
}

public static void main(String[] args) throws Exception {
new TestDefaultDate().testODServerConnect("localhost", 1445, "admin", "*******","test221");
}
}

And for my environment, here is the output I get:

Code: [Select]
List of folder fields:
 - aa
Default value
A

Default fixed value
A

 - ii
 - dd
Default value
06/03/13
09/03/13
 - ee
Default value
2013-06-03
2013-09-03
Default fixed value
2013-06-03
2013-09-03

I've put also in attachment some screenshot of my settings for the "dd" and "ee" fields.

Hope that helps a little bit.

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Sowmya Jayaprakash

  • Guest
Re: Issue in retrieving date fields
« Reply #2 on: September 03, 2013, 05:06:13 AM »
I also have given similar setting for date fields. The version of ODWEK I am using is 8.5.0.7. Tomcat Server.

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #3 on: September 04, 2013, 01:56:51 AM »
I also have given similar setting for date fields. The version of ODWEK I am using is 8.5.0.7. Tomcat Server.

Have you tried my little java sample on your folder?
Does it work?
Or does it not work?

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Sowmya Jayaprakash

  • Guest
Re: Issue in retrieving date fields
« Reply #4 on: September 04, 2013, 02:09:54 AM »
Yes I tried the code which you shared, it was also not printing default date values of my folder. But other data type values was getting printed.

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #5 on: September 11, 2013, 02:33:19 AM »
Hello,

this is strange, would it be possible to have an example of your folder definition?
if you want you can send it to me via PM.

(for example a xml extract would be wonderfull)

I want to try to reproduce it in my environment to see if I see something strange...

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Sowmya Jayaprakash

  • Guest
Re: Issue in retrieving date fields
« Reply #6 on: September 11, 2013, 09:35:29 PM »
Hi Alessandro,

I am not able to attach the extracted folder here as well as in PM. Please PM your Id, I shall forward to you to your mail.

Thanks,
Sowmya

Sowmya Jayaprakash

  • Guest
Re: Issue in retrieving date fields
« Reply #7 on: September 12, 2013, 03:10:37 AM »
Also please let me know the exact version of ODWEK you are using.

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #8 on: September 12, 2013, 08:30:06 AM »
Also please let me know the exact version of ODWEK you are using.

Well apparently you didn't read my replies  ;D
I said 9.0.0.1 ! :-)

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #9 on: September 12, 2013, 10:31:48 PM »
Hello Sowmya,

I've received your file, and the output I get is the following:

Code: [Select]
List of folder fields:
 - Posting Date
Default value
2013-03-13
2013-09-13
 - Account Number
Default value
1001

Default fixed value
1001

 - Statement date
Default value
2013-01-01
2013-08-20
 - Report ID
 - Report Title
 - Branch ID

I will install ODWEK 8.5.0.7 like you and check again if I get the same results.
Then also try ODWEK 8.5.0.8 (which is new since a few days).

I let you know.

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #10 on: September 12, 2013, 11:59:47 PM »
Hello Sowmya,

I've tried with ODWEK 8.5.0.7, and here is my output:

Code: [Select]
List of folder fields:
 - Posting Date
Default value
2013-03-13
2013-09-13
 - Account Number
Default value
1001

Default fixed value
1001

 - Statement date
Default value
2013-01-01
2013-08-20
 - Report ID
 - Report Title
 - Branch ID

The only difference I might have with you would be my CMOD Server, which runs in version 9.0.0.1... that could be the only difference I could see.
What server version do you have?
Where do you do your development?
I'm doing it in Linux x64.

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Sowmya Jayaprakash

  • Guest
Re: Issue in retrieving date fields
« Reply #11 on: September 13, 2013, 02:05:38 AM »
Thanks Alessandro,

My CMOD server version is 9.0.0.0.
I am doing in Windows 7 environment 32 bit OS.

 

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Issue in retrieving date fields
« Reply #12 on: September 13, 2013, 03:55:16 AM »
Thanks Alessandro,

My CMOD server version is 9.0.0.0.
I am doing in Windows 7 environment 32 bit OS.

Ohhhhhhhhhhhhhhhhhh I know the problem :-)

What kind of date do you have used in CMOD Server?

- Date

or

- Date (old format)

??

If you have used "Date", then you are using the new format and ODWEK 8.5 cannot see the new field format.
In that case you MUST use ODWEK 9.X.

It has worked for me, because I've converted the date to "old format"... I had also the problem with the new format with ODWEK 8.5.0.7.

So my advice, use ODWEK 9.X only, never use 8.X, if you are using the new date type from version 9.X
And to code with ODWEK V9.X, you can still access CMOD Server V8.4.1.X, V8.5.X and V9.X... so you are good on all sides!

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Sowmya Jayaprakash

  • Guest
Re: Issue in retrieving date fields
« Reply #13 on: September 16, 2013, 04:27:44 AM »
Thanks Alessandro,

I tried with 'Date (old style)' and its working. As per your suggestion I would use ODWEK 9.X.

Regards,
Sowmya