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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the creation / modification date

Status
Not open for further replies.

vlamonde

Programmer
Oct 10, 2006
5
CA
Hi there,

I'm fairly new with Livelink and am currently working at adapting a VB6 / LL8.5 to VB.Net / LL 9.5. The VB conversion is of course going very well but the Livelink conversion is proving to be much harder...

What I'm trying to do here is to set the creation and last modified date of a newly added file to the actual similar of the local file I'm uploading. In other words, if I were to add a file today, instead of it showing Oct 10th as the creation date, I'd want it to show the actual original creation date of the file say... sometime last year.

Before I go into the code I've written and tested to no avail, can someone confirm this is doable? Thx a lot!

Vince
 
I think there can be two approaches you can take
a)Usually everything in Livelink are Objects and naturally to create an object you can use CreateobjectEx followed by CreateVersion to add a document.This does not allow manipulation of the file created date as the file is statted by the app and it inherits the file system info.However you can immediately call UpdateObjectInfo on the newly created object and manipulate the attributes .CreateDate is a field you can manipulate.

b)You may be in luck if you just used AddDocument I see it does allow you to do Createdate at Object creation time.However you will be seriously constrained by category and attribute support on this call

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
The other issue is that if you have multiple timezones involved then the Livelink date stamp is neutral, if you use a local datestamp you could end up with replies being added chronologically before the original topic for example and may lead to confused users.

Using these dates can make reporting more difficult as well.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005
 
Thanks a lot for your answers!

I ended up testing out the approach a) yesterday afternoon and managed to get it to work by first creating the document using CreateObjectEx and then Updating it and finally creating the version for it. One thing I found out though is that it seems impossible to set the last modified date which thankfully isn't a problem. I also realised there were many sets of dates along the version table and object table : one for the version, one for the file in the version table as well and finally one in the object table. I managed to change 3 out of those 6 dates.

I don't think the multiple time zones will be of much importance in this case since it's a "once per file" date but definitely good to keep in mind, thanks!

Btw Appnair, I tried for a long time to pass in this CreateDate value with the FileInfo value on AddDocument but never could get it to work for the Date field I was interested in. My guess is that it's because it doesn't support attribute settings as you said?

Thanks a lot again for your answers :)

Vince
 
I see this thread started a while ago, but I was wondering if anyone has figured out why setting the creation date, owner and modification date using the fileInfo value and AddDocument call doesn't appear to do anything?

Perhaps also someone could enlighten me on ValueAlloc. It says in the documentation that FileType is "an Assoc value object, initialized using ValueAlloc" but I'm unsure of how to initialize objects usings ValueAlloc, or what it is for that matter. I can't really think of anyone other reason this wouldn't be working.

If it helps, here's what I've been trying:

LLValue fileInfo = (new LLValue()).setAssoc();
LLValue createInfo = (new LLValue()).setAssocNotSet();
LLValue versionInfo = (new LLValue()).setAssocNotSet();

DateTime ct = File.GetCreationTime(path);
DateTime mt = File.GetLastWriteTime(path);

fileInfo.add("CreatedDate", new java.util.Date(ct.ToString()));
fileInfo.add("ModifiedDate", new java.util.Date(mt.ToString()));
fileInfo.add("Creator", "Admin");
 
I am guessing you have the livelink API handy.Livelink API is not very strongly typed as in other OOP languages.You basically interact with the livelink system using value objects aka datastructures.Here's how I understand it.I look at the documentation of the UpdateObjectinfo call.The documentation says I shoud pass an assoc object as in ObjectInfo Attributes .So createDate is something I can change
fileInfo.add("CreateDate", "09/08/2007");
ModifyDate doc says NA.

When the api call hits livelink server aka oscript it looks like

<A createdate='9/08/2007',name='appnair' and a bunch of comma separated things>

If the call is not working accoring to documentation,it could very well be there is an error in documentation,or the value is not the way that livelink expects.Most of the times if you have builder handy you can debug it too.

Sometime back I posted a snippet here about how to use a date object in C#.Also like the previous poster says livelink uses several tables to show those different dates and show that in the GUI so you might have to play it with a little bit to figure out the right call to update.


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top