Tuesday, September 7, 2010

Multiple Remote Desktop Connections

0 comments
It's free. It helps with multiple RDC's and makes life simpler. I knew about it but never thought about finding the original download source. I kept getting it off of other server admins' thumbdrives...

http://terminals.codeplex.com/

Monday, August 23, 2010

Very basic Oracle query to get parent hierarchy

0 comments
Here's a simple query that uses the "connect by" functionality in Oracle to get the entire parental hierarchy of a given nodeid in DTREE.

select *
from dtree
connect by prior parentid=dataid
start with dataid = 12345 --starting nodeID

This will give you all the parent nodeid's starting from the Enterprise top level down to the dataid you specified.

Monday, May 24, 2010

Pivoting the Livelink LLATTRDATA Table

0 comments
For those who have tried to pull attribute data, you know that each attribute value is on a separate row and may even be in a different column. Here's a query (sorry MSSQL guys) that will put all the attributes into one row when you run it. This can be used in web reports or external apps to grab category/attribute data and display it nicely. Good luck.

select lla.id
, max(decode(lla.attrid, 2, lla.valstr, null)) "Attribute Name 1"
, max(decode(lla.attrid, 3, lla.valstr, null)) "
Attribute Name 2"
, max(decode(lla.attrid, 4, lla.valstr, null)) "
Attribute Name 3"
, max(decode(lla.attrid, 5, lla.valstr, null)) "Attribute Name 4" 
, max(decode(lla.attrid, 6, lla.valstr, null)) "Attribute Name 5"
, max(decode(lla2.attrid, 5, lla2.valstr, null)) "Attribute Name 6"
from llattrdata lla, llattrdata lla2
where lla.id = lla2.id
and lla.defid = 47881102 --category id 1
and lla2.defid = 40278096 --category id 2
and lla.id = 48212327 --can replace with a subselect to get a group of dataIDs in dtree (ex: *where defid in (select dataid…))
and lla2.id = 48212327
group by lla.id

Please note that the defids and ids will not be the same in your instance. You need to replace them with your own values. 

Here's the explanation:
  • select lla.id - Pulls the Livelink object ID from the LLATTRDATA table
  • , max(decode(lla.attrid, 2, lla.valstr, null)) "Attribute Name 1" - This gets only one row, one column for the specific attribute. What you need to change: The numeric value inside the decode, right after the "lla.attrid". The "2" in this case represents the attribute ID. This number can be found on the CATREGIONMAP table as the number found suffixed to the value in column REGIONNAME (Attr_1234567_###). This number gets used in the decode statement to filter against the ATTRID column in table LLATTRDATA. 
  • , max(decode(lla.attrid, 3, lla.valstr, null)) "Attribute Name 2" - SAME AS ABOVE
  • , max(decode(lla.attrid, 4, lla.valstr, null)) "Attribute Name 3" - SAME AS ABOVE
    , max(decode(lla.attrid, 5, lla.valstr, null)) "Attribute Name 4" - SAME AS ABOVE
  • , max(decode(lla.attrid, 6, lla.valstr, null)) "Attribute Name 5" - SAME AS ABOVE
  • , max(decode(lla2.attrid, 5, lla2.valstr, null)) "Attribute Name 6" - In this line, I am referencing an attribute ID off another category, hence the lla2.attrid.
  • from llattrdata lla, llattrdata lla2 - Datasource for pulling the attribute values. You will need to call the LLATTRDATA table for each different category you are trying to grab data from. In this case, there are only two that are associated with the Livelink objects in question.
  • where lla.id = lla2.id - The inner join to connect the two LLATTRDATA tables. If you had three LLATTRDATA calls, then the second JOIN would be "and lla2.id = lla3.id"
  • and lla.defid = 47881102 --category id 1 - The filter for the first LLATTRDATA table call, i.e. the DEFID or the category ID, which can be pulled from the CATREGIONMAP table.
  • and lla2.defid = 40278096 --category id 2 - Same as above except this is calling the defid of the second category
  • and lla.id = 48212327 - Filter to get a specific Livelink object in the LLATTRDATA table. This value is the object ID. You can actually implement a subselect statement in place of the hardcoded dataid. This will allow you to get multiple objects with their category/attribute values associated.
  • and lla2.id = 48212327 - Same as above. You have to apply the same filter to all LLATTRDATA table calls because of the table joins and pivots.
  • group by lla.id - Forces the results to show up in one row per Livelink object



Usages of this query: 

  • Faster than joining multiple select statements to get LiveLink attribute data.
  • Web Reporting... I've actually used this as a data source for a web report that returns 30K+ records. If you implement the SQL as a materialized view in the LiveLink schema and  reference it in your LiveReport SQL, then the results should be quick. 
  • Quick go-to for data pulling that clients need.

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");
            }

        }

