geonode.resource.utils ====================== .. py:module:: geonode.resource.utils Attributes ---------- .. autoapisummary:: geonode.resource.utils.logger geonode.resource.utils.ogc_settings Classes ------- .. autoapisummary:: geonode.resource.utils.KeywordHandler Functions --------- .. autoapisummary:: geonode.resource.utils.update_resource geonode.resource.utils.call_storers geonode.resource.utils.get_alternate_name geonode.resource.utils.document_post_save geonode.resource.utils.dataset_post_save geonode.resource.utils.metadata_post_save geonode.resource.utils.resourcebase_post_save Module Contents --------------- .. py:data:: logger .. py:data:: ogc_settings .. py:class:: KeywordHandler(instance, keywords) Object needed to handle the keywords coming from the XML The expected input are: - instance (Dataset/Document/Map): instance of any object inherited from ResourceBase. - keywords (list(dict)): Is required to analyze the keywords to find if some thesaurus is available. .. py:attribute:: instance .. py:attribute:: keywords .. py:method:: set_keywords() Method with the responsible to set the keywords (free and thesaurus) to the object. At return there is always a call to final_step to let it hookable. .. py:method:: handle_metadata_keywords() Method the extract the keyword from the dict. If the keyword are passed, try to extract them from the dict by splitting free-keyword from the thesaurus .. py:method:: is_thesaurus_available(thesaurus, keyword) :staticmethod: .. py:method:: _set_free_keyword(keywords) .. py:method:: _set_tkeyword(tkeyword) .. py:function:: update_resource(instance: geonode.base.models.ResourceBase, xml_file: str = None, regions: list = [], keywords: list = [], vals: dict = {}, extra_metadata: list = []) .. py:function:: call_storers(instance, custom={}) .. py:function:: get_alternate_name(instance) .. py:function:: document_post_save(instance, *args, **kwargs) .. py:function:: dataset_post_save(instance, *args, **kwargs) .. py:function:: metadata_post_save(instance, *args, **kwargs) .. py:function:: resourcebase_post_save(instance, *args, **kwargs) Used to fill any additional fields after the save. Has to be called by the children