Slide 1 Slide 2 Slide 3 Slide 4 Slide 5
Posted by Unknown | 1 comments

Create a Spring portlet with CRUD function in Easy Steps

What is Spring?

•    Spring is an open source framework developed by Spring Source, a division of VMware.
•    It provides lightweight solution to develop maintainable and reusable applications.
•    Any JAVA application can benefit from Spring.
  •   Simplicity
  •   Testability
  •   Loose coupling
•    Attributes of Spring
  • Lightweight
  • Inversion of control
  • Aspect oriented
  • Container
  • Framework
•    Spring is to keep the code as simple as possible.
•    It develops application with loosely coupled simple Java beans.
•    The current stable version of Spring is 3.0
•    Spring framework can be summarized in two ways.

Container:
  1. Spring can be described as a light-weight container, as it does not involve installation, configuration,  start and stop activities.
  2. It’s just simple collection of few JAVA Archive files that need to be added to the project class path.
Framework:
  1. Spring can be described as an API containing a large collection of classes, methods, interfaces, annotations, XML tag that can be used in enterprise application.
  2. API helps you to use any framework or functionality very easily in your application.
Why Spring?

•    Basic Spring philosophy
  • Better leverage
  • Avoid tight coupling among classes
  • Enables POJO programming
  • IOC simplifies JDBC
  • DI helps testability
  • No dependency cycles
  • Not exclusive to JAVA (e.g. Microsoft .NET)
  • Communicate to ORM , DAO, Web MVC


 
Main Spring Modules

•    Dependency Injection
o    DI is the basic design principal on which core Spring framework is built.
o    DI helps you to avoid unnecessary creation and lookup code in your application.
o    Lets you define an XML file that specifies which beans are created and what their properties are
  •     Simplifies OOP by promoting loose coupling between classes.
  •     Also called “Inversion of Control” (IoC)
  •     IoC refers to the creating instances being done by the Spring container.
  •     The control for creating and constructing object is taken care by the Spring container.
  •     Primary goal is reduction of dependencies in code
                           •  An excellent goal in any case
                           •  This is the central part of Spring

•    Aspect Oriented Programming
  •     “Aspect Oriented Programming” refers to the ability to add side effects to a class method calls  without modifying the class source code.
  •     Lets you separate business logic from system services.
  •     Attempts to separate concerns, increase modularity, and decrease redundancy
  •     Separation of Concerns (SoC)
  •     Break up features to minimize overlap
  •     Don’t Repeat Yourself (DRY)
  •     Minimize code duplication
  •    Cross-Cutting Concerns
  •      Program aspects that affect many others (e.g. logging)

Step 1: Start Eclipse IDE, create a Spring Portlet known as Spring Sample Portlet.
Go to File -> New->Liferay Project and click on Next








Step 2: Select Liferay MVC from Portlet Framework and click on Finish.
 


 
Step 3: Go to New -> Liferay Service Builder

 


Step 4: Provide Package path, Namespace as well as Author Name and unchecked the box.
Click on finish.


 
Step 5: Add entity, finder and order by details in service.xml.



Step 6: Add necessary Spring related library in WEB-INF/lib


Step 7: Create a Spring context file with named as PORTLET_NAME-portlet.xml.


Step 8: Add beans entry in it.


Step 9: Add Spring Dispatcher Servlet Portlet class in place of default MVC Portlet class in portlet.xml.


Step 10: Add below entry in web.xml


Step 11: Execute ant build-service command through below navigation from Eclipse IDE.
Liferay Service Artifactory generate implementation, utility classes for entity mentioned in service.xml



  
Step 12: Now Create class under src/com/liferay called Film Profile Controller, and put below code in this class.

import javax.portlet.ActionResponse;
import javax.portlet.RenderResponse;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.portlet.bind.annotation.ActionMapping;
import org.springframework.web.portlet.bind.annotation.RenderMapping;

import com.liferay.test.model.Film;
import com.liferay.test.model.impl.FilmImpl;
import com.liferay.test.service.FilmLocalServiceUtil;


@Controller("filmController")
@RequestMapping(value = "VIEW")
public class FilmProfileController {


    @RenderMapping
    public String showFilms(RenderResponse response) {
        System.out.println("inside show films......");
        return "home";
    }

  
    @ModelAttribute
    public Film newRequest(@RequestParam(required=false) Long filmId) {
        try{
            Film film = new FilmImpl();
            if(filmId!=null){
                film = FilmLocalServiceUtil.getFilm(filmId);
            }
        return film;
        }catch(Exception e){return new FilmImpl();}
    }


