Development News

OpenSense Labs: How can Augmented Reality and Drupal Come Together

Main Drupal Feed - Fri, 06/22/2018 - 13:46
How can Augmented Reality and Drupal Come Together Shankar Fri, 06/22/2018 - 19:16

Reading a fantasy book, envisaging yourself living in an imaginary world, and identifying yourself with your favourite character - such is the feeling of reading a book full of imaginations which stays with you for a long long time. We all try to visualize something far from the reality and technological advancement has made it possible to not only imagine things but to actually see them right in front of our eyes. Augmented reality is the futuristic tech marvel that can be integrated with Drupal to build a tech genius.

Source: iStock

So, what is Augmented Reality (AR)? Gartner defines AR as the real-time use of information in the form of text, graphics, audio and other virtual enhancements integrated with real-world objects. It is this “real world” element that differentiates AR from virtual reality. AR integrates and adds value to the user’s interaction with the real world, versus a simulation.

The evolution of AR is staggering and interesting at the same time.

How did Augmented Reality come into being?

Today informational overlays layered on top of the physical world is the talk of the town. Back in the 1960s, 1965 to be precise, Ivan Sutherland talked about immersive displays in an essay and created the first-ever head mounted display in 1968.

The user of one of today’s visual displays can easily make solid objects transparent - he can “see through matter!”
- Ivan Sutherland  Timeline of Augmented Reality 

Krueger demonstrated collaborative interactive overlays of graphical annotations in 1978. Fast forward to 1990s, we would witness plenty of research works and prototypes. In 1992, terminology called Augmented Reality was for the first time seen in a research at Boeing. Subsequent discoveries like KARMA in ‘93, first medical AR application in ‘94, Studierstube in ‘96, The Touring Machine in ‘97, and ARToolKit in ‘99 paved the way for many complex innovations post the millennium.

The launch of Pokémon Go had almost 45 million users at its peak in 2016. More recently, in 2018, Google displayed AR street view mode to help you in the real time in addition to personalized recommendations to discover new places around you.

A smartphone showing Google Map's augmented reality feature

Today, AR developers have a lot of options to choose from when it comes to software platforms dedicated to AR. But these inventions had a lot to offer in terms of guidance and model.

Types of Augmented Reality

AR did come a long way to go for commercial use. There are different classifications within AR.

  • Marker-based AR: It is also known as image recognition AR is the easiest to implement. It used a trigger object to display content. Google Goggles, Popcode, and ScanLife are some of the examples.
     
  • Markerless AR: It is more versatile than the market-based AR. In place of trigger object, it uses cameras, GPS and accelerometer information to track the user location and offer them relevant content. Examples of markerless AR include ARIS and Layar.
     
  • Projection-based AR: It projects digital images directly onto a surface within the user’s surrounding. Disney theme park has employed projector camera toolbox that builds 3D objects to enhance theme park experience.
     
  • Outlining AR: It uses image recognition to outline shapes and boundaries. It can be used to help drivers see the edges of the highway in dim light for safe driving.
     
  • Superimposition-based AR:  It uses object recognition to replace an object within the user’s surrounding either partially or fully with a digital image. For instance, a surgeon can use such technology for adding digital x-rays over a part of a patient’s body during a surgery.
Applications of Augmented Reality

Whether it’s transportation or sports, AR has a lot to offer for different industries. Let’s see all of them.

Retail industry can reap the benefits of AR to a great effect. IKEA has an AR application called IKEA Place which allows customers to preview thousands of virtual furniture in the actual room within their home.

Source: Entrepreneur

Transportation sector can also explore AR to simplify their work. Aero Glass have created AR headsets that can display airports, navigation points, terrain features etc. for the pilots.

AR can be a big boon for the sports industry. Stubhub developed a feature on their mobile application that would allow ticket buyers of the Super Bowl to see a virtual 3D model of the stadium and the surrounding area.

It has immense potential in the education sector as well. An application like AR Flashcards Animal Alphabet can help children in learning alphabets easily by bringing flashcards to life.

Healthcare industry promises to be one of the most important areas for AR to be explored with a vast potential. AccuVein uses AR technology to help nurses find veins more easily while inserting IVs.

Source: Hackernoon

Marketing sector can’t be far behind. In 2014, by installing outward facing cameras in a London bus shelter and projected UFOs, robots, balloons, and tigers, Pepsi took the promotional campaign to a whole new level.

Working Principle of Augmented Reality

AR is great on so many levels for a multitude of industries. How does augmented reality work?

Sensors can be found on the outside of the AR devices that gather data regarding user’s real-world interactions and process them.

Cameras, also located on the outside of the AR device, scan the surrounding area and uses this information to determine the appropriate output.

Projection based AR works through miniature projector which is found in an outward-facing AR device. They can turn any surface or object into an immersive environment. The data collected by the cameras is projected onto the surface through projection-based AR devices.

AR devices are like mini-supercomputers that require a great deal of computer processing power. They use many of the same components that the smartphones do which includes CPU, GPU, flash memory, RAM, Bluetooth/Wifi microchip, GPS microchip, etc.

AR devices can also use mirrors for reflection to help in viewing the way our eyes view the virtual image. While some AR devices may use an array of small curved mirrors, other AR devices can use a double-sided mirror with one surface that reflects incoming light to the camera which is side-mounted and the other surface would reflect this light to the user’s eye.

Drupal and Augmented Reality Use Cases

