app/soc/views/sitemap/build.py
author Sverre Rabbelier <srabbelier@gmail.com>
Sat, 06 Dec 2008 14:25:24 +0000
changeset 682 187f4d95fedb
parent 665 ce9f11f7c4cf
child 700 8baf8367340d
permissions -rw-r--r--
Added organizations Really basic for now, next stop is to have a proper document selector for the Presences. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
499
d22e4fe8e64b Fix missing dots in doc strings and some other doc string corrections.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 494
diff changeset
    17
"""Module that constructs the sitemap.
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
"""
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
    '"Sverre Rabbelier" <sverre@rabbelier.nl>',
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
  ]
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
from django.conf.urls import defaults
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    27
from soc.views.models import document
665
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    28
from soc.views.models import host
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents: 665
diff changeset
    29
from soc.views.models import organization
534
c31cfbf1a20f Replace HomeSettings with Presence Model class. Replace SiteSettings with
Todd Larsen <tlarsen@google.com>
parents: 499
diff changeset
    30
from soc.views.models import presence
665
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    31
from soc.views.models import program
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    32
from soc.views.models import request
665
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    33
from soc.views.models import site
ce9f11f7c4cf Fix import sorting in soc.views.sitemap.build module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 643
diff changeset
    34
from soc.views.models import sponsor
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
from soc.views.models import user
590
37735d97b541 Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents: 585
diff changeset
    36
from soc.views.models import user_self
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    37
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    38
from soc.views.sitemap import sidebar
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
from soc.views.sitemap import sitemap
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    41
590
37735d97b541 Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents: 585
diff changeset
    42
sidebar.addMenu(user_self.view.getSidebarLinks)
585
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    43
sidebar.addMenu(presence.view.getSidebarLinks)
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    44
sidebar.addMenu(site.view.getSidebarLinks)
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    45
sidebar.addMenu(user.view.getSidebarLinks)
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    46
sidebar.addMenu(document.view.getSidebarLinks)
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    47
sidebar.addMenu(sponsor.view.getSidebarLinks)
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    48
sidebar.addMenu(host.view.getSidebarLinks)
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    49
sidebar.addMenu(request.view.getSidebarLinks)
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents: 590
diff changeset
    50
sidebar.addMenu(program.view.getSidebarLinks)
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents: 665
diff changeset
    51
sidebar.addMenu(organization.view.getSidebarLinks)
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    52
585
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    53
sitemap.addPages(presence.view.getDjangoURLPatterns())
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    54
sitemap.addPages(site.view.getDjangoURLPatterns())
903890857ed8 Have the sidebar be rebuilt on every request with callbacks
Sverre Rabbelier <srabbelier@gmail.com>
parents: 566
diff changeset
    55
sitemap.addPages(user.view.getDjangoURLPatterns())
590
37735d97b541 Created a seperate module for editSelf things
Sverre Rabbelier <srabbelier@gmail.com>
parents: 585
diff changeset
    56
sitemap.addPages(user_self.view.getDjangoURLPatterns())
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    57
sitemap.addPages(document.view.getDjangoURLPatterns())
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    58
sitemap.addPages(sponsor.view.getDjangoURLPatterns())
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    59
sitemap.addPages(host.view.getDjangoURLPatterns())
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    60
sitemap.addPages(request.view.getDjangoURLPatterns())
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents: 590
diff changeset
    61
sitemap.addPages(program.view.getDjangoURLPatterns())
682
187f4d95fedb Added organizations
Sverre Rabbelier <srabbelier@gmail.com>
parents: 665
diff changeset
    62
sitemap.addPages(organization.view.getDjangoURLPatterns())
494
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    63
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    64
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    65
def getPatterns():
5e9c656a1b68 Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    66
  return defaults.patterns(None, *sitemap.SITEMAP)