Getting Started / The WebParts Config File
In This Topic
    The WebParts Config File
    In This Topic
    This content of this topic is related to the per site administration of the Nevron Web Parts. Skip this topic if you are not the site administrator.

    Certain behavior aspects and user interface elements visibility options can be globally controlled, on a per site level, through the NWebPartsConfig.xml file, an empty version of which is by default installed in the Nevron sub-folder of the site _layouts folder. The config file is having the following structure:

    NWebPartsConfig.xml structure
    Copy Code
    <Config>
        <RuntimeInterface>
            <ToolBar show="never/always/design"/>
        </RuntimeInterface>
        <DesignerInterface>
            <DataSourcePage Show="yes/no" ShowDataSource="yes/no"/>
            <CodePage Show="yes/no"/>
            <LicensingPage Show="yes/no"/>
            <RenderingPage Show="yes/no"/>
            <ToolBar ShowOKButton="yes/no" ShowApplyButton="yes/no" ShowCancelButton="yes/no" ShowResetButton="yes/no" ShowSaveButton="yes/no" ShowLoadButton="yes/no" ShowHelpButton="yes/no" ShowWebPartsConfigButton="yes/no"/>
        </DesignerInterface>
        <ImageStreamsContainer Storage="auto/sessionstate/appstate/webpart">
            <RuntimeStreams Max="positive number" ExpireAfter="positive number" RemoveOnServe="yes/no"/>
            <DesignStreams Max="positive number" ExpireAfter="positive number" RemoveOnServe="yes/no"/>
        </ImageStreamsContainer>
        <DesignerState storage="auto/sessionstate/appstate/webpart"/>
        <DesignerReferrerUrl storage="auto/sessionstate/appstate/webpart"/>
        <CustomCode Allow="yes/no"/>
        <Parameters Storage="auto/sessionstate/appstate/web" ExpireAfter="positive number"/>
        <Log LogErrors="yes/no" LogStatus="yes/no"/>
    </Config>
    
     Elements and Attributes Description

    Following is a detailed description of each element and its attributes and values:

    RuntimeInterface - groups the settings related to the interface of the web parts at runtime.

    ToolBar - contains settings for the toolbar that appears above the web parts inside the SharePoint page. Has the following attributes:

    Show - possible values are:

    • design - (the default) the toolbar is only shown when the web part page is in edit mode.
    • never - the toolbar is never shown.
    • always - the toolbar is always shown.

    DesignerInterface - groups the settings related to the interface of the web parts at design time.

    ToolBar  - contains settings for the designer toolbar. Has the following attributes:

    ShowOKButton - specifies whether the OK button is visible.
    ShowCancelButton - specifies whether the Cancel button is visible.
    ShowApplyButton - specifies whether the Apply button is visible.
    ShowResetButton - specifies whether the Reset button is visible.
    ShowSaveButton - specifies whether the Save button is visible.
    ShowLoadButton - specifies whether the Load button is visible.
    ShowWebPartsConfigButton - specifies whether the Config button is visible.
    ShowHelpButton - specifies whether the Help button is visible.

    The possible values for each of these attributes are yes and no.

    DataSourcePage - contains settings for all data sources pages. Has the following attributes:

    Show - specifies the visibility of the data source page. Possible values are yes and no.
    ShowDataSource - only taken into account if the Show attribute is set to yes. Specifies the visibility of the data source panel. Possible values are yes and no. If set to no users won't be able to see the data source or modify it, but will be able to preview the data which it returns.

    CodePage - contains settings for all code pages. Has the following attributes:

    Show - specifies the visibility of the code page. Possible values are yes and no.

    LicensingPage - contains settings for all licensing pages. Has the following attributes:

    Show - specifies the visibility of the licensing page. Possible values are yes and no.

    RenderingPage - contains settings for all rendering pages. Has the following attributes:

    Show - specifies the visibility of the rendering page. Possible values are yes and no.

    DesignerState - defines settings related to the currently edited web part state by the respective designer. In general each web part will be having a state that the respective designer starts to edit, when the user clicks the Run Designer command. The state edited by the designer is initially a copy of the actual web part state and is stored to a temporary storage. The state edited by the designer becomes the actual web part state only when the user clicks the OK or Apply buttons. This config element has the following attributes:

    Storage - defines where to store the temporary designer state. Possible values are: auto/sessionstate/appstate/webpart. By default set to auto. See Web_Part_Temporary_Data for more info.

    DesignerReferrerUrl - when the user clicks the Run Designer command, besides the designer state the full URL of the reffering web page must also be recorded. It will later be needed when the user clicks the OK or Cancel buttons, in the case of which the web part will redirect the browser to the page that let to the designer. This config element has the following attributes:

    Storage - defines where to store the designer referrer URL. Possible values are: auto/sessionstate/appstate/webpart. By default set to auto. See Web_Part_Temporary_Data for more info.

    ImageStreamsContainer - when the user selects the HttpHandler option as an Image Acquisition Mode inside the Rendering page, the web part saves the rendered image to a temporary location, which it later serves to the browser upon request. This eliminates the need to save a temporary image file in the respective Temp directory (e.g. _layouts/Nevron/Chart/Temp or _layouts/Nevron/Gauge/Temp) or grant write permissions to the folder. This config element has the following attributes:

    Storage - defines where to store the image streams. Possible values are: auto/sessionstate/appstate/webpart. By default set to auto. See Web_Part_Temporary_Data for more info.

    RunTimeStreams and DesignStreams are separating the streams generated by the webpart at runtime and by its designer. They are both having the following attributes:

    Max - defines the maximum number of image streams to hold. By default set to 20.
    RemoveOnServe - defines whether an image stream is automatically removed when served to the browser. By default set to false.
    ExpireAfter - defines the number of minutes after which the stream expires.

    CustomCode - defines settings related to code injection. Has the following attributes:

    Allow - defines whether custom code (the code that appears in the Code page) is allowed to be executed or not. Possible values are: yes and no. Set this property to no if you want to ensure that no Nevron Web Part executes any custom code that can be generally injected by SharePoint users.

    Parameters - defines settings related to the custom parameters. Has the following attributes:

    Storage - defines where to store the parameters. Possible values are: auto/sessionstate/appstate/web. By default set to auto. See Web_Temporary_Data for more info.

    ExpireAfter - defines the number of minutes after which a custom parameter expires, if not used. By default set to 20.

    Log - contains settings related to error and command state logging. Has the following attributes:

    LogErrors - when set to yes, the webparts will log errors in the Log_File. Typically all exceptions, that the webparts catch during design time editing are reported to the user directly in the status pane, which is dynamically displayed below each webpart designer, if needed. Runtime errors that are caught cannot be always reported. You may need to set this attribute to yes, if you need to ensure that Nevron WebParts are not silently working with any exceptions. By default set to no.

    LogStatus - when set to yes, the webparts will log command status and response duration in the Log_File. You may need to set this attribute to yes, if you need to diagnose or isolate performance issues. By default set to no.

     Web Part Temporary Data

    The DesignerState, ImageStreamsContainer and DesignerReferredUrl Storage attributes accept a value from the following enumeration:

    • auto - the web part tests to see whether session state is enabled. If session state is enabled, it uses it. Otherwise it uses application state (should be available on all SharePoint Servers). If even application state is not available, it falls back to webpart mode.
    • sessionstate - records the temporary data in the session state. If session state is not enabled, falls back to appstate mode.
    • appstate - records the temporary data in the application state. If application state is not enabled, falls back to webpart mode.
    • webpart - records the temporary data in the web part itself. This is the safest mode, but unfortunately the slowest one.
     Web Temporary Data

    The Parameters Storage attributes accept a value from the following enumeration:

    • auto - the web part tests to see whether session state is enabled. If session state is enabled, it uses it. Otherwise it uses application state (should be available on all SharePoint Servers). If even application state is not available, it falls back to web mode.
    • sessionstate - records the temporary data in the session state. If session state is not enabled, falls back to appstate mode.
    • appstate - records the temporary data in the application state. If application state is not enabled, falls back to web mode.
    • web - records the temporary data in the web properties. This is the safest mode, but unfortunately the slowest one.
     SharePoint Session and Application State

    SharePoint Session State is the default fallback for both WebPart and Web Temporary Data. This is because although Nevron SPVision has its own session state and garbage management, we also wanted to reuse the SharePoint Session State garbage collection, if possible.

    SharePoint Session State is however not enabled on all SharePoint Servers and many administrators typically disable it to increase the site performance, so Nevron WebParts will automatically fall back to application state, which according to our studies is enabled on most SharePoint servers.

    For SharePoint 2007, you can enable/disable Session State from the Center Admin, as described in the following topic:

    http://technet.microsoft.com/en-us/library/cc263527%28office.12%29.aspx#section2

    For SharePoint 2010, you can enable/disable Session State from PowerShell, as described in the following topic:

    http://technet.microsoft.com/en-us/library/ee704548.aspx

     Log File
    The NLog.txt is automatically created, if not already present, in the Nevron subfolder of the LAYOUTS folder.
    You should know that whenever you set to yes the LogErrors or LogStatus attributes of the Log element, the log file will be created and will constant grow.
    It is an adminstrator responsibly to both remove the file and set the LogErrors and LogStatus attributes of the Log element to no, when the profiling of the Nevron Web Parts has ended.
     Farm Deployment
    When you decide to change the NWebPartsConfig.xml and your SharePoint is running in a farm, it is an administrators responsibility to ensure that the same NWebPartsConfig.xml file is replicated on all SharePoint servers inside the farm.