Class Hierarchy
AcRxObject AcPublishReactor
C++
class AcPublishReactor : public AcRxObject;
File
acpublishreactors.h
Description
Clients who want notifications of key publish events can derive from this class and implement their own reactors.
Client-Side Implementation
To derive a class to receive reactor notifications from the AcPublish module:
- Include the header file AcPublishReactors.h.
- Override the class AcPublishReactor. For example:
class AcTestReactor : public AcPublishReactor { public: void OnAboutToBeginBackgroundPublishing(AcPublishBeforeJobInfo *pInfo); void OnAboutToBeginPublishing(AcPublishBeginJobInfo *pInfo); void OnBeginSheet(AcPublishSheetInfo *pInfo); void OnBeginAggregation(AcPublishAggregationInfo *pInfo); void OnAboutToEndPublishing(AcPublishReactorInfo *pInfo); void OnAboutToMoveFile(AcPublishReactorInfo *pInfo); void OnEndPublish(AcPublishReactorInfo *pInfo); void OncanceledOrFailedPublishing(AcPublishReactorInfo *pInfo); virtual ~AcTestReactor() {}; AcTestReactor() {}; };
- Implement the methods to do your processing.
If you need the final DWF file name, you can get it from the AcPublishReactorInfopInfo object using the method dwfFileName().
To add and remove your AcTestReactor instance:
- Check whether AcPublish.crx is loaded. For example:
if(!acrxServiceIsRegistered(/*MSG0*/"AdskPublish")) { acrxLoadModule(/*MSG0*/"AcPublish.crx", false, false); }
2. Once the AcPublish module is loaded, use the global method AcGlobAddPublishReactor() to add your reactor. For example:
HINSTANCE hInst = ::GetModuleHandle(/*MSG0*/"AcPublish.crx"); if ((hInst)) { ACGLOBADDPUBLISHREACTOR pAcGlobAddPublishReactor = (ACGLOBADDPUBLISHREACTOR)GetProcAddress(hInst, /*MSG0*/"AcGlobAddPublishReactor"); pAcGlobRemovePublishReactor = (ACGLOBREMOVEPUBLISHREACTOR)GetProcAddress( hInst, /*MSG0*/"AcGlobRemovePublishReactor"); if (pAcGlobAddPublishReactor != NULL) pAcGlobAddPublishReactor(&testReactor); }
- When unloading your application, call AcGlobRemovePublishReactor().
NOTE: Clients are responsibile for making sure that AcPublish.crx is loaded and unloaded, and for adding and removing their reactors.