Hi Sam,
there are two ways to get this info.  You can query the database directly with:

SELECT * from (SELECT * from uploadtree2path($UploadtreePk)) AS path ORDER BY 
lft ASC;

Or, you can use the php function Dir2Path in ui/common/common-dir.php 
(http://fossology.svn.sourceforge.net/viewvc/fossology/tags/1.0.0/ui/common/common-dir.php?revision=1780&view=markup)

Pass the uploadtree_pk value from the uploadtree table.

Mary






________________________________
From: [email protected] [mailto:[email protected]] 
On Behalf Of Zhou, Sam
Sent: Wednesday, June 24, 2009 10:58 AM
To: [email protected]
Subject: [FOSSology] How to construct the full path for the entries in table 
'agent_lic_meta'


Folks,

We are trying to generate a report from fossology database. I noticed the final 
result are stored in table 'agent_lic_meta'.

CREATE TABLE "agent_lic_meta"(
 "pfile_fk" int4 not null ,
 "tok_pfile" int4 ,
 "tok_match" int4 ,
 "version" varchar(32) ,
 "phrase_text" varchar(256) ,
 "tok_pfile_start" int4 ,
 "tok_pfile_end" int4 ,
 "tok_license_start" int4 ,
 "tok_license_end" int4 ,
 "tok_license" int4 ,
 "lic_fk" int4 ,
 "pfile_path" varchar ,
 "license_path" varchar ,
 "agent_lic_meta_pk" int4 not null default 
nextval('agent_lic_meta_agent_lic_meta_pk_seq'::regclass)
)

Each row contains potential legal phrase captured in a file. However, I see no 
obvious way to
re-construct the full path based on the information provided by that table.

Which columns can trace back to 'uploadtree' and 'pfile' to re-contruct the 
full path (of that file having legal phrase)? Has the 'pfile_path' column 
something to do with it?

For your reference, I also copy 'uploadtree' and 'pfile' schema here,

CREATE TABLE "uploadtree"(
 "uploadtree_pk" int4 not null default 
nextval('uploadtree_uploadtree_pk_seq'::regclass),
 "parent" int4 ,
 "upload_fk" int4 not null ,
 "pfile_fk" int4 ,
 "ufile_mode" int4 ,
 "lft" int4 ,
 "rgt" int4 ,
 "ufile_name" text
)

CREATE TABLE "pfile"(
 "pfile_pk" int4 not null default nextval('pfile_pfile_pk_seq'::regclass),
 "pfile_md5" bpchar(32) not null ,
 "pfile_sha1" bpchar(40) not null ,
 "pfile_size" int8 not null ,
 "pfile_mimetypefk" int4 ,
 "pfile_usecount" int4 not null default 0,
 "pfile_liccount" int4
)

Thanks a lot,
Sam.

The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.

_______________________________________________
fossology mailing list
[email protected]
http://fossology.org/mailman/listinfo/fossology

Reply via email to