Sunday, August 29, 2021

FileNet Interview Questions

 Hiring is on guys in all tech companies...Here is top 5 FileNet Interview Questions for any experienced 5/6 yrs + developers/Admin:


1. What all versions of FileNet , you have worked?

2. Tell us 5 major changes you have observed in FileNet from 4.5 to 5.5.x ?

3. How FileNet components communicate with each other?

4. What all development experience you have as a developer? U have worked on customization or OOTB stuff or support?

5. Tell us about very recent implementation you did in FileNet?   


Once interviewee answered these questions, then only Interviewer will go further else Tata Bye Bye.


Thanks


Tuesday, August 24, 2021

Job Openings

 Hi,

We are recruiting Java/J2EE and FileNet based professionals across India for a top MNC. 

Experience: 1 to 15 years  

Tech: Java / J2EE, FileNet, IBM Case Manager, ICN, DataCap

Interested candidates can share profile at jobsmaster2021@gmail.com

Thanks


Monday, July 26, 2021

FileNet API: Get Participant Name by Wob Number

 String query1 = "F_WobNum = 0x"+wobNumb ;

String pname = null;

//Get FileNet Connection code here

if(vwRoster != null){

VWRosterQuery query2 = vwRoster.createQuery(null, null, null, VWRoster.QUERY_NO_OPTIONS, query1, null, VWFetchType.FETCH_TYPE_WORKOBJECT);

while(query.hasNext()){

VWWorkObject vwElement = (VWWorkObject)query.next();

VWParticipant[] vw = ( VWParticipant[])vwElement.getFieldValue("AssignedTo");

for (int vwp = 0; vwp < vw.length; vwp++)

{

pname = vw[0].getpname();

System.out.println("Participant Name "+vw[0].getpname());

}

}

}


How to Fix Certificate Errors in Apache HttpClient?

 Error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Solution: We might be using HTTP Client...override ur client object with this method :

 try {
          TrustManager[] trustAllCerts = { new X509TrustManager() {
                public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
                
                public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
                
                public X509Certificate[] getAcceptedIssuers() {
                  return new X509Certificate[0];
                }
              } };
          SSLContext sslContext = SSLContext.getInstance("SSL");
          sslContext.init(null, trustAllCerts, new SecureRandom());
          SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
          String[] ciphers = SSLContext.getDefault().getDefaultSSLParameters().getCipherSuites();
          ciphers = sslContext.getSupportedSSLParameters().getCipherSuites();
          OkHttpClient.Builder builder = new OkHttpClient.Builder();
          builder.sslSocketFactory(sslSocketFactory, (X509TrustManager)trustAllCerts[0]);
          builder.hostnameVerifier(new HostnameVerifier() {
                public boolean verify(String hostname, SSLSession session) {
                  return true;
                }
              });
          builder.connectTimeout(90L, TimeUnit.SECONDS);
          builder.readTimeout(90L, TimeUnit.SECONDS);
          builder.writeTimeout(90L, TimeUnit.SECONDS);
          OkHttpClient okHttpClient = builder.build();
          return okHttpClient;
        } catch (Exception e) {
          LogManager.traceErrMsg("Sample", methodName, "Response : " + e.getMessage());
          throw e;
        } 

Thursday, June 24, 2021

How to save PNG base64 to Image?

String base64String  = "data:image/png;base64,iVBORw0KGg..." //Sample

base64String = base64String .replace("data:image/png;base64,", "");

byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(base64String );

//Save base64 as PNG to ur local.

File file1 = new File("C:\\sample\\abc.png");

try ( FileOutputStream fos = new FileOutputStream(file1); ) {

byte[] decoder = Base64.getDecoder().decode(base64String );

fos.write(decoder);

System.out.println("image File Saved");

} catch (Exception e) {

e.printStackTrace();

}  

Wednesday, May 26, 2021

Installation of FileNet CPE

Source: https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=system-installing-configuring-content-platform-engine

Saturday, May 15, 2021

Add document to FileNet

Steps:

//Get CE Connection

//Create Subject

//Push Subject

//Get Domain (domain)
 //Get Folder
 //Get the File details
// Create Document
//Check-in the doc
////Set document properties 
//Save document and file into a folder

ObjectStore os = null;
objectStoreName = "OSName"

os = Factory.ObjectStore.fetchInstance(domain, objectStoreName, null); 

Folder folder=null;
folderName = ''/Folder1";
folder=Factory.Folder.fetchInstance(os, folderName, null); 


InputStream inputFile = "";
String inputFileName = "";
int fileSize = "";
 
String docClass = "dcument class name";
Document document = Factory.Document.createInstance(os, docClass); 

if (inputFile != null && fileSize > 0) {
                        ContentTransfer contentTransfer = Factory.ContentTransfer.createInstance();
                        contentTransfer.setCaptureSource(file);
                        contentElementList.add(contentTransfer);
                        doc.set_ContentElements(contentElementList);
                        contentTransfer.set_RetrievalName(
inputFileName );                       
                        
document .set_MimeType(getMimetype(inputFileName ));
                    }
                   


document.checkin(AutoClassify.DO_NOT_AUTO_CLASSIFY,CheckinType.MAJOR_VERSION);                   

String documentName ="";

Properties prop = doc.getProperties();
p.putValue("DocumentTitle","Sample File");
p.putValue("Author","Iron Man");
p.putValue("Contact Number","007"); 

              

doc.save(RefreshMode.REFRESH);


 ReferentialContainmentRelationship rc = folder.file(doc,
                                    AutoUniqueName.AUTO_UNIQUE,
                                    documentName,
                                    DefineSecurityParentage.DO_NOT_DEFINE_SECURITY_PARENTAGE);

 rc.save(RefreshMode.REFRESH);