Top menu



Wascou.org / Blogs / Xavier GOULEY




Hi,

This week, I finished an old personal project on Java platform.

This project, called Jieting Launcher, is a modular engine written in Java, that offers simple interfaces & services between modules. Adding a new module into the application is very easy (like copy a JAR in a folder), and version upgrade is dynamic. This application brings frameworks for developper tasks for Swing, AWT or SWT.

The application is now in beta version, 0.2, and I will follow statistics to know if my idea is appreciated and used.

The given screenshot is an example of my application starting modules, building dependency trees, resolving conflicts between modules and libraries, and finally launching modules. It's a dynamic splash screen: the only UI that is mandatory in the application (all other stuff is in modules).

To make your own module, you just have to follow an Interface, and if you want, include existing other modules (for dependencies), and that's all!

You can access the project through the following link :
SourceForge.net: Jieting launcher

Enjoy!

Hi, today, I want to share a good tip to have access to an object attribute of an unknown class from eZpublish templates. This case is rare, but when you have an object with unknown attribute, or from an unknown PHP class, and you want to access an attribute by its name, if the object does not extends a datatype, the classic "object.attribute" operator in template language cannot work. The problem is that this operator call methods like attributes(), hasAttribute($attr) or attribute($attr) to explore the attributes. In your case, the object has no such methods, you cannot modify the class to add them (for some reasons, for example if the object comes from PHP SOAP), and then you need a wrapper to simulate a datatype.

I propose a DummyDatatype wrapper class, used by a template operator, like this :

class DummyDataType {
    var $Object = false;
    function DummyDataType($object = false) {
        $this->Operators = array( 'ddt' );
        $this->NamedOperators = array(
                'ddt'=> array( 'attribut' => array(
                       'type' => 'Object',
                       'required' => true,
                       'default' => null))
        );
        $this->Object = $object;
    }
    function modify( $tpl, $operatorName, $operatorParameters,
                  $rootNamespace, $currentNamespace,
                  &$operatorValue, $namedParameters) {
        switch ( $operatorName ) {
        case 'ddt':
            $this->Object = ($operatorValue != null)?
                 $operatorValue : $namedParameters['attribut'];
            $operatorValue = $this;
        break;
        default :
            $tpl->warning($operatorName,
                   "Unknown operator '$operatorName'");
        break;
        }
    }
    function operatorList() {
        return $this->Operators;
    }
    function namedParameterPerOperator() {
         return true;
    }
    function namedParameterList() {
         return $this->NamedOperators;
    }
    function attributes() {
         $obj = $this->Object;
         $result = array();
         foreach($obj as $key => $value) {
             $result[] = $key;
         }
         return $result;
        //TODO: test this in all cases (string,integer,...)
    }
    function hasAttribute( $attr ) {
         if ($this->Object == false) return false;
         return isset( $this->Object->$attr );
    }
    function attribute( $attr ) {
         if (isset( $this->Object )) {
             if ( isset( $this->Object->$attr ) )
                 return $this->Object->$attr;
         }
         eZDebug::writeError("Attribute '$attr' does not exist",
                        'DummyDataType::attribute');
         $attributeData = null;
         return $attributeData;
    }
}

With this class, used like a template operator in an extension, you can explore an object, whatever his class,
by calling this:

my_object|ddt('my_attribute').0 {* an array *}
my_object|ddt('sub_object')|ddt('a_datatype_object').content...
{* object containing datatype object, with content attribute *}

This class could be useful for some rare cases, but is a smart solution, so keep a bookmark on it ;)

User interface addict? Mobile phone user? Disappointed by the iPhone and its capacities/price?

Today, I wish to share my passion for Android, the user interface of my future mobile phone. Android is like an operating system on a mobile phone, but it is an open source, easy to program, and maintained by the giant Google.

Android is only at the stage of its development, it is thus still difficult to know what will be the final result, but it promises a lot, because built by the best Java developers from all over the world, and leads to creativity by a challenge of $10'000'000...

It runs on Java under an embeded and enhanced JVM, itself running over a linux kernel. Since few months, the SDK is available, with an emulator; many developers communities were formed; the challenge increased creativity and numbers of program tries. Soon, a first giant step will be made by google in the mobile phone world.

I can only advise you to go to throw a glance, as well on the Google workshops as on Youtube to see some basic demonstrations, as “how to create an application like a contact list in about 5 minutes and 15 code lines".

Next Android steps:

  • 14th April 2008: Challenge deadline, end of the first step,
  • 28th/29th May 2008: Google I/O, for much more details about Android

Some interesting links:

RSS/Atom Feeds:

Welcome to you!

This first post symbolizes the starting of my blog, about computer sciences, web technologies, computer HMI and other technological subjects.

Thanks to Wascou for lodging for this blog, we will make a pot together on a common subject - eZpublish, tool on which we both work - for unspecified duration.

RSS Feed

By this blog, I will try to share many ideas, about computer sciences, web technologies, computer HMI and other technological subjects.

Thanks to Wascou for lodging for this blog, we will make a pot together on a common subject - eZpublish, tool on which we both work - for unspecified duration.

Another subject I'm interested in is Android framework. By the end of this summer, I think I will begin an experience on it, to jump into the mobile world, wider than ever, today.

Mon Tue Wed Thu Fri Sat Sun
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30