Tuesday, December 19, 2023

InforArchive 23.4 - Experimental feature: Enabling full-text on unstructured content in a SIP archive

 Holding Preparation

 

Sample Schema

 

<xs:schema elementFormDefault="qualified"

  targetNamespace="urn:uhg:en:xsd:clinicaldocs.1.0"

  xmlns:ns1="urn:uhg:en:xsd:clinicaldocs.1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="root">

    <xs:complexType>

      <xs:sequence>

        <xs:element maxOccurs="unbounded" ref="ns1:documents"/>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

  <xs:element name="documents">

    <xs:complexType>

      <xs:sequence>

        <xs:element ref="ns1:Report_No"/>

        <xs:element ref="ns1:Patient_No"/>

        <xs:element ref="ns1:Decision_Date"/>

        <xs:element ref="ns1:Status"/>

        <xs:element ref="ns1:CoordinatedCare"/>

        <xs:element ref="ns1:start_page"/>

        <xs:element ref="ns1:page_count"/>

        <xs:element ref="ns1:content_file"/>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

  <xs:element name="Report_No" type="xs:string"/>

  <xs:element name="Patient_No" type="xs:string"/>

  <xs:element name="Decision_Date" type="xs:date"/>

  <xs:element name="Status" type="xs:string"/>

  <xs:element name="CoordinatedCare" type="xs:string"/>

  <xs:element name="start_page" type="xs:int"/>

  <xs:element name="page_count" type="xs:int"/>

  <xs:element name="content_file" type="xs:string"/>

</xs:schema>

 

 

 

 

 

 

 

1.     Create Holding

 

ApplicationsHoldings

 

Select prepared schema as shown below screen

A screenshot of a computer

Description automatically generated

 

Select AIU unit as shown below

A screenshot of a computer

Description automatically generated

 

Select search fileds

A screenshot of a computer

Description automatically generated

 

Select Partition key Method

 

A screenshot of a computer

Description automatically generated

 

 

Select fields for unstructured content.

 

Field name: content_file

 

Select encryption object.

A screenshot of a computer

Description automatically generated

 

 

 

 

 

Select File Format application/pdf.

            Hash: SHA3-224

            Encryption : true

            

 

A screenshot of a computer

Description automatically generated

 

Select Additional Settings of File format

            Start Page (OffsetPath)

            Number Of Pages ( lenghtPage)

A screenshot of a computer

Description automatically generated

 

 

 

 

*** Experimental feature: Enabling full-text on unstructured content in a SIP archive

As experimental feature, you can configure an application to extract and index text of unstructured content during ingestion, search on them with full-text capabilities, and highlight them in the search results.

Important

As experimental feature, this feature is for demo purpose and is not supported for production environments. 

