Pages

Showing posts with label ridc. Show all posts
Showing posts with label ridc. Show all posts

Wednesday, May 18, 2016

How to get expired contents and set new expired date using RIDC ?

How to get expired contents and set new  expired date using RIDC ?

Purpose : To list all the expired content and set new expired date in bulk . There is no database update is required for this .


Java Class : https://github.com/sterin501/expiredContent



Detailed steps :


1. Set config.properties for connection details .
2. Set StartDate and EndDate for search query . To list all the expired contents use blank values 





in unix

3. 


. ./classpath


4. To get expired content :


java -classpath $CLASSPATH GetExpired

Content.txt will have the expired date 

5. To update the expired Date :

java -classpath $CLASSPATH UpdateExpiredDate


in windows

3. call classpath.bat

4. java -classpath %CLASSPATH% GetExpired

5 . java -classpath %CLASSPATH% UpdateExpiredDate


OR



java -classpath .oracle.ucm.ridc.jar;. GetExpired


java -classpath .oracle.ucm.ridc.jar;. UpdateExpiredDate 



Sample run:

[sterin@sterinlap expiredContent]$ . ./classpath
[sterin@sterinlap expiredContent]$ java GetExpired 
ContentID is : STJACOBPC1IDCO003530 3131
ContentID is : STJACOBPC1IDCO003522 3123
ContentID is : STJACOBPC1IDCO003527 3128
[sterin@sterinlap expiredContent]$ java UpdateExpiredDate
Updating STJACOBPC1IDCO003530


@Properties LocalData
UserDateFormat=iso8601
IdcService=UPDATE_DOCINFO
dDocName=STJACOBPC1IDCO003530
UserTimeZone=UTC
dOutDate=2017-04-29 08:59:00
dID=3131
@end
Updating STJACOBPC1IDCO003522


@Properties LocalData
UserDateFormat=iso8601
IdcService=UPDATE_DOCINFO
dDocName=STJACOBPC1IDCO003522
UserTimeZone=UTC
dOutDate=2017-04-29 08:59:00
dID=3123
@end
Updating STJACOBPC1IDCO003527


@Properties LocalData
UserDateFormat=iso8601
IdcService=UPDATE_DOCINFO
dDocName=STJACOBPC1IDCO003527
UserTimeZone=UTC
dOutDate=2017-04-29 08:59:00
dID=3128
@end
[sterin@sterinlap expiredContent]$ java GetExpired 
[sterin@sterinlap expiredContent]$ 

Script to Set new dOutDate for Expired Content Using RIDC (Doc ID 2139331.1)

Monday, April 4, 2016

How to upload or download very large files with out any issue ?

How to upload or download very large files with out any issue ?



Things to consider for uploading and downloading the large files to UCM




Many configuration required for dealing with very large file ( more than 10gb) . It also involves many factors like network speed , UCM server capacity , weblogic configuration etc . This blog to help get more data and set the configuration


1. Make server Ready

12C server is ready by default . No need to install any patches on weblogic server and on Oracle_ECM

For 11g server , Below patches should be installed

For upload : 16083651 & 16960063

For Download : 14339868 ( this is only for Native File download , web layout works with out patch)


2. Setting required in the client

In 64 bit machine


Use Chrome 64 bit browser , that is best option for uploading file larger than 4 GB
IE 11 , Latest FireFox might work



In 32 bit machine



It allows only 2 GB size for upload . So we have to enable Chunking for upload. It is basically split the files based on the value set . Server will club all the parts together . It is more time consuming than browser upload .

It is based on Java applet . So browser and your network should support applet usage

To enable Chunking , add below entries in config.cfg of UCM

AppletChunkThreshold=10000000 // size in bytes , chucking will start only after this size
AppletChunkSize=10000000 // each size of the packets send from client
ChunkedRequestTrace=true
MultiUpload=true
DisableHttpUploadChunking=false



3. Setting Max time for weblogic thread

We have to increase the thread time out in weblogic console . By default value is 10 min ( 600 sec), if the upload or download take more than 10 min , weblogic will kill the thread ,upload process will stopped .

How to set : Weblogic console → Servers → UCM server → Configration → Tunning