    @RenderMapping(params = "myaction=addFilmForm")
    public String showAddFilmForm(RenderResponse response) {
        return "addFilmForm";
    }

    @RenderMapping(params="myaction=editFilmForm")
    public String showEditBookForm() {
        return "editFilmForm";
    }

    @ActionMapping(params = "myaction=deleteFilmForm")
    public void deleteFilmForm(@ModelAttribute Film film,ActionResponse response) {
        System.out.println("Inside delete film ...............");
        try {
            FilmLocalServiceUtil.deleteFilmProfile(film.getFilmId());
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }       
           
        }
   
    @ActionMapping(params = "myaction=addFilm")
    public void addFilm(@ModelAttribute Film film,
            BindingResult bindingResult, ActionResponse response, SessionStatus sessionStatus) {
        System.out.println("Inside add film ...............");
        try {
            FilmLocalServiceUtil.create(film);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }       
            response.setRenderParameter("myaction", "books");
            sessionStatus.setComplete();
        }
}

Step 13: Create another class called Long Number Editor under src/com/liferay/test, and put below code in this class file.

import java.beans.PropertyEditorSupport;
public class LongNumberEditor extends PropertyEditorSupport
{
    @Override
    public String getAsText() {
        String returnVal = "";
        if(getValue() instanceof Long) {
            returnVal = String.valueOf((Long)getValue());
        }
        if(getValue() != null && getValue() instanceof String[]) {
            returnVal = ((String[]) getValue())[0];
        }
        return returnVal;
    }

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        setValue(Long.valueOf(text));
    }
}

Step 14: Create another class called My Property Editor Registrar under src/com/liferay/test, and put below code in this class file.

import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry;

public class MyPropertyEditorRegistrar implements PropertyEditorRegistrar
{
    public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Long.class, new LongNumberEditor());
    }

}
 
Step 15: Edit the FilmLocalServiceImpl.java file, and put below code in Impl file. 

public Film create(long userId,long groupId,String director, String cast) throws SystemException {
       
        long filmId = counterLocalService.increment();
       
        Film film = filmPersistence.create(filmId);

        film.setUserId(userId);
        film.setGroupId(groupId);
        film.setDirector(director);
        film.setCast(cast);
        filmPersistence.update(film, false);
        return film;
    }

    public Film create(Film film) throws SystemException {
       
        long filmId = counterLocalService.increment();
       
        //Film film = filmPersistence.create(filmId);
        film.setFilmId(filmId);
       
        filmPersistence.update(film, false);
        return film;
    }
public List getFilmData(long userId)throws Exception
    {
        return filmPersistence.findByUserId(userId);
    }

    public List getCompanyFilm(long groupId)throws Exception
    {
        return filmPersistence.findByGroupId(groupId);
    }

    public int getCompanyFilmCount(long groupId)throws Exception
    {
        return filmPersistence.countByGroupId(groupId);
    }

    public void deleteFilmProfile(long filmId)throws Exception
    {

        filmLocalService.deleteFilm(filmId);
    }
}

Step 16: Now build the service and deploy the portlet.
Read more...
Posted by Unknown | 4 comments

Why to Choose PHP for Web Development

It is very essential for every business, to survive in this highly competitive market and for that it is very vital to contain a well developed and well designed website; if they have been looking for an online sales and business. To make this websites look attractive, there are numerous ways to build the website, for an instance, HTML for static, flash websites and so on. Also there are some script languages, which are quicker and safe to develop the websites. Amongst those languages, PHP is the most admired technology to develop the website, as it is simple and contains the advance features. 

PHP stands for Hyper text Preprocess, which is a well renowned programming language, contains more than 700 functions which is eventually reduces the complexities while programming. It is compatible to multiple databases such as Oracle, SQL, MYSQL servers and MS Access, but it is more helpful, if the website is hosted on Linux. On what grounds PHP is more preferable for web development, is mentioned as below.
 
Effortlessness
As PHP is similar to languages like Pearl and C, it is very simple to understand and learn. It is so comfortable to any one, from kind of field.
 
Compatibility
This programming language is completely fledged; hence, it gets very easily integrate, even with any complex application. It is more attuned with the source language called MYSQL database.

More admired in CMS
It is more admired in the Content Management Systems such as Wordpress, Drupal and Joomla; as PHP can be customized and can be manipulated as per the necessity of the programmer.
 
Cost Saving
As this programming language can be downloaded from the internet, free of charge; so it very much in flame to develop the website. It is more favorable for the new businesses, which are just getting into the market with limited budge.