Monday, March 29, 2010

The Business Analyst Algorithm

0 comments
This has nothing to do with Livelink, but after doing development work for a while, I have learned that developers do A LOT more than actual coding. I was inspired by the Friend Algorithm by Sheldon Cooper in the TV sitcom "Big Bang Theory". I gotta say, this is pretty accurate. So accurate, that even my colleagues follow it. (SOL stand for **it Out of Luck).

How To Kill Your Livelink Server.... With Web Reports

0 comments
Yes... this is true and very possible:
  • Run a long processing web report under the livelink.exe path and you'll get a CGI Timeout. 
    • Keep doing it and the server will not respond anymore. You'll have to restart services.
  • Send a null value to a search parameter based on an attribute field (if you are using search as your datasource)
    • This will cause an infinite loop. This is guaranteed when the attribute you are searching on is a required attribute. So much for depending on search as your datasource vs. old-fashioned LLATTRDATA convoluted-inner-join queries....
To avoid it: Use the llisapi.dll to run the reports. 

I brought down our production servers today. =]

Tuesday, March 23, 2010

LiveLink Object Importer Quick Check List And Tips

0 comments
  1. For Livelink 9.7: Make sure the entire Object Importer file is surrounded with <import>...</import> tags.
  2. When dealing with category attributes, always enclose the actual attribute value with the xml CDATA tags. Why? Because you never know when some piece of data will contain a character that should be escaped or not even allowed! (ampersands, quotes, ticks, colons, etc...)
  3. Use the sync tag even when you are creating new folders or objects. It just makes life easier.
  4. Depending on how your Object Importer module is set up, either put the entire Livelink object path in the tag or include the <title> tags afterward. 
  5. Watch out for colons in a name. That's a huge no-no. 
  6. If you enclose your attribute values with cdata, then you can just put in a normal carriage return for values that are multiline. Otherwise, use the &amp;br; or &amp;nl; escape.
  7. Keep multiple Object Importer files small and manageable. 
  8. Build the folder structure out first, permissions second, categories third, classifications forth, and everything else last.
  9. You cannot do a move with Object Importer. Don't even bother wasting your time researching that.
  10. Make sure your categories, ACL groups and classifications exist on the server before doing a file load. 
  11. You CAN import files from external sources... like images and docs from a network share. Just make sure the Livelink server processing the OI files can access the external source.
  12. Order of preference in Object Importer is actually based on Windows alphabetical ordering. 
  13. Don't put a shortcut link in the object importer watch folder... you can and will bring down the server.
  14. It is case sensitive!!!
  15. There is a lot of trial and error with OI files, but once you get that one record to load successfully with the correct permissions, classifications, categories, etc, then base the rest of the import process on that. 
  16. Object Importer is a good option if you need to migrate Terabytes of legacy data into Livelink. 
  17. If you are good at SQL, then you have a huge advantage to using Object Importer.
  18. If you have Automatic Document Numbering (ADN) installed, then your Object Importer routine just got more difficult.
  19. Always remember to at least populate the required attributes. 
I like Object Importer.

Tuesday, March 16, 2010

Enabling Full Livelink Logging to Capture LAPI Problems

0 comments
In trying to troubleshoot the 101107 LAPI error and 0-byte size documents, I learned there are some specific settings in the OT.ini file (not the actual name btw) to allow for LAPI logging.

In the file:
[general]
debug=2
 
[options]
WantLogs=TRUE
WantLAPILogs=TRUE
WantTimings=TRUE
WantVerbose=TRUE
 
Restart services, replicate the issue as many times as you want, and start comparing GB's worth of logs!
Have fun!

Tuesday, March 9, 2010

Speeding up a Livelink Web Report

