Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updateVersionInfo

Status
Not open for further replies.

hanreb

Technical User
Jan 23, 2008
90
US
Hello All,

I am trying to update the filetype of a document.
It does not seem to work.

Any ideas....
Appreciate your help. As always thank you for the great people here who have always helped with their valuable answers.


Below is the piece of code that I tried.


LLValue versionInfo = new LLValue().setAssoc();
if(doc.GetVersionInfo(volumeID, 1159662,1, versionInfo)!=0)
{
System.out.println("Failure in GetVersionInfo ");
}
else
{
System.out.println("Success in GetVersionInfo " +versionInfo.toInteger("ID"));
}
String newValue="pdf";
versionInfo.add("MimeType",newValue);

if(doc.UpdateVersionInfo(volumeID,1159662,1,versionInfo ) !=0)
{
System.out.println("Version info updated");
}
else
{
System.out.println("could not update version info"+ session.getStatusMessage());

}

Thank You,
Sunu
 
I am not sure why you are adding the MimeType on the assoc,it is part of versionInfo.The right way is to see what VersionInfo contains and printout the assoc key MimeType.Then you change it to something like application/pdf.It is just not the string PDF that tells windows to open it in the PDF reader.
Hope that helps.
BTW the field you are trying to manipulate is the MIMETYPE column in dversdata for that dataid.Check manually what some of the other ones have for examples

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
Thank You appnair for your quick response.

Reason why I am trying to update the mime type is.

From the vendor we get documents with extension and without extension(abc) , Once it's is livelink its renamed with the extension as (abc.pdf) and we are able to open the document in livelink.

Now we need to run a report to list all documents whose mimetype is "pdf"
But in the dversdata table the mimetype is null, hence I am trying to update the mimetype to "pdf".

I tried updating some other fields in versionInfo, like FileName etc.. did not work either.

Thank You,
Sunu
 
Hopefully this will make sense

I ask you why do you have a statement like
versionInfo.add("MimeType",newValue);


What I think I am trying to say is when you do this call
doc.GetVersionInfo(volumeID, 1159662,1, versionInfo you get an assoc.One of the columns in the assoc is MimeType.You should print it.It will be null if the database says so.

Then you should "set" it Not "add" it.
Once you set the VersionInfo assoc which is a local variable in lapi with the correct params and send it back to livelink using the call .UpdateVersionInfo it should work putting whatever value you set in the MimeType key.

the best wasy to debug this is using your IE upload a document into livelink,note its dataid.Now run the sql command to get all the columns in dversdata for that docid.These columns hsould interest you mimetype and filetype.Mimetype keeps info of what the browser tells it
usually "application/pdf" or "application/octet-stream".File type is the extension of the file after the period like doc,pdf,xls etc.




Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
from what you have said the better option may be to do this using SQL to get the list of DATAIDs from DTREE or VERSIONIDs from DVERSDATA that you may need to feed into the LAPI script that APPNAIR has outlined above.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top