Git


Instalación

  1. sudo yum install git
  2. git --version

 

Uso

Clonando un repositorio.

git clone <repository-name.git>

Verificación del estatus del repositorio local, indicandonos si está sincronizado

git status

Como buena práctica, antes verificamos que nuestro repo LOCAL tenga todos los cambios en el MASTER.

git pull origin master

Se agregan todos los cambios locales al listado de los cambios por subir.

git add .

En caso de haber elimidado algunos archivos, deberemos utilizar:

git add --all

Enviamos los cambios y hacemos commit

git push origin master
git commit -m "Comentarios"

Comparto contigo algunos proyectos en https://gitahub.com/yanellyjm

Deploy to JBoss 7


This is a brief technical memory to deploy with JBoss 7, any comments or observations are welcome

REQUIREMENTS

  • To deploy with JBoos 7 requiered install and to configured the environment variables for maven 3 and Java 7

  • This is optional, you can define a goal for maven with:

<build>

    <finalName>project name</finalName>

    <plugins>

      <plugin>

         <groupId>org.apache.maven.plugins</groupId>

         <artifactId>maven-war-plugin</artifactId>

         <version>2.3</version>

         <executions>

            <execution>

               <phase>package</phase>

               <configuration>

                  <webXml>WEB-INF/web.xml</webXml>

               </configuration>

            </execution>

         </executions>

      </plugin>

   </plugins>

  </build>

INSTALLLING JBOSS 7

 

Unpackage the jboss-as-7.0.0.Final.zip in the next location

C:\Development_Tools\JBoss

Configure the JBOSS_HOME with the JBoss path

Generate war file executing the next maven command in the location where is the pom file

  • mvn clean install

 Copy the war file generated from

C:\Development_Tools\EclipseWorkspace\WebsiteServices\target

 To

 C:\Development_Tools\JBoss\jboss-as-7.0.0\jboss-as-7.0.0\standalone\deployments

Copy properties file to next location

 C:\Development_Tools\JBoss\jboss-as-7.0.0\jboss-as-7.0.0\standalone\configuration

 

Modify the standalone.xml adding next sections with proper data:

<system-properties>

        <property name=”service.endpoint.jndi.location” value=”jnp://es-jndi-dev.something.com:8180″/>

        <property name=”website.services.properties.file.location” value=”WebsiteServices.properties”/>

    </system-properties>

<subsystem xmlns=”urn:jboss:domain:datasources:1.0″>

            <datasources>

                <datasource jndi-name=”java:/OracleDS” pool-name=”OracleDS_Pool” enabled=”true” jta=”true” use-java-context=”true” use-ccm=”true”>

                    <connection-url>

                        jdbc:oracle:thin:@name.company.com:1521:WEBDEV

                    </connection-url>

                    <driver>jdbc.driver.OracleDriver

                    </driver>

<new-connection-sql>

select 1 from dual

</new-connection-sql>

<pool>

<min-pool-size>

5

</min-pool-size>

<max-pool-size>

20

</max-pool-size>

<prefill>

false

</prefill>

<use-strict-min>

true

</use-strict-min>

<flush-strategy>

FailingConnectionOnly

</flush-strategy>

</pool>

<security>

<user-name>

WEBDB

</user-name>

<password>

wRuzuf5E

</password>

</security>

<validation>

<check-valid-connection-sql>

select 1 from dual

</check-valid-connection-sql>

<validate-on-match>

false

</validate-on-match>

<background-validation>

false

</background-validation>

<useFastFail>

false

</useFastFail>

</validation>

<timeout>

<idle-timeout-minutes>

45

</idle-timeout-minutes>

<query-timeout>

600

</query-timeout>

</timeout>

<statement>

<track-statements>

TRUE

</track-statements>

</statement>

</datasource>

 

 Finally you can run the bat for JBoss 7.0 with the following command  in this location

C:\Development_Tools\JBoss\jboss-as-7.0.0\jboss-as-7.0.0\bin

 Encrypting datasource password

 export  JBOSS_HOME=/apps/jboss/jboss-as

export CLASSPATH=$JBOSS_HOME/modules/org/picketbox/main/picketbox

-4.0.7.Final.jar:$JBOSS_HOME/modules/org/jboss/logging/main/jboss-logging-3.1.0.GA.jar:$CLASSPATH

java  org.picketbox.datasource.security.SecureIdentityLoginModule  mypassword

Encoded password: -50fa369660ea3144207a6dde3d75616de44

 Define the application policy for the corresponding datasource  

<application-policy name = “WebDBPassword”>

<authentication>

<login-module code = “org.jboss.resource.security.SecureIdentityLoginModule” flag = “required”>

<module-option name = “username”>WEBDB</module-option>

<module-option name = “password”>-50ba369694jfk40la3144207a6df87216de44</module-option>

<module-option name =“managedConnectionFactoryName”>

jboss.jca:service=LocalTxCM,name=OracleDS

</module-option>

</login-module>

</authentication>

</application-policy>

Rendering Dinamic Images [ZK]


Contexto. App Java con ZK, con una BD http://www.postgresql.org/ . He aquí el código,  cualquier duda o comentario con gusto, felices compilaciones!!

LOS CÓDIGOS

SQL

select encode(cattema_banner_header ,''base64'') as bheader, 
 cattema_extc as ext FROM CAT_TEMAS
 WHERE cattema_id = (
select cattema_id 
 from repos_delegacionmunicipio 
 where edo_cve = ' || EDO || ' 
 and mun_cve = ' || MUN || '
)') as p ( bheader text, cattema_extc text);

DAO

StringBuffer query = new StringBuffer();
query.append(“select bheader, cattema_extc from db_gev_temaencabezado_encode( “);
query.append(String.valueOf(edoCve).concat(“, “).concat(String.valueOf(munCve)) );
query.append(” )as p ( bheader text, cattema_extc text)”);
Session session = getSession();
session.beginTransaction();
SQLQuery sqlQuery = session.createSQLQuery(query.toString());
List<HeaderEncodeDTO> result = sqlQuery.setResultTransformer(Transformers.aliasToBean(HeaderEncodeDTO.class)).list();
session.getTransaction().commit();
session.close();
if( result != null && result.size() > 0 ) {

image = (Image)result.get(0); 

arrayBytes = Base64.decode( cadena );

}

BUSISNESS CLASS

image es un Array de bytes.

InputStream mediais = new ByteArrayInputStream( image );

media = new AMedia( fileName, extension, contentType, mediais );

CONTROLLER

Binding de componetes:

window.appendChild( panel );

panel.appendChild( panelChild );

pc.appendChild( frameX );

CONTROLLER

<window id=”win”  border=”none” apply=”${encabezadoControlador}” >

                                    <panel id=”panel”>
                                          <panelchildren >
                                                       <iframe id=”frame/>
                                          </panelchildren>
                                    </panel>
                                </window>

APP CONTEXT

appContext-controler.xml:

<bean id=”encabezadoControlador” class=”FOO.controler.EncabezadoControlador” singleton=”false”>
                         <property name=”loginDAO” ref=”loginDAO” />
</bean>

Read More »