本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}