Skip to main content

Posts

Drupal 8 Tutorials : Custom Module

Custom Module development in Drupal 8 is very simple. It may looks very difficult for developer who has Drupal 7 experience or nothing at all. This tutorial will show easy steps and helps you to create custom module within few minutes. Note: Content or example of this tutorial may change according to Drupal 8 version and its release. This tutorial is divided into three small sections. In first section of this tutorial we will see what directory structure we need to create for a custom module. In second section we will see what type files we need to create. And in last section we will see what code we need to write in those files and configure them in Drupal 8. 1 Directory Structure All custom module in Drupal 8 reside under “module” directory of Drupal 8 project. To create a custom module we will create a new directory named “document” under custom folder. Following is directory structure. 2 Configuration files Secon

JAX-RS Tutorilas: Hello World Example

Following is simple  JAX-RS  tutorial, which sends “Hello World” text as response string using JAX-RS API and Jersey implementation. Technologies and Tools used in this article: 1.    JDK  2.     Eclipse  3.    Tomcat 4.    Maven  5.     Jersey 1.8 Create Maven Web Project Create a Maven web project and name it "helloworld" . File -> New -> Other -> Maven Project -> Next Select  maven-archetype-webapp Select  Next Type  Group Id,   Artifact Id  and  Package  name And select  Finish Add Project Dependencies Add Jersey repository using Maven. Use following URL to get appropriate repository. http://mvnrepository.com/artifact/com.sun.jersey/jersey-server Now update pom.xml file. File : pom.xml <project ...  > ...         ... <dependencies>                 ...                 ... <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server&

Sass Tutorials

Sass   ( S yntactically   A wesome   S tyle s heets)   is scripting language which produces Cascading Style Sheets   (CSS) . Sass is compatible with all CSS version and has assorted features. It is open source and developed in Ruby. What does Sass do? In simple terms by using Sass and its features we can create robust and large Style sheet with less effort and in less time. How to Install Sass? Sass requires Ruby, so if you are using Windows System then you need to install Ruby first. Here is URL of Ruby Installer . Otherwise if you use Mac or Linux System then you don’t need Ruby, it is pre-configured. Use following commands to install Sass sudo gem install sass use following command to verify  Sass is installed properly or not. sass  -v To begin with Sass, create Sass “main.scss” file and CSS “main.css” file Then run following command sass --watch main.scss:main.css It will update main.css file whenever you do changes

JAX-RS Tutorials: REST API using Java

JAX-RS is API specification   for RESTful web services using Java. RESTful web services is implementation of REST ( Representational State Transfer ) which is architectural design for distributed system or in general we can say JAX-RS  is a set of APIs to develop REST service.   This is a brief introduction about REST and JAX-RS. You can find more information on REST on Wiki and JAX-RS Official Site. What is REST? Representational state transfer is an abstraction of the architecture of the World Wide Web. More precisely, REST is an architectural style consisting of a coordinated set of architectural constraints (source  Wikipedia ) As JAX-RS is only a specification, we need to use it's implemented library to create RESTful web service. Following are such list of libraries Apache CXF , an open source  Web service  framework. Jersey , the reference implementation from  Sun  (now  Oracle ). RESTeasy,  JBoss 's implementation. Restlet , created

MongoDb : CRUD Operations Using Java

This tutorial will help you to perform CRUD operation on MongoDB records using Java. If you unfamiliar with MongoDB then please visit Getting Started With MongoDB tutorial. To begin with this tutorial we will create Person and Person Images table    (collection in MongoDB)  to simplify the MongoDB CRUD operations. 1. Define Data Structure Following are data structure of Person and Person Images table (collection in MongoDB)  Person id Int (primary) username String first_name String last_name String email String description String birthdate Date country String state String city String lat String lang