當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript CoreFileUploaderProvider.uploadOrReuploadFiles方法代碼示例

本文整理匯總了TypeScript中@core/fileuploader/providers/fileuploader.CoreFileUploaderProvider.uploadOrReuploadFiles方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CoreFileUploaderProvider.uploadOrReuploadFiles方法的具體用法?TypeScript CoreFileUploaderProvider.uploadOrReuploadFiles怎麽用?TypeScript CoreFileUploaderProvider.uploadOrReuploadFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@core/fileuploader/providers/fileuploader.CoreFileUploaderProvider的用法示例。


在下文中一共展示了CoreFileUploaderProvider.uploadOrReuploadFiles方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: uploadOrStoreFiles

 /**
  * Upload or store some files, depending if the user is offline or not.
  *
  * @param  {number}  glossaryId    Glossary ID.
  * @param  {string}  entryName     The name of the entry.
  * @param  {number}  [timeCreated] The time the entry was created.
  * @param  {any[]}   files         List of files.
  * @param  {boolean} offline       True if files sould be stored for offline, false to upload them.
  * @param  {string}  [siteId]      Site ID. If not defined, current site.
  * @return {Promise<any>}          Promise resolved if success.
  */
 uploadOrStoreFiles(glossaryId: number, entryName: string, timeCreated: number, files: any[], offline: boolean,
         siteId?: string): Promise<any> {
     if (offline) {
         return this.storeFiles(glossaryId, entryName, timeCreated, files, siteId);
     } else {
         return this.uploaderProvider.uploadOrReuploadFiles(files, AddonModGlossaryProvider.COMPONENT, glossaryId, siteId);
     }
 }
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:19,代碼來源:helper.ts

示例2: uploadOrStoreReplyFiles

 /**
  * Upload or store some files for a reply, depending if the user is offline or not.
  *
  * @param  {number}  forumId  Forum ID.
  * @param  {number}  postId   ID of the post being replied.
  * @param  {any[]}   files    List of files.
  * @param  {boolean} offline  True if files sould be stored for offline, false to upload them.
  * @param  {string}  [siteId] Site ID. If not defined, current site.
  * @param  {number}  [userId] User the reply belongs to. If not defined, current user in site.
  * @return {Promise<any>}     Promise resolved if success.
  */
 uploadOrStoreReplyFiles(forumId: number, postId: number, files: any[], offline: boolean, siteId?: string, userId?: number)
         : Promise<any> {
     if (offline) {
         return this.storeReplyFiles(forumId, postId, files, siteId, userId);
     } else {
         return this.uploaderProvider.uploadOrReuploadFiles(files, AddonModForumProvider.COMPONENT, forumId, siteId);
     }
 }
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:19,代碼來源:helper.ts

示例3: uploadOrStoreNewDiscussionFiles

 /**
  * Upload or store some files for a new discussion, depending if the user is offline or not.
  *
  * @param  {number}  forumId     Forum ID.
  * @param  {number}  timecreated The time the discussion was created.
  * @param  {any[]}   files       List of files.
  * @param  {boolean} offline     True if files sould be stored for offline, false to upload them.
  * @param  {string}  [siteId]    Site ID. If not defined, current site.
  * @return {Promise<any>}        Promise resolved if success.
  */
 uploadOrStoreNewDiscussionFiles(forumId: number, timecreated: number, files: any[], offline: boolean, siteId?: string)
         : Promise<any> {
     if (offline) {
         return this.storeNewDiscussionFiles(forumId, timecreated, files, siteId);
     } else {
         return this.uploaderProvider.uploadOrReuploadFiles(files, AddonModForumProvider.COMPONENT, forumId, siteId);
     }
 }
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:18,代碼來源:helper.ts

示例4: uploadOrStoreAssessmentFiles

 /**
  * Upload or store some files for an assessment, depending if the user is offline or not.
  *
  * @param  {number}  workshopId   Workshop ID.
  * @param  {number}  assessmentId ID.
  * @param  {any[]}   files        List of files.
  * @param  {boolean} offline      True if files sould be stored for offline, false to upload them.
  * @param  {string}  [siteId]     Site ID. If not defined, current site.
  * @return {Promise<any>}         Promise resolved if success.
  */
 uploadOrStoreAssessmentFiles(workshopId: number, assessmentId: number, files: any[], offline: boolean, siteId?: string):
         Promise<any> {
     if (offline) {
         return this.storeAssessmentFiles(workshopId, assessmentId, files, siteId);
     } else {
         return this.uploaderProvider.uploadOrReuploadFiles(files, AddonModWorkshopProvider.COMPONENT, workshopId, siteId);
     }
 }
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:18,代碼來源:helper.ts

示例5: uploadOrStoreSubmissionFiles

 /**
  * Upload or store some files for a submission, depending if the user is offline or not.
  *
  * @param  {number}  workshopId   Workshop ID.
  * @param  {number}  submissionId If not editing, it will refer to timecreated.
  * @param  {any[]}   files        List of files.
  * @param  {boolean} editing      If the submission is being edited or added otherwise.
  * @param  {boolean} offline      True if files sould be stored for offline, false to upload them.
  * @param  {string}  [siteId]     Site ID. If not defined, current site.
  * @return {Promise<any>}         Promise resolved if success.
  */
 uploadOrStoreSubmissionFiles(workshopId: number, submissionId: number, files: any[], editing: boolean, offline: boolean,
         siteId?: string): Promise<any> {
     if (offline) {
         return this.storeSubmissionFiles(workshopId, submissionId, editing, files, siteId);
     } else {
         return this.uploaderProvider.uploadOrReuploadFiles(files, AddonModWorkshopProvider.COMPONENT, workshopId, siteId);
     }
 }
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:19,代碼來源:helper.ts

示例6: uploadOrStoreFiles

    /**
     * Upload or store some files, depending if the user is offline or not.
     *
     * @param  {number}   dataId     Database ID.
     * @param  {number}   [itemId=0] Draft ID to use. Undefined or 0 to create a new draft ID.
     * @param  {number}   entryId    Entry ID or, if creating, timemodified.
     * @param  {number}   fieldId    Field ID.
     * @param  {any[]}    files      List of files.
     * @param  {boolean}  offline    True if files sould be stored for offline, false to upload them.
     * @param  {string}   [siteId]   Site ID. If not defined, current site.
     * @return {Promise<any>}        Promise resolved if success.
     */
    uploadOrStoreFiles(dataId: number, itemId: number = 0, entryId: number, fieldId: number, files: any[], offline: boolean,
            siteId?: string): Promise<any> {
        if (files.length) {
            if (offline) {
                return this.storeFiles(dataId, entryId, fieldId, files, siteId);
            }

            return this.fileUploaderProvider.uploadOrReuploadFiles(files, AddonModDataProvider.COMPONENT, itemId, siteId);
        }

        return Promise.resolve(0);
    }
開發者ID:jleyva,項目名稱:moodlemobile2,代碼行數:24,代碼來源:helper.ts


注:本文中的@core/fileuploader/providers/fileuploader.CoreFileUploaderProvider.uploadOrReuploadFiles方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。