Wednesday, April 17, 2013

Mac: Some terminal and Unix/Mac shortcuts

Here I will give you some interesting shortcuts, that every one of us need when working on daily bases with unix or mac and their terminal:
  1. Up/Down arrows:
    Preview previews commands. It saves your time when you need the previously typed commands again and again for execution.

  2. control + a:
    Moves the cursor to start of the line. It is very useful when you got a long line about fifteen chars or more, and you need to move to the start of the line or close to the start of the line to do some changes, this shortcut will move you to the start very quickly instead of returning character by character.

  3. control + e:
    Moves the cursor to end of the line. So you can remember that by "a" for alphabit and "e" for the end.

  4. option + click line (Mac OS x and terminal only):
    Moves the cursor to the click point.

  5. tab (autocomplete):
    Try to complete the command or (file or folder name).

  6. tab + tab:
    It is useful when tab doesn't complete, pressing tab twice will show the list of available possible matches.

  7. command + ~:
    Cycle between terminal windows (terminal only), for GUI use command + tab.

  8. command + k:
    Will clear the screen and scroll back(terminal only).

  9. command + plus(+):
    Makes fonts bigger.

  10. command + minus(-):
    Makes fonts smaller.

  11. option + command + T:
    Open the characters map viewer.

  12. command + E:
    Find using the selected text.

  13. command + S:
    Export terminal text as.

  14. shift + command + S:
    Export selected text as.

  15. Triple-click the line
    Select a complete line of text.

  16. Double-click the word
    Select a word.

Use these shortcuts to save time while using Terminal.


Friday, April 12, 2013

ADF: After long time, table pagination feature has returned back in JDev11.1.1.7.0.

After a very long time since JDeveloper 10g, oracle jdeveloper 11g team has decided to remove a wonderful feature, which is the table's pagination feature.

Since that time when I have developed any project, I get the long list of scrolled data in the tables, and I have many complaints from my customers whose they need pagination feature.

I have developed a custom ADF Declarative Component to solve the pagination problem, to be used in my projects to fit my customer requirements.

I am a frequent updater for Jdeveloper, and recently Oracle has released JDeveloper v11.1.1.7.0 and surprised me with many of new features released.

But the most exciting one of existing features is Table Enhancements but the top one is returning back the pagination feature, other enhancement as the following:

  • Support for freezing the right most columns in a table so that a scroll bar appears on the left side of the frozen columns.
  • Table/TreeTable - Both components allow configuration of the paging vs. scrolling via the new scrollPolicy attribute.

Let's see how we can achieve that through the following steps, figures and code snippets.

  1. Creating the project:
    1. File > New > General > Application >Items > Fusion Web Application (ADF) > click OK button.
    2. On the create page > click Finish (Alt + F).
    3. Application > Application1 should be created as the following fig:

  2. Creating the business and presentation:
    1. On ViewController project > Right click and choose New > Categories >Web Tier > JSF > Items > JSF Page > click OK.
    2. On create JSF Page pop up >File Name: ValueList.jspx > check "create as XML Document (*.jspx)" > In initial Page layout and content > choose: Quick start layout.
    3. Open Page Implementation >choose: Automatically Expose UI > leave everything as is.
    4. Your screen configuration should be as the following:

    5. Click OK.
    6. An Empty page will be open in the editor.
    7. Go to package view.backing under ViewController project >New > Categories >General >Java > Items > Java Class > OK > Name: Employee > OK.
    8. Employee, ValueList classes, adfc-config.xml and ValueList.jspx  page should be as the following code snippets:
      adfc-config.xml

      Employee.java

      ValueList.java

      ValueList.jspx
    9. Right click on ValueList.jspx page and choose run, and when it runs, you should see the following output:


  3. Rendering rules (VIP Note):

    In order for a table to display as paginated, you must set the scrollPolicy attribute to page, the autoHeightRows attribute to 0, and the table must be placed in a flowing container (that is, a component that does not stretch its children). If these conditions are not met, the table will display a scroll bar.


Git: Alias aka shortcut your GIT commands

If you are familiar with the concept of shortcuts for ease of command or data access, and you used to use such a facility at your daily working bases. You will not find this comes with GIT version control system.

By default, Git does not come with any shortcuts, but you can add your own by aliasing commands.

If you are coming from an SVN background, you will appreciate the following bindings:

Then instead of typing the following command $git commit -m "my first comment", it could be re-written as the following: $git ci -m "my first comment".

Any shortcut or aka alias for any Git command could be defined via Git global configuration as illustrated in the above commands snippet.

Learn more by running the git help config in your Git Bash prompt.

Wednesday, April 10, 2013

JCP: New JEE 7 JSRs approved and ready for usage.

The following Java EE 7 JSRs (

1- JSR 343: Java Messaging Service 2.0,
2- JSR 349: Bean Validation 1.1,
3- JSR 352: Batch Application 1.0,
4- JSR 353: JSON-P API 1.0)

passed the final approval ballots, and ready for use now, congratulations.

Saturday, April 6, 2013

JCP: JSRs.next(); New JDk8, JEE7 JSRs stages and statuses

