How to use the abap-adt-api.objectPath function in abap-adt-api

To help you get started, we’ve selected a few abap-adt-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marcellourbani / vscode_abap_remote_fs / client / src / views / abapgit.ts View on Github external
private async pull(repoItem: AbapGitItem) {
    if ((await this.confirmPull(repoItem.repo.sapPackage)) !== confirm) return
    const server = this.repoServer(repoItem)
    const transport = await selectTransport(
      objectPath(PACKAGE, repoItem.repo.sapPackage),
      repoItem.repo.sapPackage,
      server.server.client
    )
    if (transport.cancelled) return
    const ri = await this.getRemoteInfo(repoItem.repo.url, server.server.client)
    if (!ri) return
    return await window.withProgress(
      {
        location: ProgressLocation.Window,
        title: `Pulling repo ${repoItem.repo.sapPackage}`
      },
      async () => {
        const result = await server.server.client.gitPullRepo(
          repoItem.repo.key,
          ri.branch,
          transport.transport,
github marcellourbani / vscode_abap_remote_fs / client / src / views / abapgit.ts View on Github external
private async createRepo(item: ServerItem) {
    const pkg = await item.server.objectFinder.findObject(
      "Select package",
      PACKAGE
    )
    if (!pkg) return
    const repoUrl = await window.showInputBox({ prompt: "Repository URL" })
    if (!repoUrl) return

    const repoaccess = await this.getRemoteInfo(repoUrl, item.server.client)

    const transport = await selectTransport(
      objectPath(PACKAGE, pkg.name),
      pkg.name,
      item.server.client
    )
    if (transport.cancelled) return
    if ((await this.confirmPull(pkg.name)) !== confirm) return
    return await window.withProgress(
      {
        location: ProgressLocation.Window,
        title: `Linking and pulling package ${pkg.name}`
      },
      async () => {
        const result = await item.server.client.gitCreateRepo(
          pkg.name,
          repoUrl,
          repoaccess.branch,
          transport.transport,
github marcellourbani / vscode_abap_remote_fs / client / src / adt / operations / AdtObjectCreator.ts View on Github external
const packageResult = await this.server.objectFinder.findObject(
        "Select package",
        PACKAGE
      )
      if (!packageResult) return
      devclass = packageResult.name
    }
    if (parentType === PACKAGE) parentName = devclass
    if (!devclass || !parentName) return

    const options: NewObjectOptions | NewPackageOptions = {
      description,
      name: this.fixName(name, objType.typeId, parentName),
      objtype: objType.typeId,
      parentName,
      parentPath: objectPath(parentType, parentName, ""),
      responsible
    }
    if (isPackageType(options.objtype)) {
      const pkgopt = await this.getPackageOptions(options)
      if (!pkgopt) return
      const { swcomp, packagetype, transportLayer } = pkgopt

      const pkoptions = { ...options, swcomp, packagetype, transportLayer }
      return {
        devclass,
        options: pkoptions
      }
    } else return { devclass, options }
  }
  private async findPackage(parent: MySearchResult) {
github marcellourbani / vscode_abap_remote_fs / client / src / adt / operations / AdtObjectCreator.ts View on Github external
public async createObject(uri: Uri | undefined) {
    const objDetails = await this.getObjectDetails(uri)
    if (!objDetails) return
    const { options, devclass } = objDetails
    await this.validateObject(options)
    const transport = await selectTransport(
      objectPath(options.objtype, options.name, options.parentName),
      devclass,
      this.server.client,
      true
    )
    if (transport.cancelled) return
    options.transport = transport.transport
    await this.server.client.createObject(options)

    const obj = abapObjectFromNode({
      EXPANDABLE: "",
      OBJECT_NAME: options.name,
      OBJECT_TYPE: options.objtype,
      OBJECT_URI: objectPath(options),
      OBJECT_VIT_URI: "",
      TECH_NAME: options.name
    })
github marcellourbani / vscode_abap_remote_fs / client / src / adt / operations / AdtObjectCreator.ts View on Github external
await this.validateObject(options)
    const transport = await selectTransport(
      objectPath(options.objtype, options.name, options.parentName),
      devclass,
      this.server.client,
      true
    )
    if (transport.cancelled) return
    options.transport = transport.transport
    await this.server.client.createObject(options)

    const obj = abapObjectFromNode({
      EXPANDABLE: "",
      OBJECT_NAME: options.name,
      OBJECT_TYPE: options.objtype,
      OBJECT_URI: objectPath(options),
      OBJECT_VIT_URI: "",
      TECH_NAME: options.name
    })
    await obj.loadMetadata(this.server.client)
    return obj
  }
  public guessParentByType(hierarchy: AbapNode[], type: ParentTypeIds): string {