Set : Stuck Thread max time





4. How to get Value for “Stuck Thread max time “

This is specific to each environment . Get the maximum file to upload or download

Test this RIDC upload code .

Get the RIDC code mention here :


it will show the network speed and Server Capacity , So “ Stuck Thread max time” should be more than total time required for upload . In the example

Time took in UCM server is 45.422 sec
Processing Capacity of your environment 34459.44696402624 KB/s
Processing Capacity of your environment 34.45944696402624 MB/s


So here no need to change the value . If it more than 600 sec , then “ Stuck Thread max time” should be edited .


5. Get the optimal value for AppletChunkThreshold & AppletChunkSize

We have to do trail and error method . Providing details from different test cases

Size of the file to upload to UCM : 13 gb

Upload Method : Using Chunk Applet

Test Case 1 :
AppletChunkThreshold=10000000
AppletChunkSize=10000000  ( 10 MB)
StuckThreadMaxTime=600 sec ( 10 min) (default value )
Even thoug it shows Checkin is fine but no time spend in the logs . Which means check in is failed . And it failed due to weblogic thread time out .
Test Case 2.a :
AppletChunkThreshold=10000000
AppletChunkSize=1000000000  ( 1GB)
Upload failed in the client system itself

Test Case 2.b :
AppletChunkThreshold=10000000
AppletChunkSize=500000000  ( 500 MB)
Upload cause performance issues in in client . So I stopped the upload

Test Case 3 :
AppletChunkThreshold=10000000
AppletChunkSize=100000000  ( 100 MB)
This causing performance issues in server . Server CPU went up to 100%

Test Case 4 :
AppletChunkThreshold=10000000
AppletChunkSize=50000000  ( 50 MB)
StuckThreadMaxTime=900 sec ( 15 min)
Checkin failed in the system due to thread time out in weblogic .
Last CHUNKED_UPLOAD finished it . It took 528 sec
CHUNKED_UPLOAD [dUser=weblogic][IsJava=1] 528.179931640625(secs)
Test Case 5 :

AppletChunkThreshold=1000000000
AppletChunkSize=40000000 ( 40 MB)
StuckThreadMaxTime=1200 sec ( 20 min)
I am able to check in the file in the UCM with this settings .
Total time : 1070.6832275390625(secs)
Last Chunk : 526.7379150390625(secs)
>requestaudit/6 03.11 11:54:51.750 IdcServer-10 CHECKIN_NEW [dID=1054][dDocName=STJACOBPC1IDCO001218][dDocTitle=WSS][dUser=weblogic][dSecurityGroup=Public][StatusCode=0][StatusMessage=Successfully checked in content item 'STJACOBPC1IDCO001218'.][IsJava=1] 1070.6832275390625(secs)


>requestaudit/6 03.11 11:54:51.763 IdcServer-349 CHUNKED_UPLOAD [dUser=weblogic][IsJava=1] 526.7379150390625(secs)




Last Chunk is the process which will club all the parts together , it is really time consuming process .This can be saved if 64 bit chrome browser is used 

Sunday, April 3, 2016

RIDC sample code to get Network Speed , UCM server capacity ,upload status

RIDC sample code to get Network Speed , UCM server capacity ,upload status 



This is mainly intended for large file upload ( 1.5 GB+).

JDK 1.8+ required .

Purpose : Sample code to provide
1.Status of upload process
2.Speed of network
3. Capacity of UCM server

UCM checkin process has 3 main file process

1. Send file to UCM server , UCM server keeps this file in temp directory of UCM server
2. Copy this temp file to Native File Location
3. Delete the Temp file created
4. Wait for the conversion and if there is no conversion copy Native File to Web layout

To get valid response from UCM server step 1,2,3 should be over . This code will help us to get speed of step1 ( Network speed ) , step 2&3 for the UCM capacity






Detailed Steps :

1. Download code  from : https://github.com/sterin501/CheckinSpeed.git


2.Edit config.properties

with URL , primary file etc

3. Run the code like

. ./classpath

java SpeedTest

4. Sample output ( for 1.5 GB file )

