At line 135 changed 1 line. |
Primerament, crearemos la interface PersonManager.java en el directorio src/service/**/service directory y anadiremos las cuatro operaciones basicas (ALAS) que son necesarias para cualquier clase que implemente esta interface. |
Primeramente, crearemos la interface PersonManager.java en el directorio src/service/**/service directory y anadiremos las cuatro operaciones basicas (ALAS) que son necesarias para cualquier clase que implemente esta interface. |
At line 138 changed 1 line. |
;:%%(color: blue)''As usual, I usually duplicate (open → save as) an existing file (i.e. UserManager.java).''%% |
;:%%(color: blue)''Como de costumbre, normalment duplico (open → save as) una clase existente (i.e. UserManager.java).''%% |
At line 155 changed 1 line. |
Now let's create a PersonManagerImpl class that implements the methods in PersonManager. To do this, create a new class in src/service/**/service/impl and name it PersonManagerImpl.java. It should extend BaseManager and implement PersonManager. |
Ahora crearemos la clase PersonManagerImpl que implementa los metodos de la interface PersonManager. Para ello, creamos una nueva clase |
PersonManagerImpl.java en el subdirectorio src/service/**/service/impl. Debe heredar de la clase BaseManager e implementar PersonManager. |
At line 186 changed 1 line. |
One thing to note is the {{setPersonDao()}} method. This is used by Spring to bind the PersonDao to this Manager. This is configured in the applicationContext-service.xml file. We'll get to configuring that in Step 3[3]. You should be able to compile everything now using "ant compile-service". |
Un aspecto a notar es el metodo {{setPersonDao()}} el cual es usado para "enganchar" la clase PersonDao a este Manager. Esto es configurado en el fichero applicationContext-service.xml. Configuraremos este aspecto en el paso 3[3]. Ahora todo debe compilar sin problemas usando la linea de comandos "ant compile-service". |
At line 188 changed 1 line. |
Now you need to edit Spring's config file for our services layer so it will know about this new Manager. |
Ahora necesita editar el fichero de configuracion de Spring para que la capa de servicios se actualice con la recien creada clase Manager. |
At line 190 changed 1 line. |
!!Configure Spring for this Manager and Transactions [#3] |
!!Configurar Spring para este Manager y gestion de transacciones [#3] |
At line 192 changed 2 lines. |
To notify Spring of this our PersonManager interface and its implementation, open the src/service/**/service/applicationContext-service.xml file. In here, you should see a commented out definition for the "personManager" bean. Uncomment this, or add the following to the bottom of this file. |
|
Para notificar a Spring de la presencia de la interface PersonManager y su implementacion, editemos el fichero src/service/**/service/applicationContext-service.xml file. Alli debe ver la definicion del bean "personManager" comentada. Elimine el comentario o anada lo siguiente al final del fichero. |
At line 203 changed 1 line. |
The "parent" attribute refers to a bean definition for a [TransactionProxyFactoryBean|http://www.springframework.org/docs/api/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.html] that has all the basic transaction attributes set. |
El atributo "parent" se refiere a la definicion de bean para [TransactionProxyFactoryBean|http://www.springframework.org/docs/api/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.html]que contiene todos los atributos basicos para la gestion de transacciones. |
At line 206 changed 1 line. |
!!Run the ManagerTest [#4] |
!!Ejecute la clase ManagerTest [#4] |
At line 208 changed 1 line. |
Save all your edited files and try running __ant test-service -Dtestcase=PersonManager__. |
Guarde los ficheros editados y ejecute __ant test-service -Dtestcase=PersonManager__. |
At line 216 changed 1 line. |
The files that were modified and added to this point are [available for download|https://appfuse.dev.java.net/files/documents/1397/7484/appfuse-tutorial-managers-1.6.zip]. |
Los ficheros que fueron modificados y anadidos en este tutorial se encuentran en [available for download|https://appfuse.dev.java.net/files/documents/1397/7484/appfuse-tutorial-managers-1.6.zip]. |
At line 218 changed 1 line. |
''Next Up:'' __Part III:__ [Creating Actions and JSPs|CreateActions] - A HowTo for creating Actions and JSPs in the AppFuse architecture. |
''Siguiente etapa:'' __Parte III:__ [Creacion de Actions y JSPs|CreateActions] - Como crear Actions y JSPs en la arquitectura de AppFuse. |