A Drupal agency built a chatbot prototype which assisted customers to select recipes based on the health constraints and their preferences. Interactive experience with the chatbot could make their life easier and forbade them from intensively researching for their grocery shopping. To improve it further, they tried to integrate AR in Drupal.

The demonstration shown in this video displayed a shopper interacting with the AR application. The mobile application of Freshland Market (a fictional grocery store), built on Drupal 8, guided the shopper through her shopping list.

It also assisted her to make better decisions while shopping through AR overlays. It superimposes relevant details like price, product ratings, and recommendations over the shopping items detected by the smartphone camera. The mobile application personalised the shopper’s experience by displaying the products that were best for her dietary restrictions and her preferences.

Source: Drupal.org

Drupal’s web services support and JSON API module helped in serving content to the mobile application. The Drupal 8 site of Freshland Market stored all the product related information including price, dietary constraints, and reviews and ratings. If Drupal content for one of the products is edited to show the item as being on sale, it automatically reflected in the content superimposed through the mobile application. In addition to this, the location of the product was also stored on the site to guide the shopper to the product’s location in the store.

The application was developed using AR library, Vuforia, which identifies pre-configured targets like images of product labels. For instance, in the demonstration, it identifies tomato sauce and cereal labels. Each of these targets was given a unique ID to query the Freshland Market’s Drupal 8 site thereby finding the content related to those targets.

Another use case is the Lift HoloDeck prototype which was built using commercially available technologies like Drupal(content store), Acquia Lift(a personalised engine), Vuforia(AR library) and Unity(3D game engine).

Lift HoloDeck team built a mobile application that superimposes product information and smart notifications over real-life objects that are detected on the smartphone’s screen. It could change the way customers interact with brands and improve the customer experience.

Let’s say a user informs about his purchases to a coffee shop through this mobile application. When he enters the shop, he would show his phone screen displaying “deal of the day”. The application superimposes dietary information, directions on how to order, and product information on top of the beverage. By going through the nutritional facts, he would order his preferred choice and would receive notification that his order was ready to be picked up. 

Future of Augmented Reality Source: Gartner

What is the future of augmented reality? Gartner Hype cycle discovery in 2017 suggests that it will take another 5 to 10 years for the mainstream adoption of AR.

Forecast AR & VR market size worldwide from 2016 to 2022 (in billion US dollars) Source: Statista

The graphical representation, mentioned above, clearly states that AR is going to be a force to reckon with in the coming years. The market share of AR is going to witness a dramatic transformation in the coming years.

 

Source: Hackernoon

By 2025, the biggest industries for AR, as shown in the graph above, will be the gaming and the healthcare industries followed by the engineering, real estate, and retail sectors.

Conclusion

The world is changing. And it is changing at an unimaginable pace. Technologies like augmented reality were once a part of our huge list of fantasies. Many of your fantasies can come true with this awesome piece of disrupting technology. With Drupal as a content store, designing an AR-driven web and mobile applications can be highly rewarding for your organization.

Ping us at hello@opensenselabs.com to get the best of Drupal and augmented reality for your future businesses.

blog banner blog image Augmented Reality Drupal Blog Type Articles Is it a good read ? On

Drupal Europe: E-Commerce track at Drupal Europe 2018

Main Drupal Feed - Fri, 06/22/2018 - 13:40

The e-commerce industry continues to grow rapidly year over year, bringing more merchants online and driving larger profits. With that growth comes the increased need for rich content, innovative product merchandising, and integration into an ever increasing number of third party sales, marketing, and fulfillment tools. Drupal has always excelled as a platform for building unique customer experiences, and it continues to come into its own as an adaptive sales platform via projects like Drupal Commerce.

Photo by Mike Petrucci on Unsplash

This track includes content that helps merchants understand how to start and grow their online businesses, demonstrates to developers how to build ambitious e-commerce sites, and incorporates solution providers who improve the whole process via integrations.

In the e-commerce track you will learn how to start to sell online, how to grow your existing business and reach a wider audience, and the best tools to use for developing your platform.

The track is focused on the following topics:

  • Drupal vs other e-commerce solutions: comparison, the cost of entry and scale
  • What competitive advantages does Drupal bring to online merchants?
  • What are the benefits of Drupal-native eCommerce solutions vs. integrating external systems?
  • Case studies for unique or ambitious implementations of Drupal for e-commerce
  • Latest trends in eCommerce (e.g. payment, fulfillment, security, taxes, etc.)
  • Latest trends in building eCommerce websites (e.g. headless, multichannel, AI, etc.)
About industry tracks

As you’ve probably read in one of our previous blog posts, industry verticals are a new concept being introduced at Drupal Europe and replace the summits, which typically took place on Monday. At Drupal Europe these industry verticals are integrated with the rest of the conference — same location, same ticket and provide more opportunities to learn and exchange within the industry verticals throughout three days.

Now is the perfect time to buy your ticket for Drupal Europe. Session submission is only open for a few more days so please submit your sessions and if encourage others who have great ideas.

Please help us to spread the word about this awesome conference. Our hashtag is #drupaleurope.

To recommend speakers or topics please get in touch at program@drupaleurope.org.

About the Drupal Europe Conference

Drupal is one of the leading open source technologies empowering digital solutions in the government space around the world.

Drupal Europe 2018 brings over 2,000 creators, innovators, and users of digital technologies from all over Europe and the rest of the world together for three days of intense and inspiring interaction.

