Sugar has a set of predefined entry points. you may need to extend sugar to include new entry points.
Few examples:
1. Export SugarCRM’s data to another format like pdf.
2. By pass the soap and provide some other service like REST.
3. Importing data into SugarCRM like Creating a lead capture form or connecting SugarCRM to a Queue application like ActiveMQ.
Basically if you want to have your own entry point into SugarCRM for importing or exporting data within SugarCRM’s context you will need to create an entry point and register it.
Registration is done in /include/MVC/Controller/entry_point_registry.php
This file looks like this:
$entry_point_registry = array(
‘download’ => array(’file’ => ‘download.php’, ‘auth’ => true),
‘export’ => array(’file’ => ‘export.php’, ‘auth’ => true),
‘export_dataset’ => array(’file’ => ‘export_dataset.php’, ‘auth’ => true),
‘vCard’ => array(’file’ => ‘vCard.php’, ‘auth’ => true),
‘pdf’ => array(’file’ => ‘pdf.php’, ‘auth’ => true),
‘minify’ => array(’file’ => ‘jssource/minify.php’, ‘auth’ => true),
‘json’ => array(’file’ => ‘json.php’, ‘auth’ => true),
‘json_server’ => array(’file’ => ‘json_server.php’, ‘auth’ => true),
‘HandleAjaxCall’ => array(’file’ => ‘HandleAjaxCall.php’, ‘auth’ => true),
‘TreeData’ => array(’file’ => ‘TreeData.php’, ‘auth’ => true),
‘oc_convert’ => array(’file’ => ‘oc_convert.php’, ‘auth’ => false),
‘ExampleLeadCapture’ => array(’file’ => ‘examples/ExampleLeadCapture.php’, ‘auth’ => false),
‘FormValidationTest’ => array(’file’ => ‘examples/FormValidationTest.php’, ‘auth’ => false),
‘ProgressBarTest’ => array(’file’ => ‘examples/ProgressBarTest.php’, ‘auth’ => false),
‘SoapFullTest’ => array(’file’ => ‘examples/SoapFullTest.php’, ‘auth’ => false),
‘SoapPortalFullTest’ => array(’file’ => ‘examples/SoapPortalFullTest.php’, ‘auth’ => false),
‘SoapTest’ => array(’file’ => ‘examples/SoapTest.php’, ‘auth’ => false),
‘SoapTestPortal’ => array(’file’ => ‘examples/SoapTestPortal.php’, ‘auth’ => false),
‘SoapTestPortal2′ => array(’file’ => ‘examples/SoapTestPortal2.php’, ‘auth’ => false),
‘image’ => array(’file’ => ‘modules/Campaigns/image.php’, ‘auth’ => false),
‘acceptDecline’ => array(’file’ => ‘modules/Contacts/AcceptDecline.php’, ‘auth’ => false),
‘campaign_trackerv2′ => array(’file’ => ‘modules/Campaigns/Tracker.php’, ‘auth’ => false),
‘leadCapture’ => array(’file’ => ‘modules/Leads/Capture.php’, ‘auth’ => false),
‘WebToLeadCapture’ => array(’file’ => ‘modules/Campaigns/WebToLeadCapture.php’, ‘auth’ => false),
‘removeme’ => array(’file’ => ‘modules/Campaigns/RemoveMe.php’, ‘auth’ => false),
‘process_queue’ => array(’file’ => ‘process_queue.php’, ‘auth’ => true),
‘process_workflow’ => array(’file’ => ‘process_workflow.php’, ‘auth’ => true),
’schedulers’ => array(’file’ => ’schedulers.php’, ‘auth’ => true),
‘zipatcher’ => array(’file’ => ‘zipatcher.php’, ‘auth’ => true),
‘mm_get_doc’ => array(’file’ => ‘modules/MailMerge/get_doc.php’, ‘auth’ => true),
);
This is basically an array of entry points.
There are few parameters:
1. name: what do you want to call your entry point?
2. file: what fill should be called?
3. auth: if the user should be authenticated to use this entry point.
Example:
create the file: /custom/osintegra.php
with content:
global $sugar_config;
global $locale;
require_once(”modules/Leads/Lead.php”);
$lead = new Lead();
$lead->name=”OSIntegra”;
$lead->full_name=”OSIntegra Test”;
$lead->first_name=”Parham”;
$lead->last_name=”Beheshti”;
$lead->description=”OSIntegra Entry Point Test”;
$lead->save();
?>
and modify the /include/MVC/Controller/entry_point_registry.php
$entry_point_registry = array(
‘download’ => array(’file’ => ‘download.php’, ‘auth’ => true),
‘export’ => array(’file’ => ‘export.php’, ‘auth’ => true),
‘export_dataset’ => array(’file’ => ‘export_dataset.php’, ‘auth’ => true),
‘vCard’ => array(’file’ => ‘vCard.php’, ‘auth’ => true),
‘pdf’ => array(’file’ => ‘pdf.php’, ‘auth’ => true),
‘minify’ => array(’file’ => ‘jssource/minify.php’, ‘auth’ => true),
‘json’ => array(’file’ => ‘json.php’, ‘auth’ => true),
‘json_server’ => array(’file’ => ‘json_server.php’, ‘auth’ => true),
‘HandleAjaxCall’ => array(’file’ => ‘HandleAjaxCall.php’, ‘auth’ => true),
‘TreeData’ => array(’file’ => ‘TreeData.php’, ‘auth’ => true),
‘oc_convert’ => array(’file’ => ‘oc_convert.php’, ‘auth’ => false),
‘ExampleLeadCapture’ => array(’file’ => ‘examples/ExampleLeadCapture.php’, ‘auth’ => false),
‘FormValidationTest’ => array(’file’ => ‘examples/FormValidationTest.php’, ‘auth’ => false),
‘ProgressBarTest’ => array(’file’ => ‘examples/ProgressBarTest.php’, ‘auth’ => false),
‘SoapFullTest’ => array(’file’ => ‘examples/SoapFullTest.php’, ‘auth’ => false),
‘SoapPortalFullTest’ => array(’file’ => ‘examples/SoapPortalFullTest.php’, ‘auth’ => false),
‘SoapTest’ => array(’file’ => ‘examples/SoapTest.php’, ‘auth’ => false),
‘SoapTestPortal’ => array(’file’ => ‘examples/SoapTestPortal.php’, ‘auth’ => false),
‘SoapTestPortal2′ => array(’file’ => ‘examples/SoapTestPortal2.php’, ‘auth’ => false),
‘image’ => array(’file’ => ‘modules/Campaigns/image.php’, ‘auth’ => false),
‘acceptDecline’ => array(’file’ => ‘modules/Contacts/AcceptDecline.php’, ‘auth’ => false),
‘campaign_trackerv2′ => array(’file’ => ‘modules/Campaigns/Tracker.php’, ‘auth’ => false),
‘leadCapture’ => array(’file’ => ‘modules/Leads/Capture.php’, ‘auth’ => false),
‘WebToLeadCapture’ => array(’file’ => ‘modules/Campaigns/WebToLeadCapture.php’, ‘auth’ => false),
‘removeme’ => array(’file’ => ‘modules/Campaigns/RemoveMe.php’, ‘auth’ => false),
‘process_queue’ => array(’file’ => ‘process_queue.php’, ‘auth’ => true),
‘process_workflow’ => array(’file’ => ‘process_workflow.php’, ‘auth’ => true),
’schedulers’ => array(’file’ => ’schedulers.php’, ‘auth’ => true),
‘zipatcher’ => array(’file’ => ‘zipatcher.php’, ‘auth’ => true),
‘mm_get_doc’ => array(’file’ => ‘modules/MailMerge/get_doc.php’, ‘auth’ => true),
‘osintegra’ => array(’file’ => ‘custom/osintegra.php’, ‘auth’ => false),
);
Now go to URL: http://localhost/sugar/index.php?entryPoint=osintegra
a new lead should be created.
Tags: guide, Integration, SugarCRM, web service