A ready to use example of this feature is available in the Invoices example application (refer to the "Search on unstructured contents" search.

To enable this feature for an application:

1.     In the Global Settings tab, set the experimental.ci.text.enable to true. Refer to the Global Settings tab section of the Administration Guidefor more information.

2.     Complete the following steps to update application configuration:

a.     Edit the application-config/data-model-config/application.yml file to add the fulltext option in the PDI > CIS section: 

b.  pdi:

c.    name: Invoices-pdi

d.    ...

e.    cis:

f.      - path: /root/documents/content_file

g.        offsetPath: /root/documents/start_page

h.        lengthPath: /root/documents/page_count

i.        offsetMode: PAGE

j.        mimeType: application/pdf

k.        compress: false

l.        encrypt: true

m.        ...

n.        fulltext: true

      ...

A screenshot of a computer

Description automatically generated

o.     Edit the application-config/searches/application.yml to declare the new CI criteria in the aic section:

p.  aic:

q.    name: Invoices-aic

r.    criteria:

s.    ...

t.    - name: _ci-text

u.       label: CI Text

v.       type: ci

w.    - name: _ci-mime-type

x.       label: CI Mime-Type

     type: ci

A screen shot of a computer

Description automatically generated

3.     Import the updated DC configuration using one of the following methods:

o   The import command in the IA Shell, or 

o   The Import from ZIP file function of the IA Web App’s Applications page

o   A screen shot of a computer

Description automatically generated

  1. A screen shot of a computer program

Description automatically generated

 

A close-up of a text

Description automatically generated

5.     During search composition in the IA Web App:

a.     In Search Form tab, add a new search criterion in the form.

A screenshot of a computer

Description automatically generated

b.     In Result List/Detail, include a View/Downloadable content column.

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

Wednesday, January 4, 2023

Upload files to SAP Business Objects in Extended ECM using REST API

 public static String edgeUpload(String parenId,String workspace_type,String type,String file_path,String name) {

byte[] authEncBytes = Base64.encodeBase64(Constants.authString.getBytes());

       String authStringEnc = new String(authEncBytes);

       

     MultiValueMap<String, Object> bodyMap = new LinkedMultiValueMap<>();

     bodyMap.add(Constants.FILE, new FileSystemResource(new File(file_path)));

     bodyMap.add(Constants.pID, parenId);

     bodyMap.add(Constants.wType, workspace_type);

     bodyMap.add(Constants.fName, name);

     bodyMap.add(Constants.TYPE, type);

     HttpHeaders headers = new HttpHeaders();

     headers.setContentType(MediaType.MULTIPART_FORM_DATA);

     headers.add("Authorization", "Basic " + authStringEnc);

     HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(bodyMap, headers);


     RestTemplate restTemplate = new RestTemplate();

     ResponseEntity<String> response = restTemplate.exchange(Constants.endPointUrl,

             HttpMethod.POST, requestEntity, String.class);

     //System.out.println("response status: " + response.getStatusCode());

     //System.out.println("response body: " + response.getBody());

     return response.getStatusCode().toString();

}

Tuesday, March 3, 2020

How to get User Homecabinet names with file count and total size

/**
 *
 */
package Test;
import java.io.File;  // Import the File class
import java.io.FileNotFoundException;  // Import this class to handle errors
import java.util.Scanner;

import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.IDfLoginInfo;

import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.DfQuery;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfCollection;
import com.documentum.fc.client.IDfQuery;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.IDfLoginInfo;
/**
 * @author mpoli
 *
 */
public class ReadExcelFileDemo {
  public static void main(String[] args) throws DfException  {
    try {
    // TODO Auto-generated method stub
IDfSessionManager sessionMgr = null;
IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
sessionMgr = client.newSessionManager();
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser("XXXXX");
loginInfoObj.setPassword("XXXXX");
sessionMgr.setIdentity("XXXXX", loginInfoObj);
IDfSessionManager sesMgr = getSessionMgr();
IDfSession session = sesMgr.getSession("XXX");
IDfClientX _clientx = new DfClientX();
IDfQuery query = new DfQuery();
IDfCollection rs = null;

      File myObj = new File("d://emp.txt");
      Scanner myReader = new Scanner(myObj);
      while (myReader.hasNextLine()) {
        String data = myReader.nextLine();
     
        query.setDQL(" SELECT   user_name FROM   dm_user WHERE  user_os_name='"+data+"'");
rs = query.execute(session, 0);
if (rs != null) {
while (rs.next()) {
IDfCollection rs1 = null;
query.setDQL(" select sum(r_content_size),count(r_object_id) from dm_document where folder('/Users/"+rs.getString("user_name")+"',descend) ");
rs1 = query.execute(session, 0);
if (rs1 != null) {
while (rs1.next()) {
//System.out.println(rs.getString("object_name"));
long i=Long.valueOf(rs1.getString("sum(dm_document.r_content_size)"));

System.out.println(rs.getString("user_name") +"::"+rs1.getString("count(dm_document.r_object_id)")+"::"+ getSize(i));
}
}
}
}
     
     
     
      }
      myReader.close();
    } catch (FileNotFoundException e) {
      System.out.println("An error occurred.");
      e.printStackTrace();
    }
  }
  public static String getSize(long size) {
        long n = 1000;
        String s = "";
        double kb = size / n;
        double mb = kb / n;
        double gb = mb / n;
        double tb = gb / n;
        if(size < n) {
            s = size + " Bytes";
        } else if(size >= n && size < (n * n)) {
            s =  String.format("%.2f", kb) + " KB";
        } else if(size >= (n * n) && size < (n * n * n)) {
            s = String.format("%.2f", mb) + " MB";
        } else if(size >= (n * n * n) && size < (n * n * n * n)) {
            s = String.format("%.2f", gb) + " GB";
        } else if(size >= (n * n * n * n)) {
            s = String.format("%.2f", tb) + " TB";
        }
        return s;
    }
private static IDfSessionManager getSessionMgr(){
IDfSessionManager sessionMgr = null;
try{

IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
sessionMgr = client.newSessionManager();
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser("XXX");
loginInfoObj.setPassword(XXX");
sessionMgr.setIdentity("XXXXXXX", loginInfoObj);

}catch(DfException exp){
exp.printStackTrace();
}
return sessionMgr;

}
}