Working with layout components

For each layout, the existing UI and script components can be viewed, edited, or deleted. You can also create new UI and script components. Client scripts use JavaScript, and most server scripts use VB .NET or C# as the scripting source. Global server scripts can also use pre-compiled script (DLLs) as the scripting source.

In the Portal Manager, you can view server script references, view and edit global server script references that use uploaded DLLs, and view or edit client script references. Right-click in the UI, Client Script, and Server Script cell of a selected layout to access these options. Also see "Working with project references" later in this topic.

Note: See Custom server-side scripting and Custom client-side scripting for information about scripting you can add or change in a layout.

Creating a new layout UI

To create a new layout UI, you can start from scratch, or you can start with a provided template or an existing portal layout and then save the file with a new name. You can also copy an existing layout and save it with a new name. The template layout, named _TemplatePage, contains a layout with PageTitleBanner, PageFilterLayout, and PageContentLayout cells already included. These are the methods for starting each process:

  • To create a new layout UI from scratch, click Open Editor on the Layouts form, and work with the Layout Editor.
  • To create a new layout UI based on the template or other existing layout UI file, right-click in the UI column for the existing layout and select View Layout UI. Then in the Layout Editor, click Edit to create a new copy of the layout with your specified originator.
  • To create a new layout UI by copying an existing one, right-click the name of the layout to copy and then select Copy Layout. Specify a new name for the layout and click OK. This creates a copy of the layout with your specified originator. Right-click in the UI column of the new layout file and select Edit Layout UI.

Viewing and editing layout components

To edit a layout component, the layout cannot be locked by another user. Also, you can edit a layout only if it belongs to the current editable originator.

When you right-click a client- or server-side script and select the View option, the file is opened by the most suitable installed development environment, such as Microsoft Visual Studio. If this is not installed, the script is opened in Notepad.

Synchronizing local and server script versions

Although the Portal Manager is designed to only temporarily download scripts and then delete them after they are viewed or edited, a few cases could impede this process. If the Portal Manager is closed manually or closes unexpectedly while scripts are still open, the program cannot upload or delete the scripts.

To safeguard against these situations, whenever a script is viewed or edited, Portal Manager checks for a local copy. If it finds one, it prompts you to keep this copy or overwrite it with the version from IPF. Also, when Portal Manager opens, it checks for any script editor processes it started in the past that were not shut down. If they are still running, it waits for them to close and does not allow them to be viewed or edited.

Working with project references

Both server- and client-side scripts can have references to global scripts or other third-party scripts. Once added, IntelliSense is enabled for these scripts, and you can easily incorporate them into your own scripts.

To view the references a script uses, right-click its cell and select View References.

Uploaded DLL server script references and client script references can be added or removed using the Portal Manager. Right-click the script cell and select Edit References. The Edit Script References form is displayed. It shows all available global scripts on the left side, and you can move them to and from the Selected References box to add or remove them as references for this script.

The other server-side script references cannot be edited using the Portal Manager. You must use Visual Studio. The references common to all server-side scripts are the System and System.Core assemblies from the .NET framework and the IPF.CustomCodeLib assembly containing the IPF scripting APIs. Additional references can be added by right-clicking the Visual Studio project in Solution Explorer and selecting Add Reference. References can also be added by right-clicking the My Project file, selecting Open, and navigating to the References tab. This method also displays existing references and allows for their removal.

Although references can be added or removed from the server-side scripting project, the base references listed should not be removed. If they are removed, they will continue to appear in IPF and in any future edits of the script.

Deleting layout components

To delete a layout component, right-click the cell and select the Delete option. You are prompted to confirm. Click Yes to delete it from the Layouts grid.