Wyam - API - IExecutionContext Interface

IExecutionContext Interface

Summary

All of the information that represents a given build. Also implements Wyam.Common.Meta.IMetadata to expose the global metadata.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Execution
Interfaces
Implementing Types
graph TD Interface0["IMetadata"]-.->Type click Interface0 "/api/Wyam.Common.Meta/IMetadata" Interface1["IReadOnlyDictionary<, >"]-.->Type Type["IExecutionContext"] class Type type-node Type-.->Implementing0["TestExecutionContext"] click Implementing0 "/api/Wyam.Testing.Execution/TestExecutionContext"

Syntax

public interface IExecutionContext : IMetadata, IReadOnlyDictionary<string, object>

Properties

Name Value Summary
ApplicationInput string
Gets any input that was passed to the application (for example, on stdin via piping).
Documents IDocumentCollection
Gets the collection of all previously processed documents.
DynamicAssemblies IReadOnlyCollection<>
Gets the raw bytes for dynamically compiled assemblies (such as the configuration script).
ExecutionCache IExecutionCache
Gets the current execution cache. Modules can use the cache to store data between executions.
ExecutionId Guid
Uniquly identifies the current execution cycle. This can be used to initialize and/or reset static data for a module on new generations (I.e., due to watching). For example, cache data could be cleared when this changes between runs.
FileSystem IReadOnlyFileSystem
Gets the current file system.
Module IModule
Gets the currently executing module.
Namespaces IReadOnlyCollection<>
Gets a set of namespaces that should be brought into scope for modules that perform dynamic compilation.
Pipeline IReadOnlyPipeline
Gets the currently executing pipeline.
Settings IReadOnlySettings
Gets the current settings metadata.

Methods

Name Value Summary
Execute(IEnumerable<>, IEnumerable<>) IReadOnlyList<>
Executes the specified modules with the specified input documents and returns the result documents.
Execute(IEnumerable<>, IEnumerable<>) IReadOnlyList<>
Executes the specified modules with an empty initial input document with optional additional metadata and returns the result documents.
Execute(IEnumerable<>, IEnumerable<>) IReadOnlyList<>
Executes the specified modules with an empty initial input document with optional additional metadata and returns the result documents.
GetContentStream(string) Stream
Gets a Stream that can be used for document content. If content is not null, the stream is initialized with the specified content. It is prefered to use this method to obtain a stream over creating your own if the source of the content does not already provide one. The returned streams are optimized for memory usage and performance. The position is set to the beginning of the stream when returned.
GetDocument() IDocument
Gets a new document with default initial metadata.
GetDocument(FilePath, Stream, IEnumerable<>, bool) IDocument
Gets a new document with the specified source, content stream, and metadata (in addition to the default initial metadata). If disposeStream is true (which it is by default), the provided Stream will automatically be disposed when the document is disposed (I.e., the document takes ownership of the Stream).
GetDocument(IDocument, FilePath, IEnumerable<>) IDocument
Clones the specified source document with a new source and additional metadata (all existing metadata is retained) or gets a new document if the source document is null or AsNewDocuments() was called on the module.
GetDocument(IDocument, FilePath, Stream, IEnumerable<>, bool) IDocument
Clones the specified source document with a new source, new content stream, and additional metadata (all existing metadata is retained) or gets a new document if the source document is null or AsNewDocuments() was called on the module. If disposeStream is true (which it is by default), the provided Stream will automatically be disposed when the document is disposed (I.e., the document takes ownership of the Stream).
GetDocument(IDocument, IEnumerable<>) IDocument
Clones the specified source document with identical content and additional metadata (all existing metadata is retained) or gets a new document if the source document is null or AsNewDocuments() was called on the module.
GetDocument(IDocument, Stream, IEnumerable<>, bool) IDocument
Clones the specified source document with a new content stream, and additional metadata (all existing metadata is retained) or gets a new document if the source document is null or AsNewDocuments() was called on the module. If disposeStream is true (which it is by default), the provided Stream will automatically be disposed when the document is disposed (I.e., the document takes ownership of the Stream).
GetDocument(IEnumerable<>) IDocument
Gets a new document with the specified metadata (in addition to the default initial metadata).
GetDocument(Stream, IEnumerable<>, bool) IDocument
Gets a new document with the specified content stream and metadata (in addition to the default initial metadata). If disposeStream is true (which it is by default), the provided Stream will automatically be disposed when the document is disposed (I.e., the document takes ownership of the Stream).
GetJsEnginePool(Action<>, int, int, int, TimeSpan?) IJsEnginePool
Gets a new Wyam.Common.JavaScript.IJsEnginePool. The returned engine pool should be disposed when no longer needed.
TryConvert<T>(object, T) bool
Provides access to the same enhanced type conversion used to convert metadata types.