Size of file in bytes 1602782395
Size of file in KB 1565217.0
Size of file in MB 1528.5322265625
Starting Uploadler
Sending File to UCM ----->

hostname is 10.184.36.144
Sec is myrealm
Time out value is 780000
@Properties LocalData
UserDateFormat=iso8601
IdcService=CHECKIN_UNIVERSAL
UserTimeZone=UTC
dDocTitle=Test RIDC Checkin 1565217.0
dDocType=Document
dDocAccount=
dSecurityGroup=Public
@end
----->5% speed 78260.85 KB/sec ETA 19.0 sec
----->14% speed 109565.19 KB/sec ETA 12.285714285714285 sec
----->23% speed 119999.97 KB/sec ETA 10.043478260869565 sec
----->32% speed 125217.36 KB/sec ETA 8.5 sec
----->42% speed 131478.228 KB/sec ETA 6.904761904761905 sec
----->50% speed 130434.75 KB/sec ETA 6.0 sec
----->60% speed 134161.45714285714 KB/sec ETA 4.666666666666668 sec
----->68% speed 133043.445 KB/sec ETA 3.7647058823529402 sec
----->68% speed 118260.84 KB/sec ETA 4.23529411764706 sec
----->75% speed 117391.275 KB/sec ETA 3.333333333333334 sec
----->76% speed 108142.26545454546 KB/sec ETA 3.473684210526315 sec
----->76% speed 99130.41 KB/sec ETA 3.7894736842105257 sec
----->77% speed 92709.00692307693 KB/sec ETA 3.8831168831168803 sec
----->77% speed 86086.935 KB/sec ETA 4.181818181818183 sec
----->77% speed 80347.806 KB/sec ETA 4.480519480519483 sec
----->77% speed 75326.068125 KB/sec ETA 4.779220779220779 sec
----->77% speed 70895.12294117647 KB/sec ETA 5.077922077922079 sec
----->77% speed 66956.505 KB/sec ETA 5.376623376623375 sec
----->77% speed 63432.478421052634 KB/sec ETA 5.675324675324674 sec
----->77% speed 60260.8545 KB/sec ETA 5.974025974025974 sec
----->77% speed 57391.29 KB/sec ETA 6.272727272727273 sec
----->79% speed 56205.51954545455 KB/sec ETA 5.848101265822784 sec
----->92% speed 62608.68 KB/sec ETA 2.0 sec
-->100%

time took only for file transfer is 23 sec
Network Speed between client & UCM server is 68052.91304347826 KB/sec
Network Speed between client & UCM server is 66.45792289402173MB/sec
ContentID is STJACOBPC1IDCO001819

Time took in UCM server is 45.422 sec
Processing Capacity of your environment 34459.44696402624 KB/s
Processing Capacity of your environment 34.45944696402624 MB/s






Java details :

1. Java main class to define the thread class
2. In the thread demo class , start () should contain the upload process
3. run () used to track the upload process

4. There will be different class which deals  with RIDC action should be refer by step 2 

Monday, March 21, 2016

How to get Folder Structure including File details from WCC server using RIDC

How to get Folder Structure including File details from WCC server using RIDC 


purpose : To get a folder strucutre from FF enabled WCC server

Output will show Folder details with Parent Folder and contentID belongs to each folder 


RIDC java class :  https://github.com/sterin501/FolderStructure
  1. Edit the config.properties file
  2. Run the code like java FldStructure FLD_ROOT

IdcService used : FLD_BROWSE

Example : output
java FldStructure FLD_ROOT --> Shows Parent and child folder && <--> Shows the contents