Location & Dates

Drupal Europe will be held in Darmstadtium in Darmstadt, Germany — which has a direct connection to Frankfurt International Airport. Drupal Europe will take place 10–14 September 2018 with Drupal contribution opportunities every day. Keynotes, sessions, workshops and BoFs will be from Tuesday to Thursday.

Valuebound: Integrating Headless Drupal with AngularJS

Main Drupal Feed - Fri, 06/22/2018 - 06:02

This post is the last part of AngularJS series where we have discussed all of the essential concepts and knowledge you need to get started. The series covers a wide range of topic, including an Intro to AngularJS, Data binding methods, Modules & Controller, Filter,…

Freelock : This is Why You Need Another Backup

Main Drupal Feed - Thu, 06/21/2018 - 22:12
This is Why You Need Another Backup John Locke Thu, 06/21/2018 - 16:12

At 12:27pm, our alerts started firing. Multiple ones -- website down, server down, secondary monitoring -- one of our client's servers had completely disappeared off the Internet.

I confirmed that I could not reach the site, or the server, and then looked up our AWS credentials for that customer. They didn't work. Then I tried to call two different contacts at our client, leaving messages, and sent an email asking if they needed assistance restoring their AWS account.

The answer came back 20 minutes later, after our client checked their email account associated with AWS.

Backup Drupal Planet hacked site Security

Matt: Atavist & Automattic

Wordpress Planet - Thu, 06/21/2018 - 19:14

As reported by the Wall Street Journal, and an interview about on the WP.com blog, Automattic has acquired the Atavist platform, magazine, and team. Looking forward to working alongside the team: we’re keeping the magazine going and it’ll complement Longreads, and integrating the best of the platform’s CMS and publisher features into WordPress.com and Jetpack and after that’s done providing an upgrade path so all of its publishers can move to being WordPress-powered.

WPTavern: Matt Mullenweg Unveils Gutenberg Roadmap at WCEU, WordPress Agencies and Product Developers Sprint to Prepare

Wordpress Planet - Thu, 06/21/2018 - 16:37
photo credit: WordCamp Europe Photography Team

At his WCEU keynote address in Belgrade, Matt Mullenweg laid out a detailed roadmap for Gutenberg to land in WordPress 5.0 within the next few months, garnering mixed reactions from attendees. Gutenberg’s timeline is one of the most pressing questions for those who work in the WordPress ecosystem.

The Gutenberg team has sustained a rapid pace of development over the past year with 30 releases since development began. There are currently 14,000 sites actively using the plugin and Mullenweg plans to roll it out to WordPress.com users in the near future. He announced that the WordPress 5.0 release could be ready as soon as August. In the meantime, the Gutenberg team will continue to refine its current features according to the roadmap Mullenweg outlined in his keynote:

June 2018

  • Freeze new features into Gutenberg
  • Hosts, agencies and teachers invited to opt-in sites they have influence over
  • Opt-in for wp-admin users on WP.com
  • Mobile App support in the Aztec editor across iOs and Android

July 2018

  • 4.9.x release with a strong invitation to install either Gutenberg or Classic Editor plugin
  • Opt-out for wp-admin users on WP.com
  • Heavy triage and bug gardening, getting blockers to zero
  • Explore expanding Gutenberg beyond the post into site customization

August 2018 and beyond

  • All critical issues resolved
  • Integration with Calypso, offering opt-in users
  • 100k+ sites having makde 250k+ post using Gutenberg
  • Core merge, beginning the 5.0 release cycle
  • 5.0 beta releases and translations completed
  • Mobile version of Gutenberg by the end of the year

Mullenweg said he hopes to increase Gutenberg usage to 100,000 sites with 250,000 posts made over the next few months. WordPress.com will be instrumental in that goal with a call to action for opt-in that will appear on several hundred thousand sites. In July, WordPress.com will switch the Gutenberg editor to opt-out. Mullenweg said he hopes to gather data from how users respond, especially those who have third-party plugins active on their sites.

Switching between editing posts in the mobile apps currently breaks but Mullenweg anticipates this will be resolved by August, with full mobile versions of Gutenberg available by the end of the year.

Mullenweg opened his keynote by drawing attendees’ attention to a new “Public Code” link in the footer of WordPress.org. This campaign, organized by Free Software Foundation Europe, aims to require any publicly financed software developed for the public sector be made available under a Free and Open Source Software license.

Mullenweg also announced St. Louis, MO, as the next location for WordCamp US in 2019-2020. The local WordPress community in the city spans two states with members from both Missouri and Illinois who have hosted seven WordCamps since 2011.

Developers and Agencies Double Down on Gutenberg Preparation, “Playing for Keeps”

The process of getting products and client websites ready for Gutenberg is a leap for nearly every company and freelancer invested in the WordPress ecosystem. Mullenweg said he cannot guarantee a specific date for release but thinks that “5.0 is going be ready within a relatively short time frame.”

Although many WCEU attendees expressed skepticism about the accelerated timeline for Gutenberg’s inclusion in core, most recognize the importance of working towards making their clients and products compatible with the new editor.

Gutenberg technical lead Matias Ventura said it’s too early to tell whether the WordPress community will be ready by the time Gutenberg is included in core. “I think people have already been trying to get ready and we’re already seeing many major sites being launched using Gutenberg,” Ventura said. “From what we’ve seen with plugin authors building compatibility for Gutenberg, it seems there’s already enough momentum going on that it could be achievable.”

