Class: PortalView

PortalView()

The PortalView is a generic view to render portals, it will hold portal sections

Constructor

new PortalView()

Source:

Extends

  • Backbone.View

Members

activeSection :PortalSectionView

The currently active section view
Type:
Source:

activeSectionLabel :string

The currently active section label. e.g. Data, Metrics, Settings, etc.
Type:
  • string
Source:

displaySectionInUrl :boolean

Flag to add section name to URL. Enabled by default.
Type:
  • boolean
Source:

editButtonContainer :string

A jQuery selection for the element that will contain the Edit button.
Type:
  • string
Since:
  • 2.14.0
Source:

el :string

The Portal element
Type:
  • string
Source:

events :Object

The events this view will listen to and the associated function to call.
Type:
  • Object
Source:

label :string

The unique short name of the portal
Type:
  • string
Source:

logosView :PortalLogosView

A reference to the Portal Logos View that displays the logos of this portal.
Type:
Source:

model :Portal

A Portal Model is associated with this view and gets created during render()
Type:
  • Portal
Source:

portalId :string

The seriesId of the portal document
Type:
  • string
Source:

sectionEls :string

A jQuery selector for the section elements
Type:
  • string
Source:
A jQuery selector for the element that a single section link will be inserted into
Type:
  • string
Source:
A jQuery selector for the elements that are links to the individual sections
Type:
  • string
Source:

sectionNames :Array

The names of all sections in this portal editor
Type:
  • Array
Source:

subviews :Array

The subviews contained within this view to be removed with onClose
Type:
  • Array
Source:

type :string

The type of View this is
Type:
  • string
Source:

userModel :User

A User Model is associated with this view for rendering node/user views
Type:
  • User
Source:

Methods

addSection(sectionModel)

Creates a PortalSectionView to display the content in the given portal section. Also creates a navigation link to the section.
Parameters:
Name Type Description
sectionModel PortalSectionModel The section to render in this view
Source:
Add a link to a section of this portal page
Parameters:
Name Type Description
sectionView PortalSectionView The view to add a link to
Source:

addTheming()

Checks the portal model for theme or layout options. If there are any, and if they are supported, then add the associated CSS.
Source:

addVizSection(sectionModel)

Creates a PortalSectionView to display the content in the given portal section. Also creates a navigation link to the section.
Parameters:
Name Type Description
sectionModel PortalVizSectionModel The visualization section to render in this view
Source:

getSectionByLabel(label) → {PortalSectionView|false}

Returns the section view that has a label matching the one given.
Parameters:
Name Type Description
label string The label for the section
Source:
Returns:
- Returns false if a matching section view isn't found
Type
PortalSectionView | false

getUniqueSectionLabel(sectionModel) → {string}

Creates and returns a unique label for the given section. This label is just used in the view, because portal sections can have duplicate labels. But unique labels need to be used for navigation in the view.
Parameters:
Name Type Description
sectionModel PortEditorSection The section for which to create a unique label
Source:
Returns:
The unique label string
Type
string

handleNotFound()

Handles the case where the PortalModel is fetched and nothing is found.
Source:

handleScroll()

This function is called whenever the window is scrolled.
Source:

handleSwitchSection(e)

When a section link has been clicked, switch to that section
Parameters:
Name Type Description
e Event The click event on the section link
Source:

initialize()

Is executed when a new PortalView is created
Source:

isNode(username)

Checks if the label is a repository
Parameters:
Name Type Description
username string The portal label or the member node repository identifier
Source:

onClose()

This function is called when the app navigates away from this view. Any clean-up or housekeeping happens at this time.
Source:

render() → {PortalView}

Initial render of the PortalView
Source:
Returns:
Returns itself for easy function stacking in the app
Type
PortalView

renderAsNode()

Entry point for a repository portal view At this point we know for sure that a given label/username is a repository user
Source:

renderAsPortal()

Entry point for portal rendering
Source:

renderPortal()

Render the Portal view
Source:

showError(model, reponse)

Show an error message in this view
Parameters:
Name Type Description
model SolrResult
reponse XMLHttpRequest.response | string
Source:

showNotFound()

If the given portal doesn't exist, display a Not Found message.
Source:

switchSection(portalSectionViewopt)

Manually switch to a section subview by making the tab and tab panel active. Navigation between sections is usually handled automatically by the Bootstrap library, but a manual switch may be necessary sometimes
Parameters:
Name Type Attributes Description
portalSectionView PortalSectionView <optional>
The section view to switch to. If not given, defaults to the activeSection set on the view.
Source:
toggleSectionLinks - show or hide the section links nav. Used for mobile/small screens only.
Source:

updatePath(showSectionLabelopt, retainSearchQueryopt)

Update the window location path with the active section name
Parameters:
Name Type Attributes Description
showSectionLabel boolean <optional>
If true, the section label will be added to the path
retainSearchQuery boolean <optional>
Whether to keep the search query params during a path change. These should be kept when the page is loading initially.
Source:

updateSectionNames()

Gets a list of section names from tab elements and updates the sectionNames attribute on this view.
Source: