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

    Interface Utils

    interface Utils {
        fileSystem: FileSystemUtils;
        pconServiceUrls: PconServiceUrls;
        clearEaiwsPriceListsCache(pContext: EaiwsContext): void;
        clearEaiwsProjectGroupsCache(pContext: EaiwsContext): void;
        closeEaiwsSession(
            pSession: EaiwsSession,
            pForceClose?: boolean,
        ): Promise<void>;
        createBasket(
            pContext: EaiwsContext,
            pOptions?: CreateBasketOptions,
        ): Promise<Basket>;
        createEaiwsSession(
            pOptions?: CreateEaiwsSessionOptions,
        ): Promise<EaiwsSession>;
        createEmptyI18nInstance(): i18n;
        disableEaiwsSessionAutoClose(pSession: EaiwsSession): void;
        getBrowserLocale(): string;
        getCorsProxyUrl(pUrl: string): string;
        getEaiwsPriceLists(pContext: EaiwsContext): Promise<PriceList[]>;
        getEaiwsProjectGroups(pContext: EaiwsContext): Promise<ProjectGroup[]>;
        getProjectFileName(
            pBasket: Basket,
            pFileExtension: string,
        ): Promise<string>;
        initializeI18n(
            pLanguage: string,
            pResourceVersion: string,
            pResourcesPath: string,
        ): Promise<i18n>;
        isApplePlatform(): boolean;
        isCtrlKeyDown(pEvent: MouseEvent | KeyboardEvent): boolean;
        isInputAreaFocused(): boolean;
        normalizeUserRestrictions(pRestrictions: Set<UserRestriction>): void;
        obkToObx(
            pSession: EaiwsSession,
            pObkUrl: string,
            pOptions?: ObkToObxOptions,
        ): Promise<string>;
        openLink(pUrl: string, pTarget?: string): void;
        prepareArticleImages(
            pContext: EaiwsContext,
            pOptions?: PrepareArticleImagesOptions,
        ): Promise<boolean>;
        prepareEaiwsSession(pSession: EaiwsSession): Promise<void>;
        resizeImage(pOptions: ResizeImageOptions): Promise<Blob>;
        scrollElementIntoView(pElement: HTMLElement): void;
        startFileDownload(
            pFileOrUrl: string | Blob | File,
            pDownloadFilename?: string,
        ): void;
        uploadImageToEaiwsSession(
            pOptions: UploadImageToEaiwsSessionOptions,
        ): Promise<string | null>;
        uploadToEaiwsSession(
            pOptions: UploadToEaiwsSessionOptions,
        ): Promise<string | null>;
        uploadToSharedFileStorage(
            pOptions: UploadToSharedFileStorageOptions,
        ): Promise<SharedFile>;
    }
    Index
    fileSystem: FileSystemUtils

    Utilities for the File System Access API

    pconServiceUrls: PconServiceUrls

    urls for pCon web services.

    • If the price lists have changed this function should be called to clear the internal cache. see getEaiwsPriceLists

      Parameters

      • pContext: EaiwsContext

      Returns void

    • If the project groups have changed this function should be called to clear the internal cache. see getEaiwsProjectGroups

      Parameters

      • pContext: EaiwsContext

      Returns void

    • This function will close the given eaiws session. If the given session is equal to wbkApp.user.eaiwsSession than EaiwsSession.session.loadEmptySession() will be used instead to clear the session.

      Parameters

      • pSession: EaiwsSession
      • OptionalpForceClose: boolean

        If true the session will be closed even if it is the user session.

      Returns Promise<void>

    • Creates and initializes a new basket instance.

      Parameters

      • pContext: EaiwsContext

        Session context the basket should operate on.

      • OptionalpOptions: CreateBasketOptions

        Options for the created basket.

      Returns Promise<Basket>

    • Creates and prepares a new eaiws session using the current application settings. In case of a gatekeeper error a GatekeeperError will be thrown. Note: prepareEaiwsSession() will be also called internally.

      Parameters

      Returns Promise<EaiwsSession>

    • Returns i18n

    • Calling this function will prevent the basket from automatically closing the provided session when the basket window gets closed. The session will stay open.

      Parameters

      • pSession: EaiwsSession

      Returns void

    • Returns string

    • Parameters

      • pUrl: string

      Returns string

      Should no longer be used. Will be removed.

    • Returns a list of price lists available for the given session. Note: The server response will be cached to speed up further calls.

      Parameters

      • pContext: EaiwsContext

      Returns Promise<PriceList[]>

    • Returns a list of project groups available for the given session. Note: The server response will be cached to speed up further calls.

      Parameters

      • pContext: EaiwsContext

      Returns Promise<ProjectGroup[]>

    • Returns a file name for the given project and extension.

      Parameters

      • pBasket: Basket

        Basket instance with loaded project

      • pFileExtension: string

        Extension of the file (e.g. ".obk")

      Returns Promise<string>

    • Parameters

      • pLanguage: string
      • pResourceVersion: string
      • pResourcesPath: string

      Returns Promise<i18n>

    • Returns boolean

    • Returns true if the ctrl key is currenty down. For Apple platforms the command (meta) key is checked instead.

      Parameters

      • pEvent: MouseEvent | KeyboardEvent

      Returns boolean

    • Returns boolean

    • Normalizes the given set of user restrictions. E.g. if edit is part of the set, all the other editing restrictions will be added also to the set.

      Parameters

      Returns void

    • Converts the given OBK into an OBX.

      Parameters

      • pSession: EaiwsSession

        The EAIWS session.

      • pObkUrl: string

        Url of the OBK. The URL has to belong to the given session.

      • OptionalpOptions: ObkToObxOptions

        Additional conversion options.

      Returns Promise<string>

      Returns the URL of the created OBX.

    • Can be used to programmatically open a link.

      Parameters

      • pUrl: string
      • OptionalpTarget: string

        Custom target for the link (default: _blank)

      Returns void

    • Prepares article images and shows a progress while doing so. Should be called before requesting a large amount of article images to avoid timeouts.

      Parameters

      Returns Promise<boolean>

    • Should be called after starting a session to setup parameters like data language and locale of the session. Note: Will be called automatically from createEaiwsSession()

      Parameters

      • pSession: EaiwsSession

      Returns Promise<void>

    • Resizes an image if it exeeds the maximum size. The original image will be returned in case it does not need to be resized.

      Parameters

      Returns Promise<Blob>

    • Scrolls an html element into view if necessary.

      Parameters

      • pElement: HTMLElement

      Returns void

    • Starts the download of the given file while preventing the window.beforeunload event to be triggered. Note: This is not guaranteed to work for cross domain urls (e.g. for PDFs). In this case the file will be opened in a new tab.

      Parameters

      • pFileOrUrl: string | Blob | File
      • OptionalpDownloadFilename: string

      Returns void

    • Uploads and resizes an image to an eaiws session while showing a progress. The url of the uploaded image will be returned. null will be returned if the upload was aborted by the user. Only PNG and JPG images are supported.

      Parameters

      Returns Promise<string | null>

    • Uploads a file to an eaiws session while showing a progress. The url of the uploaded file will be returned. null will be returned if the upload was aborted by the user.

      Parameters

      Returns Promise<string | null>