@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-calendars/>
  a sioc:Post ;
  dc:title "Service API and hooks" ;
  dcterms:identifier 153089 ;
  dc:modified "2026-11-01T16:41:31Z"^^xsd:dateTime ;
  dc:created "2026-11-01T16:41:31Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-calendars/service-api-and-hooks/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-calendars/">LH Calendars</a></li></ul>
<p class="wp-block-paragraph">Tooling plugins (MCP abilities, admin screens) call the provider methods rather than the tables, so they get the same data and permission rules as phones. The providers only ever act for the signed-in user, on that user&#8217;s home site.</p>



<h3 class="wp-block-heading">Service methods</h3>



<ul class="wp-block-list">
<li><code>LH_Calendars::return_home_site_id( $user_id )</code>, <code>is_home_site( $user_id )</code>, <code>return_storage_site_id()</code>.</li>



<li>Both providers: the <code>LH_DAV_Collection_Provider</code> methods <code>get_collections()</code>, <code>get_resource_index()</code>, <code>get_resources()</code>, <code>put_resource()</code> and <code>delete_resource()</code>. The organisation provider refuses writes with 403.</li>



<li><code>LH_Calendars_Personal_Provider</code> also implements <code>LH_DAV_Collection_Manager</code>: <code>can_create_collections()</code>, <code>create_collection()</code>, <code>update_collection()</code>, <code>delete_collection()</code>.</li>



<li><code>LH_Calendars_Organisations_Provider::return_organisation_site_ids( $user_id )</code> and <code>user_can_view_status( $status, $user_id )</code> (call on the organisation&#8217;s site).</li>



<li><code>LH_Calendars_Profile::get_export( $calendar )</code>: one of the current user&#8217;s calendars as a single .ics file.</li>



<li><code>LH_Calendars_Ical::read_resource()</code>, <code>build_event()</code> and <code>merge()</code>.</li>
</ul>



<h3 class="wp-block-heading">Filters and actions</h3>



<ul class="wp-block-list">
<li><code>lh_calendars_init_plugin</code>: return false to stop the plugin booting.</li>



<li><code>lh_calendars_return_home_site_id</code> ( $site_id, $user_id ): the site a user&#8217;s calendars are served on.</li>



<li><code>lh_calendars_return_default_calendar_id</code> ( &#8216;personal&#8217; ) and <code>lh_calendars_return_max_calendars</code> ( 50 ).</li>



<li><code>lh_calendars_organisation_site_ids</code> ( $site_ids, $user_id ): the organisations a user gets calendars for.</li>



<li><code>lh_calendars_return_gatherpress_plugin</code> ( &#8216;gatherpress/gatherpress.php&#8217; ).</li>



<li><code>lh_calendars_user_can_view_status</code> ( $can, $status, $user_id, $site_id ) and <code>lh_calendars_user_can_see_event</code> ( true, $post, $user_id ): who sees which events.</li>



<li><code>lh_calendars_return_organisation_days_back</code> ( 90 ) and <code>lh_calendars_organisation_event_query_args</code> ( $args, $site_id, $user_id ): which events are included.</li>



<li><code>lh_calendars_return_organisation_color</code> ( $color, $site_id ).</li>



<li><code>lh_calendars_return_description_length</code> ( 2000 ) and the action <code>lh_calendars_build_event</code> ( $vevent, $post ), run on the event&#8217;s site to add or change event properties.</li>



<li><code>lh_calendars_return_tracked_event_meta_keys</code>: GatherPress meta whose change is logged for sync.</li>
</ul>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Calendars
Tooling plugins (MCP abilities, admin screens) call the provider methods rather than the tables, so they get the same data and permission rules as phones. The providers only ever act for the signed-in user, on that user&#8217;s home site.



Service methods




LH_Calendars::return_home_site_id( $user_id ), is_home_site( $user_id ), return_storage_site_id().



Both providers: the LH_DAV_Collection_Provider methods get_collections(), get_resource_index(), get_resources(), put_resource() and delete_resource(). The organisation provider refuses writes with 403.



LH_Calendars_Personal_Provider also implements LH_DAV_Collection_Manager: can_create_collections(), create_collection(), update_collection(), delete_collection().



LH_Calendars_Organisations_Provider::return_organisation_site_ids( $user_id ) and user_can_view_status( $status, $user_id ) (call on the organisation&#8217;s site).



LH_Calendars_Profile::get_export( $calendar ): one of the current user&#8217;s calendars as a single .ics file.



LH_Calendars_Ical::read_resource(), build_event() and merge().




Filters and actions




lh_calendars_init_plugin: return false to stop the plugin booting.



lh_calendars_return_home_site_id ( $site_id, $user_id ): the site a user&#8217;s calendars are served on.



lh_calendars_return_default_calendar_id ( &#8216;personal&#8217; ) and lh_calendars_return_max_calendars ( 50 ).



lh_calendars_organisation_site_ids ( $site_ids, $user_id ): the organisations a user gets calendars for.



lh_calendars_return_gatherpress_plugin ( &#8216;gatherpress/gatherpress.php&#8217; ).



lh_calendars_user_can_view_status ( $can, $status, $user_id, $site_id ) and lh_calendars_user_can_see_event ( true, $post, $user_id ): who sees which events.



lh_calendars_return_organisation_days_back ( 90 ) and lh_calendars_organisation_event_query_args ( $args, $site_id, $user_id ): which events are included.



lh_calendars_return_organisation_color ( $color, $site_id ).



lh_calendars_return_description_length ( 2000 ) and the action lh_calendars_build_event ( $vevent, $post ), run on the event&#8217;s site to add or change event properties.



lh_calendars_return_tracked_event_meta_keys: GatherPress meta whose change is logged for sync.

""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1>, <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261101t054200-lh-calendars-service-api> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261101t054200-lh-calendars-service-api> rdfs:seeAlso <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261101t054200-lh-calendars-service-api&feed=lhrdf&format=turtle> .