Brad Williams, CEO of WebDevStudios, said his company’s team of engineers has been actively preparing for Gutenberg since late last year and is “very excited about what it means for the future of WordPress publishing.” Williams assigned two Gutenberg Leads internally to head up everything related to the new editor and conducted internal training with staff. WebDevStudios also built and released its own Gutenberg add-on framework called WDS Blocks, a framework that includes new custom blocks that many WDS clients use.

“Having a potential release date, even if it’s only a target month, is incredibly helpful,” Williams said. “This gives us a goal to work towards with each of our clients to verify we are ready for the release. I expect the majority of our clients will not enable Gutenberg on release, but we still need to make sure we have an upgrade plan ready for WordPress 5.0. We are working closely with each of our clients so they understand what is coming, the benefits Gutenberg can provide them, and what a potential roll-out plan will look like. We are also making sure any new leads coming in the door are aware of Gutenberg and the impact it will have on their new WordPress project.”

Gary Jones, plugin developer and WordPress engineer at Gamajo, expressed apprehension about the timeline. He also plans to make use of the Classic Editor plugin to opt sites out of using Gutenberg.

“With 737 open issues, I think the August timeline may still be a little short,” Jones said. “That’s only for the ‘critical issues’ to be resolved but introducing such a massive change to the basics of managing content like this needs more than just the critical issues resolved; it needs all of the workflow to be very smooth as well.”

Jones said he doesn’t think the typical rhetoric of getting a ‘1.0’ release out the door applies in the case of Gutenberg. “There’s too much riding on it for it not to make a great first impression for the user base who haven’t been following its progress,” Jones said. “A plugin can have a much quicker release turnaround time for non-critical improvements and fixes than what WP core would have.”

Jones said he plans to wait until the merge proposal before tackling plugin compatibility and will wait until 5.0 is out to start improving the experience for his clients. He said this may require creating custom blocks or installing plugins that add custom blocks clients might need. “By then we’d also know how ACF, Pods. and other plugins we use, and the Genesis theme, are supporting Gutenberg editor (or not),” Jones said.

Jake Goldman, President and founder of 10up, said his company already has an internal mandate that all new public plugins and major plugin updates must have at least “beta” support for Gutenberg. 10up’s Distributor product is already Gutenberg-ready and the company has several Gutenberg-ready plugins and updates expected to ship in the next 1-2 months.

“Clients are trickier,” Goldman said. “We have two big client projects started in the last couple of months that are using Gutenberg, and some pretty complicated custom blocks and extensions. We have a couple of other customers who are curious or in the exploratory phase. Two big client projects have us a bit gun shy about adopting [Gutenberg] as the ‘standard’ on newer projects until it matures a bit more and begins to focus a bit more on the ‘enterprise use case / user stories’ – there are some real challenges with those user stories.”

Goldman also said he was encouraged to hear that Calypso will adopt Gutenberg in the next couple of months, because he hopes it will address some of the confusion and fragmentation issues.

He doesn’t anticipate Gutenberg actually landing in August, however. “I don’t see August, frankly, because I don’t think the core team has a clear vision for ‘how’ an upgrade with Gutenberg will work,” Goldman said. “That said, I suspect Matt is knowingly putting timeline pressure on the team – a bit of ‘if I say August, we can probably hit November’ type mentality.”

Mason James, founder of Valet, said he is confident his clients and products will be ready after testing Gutenberg on hundreds of sites. His team is watching a few products that have compatibility issues but he is hopeful these will be resolved soon.

“The timeline of August seems a bit optimistic,” James said. “I’d be surprised if that is met, but our clients will be in good shape if that happens. We’ve also been sending information to our clients via email, a whitepaper, to try to mitigate any surprises ahead of time.

“We decided last year that Gutenberg was a tremendous opportunity for us to reinforce our value proposition to our clients,” James said. “It’s an ongoing important initiative for us this year; We’re playing for keeps.”

Carrie Dils, a WordPress developer, consultant, and educator, has also jumped head first into getting her products compatible with Gutenberg ahead of the new timeline.

“I’m feverishly working to get an updated version of the Utility Pro theme (my primary product) out the door,” Dils said. “The Gutenberg updates are just one part of a larger overhaul (including a minimum requirement of PHP7 and WP 5.0+). I’ve also made the decision not to incorporate Classic Editor theme styles. All looking forward, no looking back.”

Acro Media: Memory Usage in PHP - Dealing with Arrays

Main Drupal Feed - Thu, 06/21/2018 - 14:45

Drupal is built on PHP so any developer working with Drupal needs some PHP knowledge. PHP memory management is something that can initially be a difficult concept to grasp.

In this Acro Media Tech Talk video, Rob Thornton covers PHP arrays and how they use memory. He goes over various examples, helping to shed some light on how to use arrays effectively. Along the way, Rob discusses passing arrays by value vs. by reference and shares some tips about each.

If you find this video helpful, you may also be interested in these related topics:

OpenSense Labs: How important is JSON API for a Headless website

Main Drupal Feed - Thu, 06/21/2018 - 14:19
How important is JSON API for a Headless website Raman Thu, 06/21/2018 - 19:49

There has been a rapid increase in the popularity of JavaScript frameworks since their introduction in early 2010. They provide powerful architectures to build fluid, responsive and user-friendly web applications. Moreover, there are more people than ever using their mobile devices to access the digital content, hence building native applications for your site makes sense. 