Advanced Usability
PHP makes the site more attractive and interactive due to its advance features for the owner and for the visitors.  Things such as Liberty of choosing the language; comparatively low cost and fast turnaround time; can be embedded in HTML as well; Free from restrictive authorizations; regular updates; and so on.
It is very essential for the owner to know how many people have been visiting the site and what their feedback are. With PHP made website, the owner can track and target the activity of the viewers.

Attune Infocom is one of the most secured companies whereby you can develop your website in PHP.  We have expert team of professional PHP developers, who are able to provide you the complete solution in PHP web development.
Read more...
Posted by Unknown | 1 comments

5 Things to Consider Before you Approach Web Portal Development Company

Web portal is a necessity for every small, medium and large scale companies. It becomes useful to connect all internal departments into web platform whether it’s a local area or wide area with multiple locations. There are many web portal development companies working in countries like India, China, Pakistan and Philippines and claim them self as one of the best web portal development company. Client will be in great confusion because not been able to decide whom to select and award the important web development project.

Hiring or outsourcing web portal application Development Companies a common trend. As per the current market trend, there are number of IT companies that offer portal development services, and the demand in the number of organization has made it tough for the clients to select their prospective portal development partners. So, in order to help you to select offshore portal development company from India, below are the points needed to consider approaching one. 

To remove complexity and assist you to find a reputed web portal and web application Development Company from India is the objective of this blog.

First task is to get the project requirement crystal clear and refer to the five things that you must consider before connecting web portal Development Company in India.

Get ready with the list of Portal Applications and Requirements


This is universal accepted primary task for you to get on. It has been witnessed that many people enthusiastically approach company’s sales person by a mail or live chat session without preparing the thorough objective and needs. When the points triggers out, and discussion reaches to project requirement, it is ended immaturely and time spent on this task considered a waste. You may get response from company sales person with convincing what they want to sell rather what you want. Sometimes the sales person wins the situation and you are ending your decision to buy the solution with wrong portal application stack not able to fulfill your requirements.

Alert! Before you start identifying the web portal development company, define your requirement properly and clearly. Prepare a list of all available web portal application stacks that can serve your actual requirements. If you demand web portal design, then browse through the Internet and keep reference sites ready. Make a list of all the objects that you want in your web portal and the application comparison that would help you to accomplish taking right decision. It is recommended that if you’re going for web application development, then make a rough plan of its design and functionality.

Understanding of Business and Technology Consultancy


 Some of the IT web portal development company may have team of very good technocrats for development and implementation of client requirements but they may have a lack of business domain and it can result into unsuccessful project. The efforts made will have a cost and it can be a huge loss. Consider the business domain understanding and technology expertise in your selection criteria before hiring web portal development company.Now a day, there are many company offering the business process consultancy and technology consultancy in order to help customers like you to achieve project objectives and your investment goes in right direction. The consultancy services help you to identify the technology and define the scope of your projects in a much better way.It allows you to know the current market trends and guide you to build proper strategy on how you should proceed with your project.However, you are the decision maker and anytime if you feel that you are well aware of all the aspect then you can skip going for consultancy services. But, in any case, if you have queries in mind, then it is advisable to approach a consultancy services company.

Web Portal Application should be flexible enough to scale up

 Once we have decided on the business aspects, the next step is to select technology and development partner to ensure that the web portal should never goes down in any case. The web portal should be flexible in terms of programming and deployment that it can scale up at the time of peak usage and perform all the time as per the standards. The product and design should be also one of the key factors while talking about scalability. It is advisable to hire a company who can give you a complete solution for a flexible web portal with scalability option and an added advantage if they can offer a cloud based solution.

Project Cost while Outsourcing

 This is a major affecting factor while taking the decision to outsource the project to a web portal development company in India. There is always been a budget for every project with 20% (+/-) consideration of cost. The cost of the project may vary from organization to organization and depending on the technology selected to customize your requirement. The cost will majeure from quality of work and it can be seen from past work done. Before selecting a partner company for your project, do a proper homework, study the market and fix your budget in order to stay focused on your requirements.

As projected, the budget should be flexible enough to get a good quality work, as quality work always cost higher than other. In short, if you need a world class web portal, price does matter.

Maintenance and Support

 Developing and delivering an outstanding web portal is a great success for you and Partner Company. The web portal needs an attention of both while requirement rises as manpower rises in your organization. Kindly consider maintenance and support factor while finalizing and outsourcing the web portal development project. To keep the flow of visitors to your web portal, it should be updated regularly. If you are running an eCommerce portal, introducing new features and user friendly aspects is a critical demand of your project. Dynamic nature of web portal with support and maintenance by Development Company is what you must consider.

