Skip to content

AccessPaths and InternalPaths

Saif edited this page Mar 23, 2015 · 7 revisions

Internal paths

Unlike most web applications, WebWidgets does not have separate files to provide URL navigation. Instead it has internal paths, that is any path after the deployment path is handled by the application to navigate to different views or states of the application.

Access hostnames

Access hostnames are used to localize or to show a different version when the website is accessed from a specific hostname. When a user accesses the website from an access hostname, Application::AccessHostName() returns a pointer to the AccessHostNameData. Access from unknown hostnames can be rejected if an access restricted/denied page is specified.

If any access hostname does not specify "www." before the hostname, the access hostname without the "www." prefix will be used.

Access hostnames can set the default settings including

  • Default Language
  • Home Page
  • Country
  • Mobile internal path
  • Mobile mode

Examples of access hostnames

  • "*" - Defines the default access hostname
  • m.website.com - For mobile version
  • es.website.com - For Spanish language
  • website.co.uk - For country
  • cn.website.com - For country and/or language
  • product.com - For product home page
  • test.website.com:8080 - For specific port and test specific state

Access paths

Access path is the path to a part of an application uniquely identified by a combination of the access hostname and internal path. An access path tells WebWidgets what kind of content the user is asking. WebWidgets use access paths to distinguish between the following but are not limited to

  • Pages
  • Languages
  • Countries
  • Mobile UI version
  • Web services(API/IPN/RSS)

Examples of access paths

  • website.com/m/es - Mobile mode and Spanish
  • cn.website.com/en - English and China localization
  • website.com/parent/child/grandchild
  • website.com/gallery/photo/#/comment - Photo with ID '#' comment page
  • website.com/words/?/meaning - Word meaning page of the word '?'

Reserved internal paths

WebWidgets reserves the following access paths's internal paths in the following order

  1. Mobile UI mode access path
  2. Country access path -OR- Language access path

WebWidgets also provide additional functions to deal with reserved internal paths

  • internalPathAfterReserved(std::string after) which returns the internal path with the reserved part excluded.
  • setInternalPathAfterReserved(std::string internalPath) which sets the internal path after the reserved part.
  • const WSignal<void> &internalPathAfterReservedChanged() which is emitted only when setInternalPathAfterReserved() is used to change the internal path after the reserved prefix.

Language access path in internal paths

WebWidgets allows several modes of how to show language access path in internal paths.

1. Always show language

Language internal path will always be shown if the access path has an internal path. Even if internal path path is entered without language, WebWidgets will add it again.

2. Always show language but hide default language

If the language selected by the user is the default language, it will be removed from internal path, even if intentionally added, WebWidgets will remove it again. Other languages will always be shown as in option 1.

3. No restrictions but hide default language

WebWidgets will not add or remove language from internal path except if the language selected is the default language.

4. No restrictions

WebWidgets will not add or remove any language from internal path.

Country access paths

Country access paths are not implemented yet.

This wiki is currently written and managed only for the WebWidgets developer and may or may not be clear to anyone without the knowledge of the structure of WebWidgets.

Clone this wiki locally