Drupal has realized the potential of this market and has added the support for building RESTful APIs into the core. But the RESTful Web services of Drupal core does not provide a very robust solution out-of-the-box. You need to enable all the resources, configure the endpoints, verbs, authentication mechanisms, and create views with REST export to build the desired solution.

RESTful Web services of Drupal core do not provide a very robust solution out-of-the-box

But even then, the APIs built this way, do not necessarily follow any widely accepted guidelines or specifications like JSON API. You can always write custom logic, but luckily there is a contributed module for that. Before understanding this how this module proves to be a robust solution to build decoupled applications, let us clear some basics.

What is an API?

In terms of web services, an API is an agreement or a contract of request and response between the server(provider) and the client(consumer) for the purpose of exchange of data. It is that element bridges the front end and the back end. It defines which resources are accessible, who can access them, and how to access them.

What is JSON?

JavaScript Object Notation (JSON) is the most common data format for exchange of data over web services. It has primarily replaced XML due to its lightweight nature. It is easier for humans to read and for machines to parse. It is supported by almost every modern programming language and framework.

JSON API specifications – What and Why you should consider implementing them?

The JSON API specifications are a set of standards and conventions that describe how the APIs should be served by the servers and consumed by the clients for exchanging data in JSON format. The key benefits of implementing these specifications include:

  • Consistency
    The front end developers expect a consistent structure and behavior from the APIs while consuming them to build the applications.
     
  • Widely accepted and supported
    The specifications are widely accepted and implementations of client libraries can be found for almost every programming language and framework.
     
  • Efficiency
    The specification is designed to keep the number of requests and size of the data to a minimum.
     
  • Productivity
    There are numerous ways of designing an API and as a developer, you will often find yourself in an argument on what are the best practices or conventions to build an API. By following these set of standards, you can eliminate this and focus on building the application. 

Now, that we understand the foundations, let us see how does the JSON API module help in building a headless website in Drupal.

JSON API specifications of what and why are important. Downloading and installing JSON API module

The module has a dependency on the Serialization module, so enable it first and then download and install JSON API using any of the below methods:

Using Drush $ drush en serialization -y $ drush dl jsonapi && drush en jsonapi -y Using Drupal Console   $ drupal module:install serialization $ drupal module:download jsonapi && drupal module:install jsonapi Using UI Enabling JSON API and Serialization modules
  • Navigate to Manage → Extend → Install new module and enter the .tar.gz or .zip URL of the module and click on Install.
  • Once the downloader finishes downloading, click on “Enable newly added modules”.
  • Select the Serialization and the JSON API module under the Web Services package and click on “Install”.
How does JSON API help?

