1 may 2013

OSLC Workshop: Sharing our Software Engineering artifacts (Part 1)


I will start with a cycle of posts related to the OSLC world, a new way to share information between different tools and programs that help us with the software develoment cycle.

I will talk more about OSLC in the near future. But if you want to learn more about OSLC, I can recommend the two entries:

  1. http://wiki.eclipse.org/Lyo (The SDK to implement OSLC compatible systems)
  2. http://open-services.net/ (The main page)

I have started with the Bugzilla workshop, a step by step (sometimes it just does not look like a Workshop but like a guide to learn what the pieces of code do). You can download the code following the guide in http://wiki.eclipse.org/Lyo/OSLCWorkshop.

The workshop helps us to extend a Bugzilla server functionality, so it will share the bugs, tickets, change requests, or however you want to call it, for OSLC the name of this type of resource is change request.

Service Provider Catalog

In the first lab, they call it Lab 1, where we learn what is a Service Provider Catalog, this is the first piece that we need to implement to enable a tool to share its information to OSLC consumers.
In few words, it contains links to the Service Providers and some information about the tool.

Service Provider

The service provider is a piece of information that you and your team must need to decide how to separate the pieces that your tool, in this case Bugzilla, separates its component.  Bugzilla uses Products, Rational Team Concert uses Projects, etc. You can choose the way to share the different pieces of information.

A Service Provider document indicates the way to communicate with the different pieces. With links it indicates what are the requirements to create new resources, how to query them among other things.

In this workshop, the  Service Providers map to Bugzilla Products. In order to add a Service Provider to the Catalog, we create one with the code :


BugzillaServiceProviderFactory.createServiceProvider(basePath, product, parameterMap);

where 
basePath is the URL of the application, 
product is a String with the value of the product in Bugzilla
parameterMap is a Map containing the productId and its value

And we register the new Service Provider in the catalog with:

registerServiceProvider(basePath,bugzillaServiceProvider,productId);


More to come in the second part of the workshop.

References:
http://wiki.eclipse.org/Lyo/OSLCWorkshop

3 sep 2012

Resource Desciptor Framework

RDF

In my own words the Resource Descriptor Framework (RDF) is a way to get/indicate specific information (metadata) about resources in the Web.
By example, you cannot get the name of the author of the page www.example.org/index.html.
But with the RDF specification, you are able to provide this information.

For the statement

http://www.example.org/index.html has a creator whose value is John Smith
 
There are 3 terms in the RDF specification:
  • The subject (http://www.example.org/index.html)
  • The predicate (creator)
  • The object (John Smith)
There is a graphic way to describe the statement:

The triples notation allows us to write down the statement in a 3 peers way:
ex:index.html   dc:creator   exstaff:85740 .

We can also have blank nodes, that allows us to get information from the resource.
exstaff:85740   exterms:address         _:johnaddress .
_:johnaddress   exterms:street          "1501 Grant Avenue" .
_:johnaddress   exterms:city            "Bedford" .
_:johnaddress   exterms:state           "Massachusetts" .
_:johnaddress   exterms:postalCode      "01730" .

We can request the type of the object:
ex2terms:book78354   rdf:type          ex2terms:Book .
ex2terms:book78354   ex2terms:author   _:author78354 .
_:author78354        rdf:type          ex2terms:Person .
_:author78354        ex2terms:name     "Jane Smith" .


What about the specification of the data (by default all is a string)
ex:index.html  exterms:creation-date  "1999-08-16"^^xsd:date .

How does it looks in code?

1.  
2.  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3.              xmlns:dc="http://purl.org/dc/elements/1.1/"
4.              xmlns:exterms="http://www.example.org/terms/">

5.    <rdf:Description rdf:about="http://www.example.org/index.html">
6.         <exterms:creation-date rdf:datatype=
         "http://www.w3.org/2001/XMLSchema#date">1999-08-16
           
7. <dc:language>en 8. <dc:creator rdf:resource="http://www.example.org/staffid/85740"/> 9. 10.
How about a set of products?

1.   
2.   ]>
3.   xml:base="http://www.example.com/2002/04/products">
6. rdf:ID="item10245"> 7. rdf:resource="http://www.example.com/terms/Tent"/> 8. Overnighter 9. 2 10. 2.4 11. 784 12. ...other product descriptions... 13.
This is the subject:
http://www.example.com/2002/04/products#item10245



References 

http://www.w3.org/TR/rdf-primer/


28 may 2012

Colecciones

Resumen de Colecciones de Java


Set

Interface que no permite tener duplicados. Extiende a Collection y a Iterable.

Implementaciones

HashSet: Mejor performance, sin garantia de ordenamiento.
TreeSet: Ordenamiento de acuerdo al valor del objeto en un reb-black tree. Por lo tanto más lenta que un HashSet.
LinkedHashSet: Ordenada de acuerdo al orden en que son introducidos los objetos. Una tabla Hash  con una Lista Ordenada sobre la tabla. Un poco menos eficiente que el HashSet.

List

