File

src/lib/model/upload-target.model.ts

Index

Properties
Methods

Constructor

constructor(id: string, type: string, title?: string, iconId?: string, context?: string)

Creates a new instance of UploadTarget

Parameters :
Name Type Optional Description
id string no

Upload targets unique id

type string no

Upload targets type

title string yes
iconId string yes
context string yes

Properties

Static AGENT
AGENT: string
Type : string
Default value : 'agent'

add file(s) to last opened folders

Public Optional context
context: string
Type : string
Static CONTEXT
CONTEXT: string
Type : string
Default value : 'context'

add file(s) to context folder

Static CONTEXT_TREE
CONTEXT_TREE: string
Type : string
Default value : 'contexttree'

add file(s) to context folders dynamic structure

Static CUSTOM
CUSTOM: string
Type : string
Default value : 'custom'

custom targets (e.g. for plugin development)

Public description
description: string
Type : string
Static FAVORITE
FAVORITE: string
Type : string
Default value : 'favorite'

add file(s) to favorite folders

Public Optional iconId
iconId: string
Type : string
Public id
id: string
Type : string
Upload targets unique id
Public name
name: string
Type : string
Static OBJECT
OBJECT: string
Type : string
Default value : 'object'

set/replace content file of a dms object

Public referenceObject
referenceObject: DmsObject
Type : DmsObject

based on the upload targets type this is the dms object to add/replace content file for (type: OBJECT) or the context folder to add the files to (type: CONTEXT)

Static ROOT
ROOT: string
Type : string
Default value : 'root'

general filing target

Public subFolder
subFolder: StructureTreeNode
Type : StructureTreeNode

node from the structure service tree that may hold additional data to be provide to the prepare service

Public Optional title
title: string
Type : string
Public type
type: string
Type : string
Upload targets type

Methods

Public onUploadFail
onUploadFail()

Return method if the Upload fails

Returns : literal type

an empty Object if the Upload fails

Public onUploadSuccess
onUploadSuccess(target: any)

Return Method if the Upload is Successfull

Parameters :
Name Type Optional
target any no
Returns : any

the provided UploadTarget if the Upload was Successfull.

import {DmsObject} from './dms-object.model';
import {StructureTreeNode} from '../interface/tree-node.interface';

export class UploadTarget {

  /**
   * general filing target
   */
  public static ROOT = 'root';
  /**
   * add file(s) to context folder
   */
  public static CONTEXT = 'context';
  /**
   * add file(s) to context folders dynamic structure
   */
  public static CONTEXT_TREE = 'contexttree';
  /**
   * set/replace content file of a dms object
   */
  public static OBJECT = 'object';
  /**
   * custom targets (e.g. for plugin development)
   */
  public static CUSTOM = 'custom';

  /**
   * add file(s) to favorite folders
   */
  public static FAVORITE = 'favorite';

  /**
   * add file(s) to last opened folders
   */
  public static AGENT = 'agent';

  public name: string;
  public description: string;
  /**
   * based on the upload targets type this is the dms object to
   * add/replace content file for (type: OBJECT) or the context folder
   * to add the files to (type: CONTEXT)
   */
  public referenceObject: DmsObject;
  /**
   * node from the structure service tree that may hold additional
   * data to be provide to the prepare service
   */
  public subFolder: StructureTreeNode;

  /**
   * Creates a new instance of UploadTarget
   *
   * @param id Upload targets unique id
   * @param type Upload targets type
   * @param title 
   * @param iconId
   * @param context
   */
  constructor(public id: string,
              public type: string,
              public title?: string,
              public iconId?: string,
              public context?: string,
            ) { 

  }

  /**
   * Return Method if the Upload is Successfull
   *
   * @param target
   * @returns the provided UploadTarget if the Upload was Successfull.
   */
  public onUploadSuccess(target: any): any {
    return target;
  }

  /**
   * Return method if the Upload fails
   *
   * @returns an empty Object if the Upload fails
   */
  public onUploadFail(): {} {
    return {};
  }
}

results matching ""

    No results matching ""