# # Collective Knowledge # # See CK LICENSE.txt for licensing details. # See CK COPYRIGHT.txt for copyright details. # # Developer: Grigori Fursin # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temporal data) ck=None # Will be updated by CK (initialized CK kernel) # Local settings # ============================================================================ def init(i): return {'return':0} ############################################################################## # view entry as html def html_viewer(i): """ Input: { data_uoa url_base url_pull } Output: { return - return code = 0, if successful > 0, if error (error) - error text if return > 0 } """ h='' raw='no' top='no' duoa=i['data_uoa'] burl=i['url_base'] purl=i['url_pull'] if duoa!='': # Load entry rx=ck.access({'action':'load', 'module_uoa':work['self_module_uid'], 'data_uoa':duoa}) if rx['return']>0: return rx dd=rx['dict'] duid=rx['data_uid'] name=dd.get('name','') email=dd.get('email','') personal_web=dd.get('personal_web_page','') prof_web=dd.get('professional_web_page','') l_image=dd.get('large_image','') s_image=dd.get('small_image','') cjobs=dd.get('current_jobs',[]) h+='\n' h+=' \n' h+=' \n' h+=' \n' h+=' \n' h+='
\n' if l_image!='': h+=' ' h+=' \n' h+=' '+name+'
\n' h+='
\n' h+='
\n' if len(cjobs)>0: h+='\n' for q in cjobs: t=q.get('title','') o=q.get('organization','') ow=q.get('organization_web','') hx='' if t!='': hx+=t if o!='': if hx!='':hx+=', ' if ow=='': hx+=o else: hx+=''+o+'' h+='
\n' h+='    '+hx+'
\n' h+='
\n' h+='
\n' h+='
\n' h+=' \n' if email!='': h+=' \n' if prof_web!='': h+=' \n' if personal_web!='': h+=' \n' h+='
EMail:\n' h+=' '+email+'\n' h+='
Professional web:\n' h+=' '+prof_web+'\n' h+='
Personal web:\n' h+=' '+personal_web+'\n' h+='
\n' h+='
\n' ####################### List publications h+='
\n' urlx1=burl+'wcid=dissemination.keynote:&search='+duid h+=' Keynotes: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.publication:&search='+duid h+=' Publications: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.publication.artifact:&search='+duid h+=' Artifacts for publications: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.lecture:&search='+duid h+=' Lectures: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.event:&search='+duid h+=' Events: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.soft:&search='+duid h+=' Developed software: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.hardware:&search='+duid h+=' Developed hardware: [ search in CK ]
\n' urlx1=burl+'wcid=dissemination.repo:&search='+duid h+=' Shared repositories: [ search in CK ]
\n' return {'return':0, 'raw':raw, 'show_top':top, 'html':h} ############################################################################## # extended add def add(i): """ Input: { (template) - if !='', use this program as template! } Output: { return - return code = 0, if successful > 0, if error (error) - error text if return > 0 } """ o=i.get('out','') duoa=i.get('data_uoa','') d=i.get('dict',{}) d['name']=duoa i['dict']=d i['common_func']='yes' i['sort_keys']='yes' return ck.access(i)