The module provides an implementation of the above-discussed specifications for Drupal. Following are the set of features of the API provided by the module.
 

  1. Zero configuration required – Production-ready out-of-the-box

    As soon as you enable the module, it exposes all the resources with appropriate verbs, endpoints, and fields. It allows no configurations to be modified (more on that later). This ensures that API always follows the JSON API specifications and also makes the deployment quick and easy.

    All the bundles get their unique endpoints, in case an entity does not have a bundle, the entity type is repeated. For example, in case of articles, it will be /jsonapi/node/article but for users, it will be /jsonapi/user/user. We need to specify the UUID (Universally Unique Identifier) of the entity, else we will receive a “collection” of the entities.

    The standard Drupal permissions determine the accessibility of the resource. So, you may need to authenticate using Basic Auth or OAuth to perform certain operations.

    You can make the following standard requests to perform CRUD operations on the resources. Note that the configuration entities only support the read operation, i.e. only the GET request.
      Accept: application/vnd.api+json Authorization: Basic {base64 encoded username + password} Content-Type:application/vnd.api+json GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json GET /jsonapi/{entity-type}/{bundle-name}/{uuid}?_format=api_json  POST /jsonapi/{entity-type}/{bundle-name}?_format=api_json PATCH /jsonapi/{entity-type}/{bundle-name}/{uuid}?_format=api_json DELETE /jsonapi/{entity-type}/{bundle-name}/{uuid}?_format=api_json For example, the following request will return a JSON response of the collection of all the articles (paginated in the sets of 50 articles per page). GET /jsonapi/node/article?_format=api_json To get a specific article you need to specify its UUID. For example:  GET /jsonapi/node/article/6a1571e0-26c7-423f-8ff5-04b2e4deb6d3?_format=api_json Retrieving a collection of articles
  2. Include relationships

    A “relationships” object contains all the related information to the resource. This may be the author, entity references, image fields, revision details, etc. Usually, you would have to make additional requests to retrieve further information. But instead, we can add a request parameter “include” and specify the required fields of this related information to be retrieved.

    All the additional fields will be available in the “included” object. This ensures that we receive all the required data in one single request. You can even use nesting in the relationships, i.e. if the object further has relationships, it can be specified using the “.” operator. GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&include={relationships-object} For example, the article bundle has an image (entity reference) field, we can retrieve its path along with the article as follows. GET /jsonapi/node/article?_format=api_json&include=field_image This time, we will receive the JSON data with an “included” object along with the data. As you may notice, it further has UID in the relationships object, we can retrieve that by using include=field_image.uid.  "included": [         {             "type": "file--file",             "id": "e7f9cd27-3cd0-43d3-b205-b46e88d09109",             "attributes": {                 "fid": 12,                 "uuid": "e7f9cd27-3cd0-43d3-b205-b46e88d09109",                 "langcode": "en",                 "filename": "gen50F1.tmp.jpg",                 "uri": "public://2018-04/gen50F1.tmp.jpg",                 "filemime": "image/jpeg",                 "filesize": 5652,                 "status": true,                 "created": 1523243077,                 "changed": 1523243077,                 "url": "/drupal-8.4.4/sites/default/files/2018-04/gen50F1.tmp.jpg"             },             "relationships": {                 "uid": {                     "data": {                         "type": "user--user",                         "id": "434ec884-0f9b-4593-8bc4-ef58e542ac0e"                     },                     "links": {                         "self": "/drupal-8.4.4/jsonapi/file/file/e7f9cd27-3cd0-43d3-b205-b46e88d09109/relationships/uid",                         "related": "/drupal-8.4.4/jsonapi/file/file/e7f9cd27-3cd0-43d3-b205-b46e88d09109/uid"                     }                 }             },             "links": {                 "self": "/drupal-8.4.4/jsonapi/file/file/e7f9cd27-3cd0-43d3-b205-b46e88d09109"             }         }     ]
  3. Filtering

    Filters can be applied to the collections to retrieve only the required resources. They can be added using the “filter” request parameter. We need to specify the field on which the comparison has to be done, the value with which we need to compare and optionally specify the operator(default is ‘=’).

     GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&filter[label][condition][path]={field}&filter[label][condition][operator]={operator}&filter[label][condition][value]={value}

    Or

     GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&filter[field][operator]={operator}&filter[field][value]={value}

    For example, we can search an article with the title that contains some keywords.

     GET /jsonapi/node/article?_format=api_json&filter[title][operator]=CONTAINS&filter[title][value]=search-keyword

    We can even use nested and grouped filters for advanced use cases. Read the official documentation for complete reference.

  4. Paging

    Paging is a common technique used to divide a long listing of items into pages. It can be used to implement an infinite scroll, or simply a pager. This requires two parameters – limit and offset. Limit decides maximum number (default is 50) and offset(default is 0) can be used to skip first ‘n’ items or resources. The presence of “next” and “prev” links indicates our position in the pager.

    ​​​​​​​GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&page[offset]={offset}&page[limit]={limit}

    For example, we can build an infinite feed of articles. When the user scrolls to the bottom, we can use the following request asynchronously to fetch let’s say 10 more articles.

    ​​​​​​​GET /jsonapi/node/article?_format=api_json&page[offset]=10&page[limit]=10
  5. Sparse Fieldsets

    We can specify the fields of the resource which are required performing a GET request using the “fields” parameter. This is useful when we need only a limited information and save bandwidth.

    GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&fields[entity-type--bundle]={field(s)}

    For example, to display only the titles of all the articles we can use the following request.

    GET /jsonapi/node/article?_format=api_json&fields[node--article]=title    "data": [         {             "type": "node--article",             "id": "6a1571e0-26c7-423f-8ff5-04b2e4deb6d3",             "attributes": {                 "title": "Drupal 8 is awesome"             },             "links": {                 "self": "drupal-8.4.4/jsonapi/node/article/6a1571e0-26c7-423f-8ff5-04b2e4deb6d3"             }         },         {...} ]
  6. Sorting

    To sort a collection, we can add a “sort” parameter, specifying the field and the sort direction.

     GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&sort[label][path]={field}&sort[label][direction]={ASC/DESC}

    Or

     GET /jsonapi/{entity-type}/{bundle-name}?_format=api_json&sort=±{field}

    For example, to retrieve all the articles sorted by their created date and then by their titles, we can use this request:

     GET /jsonapi/node/article?_format=api_json&sort=created,title

    This is not an exhaustive list, please refer the official documentation for more usage details and examples. But, with the right mix of these features, we can easily implement all the required features in our headless website.

Customizing the API

The module does not provide any way to configure the resources and the API. We need to install an additional module, JSON API Extras, in order to customize the API. This module allows us to configure the endpoints, fields and enabling or disabling the resources.

  1. Navigate to Manage → Configuration → Web services → JSON API Overwrites. This lists all the available resources. All of them are enabled by default.Admin UI for managing the resources
  2. Click on the “Overwrite” button next to the resource you wish to customize.
     
  3. You can alter the resource type, path or the endpoint, disable specific fields, and give an alias to fields. You may disable the resources that are not required, rest of the configurations can be mostly left untouched.
     Configuration options for resources
  4. Click on “Save” when done to save the configuration.
To Conclude

The JSON API module provides production-ready API out of the box. It provides standard HTTP methods to perform basic CRUD operations on entities. It also provides some advanced features including paging, sorting, and filtering to retrieve all the required data in a single request.

However, it lacks few features like registering a user, logging in a user, checking login status, etc. But we can use Drupal core’s REST web service for this purpose and build a headless website or a native mobile application by using best of both worlds. 

At OpenSense Labs, we have worked on decoupled Drupal projects, drop a mail at hello@opensenselabs.com to connect with us. 

blog banner blog image Blog Type Tech Is it a good read ? On

Chromatic: Keeping Your Drupal Site Secure

Main Drupal Feed - Thu, 06/21/2018 - 14:00

Keeping your Drupal site secure requires diligence - here's what can happen if your site isn't up to date.

Drop Guard: A Weekend full of Hacking - and Securing

