Click here to register.
      
Sprechen Sie WebGUI? Parlez vous WebGUI? Se habla WebGUI? Spreekt u WebGUI?

Do you speak WebGUI? Please help us translate WebGUI into your language.



     Discuss > Web Design, Templates, and Themes

listing all pdfs

User elnino
Date 2/19/2008 3:36 pm
Views 877
Rating -2    Rate [
|
]
Previous · Next
User Message
elnino

I have a query that I think should list all the pdfs:

select asset.assetId, asset.parentId, assetData.url,assetData.title,assetData.menuTitle,assetData.assetSize, assetData.revisionDate from asset inner join FileAsset on asset.assetId = FileAsset.assetId inner join assetData on asset.assetId = assetData.assetId where FileAsset.filename like '%.pdf' and asset.state = 'published' and assetData.groupIdView = 7

1) how do I modify this to list all pdfs from a specific starting point?

2) how do I translate the assetSize to Kb? Is it in bytes right now?

Thanks!

 

--- (Edited on 2/19/2008 3:36 pm [GMT-0600] by elnino) ---



Back to Top
Rate [
|
]
 
 
colink

Asset size includes the size of db entry for the Asset, too.  Things like url, title, lineage, etc.

If you want to start at a certain point, you'll need to consider the Asset's lineage entry. 

--- (Edited on 2/19/2008 4:06 pm [GMT-0600] by colink) ---



Back to Top
Rate [
|
]
 
 
elnino

thank you colink.

So, how would I calculate the actual size of the file if the assetsize field includes the file size and the db record size? Or did I misunderstand you? Is the value stored in assetsize in bytes?

Ok. I read up on the lineage stuff Ithink I know what to do. Nice WIKI whoever wrote it.

--- (Edited on 2/26/2008 2:06 pm [GMT-0600] by elnino) ---



Back to Top
Rate [
|
]
 
 
elnino

Hello. My query is returning PDFs that are in a uncommitted version tag. Is there a way to filter them out?

 

select distinct assetData.url, assetData.menutitle as myfilename, round(assetData.assetSize/1024) as mykB, FROM_UNIXTIME(assetData.revisionDate, '%c/%e/%Y %l:%i %p') as mydate
from asset
inner join FileAsset on asset.assetId = FileAsset.assetId
inner join assetData on asset.assetId = assetData.assetId
where left(asset.lineage,length(?)) = ?
and assetData.url like '%.pdf'
and asset.className = 'WebGUI::Asset::File'
and FileAsset.filename like '%.pdf'
and assetData.groupIdView = 7
and asset.state = 'published'
and
  assetData.revisionDate =
    (SELECT
      MAX(maxassetData.revisionDate)
     FROM assetData as maxassetData
     WHERE assetData.assetId=maxassetData.assetId)
order by assetData.menutitle

--- (Edited on 3/13/2008 10:13 pm [GMT-0500] by elnino) ---



Back to Top
Rate [
|
]
 
 
elnino
never mind. Need to lok at status = 'aproved"

--- (Edited on 3/13/2008 11:50 pm [GMT-0500] by elnino) ---



Back to Top
Rate [
|
]
 
 

Smoketest For nightly_2008-07-05 by Visitor - Sat @ 01:46am

Smoketest For nightly_2008-07-04 by Visitor - Fri @ 01:37am

Re: News Addon? by knowmad - Thu @ 06:04pm

Re: News Addon? by bepo - Thu @ 08:54am

Re: News Addon? by bepo - Thu @ 03:35am

Smoketest For nightly_2008-07-03 by Visitor - Thu @ 01:37am

Thingy Reporting (pt 2) by knowmad - Wed @ 05:37pm

Re: News Addon? by knowmad - Wed @ 05:12pm

spell checker and tinymce by elnino - Wed @ 04:50pm

Re: WebGUI works on perl 5.10 by knowmad - Wed @ 04:41pm

Re: how the cost installing WebGUI ?? by baylink - Wed @ 12:19pm

Re: News Addon? by bepo - Wed @ 07:38am

Re: News Addon? by bepo - Wed @ 03:38am