Skip to main content

Extending/Overriding D2FS service through Service Plugin

If developer wants to create a customization which needs to override/extend the existing functionality of a D2FS service, the developer can create custom class with the "(D2FS Services Name)Plugin.java' which extends the D2FS service class and implements ID2fsPlugin class. For an example -

package com.opentext.d2.smartview.d2svdialogs.webfs.dialog;

import com.emc.d2fs.dctm.web.services.ID2fsPlugin;
import com.emc.d2fs.dctm.web.services.dialog.D2DialogService;
import com.emc.d2fs.models.context.Context;
import com.emc.d2fs.models.attribute.Attribute;
import com.emc.d2fs.models.dialog.Dialog;
import java.util.List;

public class D2DialogServicePlugin extends D2DialogService implements ID2fsPlugin {
...
public Dialog validDialog(Context context, String id, String dialogName, List<Attribute> parameters) throws Exception {
//custom logic

//If the following line is executed during an invocation then it becomes an extension, otherwise it becomes an override.
return super.validDialog(context, id, dialogName, parameters);
}
...
}

Following services can only be extended/overriden for the supported methods. Below table lists both overidable and non-overridable methods for D2-Smartview

ServicesOverridable MethodsNon-Overridable Methods
D2CreationServiceapplyVdTemplate
getVDTemplates
setTemplate
getTemplates
getTemplates
updateTemplatesListwithFilter
getConvertStructureConfig
createTemplateFromServer
createProperties
getRecentlyUsedVDTemplates
getImportStructureConfigs
getRecentlyUsedTemplates
hasAnyAttachments
removeAttachments
getUIMaxSize
hasAttachments
hasAttachments
getFilteredTemplates
isAFolderOrACabinet
getTemplateFilterOptions
isNoCreationProfile
isNoContentAuthorized
D2DialogServicegetOptions
getDialog
validDialog
cancelDialog
getTaxonomy
getLabels
isMemberOfGroup
getImportValuesUrl
getSubforms
getExportValuesUrl
D2PropertyServicedump
saveProperties
saveProperties
getProperties
D2WorkflowServicererunAutoActivity
resumeTask
pauseTask
setTaskPriority
updateWorkflowSupervisor
getWorkflowTemplatesByWidgetName
removeWorkflowSupportingDocuments
isTaskQueueItemRead
addWorkflowSupportingDocuments
getWorkflowUsersByWidgetName
getWorkflowWorkingDocumentsCount
getWorkflowSupportingDocumentsCount
completeAutoActivity
getWorkflowAttachments
checkLifeCycle
pauseWorkflow
processTask
addNoteToTask
launchWorkflow
abortWorkflow
canAddTaskNote
delegateTask
setTaskReadState
resumeWorkflow
updatePerformer
fetchWorkflowConfig
checkAttachmentLockState
getWorkflowStatusSummary
verifyEntryCriterias
verifyEntryCriteria
launchScheduledWorkflow
acquireTaskAndGetState
getUnreadTasks
delegateTaskEx
addNoteToWorkflow
doAutoTaskAction
isTaskAcquired
getTaskMode
acquireTask
getTaskPermissions
canRejectTask
canForwardTask
canDelegateTask
checkPropertyPage
checkPropertyPage
getTaskFolderLabel
canAbortWorkflow
getConfigurationsNames
getWorkflowDisplayName
checkWorkflowAliases
delegateTaskOnError
isManualAcquisitionTask
D2CheckoutServicecheckout
cancelCheckout
testCheckout
testControlledPrint
cancelCheckoutAll
checkoutAsNew
getNumberOfCheckoutDocument
D2CheckinServicegetCheckinConfigcheckin
D2DownloadServicecheckin
getUploadUrls
getUploadUrls
getUploadUrls
getPageServingUrl
getCheckinUrls
getDownloadUrls
getExtractUrls
getFile
setFile
hasAnyValidC2ExportAndRenditionConfig
getDefaultServerInfo
checkinAndLifeCycle
extractDcoumentProperty
getImportStructureUrls
setDocumentProperty
extractProperties
getDownloadObjectId
getFileInfo
getObjectsDownloadUrls
canPrintControlledView
getDispatchDownloadUrl
getDownloadFileDetails
isProtectedInControlledView
addRendition
info

In case any unsupported methods are overriden by a plugin, it will be shown as warning in D2-Smartview.log during startup of the application