Class LoadProjectSettings

All Implemented Interfaces:
HasHandlers

public class LoadProjectSettings extends DataClass
LoadProjectSettings is the bundle of settings that can be passed to loadProject() as the "settings" argument, including optional http parameters for the request to ProjectLoaderServlet.

There is no need to instantiate an LoadProjectSettings instance. Just pass a normal JavaScript object with the desired properties.

  • Constructor Details

    • LoadProjectSettings

      public LoadProjectSettings()
    • LoadProjectSettings

      public LoadProjectSettings(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static LoadProjectSettings getOrCreateRef(JavaScriptObject jsObj)
    • setAllowPlaceholders

      public LoadProjectSettings setAllowPlaceholders(Boolean allowPlaceholders)
      Should Placeholders in loaded screens be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.
      Parameters:
      allowPlaceholders - New allowPlaceholders value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getAllowPlaceholders

      public Boolean getAllowPlaceholders()
      Should Placeholders in loaded screens be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.
      Returns:
      Current allowPlaceholders value. Default value is null
    • setClobberDataSources

      public LoadProjectSettings setClobberDataSources(Boolean clobberDataSources)
      Should DataSources referenced by the first screen clobber existing, globally-bound DataSources on the client if the screen is created? The default of false means that any DataSources defined in the screen will be discarded if they collide with existing, globally-bound DataSources.

      Here we consider a DataSource to be "globally bound" if it can be retrieved by ID using the method DataSource.get(), regardless of whether it's actually bound to the browser window object.

      Note that this setting only has an impact if drawFirstScreen is true.

      Parameters:
      clobberDataSources - New clobberDataSources value. Default value is false
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getClobberDataSources

      public Boolean getClobberDataSources()
      Should DataSources referenced by the first screen clobber existing, globally-bound DataSources on the client if the screen is created? The default of false means that any DataSources defined in the screen will be discarded if they collide with existing, globally-bound DataSources.

      Here we consider a DataSource to be "globally bound" if it can be retrieved by ID using the method DataSource.get(), regardless of whether it's actually bound to the browser window object.

      Note that this setting only has an impact if drawFirstScreen is true.

      Returns:
      Current clobberDataSources value. Default value is false
    • setCurrentScreenName

      public LoadProjectSettings setCurrentScreenName(String currentScreenName)
      The name of the screen within the project to return first when loading. A null value means to use the currentScreenName as specified in the project file.

      This setting only affects the first project specified in the projectNames argument to RPCManager.loadProject().

      Parameters:
      currentScreenName - New currentScreenName value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getCurrentScreenName

      public String getCurrentScreenName()
      The name of the screen within the project to return first when loading. A null value means to use the currentScreenName as specified in the project file.

      This setting only affects the first project specified in the projectNames argument to RPCManager.loadProject().

      Returns:
      Current currentScreenName value. Default value is null
    • setDataContext

      public LoadProjectSettings setDataContext(DataContext dataContext)
      DataContext that will be provided to the top-level component as dataContext in each screen cached for the project.

      To understand how dataContext is used to automatically populate DataBoundComponents, see Canvas.autoPopulateData.

      Parameters:
      dataContext - New dataContext value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getDataContext

      public DataContext getDataContext()
      DataContext that will be provided to the top-level component as dataContext in each screen cached for the project.

      To understand how dataContext is used to automatically populate DataBoundComponents, see Canvas.autoPopulateData.

      Returns:
      Current dataContext value. Default value is null
    • setDrawFirstScreen

      public LoadProjectSettings setDrawFirstScreen(boolean drawFirstScreen)
      Determines whether the currentScreenName screen is drawn after all screens have been loaded. If not drawn, the screen will not be created.

      This setting only affects the first project specified in the projectNames argument to RPCManager.loadProject().

      Parameters:
      drawFirstScreen - New drawFirstScreen value. Default value is false
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getDrawFirstScreen

      public boolean getDrawFirstScreen()
      Determines whether the currentScreenName screen is drawn after all screens have been loaded. If not drawn, the screen will not be created.

      This setting only affects the first project specified in the projectNames argument to RPCManager.loadProject().

      Returns:
      Current drawFirstScreen value. Default value is false
      See Also:
    • setLocale

      public LoadProjectSettings setLocale(String locale)
      The name of a locale to use for resolving i18n tags in the component XML of the screen. The default value of null omits locale loading, which effectively means the framework default "en" locale is used.
      Parameters:
      locale - New locale value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getLocale

      public String getLocale()
      The name of a locale to use for resolving i18n tags in the component XML of the screen. The default value of null omits locale loading, which effectively means the framework default "en" locale is used.
      Returns:
      Current locale value. Default value is null
    • setOmitDataSources

      public LoadProjectSettings setOmitDataSources(String... omitDataSources)
      DataSource IDs in the project to skip and not load when the project is loaded. It is assumed that these IDs represent DataSources that are already globally-bound on the client.

      The special value of "*" can be specified for this property to indicate that all DataSources should be omitted.

      Note that, unless omitLoadedDataSources is false, all loaded DataSources will by default be added to whatever value you provide (making that also the default for this property).

      Parameters:
      omitDataSources - New omitDataSources value. Default value is varies
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getOmitDataSources

      public String[] getOmitDataSources()
      DataSource IDs in the project to skip and not load when the project is loaded. It is assumed that these IDs represent DataSources that are already globally-bound on the client.

      The special value of "*" can be specified for this property to indicate that all DataSources should be omitted.

      Note that, unless omitLoadedDataSources is false, all loaded DataSources will by default be added to whatever value you provide (making that also the default for this property).

      Returns:
      Current omitDataSources value. Default value is varies
      See Also:
    • setOmitLoadedDataSources

      public LoadProjectSettings setOmitLoadedDataSources(boolean omitLoadedDataSources)
      Whether to implicitly add all DataSources currently loaded on the client to omitDataSources in RPCManager.loadProject(). Setting this false would only make sense in connection with setting clobberDataSources true, and would create more potential work for the server since many more DataSources could be output.

      Note that here we consider the "loaded DataSources" to be those that are registered with the DataSource module (i.e. available by ID via DataSource.get()), regardless of whether they're actually bound to the browser window object.

      Parameters:
      omitLoadedDataSources - New omitLoadedDataSources value. Default value is true
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getOmitLoadedDataSources

      public boolean getOmitLoadedDataSources()
      Whether to implicitly add all DataSources currently loaded on the client to omitDataSources in RPCManager.loadProject(). Setting this false would only make sense in connection with setting clobberDataSources true, and would create more potential work for the server since many more DataSources could be output.

      Note that here we consider the "loaded DataSources" to be those that are registered with the DataSource module (i.e. available by ID via DataSource.get()), regardless of whether they're actually bound to the browser window object.

      Returns:
      Current omitLoadedDataSources value. Default value is true
    • setOwnerId

      public LoadProjectSettings setOwnerId(String ownerId)
      Use this attribute to specify a project owner. Only applicable if project source supports owner identification.
      Parameters:
      ownerId - New ownerId value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getOwnerId

      public String getOwnerId()
      Use this attribute to specify a project owner. Only applicable if project source supports owner identification.
      Returns:
      Current ownerId value. Default value is null
    • setPassword

      public LoadProjectSettings setPassword(String password)
      Overrides password setting the account password for Reify.loadProject().

      Note that this setting only applies when using Reify.loadProject().

      Parameters:
      password - New password value. Default value is varies
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getPassword

      public String getPassword()
      Overrides password setting the account password for Reify.loadProject().

      Note that this setting only applies when using Reify.loadProject().

      Returns:
      Current password value. Default value is varies
    • setProjectLoaderPath

      public LoadProjectSettings setProjectLoaderPath(String projectLoaderPath)
      Path relative to the server root, to target to use the project loader servlet, instead of projectLoaderPath.

      Note that this setting only applies when using Reify.loadProject().

      Parameters:
      projectLoaderPath - New projectLoaderPath value. Default value is varies
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getProjectLoaderPath

      public String getProjectLoaderPath()
      Path relative to the server root, to target to use the project loader servlet, instead of projectLoaderPath.

      Note that this setting only applies when using Reify.loadProject().

      Returns:
      Current projectLoaderPath value. Default value is varies
    • setRequestProperties

      public LoadProjectSettings setRequestProperties(RPCRequest requestProperties)
      Allows customizing the projectLoader servlet request properties. Properties that conflict with proper operation of the servlet will be overridden by RPCManager.loadProject().

      Note : This is an advanced setting

      Parameters:
      requestProperties - New requestProperties value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getRequestProperties

      public RPCRequest getRequestProperties()
      Allows customizing the projectLoader servlet request properties. Properties that conflict with proper operation of the servlet will be overridden by RPCManager.loadProject().
      Returns:
      Current requestProperties value. Default value is null
    • setScreenNames

      public LoadProjectSettings setScreenNames(String screenNames)
      A comma-separated string containing the names of screens within the project that should be loaded. A null value causes all screens to be loaded.

      This setting only affects the first project specified in the projectNames argument to RPCManager.loadProject().

      Parameters:
      screenNames - New screenNames value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getScreenNames

      public String getScreenNames()
      A comma-separated string containing the names of screens within the project that should be loaded. A null value causes all screens to be loaded.

      This setting only affects the first project specified in the projectNames argument to RPCManager.loadProject().

      Returns:
      Current screenNames value. Default value is null
    • setServerURL

      public LoadProjectSettings setServerURL(String serverURL)
      URL of Reify server to use when calling Reify.loadProject() instead of serverURL.

      Note that this setting only applies when using Reify.loadProject().

      Parameters:
      serverURL - New serverURL value. Default value is varies
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getServerURL

      public String getServerURL()
      URL of Reify server to use when calling Reify.loadProject() instead of serverURL.

      Note that this setting only applies when using Reify.loadProject().

      Returns:
      Current serverURL value. Default value is varies
      See Also:
    • setTimeout

      public LoadProjectSettings setTimeout(Integer timeout)
      Sets the timeout for the projectLoader servlet request. This is a convenience property so that requestProperties need not be set. If unset, the timeout is determined by defaultTimeout.

      Note : This is an advanced setting

      Parameters:
      timeout - New timeout value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getTimeout

      public Integer getTimeout()
      Sets the timeout for the projectLoader servlet request. This is a convenience property so that requestProperties need not be set. If unset, the timeout is determined by defaultTimeout.
      Returns:
      Current timeout value. Default value is null
    • setUserName

      public LoadProjectSettings setUserName(String userName)
      Overrides userName setting the account name for Reify.loadProject().

      Note that this setting only applies when using Reify.loadProject().

      Parameters:
      userName - New userName value. Default value is varies
      Returns:
      LoadProjectSettings instance, for chaining setter calls
    • getUserName

      public String getUserName()
      Overrides userName setting the account name for Reify.loadProject().

      Note that this setting only applies when using Reify.loadProject().

      Returns:
      Current userName value. Default value is varies
    • setVerifyAsError

      public LoadProjectSettings setVerifyAsError(Boolean verifyAsError)
      Enable verifyAsError behavior only for requests using these settings.
      Parameters:
      verifyAsError - New verifyAsError value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getVerifyAsError

      public Boolean getVerifyAsError()
      Enable verifyAsError behavior only for requests using these settings.
      Returns:
      Current verifyAsError value. Default value is null
      See Also:
    • setVerifyComponents

      public LoadProjectSettings setVerifyComponents(Map<String,String> verifyComponents)
      Enables verification that any screen created on load contains a component having a localId equal to the given key, and that it is an instance (or subclass) of the key's value. Example:
          {'customerListGrid': 'ListGrid'}
        
      You may verify the presence of Tabs, SectionStackSections, and FormItems by providing their names following the parent component's id in dot-separated notation. Example:
          {
            'mainTabSet.customersTab': 'ImgTab',
            'mainSectionStack.customerStackSection': 'SectionStackSection',
            'customerDetailsForm.customerNameItem': 'TextItem'
          }
        
      Findings are always reported to the console, and may also be presented to the user with a warning dialog by setting verifyAsError or verifyAsError.
      Parameters:
      verifyComponents - New verifyComponents value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getVerifyComponents

      public Map<String,String> getVerifyComponents()
      Enables verification that any screen created on load contains a component having a localId equal to the given key, and that it is an instance (or subclass) of the key's value. Example:
          {'customerListGrid': 'ListGrid'}
        
      You may verify the presence of Tabs, SectionStackSections, and FormItems by providing their names following the parent component's id in dot-separated notation. Example:
          {
            'mainTabSet.customersTab': 'ImgTab',
            'mainSectionStack.customerStackSection': 'SectionStackSection',
            'customerDetailsForm.customerNameItem': 'TextItem'
          }
        
      Findings are always reported to the console, and may also be presented to the user with a warning dialog by setting verifyAsError or verifyAsError.
      Returns:
      Current verifyComponents value. Default value is null
      See Also:
    • setVerifyDataSources

      public LoadProjectSettings setVerifyDataSources(Boolean verifyDataSources)
      Enables DataSource verification, causing warnings to be output about differences between DataSources loaded with a project vs those that are already present in the page (if any are present). Findings are always reported to the console, and may also be presented to the user with a warning dialog by setting verifyAsError. For discussion of which issues will be reported and how, see DataSource.verifyDataSourcePair().

      Setting this property will default omitLoadedDataSources to false, and will cause the special omitDataSources value of "*" to be ignored (but not other ID values). It's important to keep in mind when using this property that loading a project with all of its DataSources can be very slow, if there is a large amount of test data, for example.

      Note that this behavior can be enabled globally by setting verifyDataSources to true. It often makes sense to set it there during development, and turn off in production, since it slightly slows down DataSource loading.

      Parameters:
      verifyDataSources - New verifyDataSources value. Default value is null
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getVerifyDataSources

      public Boolean getVerifyDataSources()
      Enables DataSource verification, causing warnings to be output about differences between DataSources loaded with a project vs those that are already present in the page (if any are present). Findings are always reported to the console, and may also be presented to the user with a warning dialog by setting verifyAsError. For discussion of which issues will be reported and how, see DataSource.verifyDataSourcePair().

      Setting this property will default omitLoadedDataSources to false, and will cause the special omitDataSources value of "*" to be ignored (but not other ID values). It's important to keep in mind when using this property that loading a project with all of its DataSources can be very slow, if there is a large amount of test data, for example.

      Note that this behavior can be enabled globally by setting verifyDataSources to true. It often makes sense to set it there during development, and turn off in production, since it slightly slows down DataSource loading.

      Returns:
      Current verifyDataSources value. Default value is null
      See Also:
    • setWillHandleError

      public LoadProjectSettings setWillHandleError(boolean willHandleError)
      Whether to call the provided callback even if an error was encountered trying to load the project, so that you can run your own error handling. In this case, the list of projects loaded by the callback will be reported as empty.

      If true, the framework won't log any messages specifically reporting the failure to load the requested projects, but depending on the situation, the browser itself may report errors from the servlet request in the console.

      Parameters:
      willHandleError - New willHandleError value. Default value is false
      Returns:
      LoadProjectSettings instance, for chaining setter calls
      See Also:
    • getWillHandleError

      public boolean getWillHandleError()
      Whether to call the provided callback even if an error was encountered trying to load the project, so that you can run your own error handling. In this case, the list of projects loaded by the callback will be reported as empty.

      If true, the framework won't log any messages specifically reporting the failure to load the requested projects, but depending on the situation, the browser itself may report errors from the servlet request in the console.

      Returns:
      Current willHandleError value. Default value is false
      See Also: