CKANdocumentation,Release2.6.0a
def embiggen(value):
return value.upper()
Theembiggenvalidatorwillconvertvaluespassedtoall-uppercase.
validator(value, context)
Validatorsthatneedaccesstothedatabaseorinformationabouttheusermaybewrittenasacallabletakingtwo
parameters. context[’session’]isthesqlalchemysessionobjectandcontext[’user’]istheusername
ofthelogged-inuser:
from ckan.plugins.toolkit import Invalid
def fred_only(value, context):
if value and context['user'!= 'fred':
raise Invalid('only fred d may y set this value')
return value
Otherwisethisisthesameasthesingle-parameterformabove.
validator(key, flattened_data, errors, context)
Validatorsthatneedtoaccessorupdatemultiplefieldsmaybewrittenasacallabletakingfourparameters.
All fields anderrors in aflattenedform m are passedtothe validator. . The e validatormust fetchvalues from
flattened_dataandmayreplacevaluesinflattened_data.Thereturnvaluefromthisfunctionisignored.
keyistheflattenedkeyforthefieldtowhichthisvalidatorwasapplied.Forexample(’notes’,)forthedataset
notesfieldor(’resources’, 0, , ’url’)fortheurlofthefirstresourceofthedataset.Theseflattenedkeysare
thesameinboththeflattened_dataanderrorsdictspassed.
errorscontainslistsofvalidationerrorsforeachfield.
contextisthesamevaluepassedtothetwo-parameterformabove.
Notethatthisformcanbetrickytousebecausesomeofthevaluesinflattened_datawillhavehadvalidators
appliedbutotherfieldswon’t. Youmayaddthistypeofvalidatortothespecialschemafields’__before’or
’__after’tohavethemrunbeforeorafteralltheothervalidationtakesplacetoavoidtheproblemofworkingwith
partially-validateddata.
5.6.3 Tagvocabularies
Ifyouneedtoaddacustomfieldwheretheinputoptionsarerestrictedtoaprovidedlistofoptions,youcanusetag
vocabulariesTagVocabularies. Wewillneedtocreateourvocabularyfirst. Bycallingvocabulary_create().
Addafunctiontoyourplugin.pyaboveyourpluginclass.
def create_country_codes():
user tk.get_action('get_site_user')({'ignore_auth'True}, {})
context {'user': user['name']}
try:
data {'id''country_codes'}
tk.get_action('vocabulary_show')(context, data)
except tk.ObjectNotFound:
data {'name''country_codes'}
vocab tk.get_action('vocabulary_create')(context, data)
for tag in (u'uk'u'ie'u'de'u'fr'u'es'):
5.6. CustomizingdatasetandresourcemetadatafieldsusingIDatasetForm
185
Convert pdf file to powerpoint - C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
convert pdf into powerpoint; pdf picture to powerpoint
Convert pdf file to powerpoint - VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
convert pdf back to powerpoint; convert pdf pages to powerpoint slides
CKANdocumentation,Release2.6.0a
data {'name': tag, 'vocabulary_id': vocab['id']}
tk.get_action('tag_create')(context, data)
Thiscodeblockistakenfromtheexample_idatsetform plugin.create_country_codestriestofetch
thevocabularycountry_codesusingvocabulary_show().Ifitisnotfounditwillcreateitanditerateoverthelist
ofcountries‘uk’,‘ie’,‘de’,‘fr’,‘es’.Foreachoftheseavocabularytagiscreatedusingtag_create(),belonging
tothevocabularycountry_code.
Althoughwehaveonlydefinedfivetagshere,additionaltagscanbecreatedatanypointbyasysadminuserbycalling
tag_create()usingtheAPIoractionfunctions.Addasecondfunctionbelowcreate_country_codes
def country_codes():
create_country_codes()
try:
tag_list tk.get_action('tag_list')
country_codes tag_list(data_dict={'vocabulary_id''country_codes'})
return country_codes
except tk.ObjectNotFound:
return None
country_codeswillcallcreate_country_codessothatthecountry_codesvocabularyiscreatedifitdoes
notexist. Thenitcallstag_list()toreturnallofourvocabularytagstogether. Nowwehaveawayofretrieving
ourtagvocabulariesandcreatingthemiftheydonotexist.Wejustneedourplugintocallthiscode.
Addingtagstotheschema
Update_modify_package_schema()andshow_package_schema()
def _modify_package_schema(self, schema):
schema.update({
'custom_text': [tk.get_validator('ignore_missing'),
tk.get_converter('convert_to_extras')]
})
schema.update({
'country_code': [
tk.get_validator('ignore_missing'),
tk.get_converter('convert_to_tags')('country_codes')
]
})
return schema
def show_package_schema(self):
schema super(ExampleIDatasetFormPlugin, self).show_package_schema()
schema.update({
'custom_text': [tk.get_converter('convert_from_extras'),
tk.get_validator('ignore_missing')]
})
schema['tags']['__extras'].append(tk.get_converter('free_tags_only'))
schema.update({
'country_code': [
tk.get_converter('convert_from_tags')('country_codes'),
tk.get_validator('ignore_missing')]
})
return schema
Weareaddingourtagtoourplugin’sschema.Aconverterisrequiredtoconvertthefieldintoourtaginasimilarway
tohowweconvertedourfieldtoextrasearlier.Inshow_package_schema()weconvertfromthetagbackagain
186
Chapter5. Extendingguide
Online Convert PowerPoint to PDF file. Best free online export
Convert a PPTX/PPT File to PDF. Just upload your file by clicking on the blue button or drag-and-drop your pptx or ppt file into the drop area.
convert pdf to ppt online; change pdf to powerpoint
VB.NET PDF File Compress Library: Compress reduce PDF size in vb.
Convert smooth lines to curves. Detect and merge image fragments. Flatten visible layers. VB.NET Demo Code to Optimize An Exist PDF File in Visual C#.NET Project
convert pdf slides to powerpoint online; how to convert pdf file to powerpoint presentation
CKANdocumentation,Release2.6.0a
butwehaveanadditionallinewithanotherconvertercontainingfree_tags_only().Weincludethislinesothat
vocabtagsarenotshownmixedwithnormalfreetags.
Addingtagstotemplates
Addanadditionalplugin.implementslinetotoyourplugintoimplementtheITemplateHelpers,wewillneedto
addaget_helpers()functiondefinedforthisinterface.
p.implements(p.ITemplateHelpers)
def get_helpers(self):
return {'country_codes': country_codes}
Ourintentionhereistotieourcountry_codefetching/creationtowhentheyareusedinthetemplates. Addthecode
belowtopackage/snippets/package_metadata_fields.html
#}
{% block package_metadata_fields %}
<div class="control-group">
<label class="control-label" " for="field-country_code">{{ _("Country Code"}}</label>
<div class="controls">
<select id="field-country_code" " name="country_code" " data-module="autocomplete">
{% for country_code in h.country_codes()
%}
<option value="{{ country_code }}{% if country_code in data.get('country_code', []) %}selected="selected"{% endif %}>{{ country_code }}</option>
{% endfor %}
</select>
</div>
</div>
{{ super() }}
{% endblock %}
Thisaddsourcountrycodetoourtemplate,hereweareusingtheadditionalhelpercountry_codesthatwedefinedin
ourget_helpersfunctioninourplugin.
5.6.4 Addingcustomfieldstoresources
Inordertocustomizethefieldsinaresourcetheschemaforresourcesneedstobemodifiedinasimilarwaytothe
datasets. Theresourceschemaisnestedinthedatasetdictaspackage[’resources’]. Wemodifythisdictinasimilar
waytothedatasetschema.Change_modify_package_schematothefollowing.
def _modify_package_schema(self, schema):
# Add d our custom country_code e metadata a field to o the e schema.
schema.update({
'country_code': [tk.get_validator('ignore_missing'),
tk.get_converter('convert_to_tags')('country_codes')]
})
# Add d our custom_test metadata a field to o the schema, this one will l use
# convert_to_extras s instead of f convert_to_tags.
schema.update({
'custom_text': [tk.get_validator('ignore_missing'),
tk.get_converter('convert_to_extras')]
})
5.6. CustomizingdatasetandresourcemetadatafieldsusingIDatasetForm
187
VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
Microsoft Office Word, Excel and PowerPoint data to PDF form. Merge PDF with byte array, fields. Merge PDF without size limitation. Append one PDF file to the end
how to convert pdf to powerpoint in; pdf to powerpoint slide
C# PDF File Split Library: Split, seperate PDF into multiple files
Application. Best and professional adobe PDF file splitting SDK for Visual Studio .NET. outputOps); Divide PDF File into Two Using C#.
converter pdf to powerpoint; convert pdf into powerpoint online
CKANdocumentation,Release2.6.0a
# Add d our custom_resource_text t metadata a field to the e schema
schema['resources'].update({
'custom_resource_text' : [ tk.get_validator('ignore_missing') ]
})
return schema
Updateshow_package_schema()similarly
def show_package_schema(self):
schema super(ExampleIDatasetFormPlugin, self).show_package_schema()
# Don't show vocab tags mixed in n with normal 'free' tags
# (e.g. on n dataset t pages, , or on the e search page)
schema['tags']['__extras'].append(tk.get_converter('free_tags_only'))
# Add d our custom country_code e metadata a field to o the e schema.
schema.update({
'country_code': [
tk.get_converter('convert_from_tags')('country_codes'),
tk.get_validator('ignore_missing')]
})
# Add d our custom_text field to o the e dataset t schema.
schema.update({
'custom_text': [tk.get_converter('convert_from_extras'),
tk.get_validator('ignore_missing')]
})
schema['resources'].update({
'custom_resource_text' : [ tk.get_validator('ignore_missing') ]
})
return schema
# These methods just record d how w many times they're e called, , for r testing
# purposes.
# TODO: It t might be e better to test t that custom templates returned d by
# these methods are actually y used, not t just that the methods get
# called.
SaveandreloadyourdevelopmentserverCKANwilltakeanyadditionalkeysfromtheresourceschemaandsave
themtheitsextrasfield.Thetemplateswillautomaticallycheckthisfieldanddisplaythemintheresource_readpage.
5.6.5 Sortingbycustomfieldsonthedatasetsearchpage
Now
that we’ve
added
our custom
field,
we
can
customize
the
CKAN
web
front
end
search
page to
sort datasets s by
our custom
field.
Add
a
new
file called
ckanext-extrafields/ckanext/extrafields/templates/package/search.html
contain-
ing:
{% ckan_extends %}
{% block form %}
{% set facets = {
'fields'c.fields_grouped,
'search'c.search_facets,
'titles'c.facet_titles,
'translated_fields'c.translated_fields,
188
Chapter5. Extendingguide
C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
PDFPage page = (PDFPage)doc.GetPage(0); // Convert the first PDF page to a JPEG file. page.ConvertToImage(ImageType.JPEG, Program.RootPath + "\\Output.jpg");
how to convert pdf slides to powerpoint; convert pdf to powerpoint using
VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
PDF from PowerPoint; C#: Create PDF from Tiff; C#: Convert PDF to Word; C#: Convert PDF to Tiff; C#: Convert PDF to HTML; C#: Convert PDF to Jpeg; C# File: Compress
how to convert pdf to ppt; pdf to ppt converter online
CKANdocumentation,Release2.6.0a
'remove_field'c.remove_field }
%}
{% set sorting = [
(_('Relevance'), 'score desc, metadata_modified desc'),
(_('Name Ascending'), 'title_string asc'),
(_('Name Descending'), 'title_string desc'),
(_('Last Modified'), 'metadata_modified desc'),
(_('Custom Field Ascending'), 'custom_text asc'),
(_('Custom Field Descending'), 'custom_text desc'),
(_('Popular'), 'views_recent desc'if g.tracking_enabled else (falsefalse) ]
%}
{% snippet 'snippets/search_form.html'type='dataset'query=c.qsorting=sortingsorting_selected=c.sort_by_selectedcount=c.page.item_countfacets=facetsshow_empty=request.paramserror=c.query_error %}
{% endblock %}
Thisoverridesthesearchorderingdropdowncodeblock,thecodeisthesameasthedefaultdatasetsearchblockbut
weareaddingtwoadditionallinesthatdefinethedisplaynameofthatsearchordering(e.g.CustomFieldAscending)
andtheSOLRsortordering(e.g.custom_textasc). Ifyoureloadyourdevelopmentserveryoushouldbeabletosee
thesetwoadditionalsortingoptionsonthedatasetsearchpage.
The SOLR sort ordering g can n define arbitrary functions for r custom m sorting, , but t this s is beyond d the
scope of this tutorial l for r further r details see http://wiki.apache.org/solr/CommonQueryParameters#sort and
http://wiki.apache.org/solr/FunctionQuery
Youcanfindthecompletesourceforthistutorialathttps://github.com/ckan/ckan/tree/master/ckanext/example_idatasetform
5.7 Plugininterfacesreference
ckan.pluginscontainsafewcoreclassesandfunctionsforpluginstouse:
ckan.plugins
classckan.plugins.SingletonPlugin(**kwargs)
Baseclassforpluginswhicharesingletons(iemostofthem)
Onesingletoninstanceofthisclasswillbecreatedwhenthepluginisloaded. Subsequentcallstotheclass
constructorwillalwaysreturnthesamesingletoninstance.
classckan.plugins.Plugin(**kwargs)
Baseclassforpluginswhichrequiremultipleinstances.
UnlessyouneedmultipleinstancesofyourpluginobjectyoushouldprobablyuseSingletonPlugin.
ckan.plugins.implements(interface,namespace=None,inherit=False,service=True)
CanbeusedintheclassdefinitionofPluginsubclassestodeclaretheextensionpointsthatareimplementedby
thisinterfaceclass.
IftheinheritsoptionisTrue,thenthisPluginclassinheritsfromtheinterfaceclass.
ckan.plugins.interfaces
AcollectionofinterfacesthatCKANpluginscanimplementtocustomizeandextendCKAN.
classckan.plugins.interfaces.IMiddleware
HookintoPylonsmiddlewarestack
5.7. Plugininterfacesreference
189
VB.NET PDF Convert to HTML SDK: Convert PDF to html files in vb.
using RasterEdge.XDoc.PDF; This professional .NET solution that is designed to convert PDF file to HTML web page using VB.NET code efficiently.
convert pdf to powerpoint with; convert pdf to powerpoint online no email
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
Merge Microsoft Office Word, Excel and PowerPoint data to PDF form. Append one PDF file to the end of another and save to a single PDF file.
changing pdf to powerpoint; convert pdf to editable ppt online
CKANdocumentation,Release2.6.0a
make_middleware(app,config)
Returnanappconfiguredwiththismiddleware
make_error_log_middleware(app,config)
Returnanappconfiguredwiththiserrorlogmiddleware
classckan.plugins.interfaces.IRoutes
Pluginintothesetupoftheroutesmapcreation.
before_map(map)
Calledbeforetheroutesmapisgenerated.before_mapisbeforeanyothermappingsarecreatedsocan
overrideallothermappings.
Parameters map–Routesmapobject
Returns Modifiedversionofthemapobject
after_map(map)
Calledafterroutesmapissetup.after_mapcanbeusedtoaddfall-backhandlers.
Parameters map–Routesmapobject
Returns Modifiedversionofthemapobject
classckan.plugins.interfaces.IMapper
AsubsetoftheSQLAlchemymapperextensionhooks.Seehttp://docs.sqlalchemy.org/en/rel_0_9/orm/deprecated.html#sqlalchemy.orm.interfaces.MapperExtension
Example:
>>> class MyPlugin(SingletonPlugin):
...
...
implements(IMapper)
...
...
def after_update(self, mapper, , connection, instance):
...
log("Updated: %r", instance)
before_insert(mapper,connection,instance)
ReceiveanobjectinstancebeforethatinstanceisINSERTedintoitstable.
before_update(mapper,connection,instance)
ReceiveanobjectinstancebeforethatinstanceisUPDATEed.
before_delete(mapper,connection,instance)
ReceiveanobjectinstancebeforethatinstanceisPURGEd. (whereasusuallyinckan‘delete’meansto
changethestatepropertytodeleted,sousebefore_updateforthatcase.)
after_insert(mapper,connection,instance)
ReceiveanobjectinstanceafterthatinstanceisINSERTed.
after_update(mapper,connection,instance)
ReceiveanobjectinstanceafterthatinstanceisUPDATEed.
after_delete(mapper,connection,instance)
ReceiveanobjectinstanceafterthatinstanceisPURGEd. (whereasusuallyinckan‘delete’meansto
changethestatepropertytodeleted,sousebefore_updateforthatcase.)
classckan.plugins.interfaces.ISession
AsubsetoftheSQLAlchemysessionextensionhooks.
after_begin(session,transaction,connection)
Executeafteratransactionisbegunonaconnection
before_flush(session,flush_context,instances)
Executebeforeflushprocesshasstarted.
190
Chapter5. Extendingguide
CKANdocumentation,Release2.6.0a
after_flush(session,flush_context)
Executeafterflushhascompleted,butbeforecommithasbeencalled.
before_commit(session)
Executerightbeforecommitiscalled.
after_commit(session)
Executeafteracommithasoccured.
after_rollback(session)
Executeafterarollbackhasoccured.
classckan.plugins.interfaces.IDomainObjectModification
Receivesnotificationofnew,changedanddeleteddatasets.
notify(entity,operation)
Sendanotificationonentitymodification.
Parameters
• entity–instanceofmodule.Package.
• operation–‘new’,‘changed’or‘deleted’.
notify_after_commit(entity,operation)
Sendanotificationafterentitymodification.
Parameters
• entity–instanceofmodule.Package.
• operation–‘new’,‘changed’or‘deleted’.
classckan.plugins.interfaces.IResourceUrlChange
Receivesnotificationofchangedurls.
notify(resource)
Giveuseranotifyisresourceurlhaschanged.
:paramresource,instanceofmodel.Resource
classckan.plugins.interfaces.IResourceView
Addcustomviewrenderingsfordifferentresourcetypes.
info()
Returnsadictionarywithconfigurationoptionsfortheview.
Theavailablekeysare:
Parameters
• name–nameoftheviewtype. . Thisshouldmatchthenameoftheactualplugin(eg
image_vieworrecline_view).
• title–titleoftheviewtype,willbedisplayedonthefrontend.Thisshouldbetranslatable
(iewrappedontoolkit._(’Title’)).
• default_title–defaulttitlethatwillbeusediftheviewiscreatedautomatically(optional,
defaultsto‘View’).
• default_description–defaultdescriptionthatwillbeusediftheviewiscreatedautomat-
ically(optional,defaultsto‘’).
• icon–iconfortheviewtype.ShouldbeoneoftheFontAwesometypeswithouttheicon-
prefixeg.compass(optional,defaultsto‘picture’).
5.7. Plugininterfacesreference
191
CKANdocumentation,Release2.6.0a
• always_available–theviewtypeshouldbealwaysavailablewhencreatingnewviews
regardlessoftheformatoftheresource(optional,defaultstoFalse).
• iframed–theviewtemplateshouldbeiframedbeforerendering.Yougenerallywantthis
optiontobeTrueunlesstheviewstylesandJavaScriptdon’tclashwiththemainsitetheme
(optional,defaultstoTrue).
• preview_enabled–thepreviewbuttonshouldappearontheeditviewform. . Someview
typeshavetheirpreviewsintegratedwiththeform(optional,defaultstoFalse).
• full_page_edit–theeditformshouldtakethefullpagewidthofthepage(optional,de-
faultstoFalse).
• schema–schematovalidateextraconfigurationfieldsfortheview(optional). . Schemas
aredefinedasadictionary,withthekeysbeingthefieldnameandthevaluesalistof
validatorfunctionsthatwillgetappliedtothefield.Forinstance:
{
'offset': [ignore_empty, , natural_number_validator],
'limit': [ignore_empty, natural_number_validator],
}
Exampleconfigurationobject:
{'name''image_view',
'title': toolkit._('Image'),
'schema': {
'image_url': [ignore_empty, unicode]
},
'icon''picture',
'always_available'True,
'iframed'False,
}
Returns adictionarywiththeviewtypeconfiguration
Returntype dict
can_view(data_dict)
Returnswhethertheplugincanrenderaparticularresource.
Thedata_dictcontainsthefollowingkeys:
Parameters
• resource–dictoftheresourcefields
• package–dictofthefullparentdataset
Returns Trueiftheplugincanrenderaparticularresource,Falseotherwise
Returntype bool
setup_template_variables(context,data_dict)
Addsvariablestobepassedtothetemplatebeingrendered.
Thisshouldreturnanewdictinsteadofupdatingtheinputdata_dict.
Thedata_dictcontainsthefollowingkeys:
Parameters
• resource_view–dictoftheresourceviewbeingrendered
192
Chapter5. Extendingguide
CKANdocumentation,Release2.6.0a
• resource–dictoftheparentresourcefields
• package–dictofthefullparentdataset
Returns adictionarywiththeextravariablestopass
Returntype dict
view_template(context,data_dict)
Returnsastringrepresentingthelocationofthetemplatetoberenderedwhentheviewisdisplayed
The path
will be
relative to
the template
directory
you
registered
using
the
add_template_directory()
on
the
update_config
method,
for
instance
views/my_view.html.
Parameters
• resource_view–dictoftheresourceviewbeingrendered
• resource–dictoftheparentresourcefields
• package–dictofthefullparentdataset
Returns thelocationoftheviewtemplate.
Returntype string
form_template(context,data_dict)
Returnsastringrepresentingthelocationofthetemplatetoberenderedwhentheeditviewformisdis-
played
The path
will be
relative to
the template
directory
you
registered
using
the
add_template_directory()
on
the
update_config
method,
for
instance
views/my_view_form.html.
Parameters
• resource_view–dictoftheresourceviewbeingrendered
• resource–dictoftheparentresourcefields
• package–dictofthefullparentdataset
Returns thelocationoftheeditviewformtemplate.
Returntype string
classckan.plugins.interfaces.IResourcePreview
Warning: Thisinterfaceisdeprecated,andisonlykeptforbackwardscompatibilitywiththeoldresource
previewcode.PleaseuseIResourceViewforwritingcustomviewplugins.
can_preview(data_dict)
Returninfoonwhethertheplugincanpreviewtheresource.
Thiscanbedoneintwoways:
1.TheoldwayistojustreturnTrueorFalse.
2.Thenewwayistoreturnadictwiththreekeys:
•can_preview(boolean)Trueiftheextensioncanpreviewtheresource.
•fixable(string)Astringexplaininghowpreviewfortheresourcecouldbeenabled, for
exampleiftheresource_proxypluginwasenabled.
5.7. Plugininterfacesreference
193
CKANdocumentation,Release2.6.0a
•quality(int)Howgoodthepreviewis:1(poor),2(average)or3(good). Whenmultiple
previewextensionscanpreviewthesameresource,thisisusedtodeterminewhichextensionwill
beused.
Parameters data_dict(dictionary)–theresourcetobepreviewedandthedatasetthatitbelongs
to.
Makesuretochecktheon_same_domainvalueoftheresourceortheurlifyourpreviewrequiresthe
resourcetobeonthesamedomainbecauseofthesame-originpolicy.Tofindouthowtopreviewresources
thatareonadifferentdomain,readResourceProxy.
setup_template_variables(context,data_dict)
Addvariablestocjustpriortothetemplatebeingrendered.Thedata_dictcontainstheresourceand
thepackage.
Changetheurltoaproxieddomainifnecessary.
preview_template(context,data_dict)
Returns a a string g representing the e location n of the e template e to be rendered for the read page. . The
data_dictcontainstheresourceandthepackage.
classckan.plugins.interfaces.ITagController
HookintotheTagcontroller. Thesewillusuallybecalledjustbeforecommittingorreturningtherespective
object,i.e.allvalidation,synchronizationandauthorizationsetuparecomplete.
before_view(tag_dict)
Extensionswillrecievethisbeforethetaggetsdisplayed. Thedictionarypassedwillbetheonethatgets
senttothetemplate.
classckan.plugins.interfaces.IGroupController
HookintotheGroupcontroller.Thesewillusuallybecalledjustbeforecommittingorreturningtherespective
object,i.e.allvalidation,synchronizationandauthorizationsetuparecomplete.
before_view(pkg_dict)
Extensionswillrecievethisbeforethegroupgetsdisplayed. Thedictionarypassedwillbetheonethat
getssenttothetemplate.
classckan.plugins.interfaces.IOrganizationController
HookintotheOrganizationcontroller. Thesewillusuallybecalledjustbeforecommittingorreturningthe
respectiveobject,i.e.allvalidation,synchronizationandauthorizationsetuparecomplete.
before_view(pkg_dict)
Extensionswillrecievethisbeforetheorganizationgetsdisplayed.Thedictionarypassedwillbetheone
thatgetssenttothetemplate.
classckan.plugins.interfaces.IPackageController
Hookintothepackagecontroller.(seeIGroupController)
after_create(context,pkg_dict)
Extensionswillreceivethevalidateddatadictafterthepackagehasbeencreated(Notethatthecreate
methodwillreturnapackagedomainobject,whichmaynotincludeallfields). Alsothenewlycreated
packageidwillbeaddedtothedict.
after_update(context,pkg_dict)
Extensionswillreceivethevalidateddatadictafterthepackagehas beenupdated(Note thattheedit
methodwillreturnapackagedomainobject,whichmaynotincludeallfields).
after_delete(context,pkg_dict)
Extensionswillreceivethedatadict(tipicallycontainingjustthepackageid)afterthepackagehasbeen
deleted.
194
Chapter5. Extendingguide
Documents you may be interested
Documents you may be interested