1 comments
Slow-as-molasses Livelink Web Report??? Try using a saved search as your data source. "But I have a bunch of attributes as my starting filters," you say. You can work through that too... Example:

  1. Go to Advanced search.
  2. Do a full text search.
  3. Look for All words
  4. Find out what the actual field name of the attributes you want to search for are (Attr_####_##). This information is found in a table in the database. I'm not going to mention the actual name because I don't know what legal issues this post can cause. It rhymes with fatregionnap.
  5. Build your advanced query like so: Attr_33353557_3:%2 AND Attr_33353557_4:%3 AND Attr_33353557_6:%4 AND Attr_33353557_12:%5 AND Attr_33353557_11:%6 AND Attr_33353557_10:%7 AND Attr_33353557_20:%8 AND Attr_33353557_2:%9 AND Attr_33353557_19:%10 AND OTSubType:144
  6. The above will get you specifically documents that have two categories and the values you pass into attribute parameters. The middle number in those field names are the actual category id.
  7. Optionally, to speed up the results even more, Add a scope to the search. 
  8. Save it.
  9. Reference it in the Web Report.
  10. Format your web report as you would.

I will post more on building an entire web report with this data source pull method later on.

Error: Unique constraint on dtree, LAPI add object, 101107

0 comments
Environment: Livelink 9.7.1, .NET 3.5, Oracle 10, ADN module, heavy category/attributes
Problem: Multithreaded LAPI app loads several documents into Livelink and creates new folder structures, permissions, RM Classifications, and categories. Once in a while, we run into this error on the Livelink server side: Oracle error: (1) --> ORA-00001: unique constraint (LINK_OWNER.ADNIDS_INDEX1) violated

The LAPI error is CreateObjectEx Failed. Message=Error adding categories to node errMsg=Error saving generated number. Status=101107 (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
LapiException: CreateObjectEx Failed. Message=Error adding categories to node errMsg=Error saving generated number. Status=101107

Theories:
  • ADN is blowing up again. 
  • The LAPI port is getting overloaded.
  • LAPI sucks.
  • The database is being overwhelmed by multiple transactions from multiple users (adding one object to Livelink is usually about 100-200 various transactions, so do the math if there are 100+ users).

Wednesday, March 3, 2010

Error: The provider already exists in this session

0 comments
I've been trying to troubleshoot a LAPI error and perused through the Livelink connect logs. This one error kept showing up.

"The provider already exists in this session"

Looks like you can ignore this one. It is a warning message that is to be expected. It is saying that the EFS required has already been identified. It is common and can be ignored.

Link to the discussion thread here.

Wednesday, February 24, 2010

LAPI Error 107404

0 comments
Session Status=107404
Error=Error setting the category or attributes for this node. Error saving generated number.
Happening When=Updating multiple documents with latest attribute values.

The "Error saving generated number" points to an Automatic Document Numbering module specific error... but who knows. More research to follow....

Thursday, February 18, 2010

LAPI Error 101107

0 comments
LapiException: CreateObjectEx Failed. Message=Error adding categories to node errMsg=Error saving generated number. Status=101107

Scenario: Bunch of categories need to be applied to a newly created folder structure and sub objects. I was trying to add a document into Livelink via LAPI. If the folder structure for where document goes does not exist, then the LAPI app creates it with the correct categories, attributes, permissions, RM Classifications, etc... However, if the structure exists, even though the category may have been applied incorrectly, then the app will just load the document into the folder structure.

Potential cause: I'm still looking into since there are so many moving parts and factors involved with this enterprise solution.... for loading documents non-natively (if that's a word) into Livelink. (DAMN architects)
What I think is happening is that -
  • The category DNE at the expected parent level.
  • The attributes were not populated correctly.
  • ADN (automatic document numbering) had an issue
I strongly believe it has something to do with ADN because I have found issues with SQL Injections. You attempt to load a document with reserved SQL words like UNION and JOIN and ADN freaks out. Special characters like apostrophe mess it up too. We have patched ADN with a quick fix from the vendor but still run into this 101107 error. It's like Livelink is failing during the database writes into ADN along with the external file store and the attribute tables. WTF....

What a pain in the ass to resolve. Logging on the Livelink is so process intensive.

Wednesday, February 17, 2010

LAPI Connection Issues

1 comments
I've been running into sporadic issues with an enterprise app that hits Livelink constantly through LAPI. The following are some articles I found. None of them fixed my issue though because we've actually attempted the resolutions two years ago to fix ANOTHER LAPI connection issue. F%$K!!!

Article Number: 3500936 - Why do I get LAPI connectivity issues intermittently?
  • Running massive amounts LAPI transactions result in "Could not access server" error.
Article Number: 15090633 - LAPI - GetObjectAttributesEx Function Executes Increasingly Slowly When Called Repeatedly
  • Repetitive usage of the function results in degrading performance.
Article Number: 3496785 - Keep Livelink Socket Backlog In Mind When Creating Multi-Threaded LAPI programs
  • LAPI calls randomly fail in Multi-threaded applications if the number of application threads are greater than the number of Livelink server threads
Article Number: 3501616 - Getting sporadic LAPI errors (Pooling LLSession objects)
  • There is no apparent advantage to pooling LLSession objects 

Tuesday, February 16, 2010

Livelink aka Livestink

0 comments
Well... I don't hate Livelink that much. If it wasn't for the lack of developers and Livelink specialists, then I would be out of a job. There A LOT of great things about the content management system. But there are also, A LOT of nuisances that bring the product quality down. As a Livelink developer, I have been involved on all sides of a Livelink implementation. More to come as I jot down my prior and current experiences with this product.