JavaScript Extension Development API for Oracle Visual Builder Cloud Service - Classic Applications

Source: pages.dt/js/api/PageType.js

define([], function () {

    'use strict';

    /**
     * Enumeration representing types of ABCS supported {@link pages.dt/js/api/Page page}s.
     *
     * <p>If you are looking for CRUD pages, you will
     * be interested into {@link pages.dt/js/api/PageType.CREATE PageType.CREATE},
     * {@link pages.dt/js/api/PageType.EDIT PageType.EDIT} and
     * {@link pages.dt/js/api/PageType.DETAILS PageType.DETAILS}.
     * Otherwise you should use the {@link pages.dt/js/api/PageType.LANDING PageType.LANDING}
     * type representing initially blank page used for free designing.</p>
     *
     * <p>Every {@link pages.dt/js/api/Page Page} has defined {@link pages.dt/js/api/PageType PageType}.
     * Types can be stated for free designing purposes, for CRUD scenarios etc.
     * If the {@link pages.dt/js/api/Page page} is of {@link pages.dt/js/api/PageType.CREATE PageType.CREATE},
     * {@link pages.dt/js/api/PageType.EDIT PageType.EDIT} or
     * {@link pages.dt/js/api/PageType.DETAILS PageType.DETAILS} type, the page
     * is always bound to the specific {@link entity/js/api/Entity entity} then.</p>
     *
     * @AbcsExtension stable
     * @version 16.3.5
     *
     * @exports pages.dt/js/api/PageType
     * @constructor
     * @private
     * @see {@link pages.dt/js/api/Page Page} object has to be identified by one of these types saying
     *      general purpose of the page
     */
    var PageType = function () {
        AbcsLib.throwStaticClassError();
    };

    /**
     * Create page type.
     *
     * <p>Suited for pages creating new records into collections.</p>
     *
     * @AbcsExtension stable
     * @version 16.3.5
     * @type {String}
     */
    PageType.CREATE = 'create';

    /**
     * Detail page type.
     *
     * <p>Suited for pages displaying collection record's information.</p>
     *
     * @AbcsExtension stable
     * @version 16.3.5
     * @type {String}
     */
    PageType.DETAILS = 'details';

    /**
     * Edit page type.
     *
     * <p>Suited for pages which edits the collection record's fields.</p>
     *
     * @AbcsExtension stable
     * @version 16.3.5
     * @type {String}
     */
    PageType.EDIT = 'edit';

    /**
     * Landing page type.
     *
     * <p>Suited for blank {@link pages.dt/js/api/Page page}s without direct
     * connection to any Businness Object. This {@link pages.dt/js/api/PageType PageType} is mostly used
     * as welcome and introductory pages showing tables, lists, graphs and other summary information.</p>
     *
     * @AbcsExtension stable
     * @version 16.3.5
     * @type {String}
     */
    PageType.LANDING = 'landing';

    /**
     * Array of all page types names.
     *
     * @returns {string[]} list of all PageTypes
     */
    PageType.values = function() {
        return [
            PageType.CREATE,
            PageType.DETAILS,
            PageType.EDIT,
            PageType.LANDING
        ];
    };

    return PageType;
});