FLD_ROOT-->C9394B7D72DB6648F6DE0ACB220E6258<---> C9394B7D72DB6648F6DE0ACB220E6258-->DB9C18541DDA74BEBFBEE5F008D2FB03<--->PS7003005,PS7003001,PS7003010,PS7003011,PS7003009,PS7003007,PS7003003,PS7003002,PS7003008, FLD_ROOT-->BE91ED870AA7F1DECC857E3FCEDA0C5D<---> BE91ED870AA7F1DECC857E3FCEDA0C5D-->B4730B5CDCD9217F9D7EC85DDD464303<---> FLD_ROOT-->FLD_ENTERPRISE_LIBRARY<---> FLD_ENTERPRISE_LIBRARY-->BDF314BBFB0735189BA579633B8F52F1<---> BDF314BBFB0735189BA579633B8F52F1-->139563A86D0A8557B40228E687AC841D<---> FLD_ENTERPRISE_LIBRARY-->06767B69F8092A70DFA370E65C8D5991<--->PS7008822, FLD_ENTERPRISE_LIBRARY-->24F3ADC920D186FA683D16837133F225<---> 24F3ADC920D186FA683D16837133F225-->61AADBD3C3341654311E113EFCC1055F<---> FLD_ENTERPRISE_LIBRARY-->E9D9BF42F08586C8FEA763DFC45E9492<--->PS7008222, E9D9BF42F08586C8FEA763DFC45E9492-->79B3EBBC303C17D1F66EC0CA9D7F331B<---> ........................................ .......................................
Total Folders Under FLD_ROOT : 29 Total Contents Under FLD_ROOT : 59 Folder Mapping FLD_ROOT-->C9394B7D72DB6648F6DE0ACB220E6258-->DB9C18541DDA74BEBFBEE5F008D2FB03 FLD_ROOT-->BE91ED870AA7F1DECC857E3FCEDA0C5D-->B4730B5CDCD9217F9D7EC85DDD464303 FLD_ROOT-->FLD_ENTERPRISE_LIBRARY-->BDF314BBFB0735189BA579633B8F52F1-->139563A86D0A8557B40228E687AC841D FLD_ROOT-->FLD_ENTERPRISE_LIBRARY-->06767B69F8092A70DFA370E65C8D5991
:Second
java FldStructure BDF314BBFB0735189BA579633B8F52F1 --> Shows Parent and child folder && <--> Shows the contents BDF314BBFB0735189BA579633B8F52F1-->139563A86D0A8557B40228E687AC841D<---> ...................... Total Folders Under BDF314BBFB0735189BA579633B8F52F1 : 1 Total Contents Under BDF314BBFB0735189BA579633B8F52F1 : 1 Folder Mapping BDF314BBFB0735189BA579633B8F52F1-->139563A86D0A8557B40228E687AC841D

Wednesday, February 17, 2016

How to search old revisions of the contents in UCM or WCC server?

How to search old revisions of the contents in UCM or WCC server? 

OR 

How to search for dID in WCC instead of dDocName ?

By default GET_SEARCH_RESULT search only the active revision of the content

 .

Like Revision 1 of content having Comment as '123'
Revision 2 of content having Comment as '456'

GET_SEARCH_RESULT with xComments=456 will show the content . But xComment=123 wont show any content .

This is working as expected from UCM side .

Work around : IdcService GET_DATARESULTSET can be used here . But this service wont have any dynamic Html page is associated with it . So you need some customization to use it

Append &IsSoap=1 will show the DataResultSet in xml format .

Paramete to pass:

IdcService=GET_DATARESULTSET
dataSource=Documents
whereClause=(xComments='123')
resultName=DOCUMENTS
IsSoap=1 (or Is Java=1 , IsJson=1)


RIDC code for this

config.properties
url=http://IP:16200/cs/idcplg
#url=idc://IP:IDCPORT
user=weblogic
password=welcome1
primaryFile=/tmp/sterin

java class



import java.io.*;
import oracle.stellent.ridc.*;
import oracle.stellent.ridc.model.*;
import oracle.stellent.ridc.protocol.*;
import oracle.stellent.ridc.protocol.intradoc.*;
import oracle.stellent.ridc.common.log.*;
import oracle.stellent.ridc.model.serialize.*;
import java.util.Properties;

/*
* @author Sterin- Oracle Inc
*
* This is a class used to test the basic functionality
* of submitting a search to Content Server using RIDC.
* The response is then used to retrieve metadata about
* the content items.
*/

