Hi Andrew, *,
On Tue, Nov 12, 2013 at 2:21 PM, Andrew Pullins <android2772@gmail.com> wrote:
[...] I was wondering if someone could explain how
you guys did our download page so I might make their page better. I know
that it ha to do with user agents but after that I don't know what to do.
Yes, that's right. We use the browser's user-agent string to make a
guess as to what platform/OS the user might want to get.
Fairly accurate for distinguishing between Linux, Mac and Windows, a
little harder to get x86 vs x86_64 right and even harder to guess
right for rpm vs deb.
With the user-agent parsing, we classify into the following groups:
"win-x86" => "Windows",
"mac-x86" => "Mac OS X (Intel)",
"mac-ppc" => "Mac OS X (PPC)",
"deb-x86" => "Linux - deb (x86)",
"deb-x86_64" => "Linux - deb (x86_64)",
"rpm-x86" => "Linux - rpm (x86)",
"rpm-x86_64" => "Linux - rpm (x86_64)"
So that's the user-interaction side. On the other hand we have the
site keep a database of the available downloads. For that we parse our
mirror's filelist using rsync and extract the corresponding metadata
from the pathnames. We end up with the following:
'Type' => 'Varchar(20)', /* box, portable, src,
stable, testing */
'Platform' => 'Varchar(10)', /* deb, rpm, win, mac,
multi (box) */
'Arch' => 'Varchar(10)', /* x86, x86_64, ppc, multi (box) */
'Version' => 'Varchar(20)', /* 3.3.0, 3.3.1-rc2,
3.3.0.4 (Sources),...*/
'Size' => 'DBFileSize', /* varchartype not int
because of dvd-isos, larger than int-type */
'Fullpath' => 'Varchar(256)', /* redundant, but as the
scheme differs between type... */
'Filename' => 'Varchar(100)', /* redundant, but as the
scheme differs between type... */
'InstallType' => 'Varchar(20)', /* Full, Helppack,
Languagepack, SDK */
'Lang' => 'Varchar(10)', /* multi/all_lang (win),
en-US,...pt-BR,... */
WIth that it is easy to combine the two.
From the list of downloads, we determine the versions to offer on the
dl-page (and default to the lastest) - with the version and the
guessed platform you have all you need.
For a user wanting winx86, you query the downloads for matching
Platform, version and bam, you have the matching download.
Now there are additional downloads for platforms, and the set of
available downloads differ per platfrom (helppack and languagepack or
only languagepack). This is taken care of by the html-templating
language along with the php using corresponding conditionals.
The third part of it is the related links section - this is assembled
from other pages stored in the cms by looking at the meta-tags of the
pages. You basically tag pages that show up in the related links
section by applying a meta-keyword to the desired page.
If you're interested in how it actually works, have a look at
https://github.com/tdf/cms-code (mysite/code for the php-stuff, and
mysite/templates for the template stuff) or ask more specific
follow-up questions :-)
ciao
Christian
--
To unsubscribe e-mail to: website+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/website/
All messages sent to this list will be publicly archived and cannot be deleted
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.