UrlMagic

OurWork Edit-chalk-10bo12.png

What (summary)

Pages in some portals should be accessible if and only if the site is being viewed from a specified domain. If a page is viewed in the wrong domain, the user is redirected to the right domain.

Why this is important

Lets us continue our portal branding in a way that gives sponsors a greater sense of ownership.

DoneDone

  • If a page is skinned via the <setSkin> tag, all attempted page views for that page are redirected to the proper domain. For example, if a page is called PortlandTechCompany, and is skinned PortlandTech, any attempts to reach www.aboutus.org/PortlandTechCompany are redirected (301 permanent) to www.portlandtech.net/PortlandTechCompany. Likewise, visiting www.portlandtech.net/NotInPortlandTech should redirect to www.aboutus.org/NotInPortlandTech
  • The detection of a particular portal is done using the skin-detection logic from CustomSkinForPortals. If this capability is insufficient, make sure that developers working on both projects address it together instead of creating our own solutions.
    • We may want to factor out the function get_portal_skin from design.php. The basic approach should stay the same.
    • Create a mapping between skin names and portal URLs
  • Develop this extension using an integration test written in Ruby using Net::Mechanize. See compost/test/integration/build_domain_test.rb for an example. We want to do this so that if we modify our platform in the future we have regression tests to know this capability still works.

Steps to get to DoneDone

  • Create a new branch named urlmagic for this task.
  • Bug in stage_branch script. SSL certificate not stored. Fix this.
  • find out why we do not get any page text when we try to either use fixtures or create a page in compost side, and then try to view it by calling mediawiki resolved by using article's fetchContent function
  • Write a test cases for testing the redirect.
  • look at permanent redirects
  • do permanent redirects
  • write test cases for trying to visit a page under aboutus, being accessed as if it belongs to portal
  • instead of using a text file, use a 2-d array for names of portalskin-url pairs.
  • use the same array in compost tests
  • clean up test cases by using fixtures and default messages in a better way
  • set up on the staging server
  • make a few changes to UrlMagicLinks.php file because its urls are different from urls running on our machines.
  • looking at how geo_cache_test file uses flexmock
  • still wondering whether it is even possible to do this or not, because we dont want to FAKE calls, we want to send calls to Mediwiki, and want the apache to know where to redirect our calls you can do this, but this does not mean that mediawiki behaves well in this case
  • checking out how to use flexmock for tests so that we avoid having to configure the /etc/hosts and {{urlstowork}}.conf files
  • test cases for redirect code set to 301 for permanency


Retrieved from "http://aboutus.com/index.php?title=UrlMagic&oldid=14783200"