At CivicSpace we need to programmatically create contribution pages, which currently lack a public API.
For the pages themselves, RAO and DAO methods exist, but page creation requires more than just the page table to be updated--we need to update all the various tables affected when a user submits a page through the wizard UI.
It appears that some of the methods we need to call are currently limited to form input. For example, CRM_Contribute_Form_ContributionPage_Amount::postProcess receives form input and creates CustomOption records from it via CRM_Core_DAO_CustomOption. Can this code be called outside the context of form submission? If not, should it be abstracted so that it can?
Any tips or guidance would be much appreciated. What is the best approach? Are public APIs indeed the best/appropriate means of programmatically creating items? Do we need a series of public APIs: ContributionPage, CustomOption, etc., with ContributionPage calling the others as needed? Is anyone working in this area? Are there plans to extend the public APIs until they include all available items/objects?