Interface que permite tener duplicados y ordenamiento.
Las implementanciones de listas nos proveen de nuevos metodos:

  • Acceso a los elementos de acuerdo a su posición.
  • Busqueda.
  • Iterador de ambas direcciones.
  • Sub listas de acuerdo a rangos.

Implementaciones

ArrayLink: Mejor performance.
LinkedList: Mejor performance bajo ciertas circunstancias.
Vector: Anteriormente no implementaba List.

Queue

Interfaz para implementar una cola, tiene muchas clases que implementan sus metodos. Un buen ejemplo es el PriorityQueue.

Map

Un conjunto de llave (única) y un valor. No hereda de Collection.

Implementaciones

HashMap: Mejor performance, sin garantia de ordenamiento.
TreeMap: Ordenamiento de acuerdo al valor del objeto en un reb-black tree. Por lo tanto más lenta que un HashMap.
LinkedHashMap: Ordenada de acuerdo al orden en que son introducidos los objetos. Una tabla Hash  con una Lista Ordenada sobre la tabla. Un poco menos eficiente que el HashSet.



http://docs.oracle.com/javase/tutorial/collections/index.html

25 ago 2011

Configuring iptables to allow access to tcp ports

Configuring iptables to allow access to tcp ports

When Tomcat or WebSphere are installed in a Linux System (like RHEL or Ubuntu) you will find that you cannot access the web applications from a different computer.
Most of the time the "problem" comes from the iptables configuration, as only few ports are opened.

What should I do to allow access to the port "9043" by example

Pre-req:
  • You must be able to edit the iptables configuration.
Steps:

1.
sudo iptables -L
This will show you the list of rules, locate the latest ACCEPT, like
33 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:xxxxx
34 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:xxxxx:xxxxxx
35 DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:xxxxxx:xxxxx

2.
sudo iptables -I INPUT  -p tcp --dport 9043 -j ACCEPT

You will be accepting Input messages for the tcp protocol in the port 9043, the value is going to be the next number after the last ACCEPT that you get, or it can be any other as long as it is not after one like this:

51 DROP all -- 0.0.0.0/0 0.0.0.0/0
in my case
sudo iptables -I INPUT 35 -p tcp --dport 9043 -j ACCEPT
Follow the steps in this page to save the iptables
http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/



References:
https://help.ubuntu.com/community/IptablesHowTo
http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/


26 jul 2010

Los niños de hoy

Los niños de hoy en día pasan mucho tiempo a las pantallas, algo que los niños de los años 60 apenas y tenían oportunidad de poseer.
Celulares, computadoras, videojuegos portátiles, televisores, etc. Todo a un precio más ecónimico cada vez y con mayor capacidad de procesamiento.
Estos niños aprenden a mandar mensajes de texto y escribir en el ordenador antes de cumplir un par de años. ¿Será que en el futuro los niños adquirirán el conocimiento que antes alcanzabamos penosamente a los 12 años? No lo creo, pero el día de hoy ya pocas cosas me sorprenden.

1 ago 2009

Socket client, wirte and read

How a Java Socket write and read?
echoSocket = new Socket("taranis", 7);
out = new PrintWriter(echoSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(
echoSocket.getInputStream()));

The second statement gets the socket's output stream and opens a PrintWriter on it. Similarly, the third statement gets the socket's input stream and opens a BufferedReader on it. The example uses readers and writers so that it can write Unicode characters over the socket.

To send data through the socket to the server, EchoClient simply needs to write to the PrintWriter. To get the server's response, EchoClient reads from the BufferedReader. The rest of the program achieves this.

RSA4WS and WASCE 2.1 integration

How do I do to start a WASCE server from RSA4WS 753?

Pre-Req:
  • IM 1.3.1,
  • RSA4WS 7.5.x installed with default options,
  • WASCE 2.1 (for this example, can be different) installed, you will need the admin user and password.
  1. In RSA4WS, you may need to use the Windows-Preferences dialog, and then in the General-Capabilities option, select the Web Developer options.
  2. Go to Windows-Show View, write Servers in the textbox.
  3. Select Servers.
  4. In the panel, right-click, then New-Server.
  5. If you do not see the WASCE 2.1 or the server that you have installed, you will need to go to this site and http://download.boulder.ibm.com/ibmdl/pub/software/websphere/wasce/updates/ and get the integratetion files. You will use Help-Software Updates and that address to install it, or if you download the files, point to the local folder with it.
  6. Once the installation complete, try again with the New-Server menu. You will need to indicate the folder where WAS is installed.
  7. Use the user and password to fill the panels.
  8. Press finsh, the server should be shown into the servers list.

20 jul 2009

XML XPath with DOM

I was searching for a good tutorial about XML Xpath and I found this one:

http://www.w3schools.com/dom/default.asp

I really liked, because it has a lot of example about all.
Enlace

18 jul 2009

JDBC algoritms

Where to find jdbc examples of almost everything that can be done with that framework:

http://www.roseindia.net/jdbc/jdbc-mysql/index.shtml

JFrame: two ways to close a window

Two way to make a windows that can be closed created with JFrame .
JFrame window= new JFrame("Test");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

or

window.addWindowListener(new WindowAdapter(){
@Override
public void windowClosed(WindowEvent e) {
System.exit(0);
}
});