pCon.basket - Plugin Development
    Preparing search index...

    Interface ProjectEditorActivityOptions

    Options for ComponentFactory.createProjectEditorActivity()

    interface ProjectEditorActivityOptions {
        additionalActions?: ActionProvider;
        additionalRestrictions?:
            | UserRestrictionsProvider
            | ReadonlySet<UserRestriction>;
        clipboardData?: ClipboardData;
        closeSessionOnDispose?: boolean;
        editorMode?: ProjectEditorMode;
        importForeignCalculation?: boolean;
        lockedItems?: ReadonlyMap<string, ItemLockState>;
        migrateLegacyProjectData?: boolean;
        onCreateSession?: () => Promise<EaiwsContext | null>;
        onGetMainMenuActions?: (
            pProjectEditor: ProjectEditor | null,
        ) => readonly MenuAction[] | null;
        onGetProjectEditorOptions?: (
            pContext: EaiwsContext,
        ) => BaseProjectEditorActivityOptions;
        onGetProjectInfo?: (pContext: EaiwsContext) => ProjectInfo | null;
        onPrepareActivityStop?: (
            pProjectEditor: ProjectEditor | null,
            pCancelable: boolean,
        ) => Promise<boolean>;
        onPrepareProjectEditor?: (pProjectEditor: ProjectEditor) => Promise<void>;
        onPrepareSession?: (pContext: EaiwsContext) => Promise<boolean>;
        projectMetaData?: ProjectMetaData;
        selectedItems?: string[];
        triggerOfmlArticleUpdate?: boolean;
        useProjectNameAsTitle?: boolean;
    }

    Hierarchy

    • Omit<ProjectEditorOptions, "container" | "eaiwsContext" | "projectInfo">
      • ProjectEditorActivityOptions
    Index
    additionalActions?: ActionProvider

    Additional actions for the editor

    additionalRestrictions?: UserRestrictionsProvider | ReadonlySet<UserRestriction>

    Additional restrictions for the current user. Effective only for this project editor.

    clipboardData?: ClipboardData

    Optional predefined clipboard data which can be used to fill the clipboard of the editor in advance.

    closeSessionOnDispose?: boolean

    If true the eaiws session will be closed if the activity gets disposed. (default: true)

    editorMode?: ProjectEditorMode

    The editor mode defines the primary purpose of the project editor. If not defined Default will be used. The mode may be used by plugins to react to different use cases.

    importForeignCalculation?: boolean

    If true and the project was last edited using a different pricing procedure than the current default one, the user will be asked if he wants to import the calculation.

    false
    
    lockedItems?: ReadonlyMap<string, ItemLockState>

    Optional list of locked items (map from basket item id to lock state) which will be used to lock certain item related operations.

    migrateLegacyProjectData?: boolean

    If true, legacy data (e.g. header or address data) will be loaded and migrated. Should be used when loading obk files of older applications.

    false
    
    onCreateSession?: () => Promise<EaiwsContext | null>

    Can be used to create a custom eaiws session. If not implemented a default session will be created. Null should be returned if the start of the project editor should be aborted.

    onGetMainMenuActions?: (
        pProjectEditor: ProjectEditor | null,
    ) => readonly MenuAction[] | null

    Will be called everytime the main menu gets opened. Can be used to add new actions or override the project editor actions. Note: use pProjectEditor.getMainMenuActions() to get the default actions of the editor.

    onGetProjectEditorOptions?: (
        pContext: EaiwsContext,
    ) => BaseProjectEditorActivityOptions

    Will be called directly before creating the project editor. Can be used to change options dynamically depending on the session/context.

    onGetProjectInfo?: (pContext: EaiwsContext) => ProjectInfo | null

    Will be called before creating the project editor to define a pre-created ProjectInfo instance.

    Use onGetProjectEditorOptions instead

    onPrepareActivityStop?: (
        pProjectEditor: ProjectEditor | null,
        pCancelable: boolean,
    ) => Promise<boolean>

    Can be implemented to make preparations before the activity gets stopped and disposed. If pCancelable is true and the promise resolves with false, the activity stop will be canceled. Otherwise true should be returned.

    onPrepareProjectEditor?: (pProjectEditor: ProjectEditor) => Promise<void>

    Will be called directly after the project editor was started.

    onPrepareSession?: (pContext: EaiwsContext) => Promise<boolean>

    Can be used to prepare the eaiws session before starting the project editor. False should be returned if the start of the project editor should be aborted. E.g. Can be used to load an existing project.

    projectMetaData?: ProjectMetaData

    Optional project related meta data which may be used by certain operations (e.g. ordering)

    selectedItems?: string[]

    List of item ids for items which should be initially selected.

    triggerOfmlArticleUpdate?: boolean

    If true the user will be asked if he wants to update the OFML articles currently inside the basket

    false
    
    useProjectNameAsTitle?: boolean

    If true the project name will be used as the title for the activity. (default: true)