Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
I need an outline of the taxonomy from the Enterprise Level
Dan_Taylor_(shelloffuser7_-_(deleted))
The 'Project Outline' tab in projects will give a outline for that project, but because the outline is shown as links to those workspaces or documents, only the project participants can see this outline. I need a LiveReport that will give a non-linked outline from the Enterprise level, and I only want to show projects, folders and sub-projects.What is the code for Oracle to do this?
Find more posts tagged with
Comments
John W. Simon, Jr.
I think the following SQL is what you are wanting:select dataid, name, subtypefrom dtreewhere subtype in (0,202)start with dataid = 2001connect by prior dataid = parentidGood Luck,JWS
Dan_Taylor_(shelloffuser7_-_(deleted))
Thanks, but your code returned 'no results'.
Robert_Davies_(unlondonadmin_-_(deleted))
I tried this code as well and similarly got no results but as I looked at the value for Dtree.Dataid I thought I had seen another report that used 2001 instead of 2000 as a vlue for Dtree.Dataid (I think this is something to do with different versions of Livelink - but don't quote me). When I put in this value I did get results - but it doesn't seem to give the full taxonomy only the top level. Let me know if you get any further as this is something I am interested in as well.Best regardsAnne
Magnus_Salgo_(IDNordicAdmin_(Delete)_2300172)
One reason for troubles could be that you connect is just valid in Oracle ....If you look in MSSQL help you have the following suggestion for expanding hierarchiesThe best way in Livelink I think is to do a small request handler ....From SQL Server Books OnlineExpanding HierarchiesDatabases often store hierarchical information. For example, the following data is a hierarchical representation of regions of the world. This representation does not clearly show the structure implied by the data.Parent Child ---------------------------------- ----------------------------------World Europe World North America Europe France France Paris North America United States North America Canada United States New York United States Washington New York New York City Washington Redmond This example is easier to interpret:World North America Canada United States Washington Redmond New York New York City Europe France Paris The following Transact-SQL procedure expands an encoded hierarchy to any arbitrary depth. Although Transact-SQL supports recursion, it is more efficient to use a temporary table as a stack to keep track of all of the items for which processing has begun but is not complete. When processing is complete for a particular item, it is removed from the stack. New items are added to the stack as they are identified.CREATE PROCEDURE expand (
@current
char(20)) asSET NOCOUNT ONDECLARE
@level
int,
@line
char(20)CREATE TABLE #stack (item char(20), level int)INSERT INTO #stack VALUES (
@current
, 1)SELECT
@level
= 1 WHILE
@level
> 0BEGIN IF EXISTS (SELECT * FROM #stack WHERE level =
@level)
BEGIN SELECT
@current
= item FROM #stack WHERE level =
@level
SELECT
@line
= space(
@level
- 1) +
@current
PRINT
@line
DELETE FROM #stack WHERE level =
@level
AND item =
@current
INSERT #stack SELECT child,
@level
+ 1 FROM hierarchy WHERE parent =
@ROWCOUNT
> 0 SELECT
@level
=
@level
+ 1 END ELSE SELECT
@level
=
@level
- 1END -- WHILE The input parameter (
@current)
indicates the place in the hierarchy to start. It also keeps track of the current item in the main loop.The two local variables used are
@level
, which keeps track of the current level in the hierarchy, and
@line
, which is a work area used to construct the indented line. The SET NOCOUNT ON statement avoids cluttering up the output with ROWCOUNT messages from each SELECT.The temporary table, #stack, is created and primed with the item identifier of the starting point in the hierarchy, and
@level
is set to match. The level column in #stack allows the same item to appear at multiple levels in the database. Although this situation does not apply to the geographic data in the example, it can apply in other examples.In this example, when
@level
is greater than 0, the procedure follows several steps: If there are any items in the stack at the current level (
@level)
, the procedure chooses one and calls it
@current
. Indents the item
@level
spaces, and then prints the item. Deletes the item from the stack so it won?t be processed again, and then adds all its child items to the stack at the next level (
@ROWCOUNT
> 0), descends one level to process them (
@level
=
@level
+ 1); otherwise, continues processing at the current level. Finally, if there are no items on the stack awaiting processing at the current level, goes back up one level to see if there are any awaiting processing at the previous level (
@level
=
@level
- 1). When there is no previous level, the expansion is complete. (c) 1988-98 Microsoft Corporation. All Rights Reserved.
John W. Simon, Jr.
2001 is the dataid for the Enterprise for anyone who converted from v7 to v8. If you did not go through the conversion then you will want to use 2000.Also, this will only work on an Oracle instance.By the way, to get more of an outline look try this:select dataid, lpad(' ',2*(level-1)) || name name, subtypefrom dtreewhere subtype in (0,202)start with dataid = 2001connect by prior dataid = parentid
Dan_Taylor_(shelloffuser7_-_(deleted))
Well, actually, I had gotten:SELECT LPAD('.',2*(LEVEL-1),'.') || NAME "HIERARCHY", LEVEL FROM DTREE WHERE SUBTYPE = 0 OR SUBTYPE = 202 START WITH DATAID = 2000 CONNECT BY PRIOR DATAID = PARENTIDto work with version 8.1.3. If I left out the periods in the LPAD it did not do any indentation so I had to put them in.
Alex_Kowalenko_(akowalen_(Delete)_2285456)
To get a taxonomy replica starting from some container other than the enterprise root (dataid = 2000 or 2001) use the following Oracle code in a LiveReport with a Container input field. It also reports Compound documents and taxonomy within (sub)projects but does not sort elements within a container:select lpad(' ', 4 * (level - 1) + 1,'|...') || dree.name "name", DTree.DataID, DTree.SubType, DTree.GIF, DTree.PermID, DTree.Reserved, DTree.ReservedBy from dtree where subtype in (0,136,202) start with dataid = %1 connect by prior dataid = abs(parentid)