Click here to register.
      
PBWG Banner


     Discuss > Web Design, Templates, and Themes

listing all pdfs

User elnino
Date 2/19/2008 3:36 pm
Views 922
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 [
|
]
 
 

Re: Duplicate web site by bartjol - Sun @ 01:21pm

YouSendIt like app. by pvanthony - Sun @ 09:33am

Smoketest For nightly_2008-07-20 by Visitor - Sun @ 01:37am

Smoketest For nightly_2008-07-19 by Visitor - Sat @ 01:38am

Re: Survey2 by perlmonkey2 - Fri @ 05:36pm

Smoketest For nightly_2008-07-18 by Visitor - Fri @ 01:39am

Re: Building WRE for Fedora Core 4 x86_64 by neodymiumex - Thu @ 02:59pm

Tracking file downloads in WebGUI by colink - Thu @ 02:00pm

Smoketest For nightly_2008-07-17 by Visitor - Thu @ 01:39am

Re: Survey2 by perlmonkey2 - Wed @ 11:05pm

Re: Survey2 by patspam - Wed @ 08:05pm

Re: Survey2 by perlmonkey2 - Wed @ 03:41pm

Re: Duplicate web site by techwriter - Wed @ 09:07am

Re: Limiting the size of avatars by bernd - Wed @ 03:45am

Smoketest For nightly_2008-07-16 by Visitor - Wed @ 01:38am