samedi 12 juillet 2014

Custom lazy loading indicator for ajax processing with WICKET APACHE


One of the things we must take care of when we use AJAX is to notify user when an AJAX request is already in progress. This is usually done displaying an animated picture as activity indicator while the AJAX request is running.

Wicket comes with a variant of components that display a default activity indicator during AJAX request processing.These components are respectively IndicatingAjaxButton, IndicatingAjaxLink and
IndicatingAjaxFallbackLink. you can check the official documentation for more details.

Here i will show you my prefered way of making ajax lazy loading indicator : first i want to make global ajax indicator that will be displayed when any component in that page make an ajax process, then i want to display a specific ajax indicator for specific component like submit button, of course with custom indicator picture and styling.

Global AJAX indicator

if you want to show an ajax indicator when any component in a page does an ajax process just make the wicket page implement the interface IAjaxIndicatorAware then override the method getAjaxIndicatorMarkupId(), this method should return the markup id of div panel which contain the custom loading picture.

JAVA code

public class pageWithAjaxProcess extends WebPage implements IAjaxIndicatorAware { 
...
       @Override
public String getAjaxIndicatorMarkupId() {
              return "loadingIndicator_id";
}
....

HTML code

<div id="loadingIndicator_id" style="display:none;">
<img src="assets/lazyLoading.gif" width="48" height="48" alt="loading"/>
</div>

like this you can make your custom loading indicator, it is just a question of css styling.

Specific Ajax indicator

Sometimes we want to display a loading picture only  for submit button which has a long processing time, so we can use IndicatingAjaxButton component and we override its getAjaxIndicatorMarkupId() method for customizing its loading panel.




vendredi 24 janvier 2014

Example syntax for Secure Copy (scp)


Example syntax for Secure Copy (scp)

What is Secure Copy?

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Examples


Copy the file "foobar.txt" from a remote host to the local host

    $ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host

    $ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar"

    $ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

lundi 20 janvier 2014

How to Install Oracle Java JDK 6/7/8 on Ubuntu 13.04 / 12.10 / 12.04



In this article I will show you how to install the Oracle Java (JDK) 8, Oracle Java (JDK + JRE) 7 or Oracle Java (JDK) 6 on Ubuntu 13.04, Ubuntu 12.10 and Ubuntu 12.04.
The Oracla Java has been removed from the official Ubuntu repositories due to some Java licence issues.
Before you install it, remove OpenJDK, if you have it installed
$ sudo apt-get purge openjdk*

To install Java 8/7/6, do this:
In order not to get issues with the add-apt-repository command, install the following package:

$ sudo apt-get install software-properties-common

Add the PPA:
$ sudo add-apt-repository ppa:webupd8team/java

Update the repo index:
$ sudo apt-get update

install Java 8:
$ sudo apt-get install oracle-java8-installer

Or, install Java 7:
$ sudo apt-get install oracle-java7-installer

Or, install Java 6:
$ sudo apt-get install oracle-java6-installer