Main Drupal Feed - Thu, 06/21/2018 - 13:45
A Weekend full of Hacking - and Securing Our CEO Joe visited the Drupal HackCamp in Bucharest at the beginning of June and experienced a great Drupal event. The event was mainly organized by Softescu, a digital agency of Romania, and the main topics were security and security related issues. Drupal Drupal Planet Drupal 8 Drupal Community Drupal Camp

Agiledrop.com Blog: AGILEDROP: How to Integrate Maps to Drupal 8

Main Drupal Feed - Thu, 06/21/2018 - 10:27
Thanks to advancements in the tech industry, things that were once difficult have become incredibly easy now. One of these is finding addresses. As an online business, making sure your physical address is easily visible to your users can be crucial. What other way is there to show your visitors your address other than digital maps such as Google Maps, the largest and the most widely used online map software in the world. In this post, I’ll take a look at various ways of adding maps to your Drupal site and how they can be utilized for better convenience for your site visitors.   Integrating… READ MORE

mark.ie: Drupal's Settings Tray Module is Freakin' Awesome

Main Drupal Feed - Thu, 06/21/2018 - 08:55
Drupal's Settings Tray Module is Freakin' Awesome

Here's a very short video demo of editing a menu using Drupal's Settings Tray module. Things like this will be what drives Drupal adoption.

markconroy Thu, 06/21/2018 - 09:55

I'm a big fan of the quick edit module for Drupal. If it could work better with paragraphs module, it'd be a knockout feature. Aligned with that, I'm really impressed with the settings tray module and can see so many uses for it in the future - sidemenus, shopping cart slideouts, node editing, etc. Here's a very short video of using it to edit a menu, which should make many content editors' lives easier.

Amazee Labs: Remember to submit your DrupalEurope sessions!

Main Drupal Feed - Thu, 06/21/2018 - 08:54
Remember to submit your DrupalEurope sessions!

DrupalEurope will be taking place soon – different organization, different structure, same great community. There are a few things you need to know about this year’s edition of Europe’s largest Drupal conference, so let me tell you about them. But before I start, your case studies, as always, are more than welcome!

Fran Garcia-Linares Thu, 06/21/2018 - 10:54

DrupalCon Europe or DrupalEurope?

The first thing you might have noticed is that the event is called DrupalEurope and not DrupalCon Europe as in previous events. In order to find a sustainable approach to the conference in Europe, DrupalCon decided to take a year off in 2018 in order to come back stronger than ever, so the community decided to weigh in and organize this year’s event - DrupalEurope. This is the best possible example of one of the Drupal community mottos, “Come for the code, stay for the community”.

Main changes

Did I just mention that the event is fully organised by the community? Ah, yes, so here are some other changes:

Additional time for contribution - this will be a constant topic throughout the event. There will be mentors and self-organised contribution teams, so make sure you come prepared if you want to contribute and if you’d like to volunteer as a mentor then register here as well!

Date and place

The event will take place from 10 to 14 September in Darmstadt, Germany, which is just 20 minutes from the Frankfurt airport. It’ll be a fun week, so clear your calendar! There will be plenty of opportunities to attend talks, mentoring sessions, sprints, etc.

The week’s schedule is as follows:

  • Monday - Contribution with some mentors
  • Tuesday to Thursday - Sessions, panels, workshops, BoFs and contribution lounge
  • Friday - Traditional mentored contribution and self-organized contribution spaces

Get involved

Just attending the conference is a great experience, but there are more ways to get involved:

  • Volunteering - Help with the organization of the event, find out more here.
  • Submit a session - By submitting and preparing a session gives you a great way to give back to the community. Sharing your knowledge and experience with others is what makes these conferences so great. So, make sure to submit your sessions here.

Josef, our Agile Consultant, is part of the conference program committee, so if you see him during that week, make sure you give him kudos for putting his energy, as well as that of all the other volunteers, into the event.

A number of Amazees are already working hard on submitting sessions, ranging from client case studies to more technical talks. We love these gatherings and want to contribute as much as possible, so you’ll be sure to see a lot of us there in that week.

To-Do

So here is your to-do list:

  • Sign-up for DrupalEurope (if you haven’t already).
  • Submit your session/s, you have until the end of this month to do so.
  • Enjoy!

Matt: WordPress in Uber

Wordpress Planet - Thu, 06/21/2018 - 05:20

I really love this thread and the replies sharing stories about Val Vesa’s experience talking about WordPress in an Uber / Lyft ride:

My @Uber driver last night, going home from airport asked me where was I coming from.
Told here about #WCEU
– what is that, she asked.
– the European Conference for #WordPress, I said.
Her eyes sparkling, she grabbed the wheel firm, looked in the rear view mirror at me and said,

— Val Vesa | Social Media & Travel Photography (@adspedia) June 18, 2018

Hook 42: Drupal 8 Interviews: Spotlight on Jill Cohen from Autodesk

Main Drupal Feed - Thu, 06/21/2018 - 01:41

 

Jill Cohen is a Senior Software Application Engineer at Autodesk Inc. Autodesk is a global company that empowers users to design and create just about everything on this planet - and in virtual worlds. She works with the Digital Platform and Experience Organization on the Digital Help team, which manages the Autodesk Knowledge Network and Services Marketplace. She is also on the board for Autodesk Women in Leadership.

WPTavern: WPWeekly Episode 321 – Recap of WordCamp EU 2018

Wordpress Planet - Thu, 06/21/2018 - 01:31

