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

Set Folder Title using LAPI 1

Status
Not open for further replies.

slangevi

Programmer
Dec 19, 2005
4
US
Does anyone know how to set/retrieve the title of a folder or a document via LAPI?

I am able to set the name of the folder using this code:

llFolder.setString("Name", "Test Folder")

but I can't find the attribute to use to set the title. I've tried inspecting the LLVALUE object values but nothing is jumping out at me. Am I missing something?

Anyone have any ideas? Thanks!
 
What do you mean Title ? A folder only has one name which is its DISPLAY NAME unlike documents in Livelink.
 
As an example of the Title: in my workspace I see a list of documents and folders. This list displays the Type, Name, Title and Modified date of each folder/document. You can click on any of these headings and sort on that attribute.

Maybe the underlying attribute is not called the Title and that is just the display name of the heading?

I'm wondering how I can set this value for a newly created folder. I've seen other folders with a "title" set so I know it can be done somehow.

Also, If I edit the general properties of a folder there is a Title text box where I can manually enter in a value. If you have not seen this then maybe this is a custom extension of the System Category?

Thanks
 
A bit more investigation and it does appear to be an extension of the System Category.

I'm having troubles setting it's value through LAPI still. Note this is not a required attribute.

Here's what I'm currently doing to try and set the attribute.

Dim attribs As LLValue = (New LLValue).setAssocNotSet()
attribs.add("title", "TEST")
createInfo.add("request", attribs)

Then I'm passing the createInfo into the CreateObjectEx method.

I'm getting no errors back but when I check the title attribute is not being set.

Any ideas?
 
It will make much better sense if you as a simple GUI user went into your personal interface and created a folder.Without any customization what all do you fill? In vanilla livelink,it will ask for title ,and if you have got categories permission you will be filling values in that.I do not know what the System category is,maybe it is some category that your organization has created.If however you are implying "Additional Node Attributes",then you need to research how to get that set with LAPI.Otherwise if it is regular category and attributes that we are talking about then first you have to get the category object in its latest version and set that value and I am guessing "Title" might be a field in that.As for the Title that you see,as far as I know livelink it is probably a customization on either the webnodes view or it may be driving it off a category.I would not know..



Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Okay after more investigation I have figured out how to set this attribute.

The System Category is the built-in category that all livelink objects inherit. It specifies things like the Name, Creator, Create Date, etc. You can extend this category and add your own attributes. In this case that's what the "Title" attribute was.

To set these extended system attributes it's a bit different than setting other category attribute values. It's also different than setting standard object data attributes.

To do it you use the GetObjectAttributes and SetObjectAttributes functions.

Finding this in the API documentation is like finding a needle in a hay stack. One sentence mentions it, I easily overlooked it:

"This function sets the attribute information for custom <System> attributes."

If you refer to the documentation for those two functions it will point you in the right direction on how to set custom system attributes, but here is some simple sample code to set a custom attribute "Title" on a particular folder:

Dim attribs As LLValue = (New LLValue).setAssocNotSet()
status = m_Document.GetObjectAttributes(m_WorkspaceVolID, llFolderID, attribs)
If (status <> 0) Then Throw New Exception("Error!")
// The title attribute is the first rec value in the attributes
attribs.setString(0, "Value", "Test Title")
status = m_Document.SetObjectAttributes(m_WorkspaceVolID, llFolderID, attribs)

Even though I figured it out, thanks for the help guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top