To make your hiring task easy, do a proper home work by considering all above points before approaching and finalizing your decision to web portal development company in India. Attune Infocom is one of the most growing Web development company in India. Feel free to contact us for one stop web portal solution.
Read more...
Posted by Unknown | 3 comments

Hire Dedicated Developers at Competitive Rates From India



A Successful project with financial benefits is the prime objective for every organization. We at Attune Infocom help our clients and partners to achieve such benefits by our dedicated programmers and developers hire services.

 

IT organizations may have limited bandwidth to serve all the client requirements in the arena of Open Source technologies. To consider each requirement and penetrate its expertise organizations are open to work on multiple technologies with the business model of hiring contract based engineers during past few years. 

Hiring a web programmer for short term and long term basis is now possible with Attune Infocom. We are offering solution on very niche and specialized open source technologies. We have a team of tech leads, architects, sr. developers and UI designers working on technology like Alfresco, Liferay, JBoss JBPM, Activiti BPM, JBoss SOA, JBoss ESB, Mule ESB, Apache, Drupal, Moodle, Magento, Mobile development – Android and Sencha touch, etc.

The benefits of hiring developers as and when require is taking its place slowly and gradually realizing the benefits of time & material based hiring, fixed cost based hiring or project based hiring. This model is a successful one compare to maintain full time in house employees. We all know that the cost of owning a resource always goes more compare to the limited duration of project and work.While hiring on contract from Attune Infocom, we assures the quality resources will work towards successful delivery of projects.
As a system integrators, we have pool of industry experienced and qualified web developers available on board at Attune Infocom. Each of the experienced programmers is capable to work on multiple technology frameworks and enable our client to utilize the skill set for integration projects. We are open to join hands with you and become a valuable offshore development partner.Our methodology allows you to get maximum advantage as we allocate a dedicate development team to fulfill your project requirement needs. We enable entire control over the team.

What will you get?
  • -    Complete hold on Dedicated Developer
  • -    Select the expert Programmers
  • -    Round the clock support with flexible working hours
  • -    Always connected
  • -    Quality work
  • -    Client First–Full Control on your Project

Hiring Model for Our Dedicated Programmers


Model
Working Hours
Support / Consulting Packs
8 hours shift
Full time
Weekly consulting
Immediate Allocation
Weekends availability
Monthly consulting
Time& Material
10 AM to 7 PM or flexible
Short term hire
Fixed Price
5 Working days a week
Long term hire
On site / Off shore /
Project based





Being an open source web development company, we deliver the source code with projects and all rights remains with you.

Our Resource Management Team Ensures

  • •    Industry experienced resources
  • •    8 hours a day with time management
  • •  Daily standup meetings and calls through telephone, emails and instant messengers
  • •    Best software development methodology with coding standards
  • •    Infrastructure to create supportive environment
  • •    Internet connectivity 24 X 7 with Leased Line

To know more about our success, please visit our Portfolio and client feedback.
We have various domains knowledge with business process understanding. Feel free to contact us to know more about our Hire Dedicated Developers and Programmers model.
Read more...
Posted by Unknown | 0 comments

Mule - Easy to Understand and Powerful Enterprise Service Bus


What is Mule ESB?
Mule ESB is a Java-based enterprise service bus (ESB) and integration platform, developer can connect their application with ESB. Mule use service oriented architecture. Apart from of the different technologies the applications use, including JMS, Web Services, SMTP, HTTP. The advantage of ESB, it’s allow communicate different application. Messages can be any format SOAP to JSON. Mule ESB Development provide messaging framework that enable exchange of data among application.

Why Mule ESB?
Mule ESB is lightweight open source framework but highly scalable, allowing you to start small application and connect multiple applications. Mule manages all the interactions between applications and components transparently, ESB will take care of the multiple application, we can easily integrate third party application using Mule.

Features of Mule ESB
An ESB is a used for integration using a service-oriented approach. Its main features are:

  • *  Set of Service Container
  • *  Message Transformation Service
  • *  Message Routing Service
  • *  Web Service Security   

Through Mule ESB we can integrate third party application like LinkedIn, Twitter, Facebook. To create a Flow we can use Mule Studio, Mule Studio is eclipsed based tool. Mule Studio has three main components: A package tree, a palette, and a canvas. Mule Studio easily creates flows as well as edit and test them in a few minutes. . It is based on drag-and-drop elements and supports two-way editing.  

Mule Configuration


Spring Beans: You can construct service components from spring beans that you define in a separate spring context file or right in the Mule ESB configuration file.

Agents: An agent is a service that is associated with or used by Mule ESB but is not a Mule-managed component. Agents have the same life cycle as the Mule instance they are registered with, so you can initialize and destroy resources when the Mule instance starts or is disposed.
 
Connectors: The connector is a non-default configuration of any transports used.
 
Global Configuration: The mule global configuration is used to Global settings, such as the default transaction time-out, that apply to the entire Mule configuration.
 
Global Endpoint: Global endpoints can be used as they are defined globally, or they can be extended by adding more configuration attributes or elements. To reference a global endpoint, use the usual and elements, and specify the global endpoint name using the ref attribute.
 
Transformers: The transformer is Convert data from one format to another. You can define them globally and use them in multiple flows.
 
Filter: Filters decide which Mule messages are processed. Filters specify conditions that must be met for a message to be routed to a service or continue progressing through a flow. There are several standard filters that come with Mule ESB that you can use, or you can create your own filters.
 
Global Message Processors: A global message processor observes a message, or modifies either a message or the message flow. Examples include transformers and filters.

Models: You can define one or more models that logically group together your services.

Services: You can define One or more services that wrap your components (business logic) and configure routers, endpoints, transformers, and filters specifically for that service. Services are connected using endpoint.

Endpoints: Services are connected using endpoint. It is an object on which services will receive (inbound) and send (outbound) message.
 
Flow: Flow is a use message processor to define message flow between a source and a target. 

Dr. Zakir Laliwala
Read more...
Posted by Unknown | 2 comments

EC2 Micro Instances - Best among Amazon Web Service (AWS)


Hope this article gave you the basic fundamentals to get best out of the Micro Instances. I have mentioned core advantages and use cases of EC2 micro instance type over here. From Best-of-breed, you can use micro instances for normal dynamic websites and contents with caching power and scaling advantage.

Micro instance (t1.micro) type is one of the most fashionable and highly acceptable instance types by IT fellows supported by Amazon EC2. During November 2010, AWS announced the free tier and started offering 750 hours of Micro Instance usage free per month for the first one year, but it's available as an Amazon EBS-backed instance only. You can now launch EC2 micro instances within a Virtual Private Cloud (VPC). AWS now extends to t1.micro instances running inside of a VPC also.

Talking to it technical specifications, the Micro Instance type doesn’t have that much power required for heavy stimulating. The main memory presented in Micro instance type is 613MB. It comes with explode CPU capacity that can be goes up to 2 Elastic Compute Units (ECU). That means the CPU performance is not conventional. This is just not enough for running any severe workloads. And yes, storage can be added through Elastic Block Storage (EBS) and the free tier covers up to 30GB of storage space.

Best Recommendation when optimizing an AMI for the micro instance type: 
 
  • Design the AMI can run on at max. 600 MB of Memory Usage
  • Edge the number of chronic processes that use CPU time (e.g., cron jobs, daemons)
But from the technical specification it doesn’t mean Micro Instances are totally ineffective. They offer excellent worth in certain cases. In this article, I want to share how to get the best out of the Amazon EC2 Micro Instances.

Optimize Swap Memory: This is pertinent to Linux based Micro Instances. By default, these types of instances do not have swap space configured at initial level. I ran my Cloud Magic World Website on a Micro Instance for a few days. During the crest loads, I have experienced Apache Server or MySQL crashing unexpectedly. So with just 613 MB at your clearance, you got to make sure that you have set aside enough disk space for the swap. This will radically enlarge the reliability of Micro Instance.

Auto Scaling Out: The funda on the Cloud is auto scaling out. Running a convoy of low-end servers in parallel is more competent and cost effectual on any virtualized infrastructure. As per the load and use-case, splitting a job across number of Micro Instances may be cheaper and faster than running the same job on a single Large Instance. This scale out structural design provides better fail over and quicker processing.

Mull over Caching: If you are scheduling to host sites on these Micro Instances, be clear in your mind that they are not very dynamic. Dynamic websites demand more CPU power and memory due to the approach each request is processed. Straightforward websites like blogs and marketing sites with a few dynamic contents are ideal participants for the Micro Instances. Moreover, consider caching the content to avoid CPU spikes. For example, if you are running any blog or website, you can enable caching plug-ins to increase the performance. There are plenty of plug-ins available for caching by free of cost.

Select 64-bit: Always pick 64-bit when running Micro Instances. This is assured to give you better recital than the 32-bit complement. You will see the difference when you are running batch processing that deals with large files and processes.

Pull the Cron jobs:  Many patrons operate a Linux Micro Instance to run cron jobs and precise locale tasks that monitor and handle their entire AWS infrastructure. If you want to run a cron job, stop all other running services, add swap space to instance and pull it to make it a tilt and mean cron job machine. 
Read more...