Saturday, April 10, 2010

New Bug in Livelink 9.7.1 - Destroy Your Search Index

0 comments
That's right.... this one will destroy your search index. It's a new bug that we discovered unfortunately the hard way. Opentext confirmed it and should be working on a patch.

Basically, when you create an extended attribute table for a category to reference, Livelink will build out a new table in its schema. The issue is that certain attribute names or the column name that Livelink will use when building out the table are in fact reserved words.

The reserved word in question this time around is ATTR_VALUE. Of course, this famous word is seen everywhere in Livelink, especially in the catregionmap table and llattrdata table. OUCH.

Words of warning here: Don't name an attribute or actually anything in Livelink "ATTR_VALUE". Just stay away from using it as a prefix or suffix. What happens is that the search index becomes corrupt and you have to rebuild it from the ground up. That is MASSIVE.

Good luck =]

Tuesday, April 6, 2010

How to update a boolean, yes/no, true/false attribute with LAPI

1 comments
Below is sample code in C# on updating a physical item attribute (custom system attributes in the Specifics tab of a physical object). You can use the same logic to update a regular category attribute that is boolean based.

The most important line is the  request.add("mtField_PrintNewLabel", "on");

Basically, use "on" for true, "off" for false. The "mtField_PrintNewLabel" is the name of the custom physical object attribute. It's mtField_Name-of-the-field.

For a category-attribute, you would use the update category functions and call the attribute name with the "on"/"off" value being passed.  


***I will post more examples of updating category/attributes, physical items (records management), and easy Livelink session establishment.

void doIt(int nodeID)
        {
            LLSession session = null;
            session = new LLSession("opentext.server.blah.com",
                                    2099,
                                    "",
                                    "adminloginacct",
                                    "adminpw");

            session.ImpersonateUser("yomama");


            LAPI_DOCUMENTS doc = new LAPI_DOCUMENTS(session);

            LLValue request = (new LLValue()).setAssocNotSet();

            request.add("objAction", "info2");
            request.add("selectedMedia",1235465 );
            request.add("poLocation", "CRC - ABC");
            request.add("mtField_Volume", "Vol10");
            request.add("mtField_Temporary", "No");
            request.add("mtField_FileType", "");           
            request.add("mtField_PrintNewLabel", "on");

            LLValue myEntValues = new LLValue();
            int volID = 0;
            if (doc.AccessEnterpriseWS(myEntValues) == 0)
            {
                volID = myEntValues.toInteger("VolumeID");
            }

            int status = 0;

            status = doc.UpdateObjectInfo(volID, nodeID, request);


            if (status != 0)
            {
                string errMsg = string.Format("Problem: {0} | {1} | {2} | {3}", session.getApiError(), session.getErrMsg(), session.getStatus(), session.getStatusMessage());
                Response.Write(errMsg);
            }
            else
            {
                Response.Write("Something got updated");
            }

        }