In this episode, John James Jacoby and I are joined by Milan Ivanović who helped organize WordCamp EU in Belgrade, Serbia this past weekend. Ivanović describes what it was like to organize such a large event, challenges the team overcame, and a few details related to WordCamp EU 2019 that will be held in Berlin, Germany. John and I finished the show discussing Matt Mullenweg’s keynote presentation and Gutenberg’s proposed timeline.

Stories Discussed:

Gutenberg Team Panel Talks Release Timeline, Theme Building, and Customization at WCEU
WordCamp Europe 2018 Contributor Day Posts Record Turnout Amid Wi-Fi Outage
Mullenweg announced Gutenberg Roadmap
WP Rig – A WordPress Starter Theme and Build Process in One

WPWeekly Meta:

Next Episode: Wednesday, June 27th 3:00 P.M. Eastern

Subscribe to WordPress Weekly via Itunes

Subscribe to WordPress Weekly via RSS

Subscribe to WordPress Weekly via Stitcher Radio

Subscribe to WordPress Weekly via Google Play

Listen To Episode #321:

Drupal Association blog: We're driving Drupal.org forward during our membership campaign

Main Drupal Feed - Wed, 06/20/2018 - 19:12

The work accomplished by the Drupal.org engineering team is no small feat. And so we're celebrating all the team is doing to help the community using the Drupal.org tools and services. Check out our membership campaign page to learn more about the team's work and how it helps your own work every day.

Here's how to help:

  • Share how Drupal.org helps you. Use these resources made for sharing.
  • If you aren't a member, join today!

This campaign ends on July 20, 2018. Thanks for all that you give to the project and for your support.

Drupal Association blog: Drupal Business Survey 2018 calls for input

Main Drupal Feed - Wed, 06/20/2018 - 16:55

At the end of June 2018, the third edition of the Drupal Business Survey will be launched by One Shoe and Exove in collaboration with the Drupal Association. You can read the results of the 2017 survey in this previous blog post.

With this worldwide survey, new insights into key issues that Drupal company owners and business leaders face, can be discovered. The purpose of the survey is to provide information on how Drupal agencies are doing worldwide and how Drupal fits in business-wise.

Seeking your input

Therefore, the initiators of the Drupal Business Survey 2018, call for input from the Drupal Community. Any Drupal business related topics, ideas or suggestions you wish to see investigated, are more than welcome.

This year’s Drupal Business Survey will focus on the health of Drupal companies and the obstacles and enablers for Drupal’s business success. The initiators also hope to gain information on how to further improve the demand for Drupal projects.

You can send your questions to Janne Kalliola (janne@exove.com) or Michel van Velde (Michel.vanvelde@oneshoe.com) before the end of June. The Drupal Business Survey will become available for participants soon after. The results of the survey will be officially published at this year’s Drupal Europe in Darmstadt, Germany.

Drupal Europe: Drupal + Technology track at Drupal Europe

Main Drupal Feed - Wed, 06/20/2018 - 15:24
Jeff Geerling @flickr

With Drupal 8 core now in full swing and the contrib space rapidly maturing, it is an excellent time to get more deeply involved with one of the world’s largest open-source development communities. The Drupal + Technology track is focused on educating developers on the latest techniques and tools for increasing the quality and efficiency of their projects.

The Drupal + Technology track is the place for Drupal experts actively working on and contributing to Drupal to share their knowledge and help attendees to grow their Drupal skills.

We expect deeply technical sessions that inspire developers to see what is possible with Drupal. We welcome sessions sharing knowledge about integrating Drupal with bleeding-edge technologies (blockchain, IoT, decoupled frontend, etc) to empower the audience to create amazing digital experiences.

This year, the Drupal Europe program is designed around the idea of industry verticals with sessions and workshops based on specific industries. We expect a huge amount of session submissions in the Drupal + Technology track and would kindly advise you to look if an industry track could be more appropriate for your talk to have a better chance of being accepted.

Be ready to sharpen your skills and connect with other tech-minded folks. Convince your boss to invest in your skills, and get you a regular Drupal Europe ticket before they increase in price on 12th of August.

There will also be plenty of contribution opportunities during the event. All expertises and energy levels are equally invited!

Susanne Coates @flickr

Location & Dates

The deadline for the call for papers is 30th of June. Share your skills and empower other developers at the Drupal + Technology track. Submit your session now!

About Drupal Europe 2018

Drupal Europe will be held in Darmstadtium in Darmstadt, Germany — with a 15 min direct connection to Frankfurt International Airport. Drupal Europe will take place 10–14 September 2018 and will bring over 2,000 creators, innovators, and users of digital technologies from all over Europe and the rest of the world together for three days of intense and inspiring interaction.

Drupal Association blog: Adding a Little Color

Main Drupal Feed - Wed, 06/20/2018 - 15:12

You may have noticed today that we have added a little color to our Drupal Association logo on social media. The changed logo will be around until the end of June, which is traditionally Pride Month.

The Drupal Association is an educational non-profit and does not advocate policy. I personally wanted to make this happen simply to say thank you to everyone at the Drupal Association who have made this LGBTQIA woman feel extraordinarily welcome and empowered this year.

For all LGBTQIA people and their allies, I’d also like to take the opportunity to draw their attention to the Drupal Rainbow Group on groups.drupal.org.

Could we, as a community, do more for Pride Month next year? Let me know - and let’s organise ourselves in the Drupal Rainbow Group.

Rachel

Pages