Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for transforming file properties #183

Open
nick4598 opened this issue May 20, 2024 · 0 comments
Open

Add support for transforming file properties #183

nick4598 opened this issue May 20, 2024 · 0 comments
Labels
enhancement New feature or request low priority

Comments

@nick4598
Copy link
Collaborator

I'm not sure who requested this, but I assume its low priority until we are requested to do it again. Just capturing this work in a work item.

3 years ago Mike B. opened a PR here that never merged: iTwin/itwinjs-core#2986
Important functions from Mike B's PR

 protected override onExportFileProperty(props: FilePropertyProps): void {
    const hasNoSuchFileProp = this.targetDb.queryNextAvailableFileProperty(props) === 0;
    if (hasNoSuchFileProp) {
      // TODO: replace with new native call that is a single query
      const blob = this.sourceDb.queryFilePropertyBlob(props);
      const strval = this.sourceDb.queryFilePropertyString(props);
      this.targetDb.saveFileProperty(props, strval, blob);
    }
  }
/** Export all file properties from the source iModel. Used to export things such as file settings.
   * @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
   * file properties are not merged, conflicts resolve to the target, only file properties that do not already exist in the target are inserted.
   * @note file properties with the same id but different sub-ids are considered conflicting
   */
  public async exportFileProperties(): Promise<void> {
    Logger.logTrace(loggerCategory, `exportFileProperties()`);
    for (const props of this.sourceDb.nativeDb.getAllFileProperties()) {
      await this.exportFileProperty(props);
    }
  }

  public async exportFileProperty(props: FilePropertyProps): Promise<void> {
    this.callHandlerOrThis("onExportFileProperty", props);
  }
@nick4598 nick4598 added low priority enhancement New feature or request labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

1 participant