C# Class RockWeb.Blocks.Core.RockUpdate

Inheritance: Rock.Web.UI.RockBlock
ファイルを表示 Open project: NewSpring/Rock

Public Methods

Method Description
ConvertToHtmlLiWrappedUl ( string str ) : string

Converts + and * to html line items (li) wrapped in unordered lists (ul).

Protected Methods

Method Description
DisplayRockVersion ( ) : void

Fetches and displays the official Rock product version.

ExtractRequiredVersionFromTags ( IPackage package ) : SemanticVersion

Extracts the required SemanticVersion from the package's tags.

GetRockVersion ( object version ) : string
OnInit ( EventArgs e ) : void

Raises the E:System.Web.UI.Control.Init event.

OnLoad ( EventArgs e ) : void

Invoked on page load.

RockVersion ( SemanticVersion version ) : string
UpdateRockPackage ( string version ) : bool

Updates an existing Rock package to the given version and returns true if successful.

rptPackageVersions_ItemCommand ( object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e ) : void

Handles the click event for the particular version button that was clicked.

rptPackageVersions_ItemDataBound ( object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e ) : void

Enables and sets the appropriate CSS class on the install buttons and each div panel.

Private Methods

Method Description
BindGrid ( ) : void

Bind the available packages to the repeater.

Check45PlusFromRegistry ( ) : VersionCheckResult

Suggested approach to check which version of the .Net framework is intalled when using version 4.5 or later as per https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx.

CheckForManualFileMoves ( string version ) : void
CheckFrameworkVersion ( ) : VersionCheckResult

Checks the .NET Framework version and returns Pass, Fail, or Unknown which can be used to determine if it's safe to proceed.

CheckSqlServerVersion ( ) : bool

Checks the SQL server version and returns false if not at the needed level to proceed.

CreateOfflineFileFromScratch ( string offlineFile ) : void

Simply creates an app_offline.htm file so no one else can hit the app.

HandleNuGetException ( Exception ex ) : void

Sets up the page to report the error in a nicer manner.

IsUpdateAvailable ( ) : bool

Determines if there is an update available to install and puts the valid ones (that is those that meet the requirements) into the _availablePackages list.

ManuallyMoveFile ( FileInfo file, string newPath ) : void
RemoveAppOffline ( ) : void

Removes the app_offline.htm file so the app can be used again.

RemoveOldRDeleteFiles ( ) : void

Removes the old *.rdelete (Rock delete) files that were created during an update.

SendStatictics ( string version ) : void

Sends statistics to the SDN server but only if there are more than 100 person records or the sample data has not been loaded. The statistics are: * Rock Instance Id * Update Version * IP Address - The IP address of your Rock server. ...and we only send these if they checked the "Include Impact Statistics": * Organization Name and Address * Public Web Address * Number of Active Records As per http://www.rockrms.com/Rock/Impact

SendToSpark ( System.Guid rockInstanceId, string version, string ipAddress, string publicUrl, string organizationName, ImpactLocation organizationLocation, int numberOfActiveRecords, string environmentData ) : void

Sends the public data and impact statistics to the Rock server.

Update ( string version ) : void

Wraps the install or update process in some guarded code while putting the app in "offline" mode and then back "online" when it's complete.

WriteAppOffline ( ) : void

Copies the app_offline-template.htm file to app_offline.htm so no one else can hit the app. If the template file does not exist an app_offline.htm file will be created from scratch.

Method Details

ConvertToHtmlLiWrappedUl() public method

Converts + and * to html line items (li) wrapped in unordered lists (ul).
public ConvertToHtmlLiWrappedUl ( string str ) : string
str string a string that contains lines that start with + or *
return string

DisplayRockVersion() protected method

Fetches and displays the official Rock product version.
protected DisplayRockVersion ( ) : void
return void

ExtractRequiredVersionFromTags() protected method

Extracts the required SemanticVersion from the package's tags.
protected ExtractRequiredVersionFromTags ( IPackage package ) : SemanticVersion
package IPackage a Rock nuget package
return SemanticVersion

GetRockVersion() protected method

protected GetRockVersion ( object version ) : string
version object
return string

OnInit() protected method

Raises the E:System.Web.UI.Control.Init event.
protected OnInit ( EventArgs e ) : void
e System.EventArgs An object that contains the event data.
return void

OnLoad() protected method

Invoked on page load.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs An object that contains the event data.
return void

RockVersion() protected method

protected RockVersion ( SemanticVersion version ) : string
version SemanticVersion
return string

UpdateRockPackage() protected method

Updates an existing Rock package to the given version and returns true if successful.
protected UpdateRockPackage ( string version ) : bool
version string
return bool

rptPackageVersions_ItemCommand() protected method

Handles the click event for the particular version button that was clicked.
protected rptPackageVersions_ItemCommand ( object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e ) : void
source object The source of the event.
e System.Web.UI.WebControls.RepeaterCommandEventArgs The instance containing the event data.
return void

rptPackageVersions_ItemDataBound() protected method

Enables and sets the appropriate CSS class on the install buttons and each div panel.
protected rptPackageVersions_ItemDataBound ( object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e ) : void
sender object The source of the event.
e System.Web.UI.WebControls.RepeaterItemEventArgs The instance containing the event data.
return void