Extension Methods

Name Value Summary
ForEach(IEnumerable<>, Action<>) void
If an exception is thrown within the action, an error messages will be sent to the trace output containing information about the document source, the current module, and the exception message. The exception will also be re-thrown once the message has been sent to the trace listeners.
GenerateInfobarHeadings(IDocument) string
Generates links to each heading on a page and returns a string containing all of the links.
GetDateTimeDisplayCulture(string) CultureInfo
Gets the CultureInfo for the date display culture.
GetDateTimeInputCulture() CultureInfo
Gets the CultureInfo for the date input culture.
GetLink() string
Gets a link for the root of the site using the host and root path specified in the settings.
GetLink(IMetadata, bool) string
Gets a link for the specified metadata (typically a document) using the "RelativeFilePath" metadata value and the default settings from the Wyam.Common.Configuration.IReadOnlySettings. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(IMetadata, string, bool) string
Gets a link for the specified metadata (typically a document) using the specified metadata value (by default, "RelativeFilePath") and the default settings from the Wyam.Common.Configuration.IReadOnlySettings. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(NormalizedPath, bool) string
Converts the specified path into a string appropriate for use as a link using default settings from the Wyam.Common.Configuration.IReadOnlySettings. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(NormalizedPath, string, DirectoryPath, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the Wyam.Common.Configuration.IReadOnlySettings.
GetLink(NormalizedPath, string, DirectoryPath, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the Wyam.Common.Configuration.IReadOnlySettings.
GetLink(string, bool) string
Converts the specified path into a string appropriate for use as a link using default settings from the Wyam.Common.Configuration.IReadOnlySettings. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(string, string, DirectoryPath, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the Wyam.Common.Configuration.IReadOnlySettings.
GetTypeLink(IMetadata) HtmlString
GetTypeLink(IMetadata, HtmlString) HtmlString
GetTypeLink(IMetadata, string) HtmlString
ParallelForEach(IEnumerable<>, Action<>) void
If an exception is thrown within the action, an error messages will be sent to the trace output containing information about the document source, the current module, and the exception message. The exception will also be re-thrown once the message has been sent to the trace listeners.
TraceExceptions(Action) void
If an exception is thrown within the action, an error messages will be sent to the trace output containing information about the current module and the exception message. The exception will also be re-thrown once the message has been sent to the trace listeners.
TraceExceptions(IDocument, Action<>) void
If an exception is thrown within the action, an error messages will be sent to the trace output containing information about the document source, the current module, and the exception message. The exception will also be re-thrown once the message has been sent to the trace listeners.
TraceExceptions<TResult>(Func<>) TResult
If an exception is thrown within the action, an error messages will be sent to the trace output containing information about the current module and the exception message. The exception will also be re-thrown once the message has been sent to the trace listeners.
TraceExceptions<TResult>(IDocument, Func<, >) TResult
If an exception is thrown within the action, an error messages will be sent to the trace output containing information about the document source, the current module, and the exception message. The exception will also be re-thrown once the message has been sent to the trace listeners.
TryParseInputDateTime(string, DateTime) bool
Attempts to parse and input date using the input date culture setting.
GitHub