Presentation for the talk I gave at Drupal Camp Baltics (2010 september 25th in Riga). The main focus is on the basic concepts behind drupal module development. A short overview of available APIs and examples of the most common hooks are given.
This presentation was delivered on 11th May, 2014 in Drupal Camp Pakistan held in DatumSquare IT Services Islamabad. Contents of the presentation contains some basics stuff for designers, themers and coders.
JavaOne - 10 Tips for Java EE 7 with PrimeFacesMert Çalışkan
This presentation takes you on a JSF tour with the help of Java EE 7, together with PrimeFaces and the NetBeans IDE. The tour begins with an introduction of PrimeFaces and its features, such as UI components and themes. Focusing on Java EE 7, it examines HTML5-friendly templates, resource libraries contracts, Faces Flow, EL operators, and lambda magic. Throughout, you will be shown how to apply the principles and concepts learned, via working examples in the NetBeans IDE. The presentation is brought to you “from the horse's mouth”—that is, by PrimeFaces and NetBeans IDE engineers.
This presentation was delivered on 11th May, 2014 in Drupal Camp Pakistan held in DatumSquare IT Services Islamabad. Contents of the presentation contains some basics stuff for designers, themers and coders.
JavaOne - 10 Tips for Java EE 7 with PrimeFacesMert Çalışkan
This presentation takes you on a JSF tour with the help of Java EE 7, together with PrimeFaces and the NetBeans IDE. The tour begins with an introduction of PrimeFaces and its features, such as UI components and themes. Focusing on Java EE 7, it examines HTML5-friendly templates, resource libraries contracts, Faces Flow, EL operators, and lambda magic. Throughout, you will be shown how to apply the principles and concepts learned, via working examples in the NetBeans IDE. The presentation is brought to you “from the horse's mouth”—that is, by PrimeFaces and NetBeans IDE engineers.
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...JAX London
2011-10-31 | 02:15 PM - 03:00 PM
There are many tools out there to help developers working with the Spring framework and its manifold extensions. But it's not always easy to choose the right tool for the job. This talk guides you through the tooling landscape for Spring and illustrates when to use Spring Roo, WaveMaker or the SpringSource Tool Suite. Demos and examples give the audience first-hand insights and useful hints how to use and combine those tools effectively.
Using Zend_Tool to Establish Your Project's SkeletonJeremy Brown
User Group presentation titled "Using Zend_Tool to Establish Your Project's Skeleton"
Event information can be found at: http://www.meetup.com/DFW-Apache-LAMP/calendar/11819226/
This is what I created in 2006 - 2007. Inspired by Ruby on Rails, I wanted to have something similar for Java, J2EE that would accelerate building web apps. I have built few projects on top it and those worked pretty well.
We don't this. Java also has many solid options now like Play, Spring and more.
In September 2017 the long-awaited release of Java 9 gave us a new module system in Java. It also kick-started the release-train of frequent Java releases, with Java 11 being the first long-term supported Java version poised to take modules into the mainstream. So what has happened since the introduction of the module system?
This talk will provide an overview adoption of modules in open-source libraries, IDEs, build tools, and so on. It will also feature tools that have emerged to make working with modules easier. Expect an honest overview of the current state of modules in Java, with lots of demos to show what's possible. After this talk you can start developing your own modular Java application without hesitation!
The Modern Java Web Developer - Denver JUG 2013Matt Raible
HTML5, CSS3, JavaScript, jQuery, Angular JS, Bootstrap, Mobile, CoffeeScript, GitHub, functional programming, Page Speed, Apache, JSON with Jackson, caching, REST, Security, load testing, profiling, Wro4j, Heroku, Cloudbees, AWS. These are just some of the buzzwords that a Java web developer hears on a daily basis. This talk is designed to expose you to a plethora of technologies that you might've heard about, but haven't learned yet. We'll concentrate on the most important web developer skills, as well as UI tips and tricks to make you a better front-end engineer. Some of the most valuable engineers these days have front-end JS/CSS skills, as well as backend Java skills.
This article is about aspect oriented programming (aop) in spring. the related example of an application with aop support is in the following address :
https://github.com/ghorbanihamid/SpringBoot_AOP_JPA_Example
Zen and the Art of Claroline Module DevelopmentClaroline
Or: How I Learned to Stop
Worrying and Love
Creating Claroline
Modules
by Frédéric Minne
Institut de pédagogie universitaire et des
multimédias
UCL - Belgique
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...Edureka!
This Edureka Java Interview Questions and Answers tutorial will help you to prepare yourself for Java Interviews ( Java Interview Questions Blog: https://goo.gl/GY3yTR ). Learn about the most important Java interview questions and answers and know what will set you apart in the interview process.
This tutorial covers Java Interview Questions on:
1) Basic Java Questions
2) OOPS Questions
3) Servlets
4) JDBC
5) Spring
6) Hibernate
Last updated on Dec 12, 2014
The Sightly template language, shipped with Adobe Experience Manager 6.0, simplifies a lot the component development workflow by allowing front-end developers to edit components themselves directly.
Learn about the main features of that template language, and about the tools available to make project development work more efficient.
So, you need a Content Management System on the .NET framework. While your business might spend wheelbarrows of money on a platform that is powerful and extensible, your personal site would abandon extensibility for a free, open-source solution. But what if we had an option that was free and powerful and extensible? We do: Orchard CMS. Since we already know that Orchard is free, in this session we will discuss the power of Orchard’s CMS engine. You will learn how to build new modules for the Orchard platform, allowing you to extend functionality as you see fit to meet the needs of your site, your business, and customers.
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...Jorge Hidalgo
Slides from JavaOne 2014 conference session CON2013
The Java compiler and annotation processors are powerful tools within the Java platform, and both, combined, unleash great power in developers’ hands, as this session illustrates. Triggered during the Java compilation process, APs can be used to generate new sources and configuration from metadata present in the class source. Why expend time creating a BeanInfo class or dealing with boring XML configuration files when you can have them easily created at compilation time? Moreover, APs are compatible with IDEs and build tools, and hence they are virtually everywhere your Java code is. Unleash the power of annotation processors, and let them do the hard work for you
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...JAX London
2011-10-31 | 02:15 PM - 03:00 PM
There are many tools out there to help developers working with the Spring framework and its manifold extensions. But it's not always easy to choose the right tool for the job. This talk guides you through the tooling landscape for Spring and illustrates when to use Spring Roo, WaveMaker or the SpringSource Tool Suite. Demos and examples give the audience first-hand insights and useful hints how to use and combine those tools effectively.
Using Zend_Tool to Establish Your Project's SkeletonJeremy Brown
User Group presentation titled "Using Zend_Tool to Establish Your Project's Skeleton"
Event information can be found at: http://www.meetup.com/DFW-Apache-LAMP/calendar/11819226/
This is what I created in 2006 - 2007. Inspired by Ruby on Rails, I wanted to have something similar for Java, J2EE that would accelerate building web apps. I have built few projects on top it and those worked pretty well.
We don't this. Java also has many solid options now like Play, Spring and more.
In September 2017 the long-awaited release of Java 9 gave us a new module system in Java. It also kick-started the release-train of frequent Java releases, with Java 11 being the first long-term supported Java version poised to take modules into the mainstream. So what has happened since the introduction of the module system?
This talk will provide an overview adoption of modules in open-source libraries, IDEs, build tools, and so on. It will also feature tools that have emerged to make working with modules easier. Expect an honest overview of the current state of modules in Java, with lots of demos to show what's possible. After this talk you can start developing your own modular Java application without hesitation!
The Modern Java Web Developer - Denver JUG 2013Matt Raible
HTML5, CSS3, JavaScript, jQuery, Angular JS, Bootstrap, Mobile, CoffeeScript, GitHub, functional programming, Page Speed, Apache, JSON with Jackson, caching, REST, Security, load testing, profiling, Wro4j, Heroku, Cloudbees, AWS. These are just some of the buzzwords that a Java web developer hears on a daily basis. This talk is designed to expose you to a plethora of technologies that you might've heard about, but haven't learned yet. We'll concentrate on the most important web developer skills, as well as UI tips and tricks to make you a better front-end engineer. Some of the most valuable engineers these days have front-end JS/CSS skills, as well as backend Java skills.
This article is about aspect oriented programming (aop) in spring. the related example of an application with aop support is in the following address :
https://github.com/ghorbanihamid/SpringBoot_AOP_JPA_Example
Zen and the Art of Claroline Module DevelopmentClaroline
Or: How I Learned to Stop
Worrying and Love
Creating Claroline
Modules
by Frédéric Minne
Institut de pédagogie universitaire et des
multimédias
UCL - Belgique
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...Edureka!
This Edureka Java Interview Questions and Answers tutorial will help you to prepare yourself for Java Interviews ( Java Interview Questions Blog: https://goo.gl/GY3yTR ). Learn about the most important Java interview questions and answers and know what will set you apart in the interview process.
This tutorial covers Java Interview Questions on:
1) Basic Java Questions
2) OOPS Questions
3) Servlets
4) JDBC
5) Spring
6) Hibernate
Last updated on Dec 12, 2014
The Sightly template language, shipped with Adobe Experience Manager 6.0, simplifies a lot the component development workflow by allowing front-end developers to edit components themselves directly.
Learn about the main features of that template language, and about the tools available to make project development work more efficient.
So, you need a Content Management System on the .NET framework. While your business might spend wheelbarrows of money on a platform that is powerful and extensible, your personal site would abandon extensibility for a free, open-source solution. But what if we had an option that was free and powerful and extensible? We do: Orchard CMS. Since we already know that Orchard is free, in this session we will discuss the power of Orchard’s CMS engine. You will learn how to build new modules for the Orchard platform, allowing you to extend functionality as you see fit to meet the needs of your site, your business, and customers.
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...Jorge Hidalgo
Slides from JavaOne 2014 conference session CON2013
The Java compiler and annotation processors are powerful tools within the Java platform, and both, combined, unleash great power in developers’ hands, as this session illustrates. Triggered during the Java compilation process, APs can be used to generate new sources and configuration from metadata present in the class source. Why expend time creating a BeanInfo class or dealing with boring XML configuration files when you can have them easily created at compilation time? Moreover, APs are compatible with IDEs and build tools, and hence they are virtually everywhere your Java code is. Unleash the power of annotation processors, and let them do the hard work for you
Useful little tool to give to all hands on a programme to see whether everyone is aligned and if the programme is healthy or not - the closer to zero the scores, the better
This session will cover how to write effective API modules utilizing the hook system found in Drupal in a way that makes your module extensible and pluggable.
We’ll look at some of the Drupal modules that do this effectively(Views, Fields/CCK, etc.) and also look at a recent example, The Piecemaker API module, where I implemented this strategy.
Drupal is a flexible, open-source content management system, powering thousands of websites like those of The Onion, Bob Dylan and Amnesty International. In this introduction, you’ll learn the basic structure of a Drupal web site and find out how Drupal compares with other content management systems. We’ll also cover some common Drupal modules of specific interest for SEO, advertising and social media.
Wayne Eaker is a software developer and online strategy consultant, based in Ann Arbor, Michigan. Wayne is a key contributor to LA2M, and is LA2M’s website programmer.
Review of DrupalCon LA 2015, held in Los Angeles on May 11-15th. Includes summits, sessions, and exhibits. Includes pictures of events and some technical information.
This session will give you a roadmap describing how to learn more about Drupal. Learn what to look for at conferences, the different types of Drupal users and a vocabulary of Drupal terms . Learn how to keep moving up on the Drupal Learning Curve. Presented at SANDCamp 2010.
A detailed overview of the laravel framework, created by Awulonu Obinna and presented at: Laravel Abuja.
Author details:
Twitter – https://www.twitter.com/awulonu_obinna
Facebook – https://www.facebook.com/awulonuobinna
GitHub – https://www.github.com/obinosteve
Drupal Camp Porto - Developing with Drupal: First StepsLuís Carneiro
The goal of this presentation is to give Drupal new comers some insights about key aspects of developing with Drupal.
The idea is to give the audience some guidelines about good practices of Drupal development along with some tips and, by a simple example application, present the most common and important structures/characteristics of the Drupal API.
Walks through the top 8 improvements coming to Drupal 8, including videos and code samples to demonstrate "before vs. after."
Given to the @DrupalNS meet up in Bedford, Nova Scotia on July 28, 2014.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
3. Overview Drupal’s components Modules APIs
What is drupal?
CMS
Node system
Taxonomy
CCK & Views
4. Overview Drupal’s components Modules APIs
What is drupal?
CMS FRAMEWORK
Node system Module Architecture
Taxonomy Theming
CCK & Views APIs
5. Overview Drupal’s components Modules APIs
Drupal development workflow
Where did my time go?
6. Overview Drupal’s components Modules APIs
Should You develop a custom module?
7. Overview Drupal’s components Modules APIs
Considerations
Not-invented-here?
Maintenance - you will need to maintain and update even if
you do not release it.
8. Overview Drupal’s components Modules APIs
Considerations
Not-invented-here?
Maintenance - you will need to maintain and update even if
you do not release it.
Investment - making custom one-off modules is not overly
cost-effective. Will you need it again? In the foreseeable
future?
9. Overview Drupal’s components Modules APIs
Considerations
Not-invented-here?
Maintenance - you will need to maintain and update even if
you do not release it.
Investment - making custom one-off modules is not overly
cost-effective. Will you need it again? In the foreseeable
future?
Lonely path - it takes time to flush out all the bugs. Only in
this case you will almost always be the only one finding them.
10. Overview Drupal’s components Modules APIs
Alternatives
To custom modules
Contrib - over 4500 modules, are you sure your problem
hasn’t been tackled?
11. Overview Drupal’s components Modules APIs
Alternatives
To custom modules
Contrib - over 4500 modules, are you sure your problem
hasn’t been tackled?
Extending similar modules - base your work on a tested
codebase.
12. Overview Drupal’s components Modules APIs
Alternatives
To custom modules
Contrib - over 4500 modules, are you sure your problem
hasn’t been tackled?
Extending similar modules - base your work on a tested
codebase.
One-off solutions - if it’s a rare problem, sometimes hacks
are not the worst idea.
13. Overview Drupal’s components Modules APIs
Enough talk
Let’s get to the programming
Things you need to know:
Drupal’s architecture
Drupal module structure
Drupal core subsystems and APIs
Coding conventions
14. Overview Drupal’s components Modules APIs
Enough talk
Let’s get to the programming
Things you need to know:
Drupal’s architecture
Drupal module structure
Drupal core subsystems and APIs
Coding conventions
Things you REALLY need to know:
PHP
MySQL
HTML, CSS
javascript (probably)
26. Overview Drupal’s components Modules APIs
How does this work?
27. Overview Drupal’s components Modules APIs
Hooking things together
Delayed publishing
Problem
We need to publish nodes of unverified users not immediately, but
after a certain wait period.
28. Overview Drupal’s components Modules APIs
Hooking things together
Delayed publishing
Problem
We need to publish nodes of unverified users not immediately, but
after a certain wait period.
Hooks used
hook_perms
To define a permission ’Publish nodes immediately’.
hook_nodeapi
To forcefully unpublish new nodes.
hook_cron
To publish nodes whose wait period has already passed.
29. Overview Drupal’s components Modules APIs
Hooking things together
Term-node synchronization
Task
Create a node for every term in the dictionary and vice-versa,
constantly synchronizing the contents of a node’s body and the
term’s description.
30. Overview Drupal’s components Modules APIs
Hooking things together
Term-node synchronization
Task
Create a node for every term in the dictionary and vice-versa,
constantly synchronizing the contents of a node’s body and the
term’s description.
Hooks used
hook_form_alter
To add options to taxonomy vocabulary edit form.
hook_taxonomy
To react to term creation, updates and deletes.
hook_node_info
To define a custom node type.
hook_insert, hook_update, hook_delete
To react to node creation, updates and deletes.
31. Overview Drupal’s components Modules APIs
So where do we put this?
32. Overview Drupal’s components Modules APIs
The structure of a drupal module
module_name/
* module_name.info - module description
module_name.install - installation/uninstallation
* module_name.module - module code
33. Overview Drupal’s components Modules APIs
The .info file
name = Devel
description = Various blocks, pages..
package = Development
dependencies[] = menu
core = 6.x
34. Overview Drupal’s components Modules APIs
The .module file
A simple php file
Hooks and internal functions
36. Overview Drupal’s components Modules APIs
3 most common APIs/hooks
37. Overview Drupal’s components Modules APIs
Menu API
Tasks
routing
menus
breadcrumbs
38. Overview Drupal’s components Modules APIs
Menu API
An example
function devel_menu() {
$items = array();
$items[’devel/queries’] = array(
’title’ => ’Database queries’,
’page callback’ => ’devel_queries’,
’access callback’ => ’devel_menu_access_store_queries’,
’access arguments’ => array(),
’menu_name’ => ’devel’,
);
...
return $items;
}
39. Overview Drupal’s components Modules APIs
Menu API
40. Overview Drupal’s components Modules APIs
Form API
Tasks
Form creation and rendering
Form altering
Processing
Form validation and security
41. Overview Drupal’s components Modules APIs
Form API
What’s in a form?
Forms are defined as nested arrays
$form = array();
$form[’mail’] = array(
’#type’ => ’textfield’,
’#title’ => t(’Email’),
’#size’ => 20,
’#maxlength’ => 128,
’#required’ => TRUE,
);
return drupal_get_form($form);
42. Overview Drupal’s components Modules APIs
Form API
Altering forms
Any Form API form can be altered by other modules
Fields can be added, removed or changed
Additional validation and submit processing can be added
43. Overview Drupal’s components Modules APIs
Form API
hook_form_alter
function hook_form_alter(&$form, $form_state, $form_id)
$form
The form array - passed by reference, can be altered
$form_state
The form’s state (if the form has already been rendered)
$form_id
The id of the form being processed
44. Overview Drupal’s components Modules APIs
Form API
An example
function path_form_alter(&$form, $form_state, $form_id) {
if (isset($form[’type’]) && isset($form[’#node’])
&& $form[’type’][’#value’] .’_node_form’ == $form_id) {
$path = isset($form[’#node’]->path) ? $form[’#node’]->path : NULL;
$form[’path’] = array(
’#type’ => ’fieldset’,
’#title’ => t(’URL path settings’),
’#collapsible’ => TRUE,
’#collapsed’ => empty($path),
’#access’ => user_access(’create url aliases’),
’#weight’ => 30,
);
...
45. Overview Drupal’s components Modules APIs
hook_node_api
Tasks
React to all operations on nodes
Additional processing or validation of node fields
Add additional content to nodes on load
46. Overview Drupal’s components Modules APIs
function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
$node
The node object
$op
The operation being performed
$a3, $a4
Additional parameters, dependant on operation
47. Overview Drupal’s components Modules APIs
Node API
Operations
load
insert
update
delete
validate
presave
etc.
48. Overview Drupal’s components Modules APIs
Node API
An example
function nodeasblock_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case ’load’:
$node->nodeasblock = db_result(
db_query(’SELECT nid FROM {nodeasblock}
WHERE nid = %d’, $node->nid));
break;
case ’insert’:
...
49. Overview Drupal’s components Modules APIs
Tips and tools
50. Overview Drupal’s components Modules APIs
Tools
devel module
cache operations, dummy content generation, debugging aids
coder module
coding standards validation, basic module security tips
drupal api module
have a local instance of api.drupal.org
simpletest module
automated unit testing of your module (highly encouraged)
version control
cvs, svn, git, mercurial - anything is better than nothing
51. Overview Drupal’s components Modules APIs
Tips
Coding practices
Coding standards
keep your code clean and documented - if you ever decide to
release it
Caching
because performance matters
Splitting large module files
parts can be loaded on demand - less load on the system
Looking for help
#drupal
go to the irc.freenode.net irc channel for help
api.drupal.org
complete reference of drupal core APIs
52. Overview Drupal’s components Modules APIs
.. and never
53. Overview Drupal’s components Modules APIs
.. and never
ever
54. Overview Drupal’s components Modules APIs
.. and never
ever
hack
55. Overview Drupal’s components Modules APIs
.. and never
ever
hack
core