Does someone have a simple upload sample to share? Getting null pointer but have no idea why. Thanks.
Here you go...
File[] files populated with file objects from a shared drive
iSubFolderID is the nodeID of a LL folder
objFile = files[i];
fileArray = new byte[( int)objFile.length()];
fis = new FileInputStream(objFile);
fis.read(fileArray);
objMetadata = new Metadata();
objAttachment = new Attachment();
objAttachment.setContents(fileArray);
objAttachment.setFileName(objFile.getName());
objAttachment.setFileSize(objFile.length());
objChild = objDocMan.createDocument(iSubFolderID, objFile.getName(), "", false, null, objAttachment);
Thanks for the help.
I think you are just missing setting the CreatedDate and ModifiedDate on the Attachment object. Non-null values must be set for these.
Thanks, that did the trick. I was thinking it would default to current time if not specified. Didn't think it would let you manipulate the created and modified times.
The node object's dates cannot be modified (dates stored in DTree) but the file version dates can be set. These dates are stored as the version's create date and modified date as found in the DVersData table under the FileCDate and FileMDate columns.
Thanks for the explanation. Is there a way to set max versions for all docs within a folder? In general, not through code.
If that can't be done how do you purge versions via code?
Hi.
This doesn’t exactly answer your question, but I wonder if you are aware of the feature in the OTRM module that allows you to purge versions automatically as a stage in the lifecycle? If you do use RM, and have version 4.2.1 or higher, there is a new option in the retention schedules (which you must turn on in the RM Settings ‘Display Purge Versions options’) to set this up.
Why we built this feature:
What you can configure:
<![if !supportLists]>· <![endif]>You can configure a minimum number of versions to keep (so, even if you say to get rid of versions that are older than 2 years old, you can specify a minimum number of versions to keep such as 5 so that you always keep 5 versions regardless of how old they are)
<![if !supportLists]>· <![endif]>If you use Major/Minor versioning, you can configure if you want to purge Majors or just minor versions
<![if !supportLists]>· <![endif]>You can set the configurations per RSI so you can have different rules to purge versions on different RSIs
<![if !supportLists]>· <![endif]>You can set the purging to happen automatically if desired (or follow a manual process)
<![if !supportLists]>· <![endif]>Choose whether to purge versions older than <period> or purge versions <period of time> after they have been superseded (date is based on the Version Create Date)
Tracy
From: eLink Entry: Content Web Services Forum [mailto:otdncontentwebservices971forum@elinkkc.opentext.com]Sent: May-22-12 2:01 PMTo: eLink RecipientSubject: Simple upload sample?
Simple upload sample?
Posted byswalker@celgene.com (Walker, Sean) On 05-22-2012 13:58
[To post a comment, use the normal reply function]
Topic:
Forum:
Content Web Services Forum
Content Server:
Knowledge Center
Tracy,
That sounds like it might work. Just to clarify: you can set max versions for a particular folder? Or is it set at the document level? Do you possibly have something that details the steps on how to do this?
Thanks,
Sean