In a previous post "JEE7: Where we are now, Glassfish v4 and JEE7 roadmap", I have introduced latest update on JEE7 JSRs links, status provided with mailing lists, javadocs and reference implementation projects links.

As part of Adopt-A-JSR and Adopt OpenJDK programs, now I am going to widening the JSRs announcements to include JDK8, as well as JEE7 new updates alongside some interesting JSRs from previews JDK7 and JEE6 releases.

For more information, and keeping your-self up to date about JSRs statuses check our Trello JSR Stages board, which is public board to everyone interested to know about the latest JSRs status of JEE7 and JDK8 JSRs.

Here is JEE7, JSE8 JSRs list and some of the most popular JDK7 and JEE6 JSRs status and stages.

Java 8 Second Edition JSRs.

JSR

Name

Description

Approved for Status

JSR 335

Lambda Expressions for the Java Programming Language

Extend the Java language to support compact lambda expressions(closures), as well as related language and library features to enable the Java SE APIs to use lambda expressions effectively.

Early Draft Review 3

JSR 308

Annotations on Java Types

This JSR extends the Java annotation syntax to permit annotations on any occurrence of a type. Previously, annotations could not be placed on generic type arguments, type casts, etc.

Java 7 Enterprise Edition JSRs.

JSR 362

Portlet Specification 3.0

This update to the Portlet Specification will address progress in Java EE, client-side web, and mobile technology that has taken place since JSR286 Portlet Specification 2.0 became final in 2008.

New JSR approved, JSR Review Ballot

JSR 342

Java Platform, Enterprise Edition 7 (Java EE 7) Specification

This JSR will develop Java EE 7, the next version of the Java Platform, Enterprise Edition. 

Proposed Final Draft

JSR 236

Concurrency Utilities for Java EE v1.0

Concurrency Utilities for Java EE provides a simple, standardized API for using concurrency from application components without compromising container integrity while still preserving the Java EE platform's fundamental benefits.

JSR 338

Java Persistence 2.1

The Java Persistence API is the Java API for the management of persistence and object/relational mapping in Java EE and Java SE environments. 

JSR 339

JAX-RS 2.0: The Java API for RESTful Web Services

This JSR will develop the next version of JAX-RS, the API for RESTful (Representational State Transfer) Web Services in the Java Platform. 

JSR 340

Java Servlet 3.1

This JSR is to develop the next version of Java Servlets - Java Servlets 3.1

JSR 341

Expression Language 3.0

This is an update to Expression Language 2.2, currently part of JSR 245, JavaServer Page (JSP) 2.2.

JSR 345

Enterprise JavaBeans 3.2

Enterprise JavaBeans is an architecture for the development and deployment of component-based business applications.

JSR 346

Contexts and Dependency Injection for Java EE 1.1

Updates and clarifications to CDI 1.0 along much requested features.

JSR 356

Java API for WebSocket v1.0

The Java API for WebSocket JSR will define a standard API for creating WebSocket applications.

JSR 344

JavaServer Faces 2.2

This JSR is an update to the 2.1 version of the JavaServer Faces specification. This is the first major revision of the JavaServer Specification since JSR 314.

Final Approval ballot

JSR 343

Java Message Service v2.0

This is an update to the Java Message Service API, an existing API for accessing enterprise-messaging systems from Java programs.

JSR 349

Bean Validation v1.1

Bean Validation standardizes constraint definition, declaration, and validation for the Java platform. For more information on Bean Validation and how to participate, check out http://beanvalidation.org.

JSR 352

Batch Applications for the Java Platform v1.0

This JSR specifies a programming model for batch applications and a runtime for scheduling and executing jobs. 

JSR 353

Java API for JSON Processing v1.0

The Java API for JSON Processing (JSON-P) JSR will develop a Java API to process (for e.g. parse, generate, transform and query) JSON. 

Current JDK7 and JEE6 JSRs with status maintenance review:

JSR 322

Java EE Connector Architecture 1.6

The Java EE Connector Architecture 1.5 defines a standard architecture for connecting to Enterprise Information Systems. This JSR will enhance the existing specification with features requested by experts and community.

Maintenance Review 1

JSR 245

JavaServer Pages 2.1

This is the next revision of the JavaServerTM Pages specification. The purpose of JSP 2.1 is to improve alignment with JavaServerTM Faces (JSF) and enhance ease of development.

 

Maintenance Review 3

JSR 919

JavaMail API

A description of the new APIs that are being introduced in JavaMail. 

JSR 907

Java Transaction API (JTA)

Revisions to the JTA specification. 

Maintenance Review 5

JSR 115

Java Authorization Contract for Containers

This JSR seeks to define a contract between containers and authorization service providers that will result in the implementation of providers for use by containers.

Maintenance Review 8

JSR 250

Common Annotations for the Java Platform

This JSR will develop annotations for common semantic concepts in the J2SE and J2EE platforms that apply across a variety of individual technologies. 

Maintenance Review 2

JSR 318

Enterprise JavaBeans 3.1

Enterprise JavaBeans is an architecture for the development and deployment of component-based business applications.