public class SearchfordID {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
IdcClientManager manager = new IdcClientManager ();

Properties prop = new Properties();
InputStream input = null;

try{

input = new FileInputStream("config.properties");
// load a properties file
prop.load(input);


// Create a new IdcClient Connection using idc protocol (i.e. socket connection to Content Server)
IdcClient idcClient = manager.createClient (prop.getProperty("url"));

IdcContext userContext = new IdcContext (prop.getProperty("user"),prop.getProperty("password"));

// Create an HdaBinderSerializer; this is not necessary, but it allows us to serialize the request and response data binders
HdaBinderSerializer serializer = new HdaBinderSerializer ("UTF-8", idcClient.getDataFactory ());
// Create a new binder for submitting a search
DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "GET_DATARESULTSET");
dataBinder.putLocal("dataSource", "Documents");
dataBinder.putLocal("whereClause", "xComments='123'");
dataBinder.putLocal("resultName", "DOCUMENTS");

ServiceResponse response = idcClient.sendRequest(userContext,dataBinder);

DataBinder responseData = response.getResponseAsBinder();
DataResultSet resultSet = responseData.getResultSet("DOCUMENTS");



for (DataObject dataObject : resultSet.getRows ())

{
System.out.println("dID "+ dataObject.get("dID")+" dDocName "+dataObject.get("dDocName") + " Revision " +dataObject.get("dRevLabel") );


}



} catch (IdcClientException ice){
ice.printStackTrace();
} catch (IOException ioe){
ioe.printStackTrace();
}
}

}

Example of Output


java SearchfordID

dID 1335 dDocName SOURCEFF001325 Revision 1
dID 802 dDocName SOURCEFF000802 Revision 1
dID 1337 dDocName SOURCEFF001325 Revision 3


Tuesday, February 2, 2016

How to create High Availability Port with idc protocol ?

How to create High Availability Port with  idc protocol ?




Purpose : Using balance software , HA port is created with idc protocol . So this will help to load balance idc port in clustered domain .



Steps :
1.Install balance
2.run balance command


Detailed Steps :

1. Download balance from : https://www.inlab.de/balance.html




2. Make and Install it

cd balance-3.56
[root@LB balance-3.56]# make

gcc -O2 -Wall -Wstrict-prototypes -Wuninitialized -I. -c balance.c
balance.c: In function ‘stream’:
balance.c:910: warning: pointer targets in passing argument 1 of ‘hash_fold’ differ in signedness
./balance.h:133: note: expected ‘char *’ but argument is of type ‘unsigned char *’
balance.c: In function ‘main’:
balance.c:1813: warning: pointer targets in passing argument 1 of ‘hash_fold’ differ in signedness
./balance.h:133: note: expected ‘char *’ but argument is of type ‘unsigned char *’
gcc -O2 -Wall -Wstrict-prototypes -Wuninitialized -I. -c butils.c
gcc -O2 -Wall -Wstrict-prototypes -Wuninitialized -I. -o balance balance.o butils.o

[root@LB balance-3.56]# make install


install -o root -g root -m 755 balance \
/usr/sbin/balance
install -o root -g root -m 755 balance.1 \
/usr/sbin/../man/man1
install: cannot create regular file `/usr/sbin/../man/man1': No such file or directory


3.Verify by running balance commad

[root@myserver ~]balance
_ _
| |__ __ _| | __ _ _ __ ___ ___
| '_ \ / _` | |/ _` | '_ \ / __/ _ \
| |_) | (_| | | (_| | | | | (_| __/
|_.__/ \__,_|_|\__,_|_| |_|\___\___|
this is balance 3.56
Copyright (c) 2000-2009,2010
by Inlab Software GmbH, Gruenwald, Germany.
All rights reserved.



4.Run the balance command with idc server

Example : balance -b ::ffff:<LB> -B <LBHOSTNAME> <LBPORT> <IP1:POR1> <IP2:PORT2>

[root@myserver ~]# netstat -anp | grep 4444

[root@LB ]# balance -b ::ffff:10.111.11.111 -B LBHOST 4444 10.111.11.121:4453 10.111.11.122:4997
[root@LB ]# netstat -anp | grep 4444
tcp 0 0 ::ffff:10.111.11.111:4444 :::* LISTEN 23705/balance


6. Verify it

Here for testing purpose I am connecting two different WCC servers , which is having different autoprefix and running CHECKIN_UNIVERSAL . Make sure that admin server should be up and running while connecting via idc protocol

url= 10.111.11.111:4444
[sterin@sterinlap test]$ java TestRIDCCheckin
dDocName is SOURCEFF001052
[sterin@sterinlap test]$ java TestRIDCCheckin
dDocName is STJACOBPC1IDCO001205

So It will connect in round robin fashion . If one server is down, then automatically connect to other one




Monday, January 18, 2016

How to automate export and transfer process of archiver using RIDC ?

How to automate  export and transfer process of archiver  using RIDC ?






Purpose : Sample code to automate the archiver process

These are the basic Archiver process


1.Export ( Create batches )
2.Transfer
3.Delete batches

This RIDC code will do all the process required for archiver to run . Before running the code , there should be proxied target server should be configured . So that archiver can be transfer to there

Location of RIDC class : https://github.com/sterin501/ExportTransferRIDC

Step 1: Exporting

IDC service for export EXPORT_ARCHIVE

dataBinder.putLocal("IdcService", "EXPORT_ARCHIVE");
dataBinder.putLocal("IDC_Name",prop.getProperty("IDC_Name"));
dataBinder.putLocal("aArchiveName",prop.getProperty("aArchiveName"));
dataBinder.putLocal("dataSource","RevisionIDs");
dataBinder.putLocal("aDoExportTable","1");
dataBinder.putLocal("forceLogin","1");
dataBinder.putLocal("monitoredSubjects","collaborations");



2. Getting batch details created by step 1

dataBinder.putLocal("IdcService", "GET_BATCHFILES");
dataBinder.putLocal("IDC_Name",prop.getProperty("IDC_Name"));
dataBinder.putLocal("aArchiveName",prop.getProperty("aArchiveName"));

3. Getting ContentIDs from Batches created in Step 1

dataBinder.putLocal("IdcService", "GET_BATCH_FILE_DOCUMENTS");
dataBinder.putLocal("IDC_Name",prop.getProperty("IDC_Name"));
dataBinder.putLocal("aArchiveName",prop.getProperty("aArchiveName"));
dataBinder.putLocal("aBatchFile",aBatchFile);

This will provide “ExportResults” resultSet . From ther dDocName can be obtained


4.Transferring Batches

dataBinder.putLocal("IdcService", "TRANSFER_ARCHIVE");
dataBinder.putLocal("IDC_Name",prop.getProperty("IDC_Name"));
dataBinder.putLocal("aArchiveName",prop.getProperty("aArchiveName"));
dataBinder.putLocal("aTargetArchive",prop.getProperty("aTargetArchive"));
5. Getting Archiver Status before deleting the batches

dataBinder.putLocal("IdcService", "GET_ARCHIVES");
dataBinder.putLocal("IDC_Name",prop.getProperty("IDC_Name"));

This will return “ArchiveData” resultSet , which can be used to get the transfer count.

6. Verify the transfer count ,

you can compare the number of contents exported and transferred . Using Step 3 and Step 5 .



7. Delete Batches

dataBinder.putLocal("IdcService", "DELETE_BATCH_FILE");
dataBinder.putLocal("IDC_Name",prop.getProperty("IDC_Name"));
dataBinder.putLocal("aArchiveName",prop.getProperty("aArchiveName"));



Location of RIDC class : https://github.com/sterin501/ExportTransferRIDC

Monday, December 21, 2015

RIDC sample : How to Create Native file URL from checkin response

RIDC sample : How to Create Native file  URL from  checkin response


Customer having requirment to get the Native URL after checkin the file . Usually it takes one more service call required to get the Native File URL . Using this method we can save the next DOC_INFO service call and create the link or URL from the same response of checking

1. Place required lib files under lib folder
commons-codec-1.2.jar
commons-httpclient-3.1.jar
commons-logging-1.0.4.jar
oracle.ucm.ridc-11.1.1.jar


2.Create classpath file :

LIB=`pwd`/lib

CLASSPATH=$CLASSPATH:$LIB/oracle.ucm.ridc-11.1.1.jar:$LIB/commons-codec-1.2.jar:$LIB/commons-httpclient-3.1.jar:$LIB/commons-logging-1.0.4.jar:.
export CLASSPATH


3. source classpath

. ./classpath

4. Complie RIDCCheckinAndNativeURL.java file ( check the bottom of page )


javac RIDCCheckinAndNativeURL.java

5. Create connection.properties : this contains connection details like IP,username & password

url=http://IP:16200/cs/idcplg
#url=idc://IP:IDCPORT
user=weblogic
password=welcome1
primaryFile=/tmp/sterin

Make sure that file will be created in path mention in the config.properties file

8. Run java class:

java RIDCCheckinAndNativeURL

Example of Output


java RIDCCheckinAndNativeURL

java RIDCCheckinAndNativeURL
@Properties LocalData
UserDateFormat=iso8601
IdcService=CHECKIN_UNIVERSAL
UserTimeZone=UTC
dDocTitle=Test RIDC Checkin
dDocType=Document
dDocAccount=
dSecurityGroup=Public
@end
ContentID is STJACOBPC1IDCO1245601
dID is 1245601
GET_FILE_URL http://IP:PORT/cs/idcplg?IdcService=GET_FILE&dID=1245601&dDocName=CO1245601&AllowInterrupt=1


I edited the IP and PORT from the output


If there is issue with check in , then exception will be automatically caught

Code :


import java.io.*;
import oracle.stellent.ridc.*;
import oracle.stellent.ridc.model.*;
import oracle.stellent.ridc.protocol.*;
import oracle.stellent.ridc.protocol.intradoc.*;
import oracle.stellent.ridc.common.log.*;
import oracle.stellent.ridc.model.serialize.*;
import oracle.stellent.ridc.protocol.http.*;
import java.util.*;

/*
* @author Sterin Jacob -
*
* This is a class used to test the basic functionality
* of submitting a checkin to Content Server using RIDC.
*/

public class RIDCCheckinAndNativeURL {

/**
* @param args
*/
public static void main(String[] args) {
// Create a new IdcClientManager
IdcClientManager manager = new IdcClientManager ();
Properties prop = new Properties();
InputStream input = null;

try{

input = new FileInputStream("config.properties");
// load a properties file
prop.load(input);


// Create a new IdcClient Connection using idc protocol (i.e. socket connection to Content Server)
IdcClient idcClient = manager.createClient (prop.getProperty("url"));

IdcContext userContext = new IdcContext (prop.getProperty("user"),prop.getProperty("password"));

// Create an HdaBinderSerializer; this is not necessary, but it allows us to serialize the request and response data binders
HdaBinderSerializer serializer = new HdaBinderSerializer ("UTF-8", idcClient.getDataFactory ());
// Create a new binder for submitting a search
DataBinder dataBinder = idcClient.createBinder();
// Databinder for checkin request
dataBinder.putLocal("IdcService", "CHECKIN_UNIVERSAL");
dataBinder.putLocal("dDocTitle", "Test RIDC Checkin");
dataBinder.putLocal("dDocType", "Document");
dataBinder.putLocal("dDocAccount", "");
dataBinder.putLocal("dSecurityGroup", "Public");
dataBinder.addFile("primaryFile", new File( prop.getProperty("primaryFile") ));
// Write the data binder for the request to stdout
serializer.serializeBinder (System.out, dataBinder);
// Send the request to Content Server
ServiceResponse response = idcClient.sendRequest(userContext,dataBinder);
// Get the data binder for the response from Content Server
DataBinder responseData = response.getResponseAsBinder();
// Write the response data binder to stdout
//serializer.serializeBinder (System.out, responseData);


System.out.println("ContentID is " + responseData.getLocal("dDocName"));
System.out.println("dID is " + responseData.getLocal("dID"));
String GET_FILE_URL;

GET_FILE_URL=prop.getProperty("url")+"?IdcService=GET_FILE&dID="+responseData.getLocal("dID")+"&dDocName="+responseData.getLocal("dDocName")+"&AllowInterrupt=1";

System.out.println("GET_FILE_URL "+ GET_FILE_URL);
} catch (IdcClientException ice){
ice.printStackTrace();
} catch (IOException ioe){
ioe.printStackTrace();
}
}

}