martes, abril 13, 2010

Utilizando Campos tipo BLOBs en RPG con Java, VFP o Net.


Tomado de: 

http://wiki.gxtechnical.com/commwiki/servlet/hwiki?Using+BLOBs+in+RPG+and+Java+modelsEng,

Resumen de la Solución

Para ello debemos crear una KB (base de conocimiento) con el Generador Java, Net o VFP, ya que estos generadores son los que permiten almacenar imagenes, dentro de una tabla.
Esta base de datos dentro del ISERIES se creará como una colección no soportada por el ambiente pantalla verde, solo podemos revisar los datos con sentencias SQL.
  
En la grafica siguiente nos indica como seria la soucion para el caso de Empleados.


img/wiki_up//kbs and dbs.jpg


 

La Base de Datos Main sera creada con el generador RPG, y la Base de Datos Secondary sera creada con el generador Java, Net o VFP.
Para el caso no se requiere que el modelo en RPG accesar al modelo en Java, Net o VFP.


Detalle

Para el caso se descargo una KB desde el gxopen estas dos KB estaban en la version GX8, se acomodo a nuestra realidad para que se puede ver como solucion viable.


Secondary KB

En esta KB se creara una transaccion en cuya estructra debe constar un atributo BLOB, su clave principal puede ser un autonumerico, lo que facilitaria en gran medida su codificacion de imagenes.
Con esta KB

In the previous picture there is a "EmployeesImg" transaction with the following structure:

EmployeeImgId*
EmployeeImgPhoto - atributo blob


Main KB

This KB has RPG as the default/reorg generator and Java as a secondary generator.
It's the KB that has all the structures and generates all the objects of the Human Resources application.

To be more specific, the obejects to solve the example are:

DataView to the table defined in the secondary KB

EmpImgId*
EmppImgPhoto - atributo blob

Employees transation

EmpId*
EmpName
EmpImgId 
EmpImgPhoto

The attributes EmpImgId and EmpImgPhoto were added to the employees transaction.

A sample of use could be a report of the employees including the relevant photo.
In this case, the code could be as follows:

for each                            // for each employee (table managed in main KB)
    &Photo=loadbitmap(EmpImgPhoto)   // loading the employee's photo (blob). It's accessing using the DV 
    print employee                  // printing (name, id, photo, etc)
endfor


In other words, the report will navigate the "Employees" and will perform a join with the "EmployeesImg" table to get the relevant image.

As the solution "add an attribute to the table" it is not possible, then the solution becomes to "add a table with that attribute".

NOTE: It is important to emphasize that at database level a relation N - 1 between Employees and EmployeesImg is established, when in fact the relation is 1 - 1.
This must be controlled by code, that is to say, it should not exist more than one employee pointing to the same image.

How to insert a new employe?
It depends on the interface required.
There are many possibilities:

  • set Nulls property to Yes for EmpImgId in the Employees transaction and call another transaction after the insert.
  • use parallel transactions that do not have foreign key so that, even a RPG program can insert a new employee.
  • in GeneXus 9.0 we have an update rule that could solve the problem more information about Update rule

It does not seem to be so complex, the thing is to find the best option that suits your needs. In addition, we will mention some variations of the solution later on this document.

How to delete an employee?
Very similar to the insert, when deleting an employee a procedure should be called in order to delete the relevant record on the EmployeesImg table.


Variations

The solution at structural level allows many variations.

For instance, maintaining the table of employees like it is but adding a new table that establishes the relation.

Result:


EMPLOYEES
EmployeeId*
EmployeeName

EMPLOYEEIMG
EmpImgId*
EmpImgPhoto


and the following transacton is added


EMPLOYEE2
EmpId*
EmpImgId*


In this case the functionality Filters As Hint included in GeneXus 9.0 can be useful.

Another possible variation is that there is not any relation between the tables. In this case the structures will be as follows:


EMPLOYEES
EmployeeId*
EmployeeName

EMPLOYEEIMG
EmpImgId*
EmpImgPhoto



there is no relation between them. If you need to establish a relation, it must be by coding it.
In the case of the report, the code would be as follows:


for each                            // for each employee (table managed in main KB)
    &EmployeeId=EmployeeId          // saving the employeeId
    &Photo=nullvalue(&Photo)        // initializing with null the employeePhoto
    for each                        // for each image (accessing the table defined in the secondary KB)
        where EmpImgId=&EmployeeId  // filtering using the employeeId saved previously
        &Photo=loadbitmap(EmpImgPhoto)// loading the employee's photo (blob)
    endfor
    print employee                  // printing (name, id, photo, etc)
endfor


There are more variations. However, all of them arrive to the same idea "extend one table defining a 1-1 table and not adding attributes".

Maybe the first solutions when establishing a 1->N or N->1 relation define a more approximate structure to the reality and the last option, when not definf relations at all, can bring more complexity when coding the objects that require the relation..

Problema al compilar con Genexus 9 y Tomcat.

NMAKE: fatal error U1077: 'copy' return code '0x1'

Significa que esta faltando de crear una carpeta en el tomcat.

Esta estructura se debe tener en la carpeta webapps, respetando las mayusculas y minusculas.

webapps
             miaplicacion
                              images
                              WEB-INF
                                              classes
                                              lib
Si falta una de estas carpetas nos origina el error citado en la parte superior.



                             

Comparación entre CMS conocidos.

Tomado de:



Last Updated
10/2/2007
2/26/2009
1/11/2009
10/14/2009

System Requirements
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Application Server
Apache
Apache
CGI
Apache
Approximate Cost

Free
Free
Free
Database
MySQL
MySQL
MySQL
MySQL
License
Closed Source
Open Source
Open Source
Open Source
Operating System
Platform Independent
Platform Independent
Platform Independent
Platform Independent
Programming Language
PHP
PHP
PHP
PHP
Root Access
No
No
No
No
Shell Access
No
No
No
No
Web Server
Apache
Apache
Apache
Apache

Security
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Audit Trail
Yes
Yes
No
Yes
Captcha
No
Free Add On
Free Add On
Free Add On
Content Approval
Yes
Yes
Yes
Yes
Email Verification
No
Yes
Yes
Yes
Granular Privileges
Yes
Yes
No
Yes
Kerberos Authentication
No
No
No
Free Add On
LDAP Authentication
No
Free Add On
Yes
Free Add On
Login History
Yes
Yes
Yes
Yes
NIS Authentication
No
No
No
Free Add On
NTLM Authentication
No
Free Add On
No
Free Add On
Pluggable Authentication
No
Yes
Yes
Free Add On
Problem Notification
Yes
No
No
Yes
Sandbox
Yes
No
No
Yes
Session Management
No
Yes
Yes
Yes
SMB Authentication
No
No
No
Free Add On
SSL Compatible
Yes
Yes
Yes
Yes
SSL Logins
Yes
No
Yes
Yes
SSL Pages
No
No
Yes
Free Add On
Versioning
Yes
Yes
Free Add On
Yes

Support
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Certification Program
Limited
No
No
Yes
Code Skeletons
Yes
Yes
No
Free Add On
Commercial Manuals
Limited
Yes
Yes
Yes
Commercial Support
Yes
Yes
Yes
Yes
Commercial Training
Yes
Yes
Yes
Yes
Developer Community
Yes
Yes
Yes
Yes
Online Help
No
Yes
Yes
Yes
Pluggable API
Yes
Yes
Yes
Yes
Professional Hosting
Limited
Yes
Yes
Yes
Professional Services
Yes
Yes
Yes
Yes
Public Forum
Yes
Yes
Yes
Yes
Public Mailing List
No
Yes
No
Yes
Test Framework
No
Free Add On
Yes
Free Add On
Third-Party Developers
Yes
Yes
Yes
Yes
Users Conference
No
Yes
Yes
Yes

Ease of Use
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Drag-N-Drop Content
Yes
Free Add On
No
Free Add On
Email To Discussion
No
Free Add On
Free Add On
Free Add On
Friendly URLs
No
Yes
Yes
Yes
Image Resizing
Yes
Free Add On
Yes
Yes
Macro Language
Limited
Free Add On
Yes
Yes
Mass Upload
Yes
Free Add On
Yes
Free Add On
Prototyping
No
Limited
Yes
Free Add On
Server Page Language
Yes
Yes
Yes
Yes
Site Setup Wizard
No
Limited
No
Free Add On
Spell Checker
No
Free Add On
No
Yes
Style Wizard
No
Limited
No
Yes
Subscriptions
No
Free Add On
Costs Extra
Free Add On
Template Language
Yes
Limited
Yes
Yes
UI Levels
Yes
No
Yes
Yes
Undo
Limited
Limited
No
Yes
WYSIWYG Editor
Yes
Free Add On
Yes
Yes
Zip Archives
No
No
No
Free Add On

Performance
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Advanced Caching
Yes
Yes
Yes
Yes
Database Replication
Costs Extra
Limited
No
Free Add On
Load Balancing
Limited
Yes
Yes
Yes
Page Caching
Yes
Yes
Yes
Yes
Static Content Export
No
No
No
Free Add On

Management
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Advertising Management
No
Free Add On
Yes
Free Add On
Asset Management
Yes
Yes
Yes
Yes
Clipboard
Yes
No
No
Yes
Content Scheduling
Yes
Free Add On
Yes
Yes
Content Staging
Limited
Free Add On
No
Free Add On
Inline Administration
Yes
Yes
Yes
Yes
Online Administration
Yes
Yes
Yes
Yes
Package Deployment
Limited
No
No
Yes
Sub-sites / Roots
Yes
Yes
Yes
Yes
Themes / Skins
Limited
Yes
Yes
Yes
Trash
No
No
Yes
Free Add On
Web Statistics
Yes
Yes
Yes
Free Add On
Web-based Style/Template Management
No
Yes
Yes
Yes
Web-based Translation Management
Yes
Yes
Free Add On
Yes
Workflow Engine
Yes
Limited
No
Limited

Interoperability
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Content Syndication (RSS)
Yes
Yes
Yes
Yes
FTP Support
Yes
Limited
Yes
Yes
iCal
No
Free Add On
No
Free Add On
UTF-8 Support
Yes
Yes
Yes
Yes
WAI Compliant
No
Limited
No
Free Add On
WebDAV Support
Yes
No
No
Free Add On
XHTML Compliant
Limited
Yes
No
Yes

Flexibility
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
CGI-mode Support
Yes
Yes
Yes
Yes
Content Reuse
Yes
Limited
Yes
Yes
Extensible User Profiles
Yes
Yes
Yes
Free Add On
Interface Localization
Yes
Yes
Yes
Yes
Metadata
Limited
Yes
Yes
Yes
Multi-lingual Content
Yes
Yes
Free Add On
Yes
Multi-lingual Content Integration
Yes
Free Add On
Free Add On
Yes
Multi-Site Deployment
Yes
Yes
Free Add On
Yes
URL Rewriting
Limited
Yes
Yes
Yes

Built-in Applications
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Blog
Limited
Yes
Yes
Free Add On
Chat
No
Free Add On
Free Add On
Free Add On
Classifieds
No
Free Add On
Free Add On
Free Add On
Contact Management
No
Free Add On
Yes
Free Add On
Data Entry
Yes
Free Add On
Free Add On
Free Add On
Database Reports
Yes
No
Free Add On
Free Add On
Discussion / Forum
No
Yes
Free Add On
Free Add On
Document Management
No
Limited
Free Add On
Free Add On
Events Calendar
No
Free Add On
Free Add On
Free Add On
Events Management
No
Free Add On
Free Add On
Free Add On
Expense Reports
No
No
Free Add On
Free Add On
FAQ Management
Yes
Yes
Yes
Free Add On
File Distribution
No
Free Add On
Free Add On
Free Add On
Graphs and Charts
No
No
Free Add On
Free Add On
Groupware
No
Free Add On
Free Add On
Free Add On
Guest Book
No
Free Add On
Free Add On
Free Add On
Help Desk / Bug Reporting
No
Free Add On
Free Add On
Free Add On
HTTP Proxy
No
No
No
Free Add On
In/Out Board
No
No
No
No
Job Postings
No
Free Add On
Free Add On
Free Add On
Link Management
Yes
Free Add On
Yes
Free Add On
Mail Form
Yes
Free Add On
Yes
Yes
Matrix
Yes
No
No
Free Add On
My Page / Dashboard
No
Free Add On
No
Free Add On
Newsletter
Yes
Free Add On
Free Add On
Yes
Photo Gallery
Yes
Free Add On
Free Add On
Free Add On
Polls
Yes
Yes
Yes
Free Add On
Product Management
Yes
Free Add On
Yes
Free Add On
Project Tracking
No
Free Add On
Free Add On
Free Add On
Search Engine
Yes
Yes
Yes
Yes
Site Map
Yes
Free Add On
Free Add On
Yes
Stock Quotes
No
Free Add On
Free Add On
Free Add On
Surveys
No
Free Add On
Free Add On
Free Add On
Syndicated Content (RSS)
Yes
Yes
Yes
Free Add On
Tests / Quizzes
No
Free Add On
Free Add On
Free Add On
Time Tracking
No
Free Add On
No
Free Add On
User Contributions
Yes
Yes
Yes
Yes
Weather
No
Free Add On
Free Add On
Free Add On
Web Services Front End
No
Limited
Yes
Free Add On
Wiki
Limited
Free Add On
Free Add On
Free Add On

Commerce
+CMS Content Management System 2.0.0
Drupal 6.10
Joomla! 1.5.10
TYPO3 4.2.9
Affiliate Tracking
No
Free Add On
Free Add On
Free Add On
Inventory Management
No
Free Add On
Free Add On
Free Add On
Pluggable Payments
No
Free Add On
Free Add On
Free Add On
Pluggable Shipping
No
Free Add On
Free Add On
Free Add On
Pluggable Tax
No
Free Add On
Free Add On
Free Add On
Point of Sale
No
No
Free Add On
No
Shopping Cart
No
Free Add On
Free Add On
Free Add On
Subscriptions
No
Free Add On
Free Add On
No
Wish Lists
No
Free Add On
Free Add On
Free Add On





Last Updated
10/14/2009
6/19/2009
1/11/2009
2/26/2009

System Requirements
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Application Server
Apache
J2EE
CGI
Apache
Approximate Cost
Free
Free
Free
Free
Database
MySQL
Oracle
MySQL
MySQL
License
Open Source
Open Source
Open Source
Open Source
Operating System
Platform Independent
Platform Independent
Platform Independent
Platform Independent
Programming Language
PHP
Java
PHP
PHP
Root Access
No
No
No
No
Shell Access
No
No
No
No
Web Server
Apache
Apache
Apache
Apache

Security
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Audit Trail
Yes
Yes
No
Yes
Captcha
Free Add On
Yes
Free Add On
Free Add On
Content Approval
Yes
Yes
Yes
Yes
Email Verification
Yes
No
Yes
Yes
Granular Privileges
Yes
Yes
No
Yes
Kerberos Authentication
Free Add On
No
No
No
LDAP Authentication
Free Add On
Costs Extra
Yes
Free Add On
Login History
Yes
Yes
Yes
Yes
NIS Authentication
Free Add On
No
No
No
NTLM Authentication
Free Add On
No
No
Free Add On
Pluggable Authentication
Free Add On
Costs Extra
Yes
Yes
Problem Notification
Yes
Yes
No
No
Sandbox
Yes
Yes
No
No
Session Management
Yes
Yes
Yes
Yes
SMB Authentication
Free Add On
No
No
No
SSL Compatible
Yes
Yes
Yes
Yes
SSL Logins
Yes
Yes
Yes
No
SSL Pages
Free Add On
Yes
Yes
No
Versioning
Yes
Yes
Free Add On
Yes

Support
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Certification Program
Yes
Limited
No
No
Code Skeletons
Free Add On
Yes
No
Yes
Commercial Manuals
Yes
Yes
Yes
Yes
Commercial Support
Yes
Yes
Yes
Yes
Commercial Training
Yes
Yes
Yes
Yes
Developer Community
Yes
Yes
Yes
Yes
Online Help
Yes
Yes
Yes
Yes
Pluggable API
Yes
Yes
Yes
Yes
Professional Hosting
Yes
Limited
Yes
Yes
Professional Services
Yes
Yes
Yes
Yes
Public Forum
Yes
Yes
Yes
Yes
Public Mailing List
Yes
Yes
No
Yes
Test Framework
Free Add On
Yes
Yes
Free Add On
Third-Party Developers
Yes
Yes
Yes
Yes
Users Conference
Yes
Yes
Yes
Yes

Ease of Use
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Drag-N-Drop Content
Free Add On
Limited
No
Free Add On
Email To Discussion
Free Add On
No
Free Add On
Free Add On
Friendly URLs
Yes
Yes
Yes
Yes
Image Resizing
Yes
Yes
Yes
Free Add On
Macro Language
Yes
No
Yes
Free Add On
Mass Upload
Free Add On
Yes
Yes
Free Add On
Prototyping
Free Add On
No
Yes
Limited
Server Page Language
Yes
Yes
Yes
Yes
Site Setup Wizard
Free Add On
No
No
Limited
Spell Checker
Yes
Free Add On
No
Free Add On
Style Wizard
Yes
Free Add On
No
Limited
Subscriptions
Free Add On
Free Add On
Costs Extra
Free Add On
Template Language
Yes
Yes
Yes
Limited
UI Levels
Yes
Yes
Yes
No
Undo
Yes
Yes
No
Limited
WYSIWYG Editor
Yes
Yes
Yes
Free Add On
Zip Archives
Free Add On
Limited
No
No

Performance
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Advanced Caching
Yes
Yes
Yes
Yes
Database Replication
Free Add On
Costs Extra
No
Limited
Load Balancing
Yes
Costs Extra
Yes
Yes
Page Caching
Yes
Yes
Yes
Yes
Static Content Export
Free Add On
Yes
No
No

Management
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Advertising Management
Free Add On
No
Yes
Free Add On
Asset Management
Yes
Yes
Yes
Yes
Clipboard
Yes
No
No
No
Content Scheduling
Yes
Yes
Yes
Free Add On
Content Staging
Free Add On
Yes
No
Free Add On
Inline Administration
Yes
Yes
Yes
Yes
Online Administration
Yes
Yes
Yes
Yes
Package Deployment
Yes
Limited
No
No
Sub-sites / Roots
Yes
Yes
Yes
Yes
Themes / Skins
Yes
No
Yes
Yes
Trash
Free Add On
Yes
Yes
No
Web Statistics
Free Add On
No
Yes
Yes
Web-based Style/Template Management
Yes
Yes
Yes
Yes
Web-based Translation Management
Yes
Limited
Free Add On
Yes
Workflow Engine
Limited
Free Add On
No
Limited

Interoperability
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Content Syndication (RSS)
Yes
Free Add On
Yes
Yes
FTP Support
Yes
No
Yes
Limited
iCal
Free Add On
No
No
Free Add On
UTF-8 Support
Yes
Yes
Yes
Yes
WAI Compliant
Free Add On
Limited
No
Limited
WebDAV Support
Free Add On
Yes
No
No
XHTML Compliant
Yes
Yes
No
Yes

Flexibility
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
CGI-mode Support
Yes
No
Yes
Yes
Content Reuse
Yes
Yes
Yes
Limited
Extensible User Profiles
Free Add On
Yes
Yes
Yes
Interface Localization
Yes
Yes
Yes
Yes
Metadata
Yes
Yes
Yes
Yes
Multi-lingual Content
Yes
Yes
Free Add On
Yes
Multi-lingual Content Integration
Yes
Yes
Free Add On
Free Add On
Multi-Site Deployment
Yes
Yes
Free Add On
Yes
URL Rewriting
Yes
Yes
Yes
Yes

Built-in Applications
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Blog
Free Add On
No
Yes
Yes
Chat
Free Add On
No
Free Add On
Free Add On
Classifieds
Free Add On
No
Free Add On
Free Add On
Contact Management
Free Add On
No
Yes
Free Add On
Data Entry
Free Add On
No
Free Add On
Free Add On
Database Reports
Free Add On
Costs Extra
Free Add On
No
Discussion / Forum
Free Add On
No
Free Add On
Yes
Document Management
Free Add On
No
Free Add On
Limited
Events Calendar
Free Add On
Free Add On
Free Add On
Free Add On
Events Management
Free Add On
Yes
Free Add On
Free Add On
Expense Reports
Free Add On
No
Free Add On
No
FAQ Management
Free Add On
Free Add On
Yes
Yes
File Distribution
Free Add On
Free Add On
Free Add On
Free Add On
Graphs and Charts
Free Add On
No
Free Add On
No
Groupware
Free Add On
No
Free Add On
Free Add On
Guest Book
Free Add On
No
Free Add On
Free Add On
Help Desk / Bug Reporting
Free Add On
No
Free Add On
Free Add On
HTTP Proxy
Free Add On
No
No
No
In/Out Board
No
No
No
No
Job Postings
Free Add On
Costs Extra
Free Add On
Free Add On
Link Management
Free Add On
Yes
Yes
Free Add On
Mail Form
Yes
Yes
Yes
Free Add On
Matrix
Free Add On
No
No
No
My Page / Dashboard
Free Add On
No
No
Free Add On
Newsletter
Yes
Free Add On
Free Add On
Free Add On
Photo Gallery
Free Add On
Yes
Free Add On
Free Add On
Polls
Free Add On
Free Add On
Yes
Yes
Product Management
Free Add On
Costs Extra
Yes
Free Add On
Project Tracking
Free Add On
No
Free Add On
Free Add On
Search Engine
Yes
Yes
Yes
Yes
Site Map
Yes
Yes
Free Add On
Free Add On
Stock Quotes
Free Add On
No
Free Add On
Free Add On
Surveys
Free Add On
Free Add On
Free Add On
Free Add On
Syndicated Content (RSS)
Free Add On
Free Add On
Yes
Yes
Tests / Quizzes
Free Add On
No
Free Add On
Free Add On
Time Tracking
Free Add On
No
No
Free Add On
User Contributions
Yes
Free Add On
Yes
Yes
Weather
Free Add On
No
Free Add On
Free Add On
Web Services Front End
Free Add On
No
Yes
Limited
Wiki
Free Add On
No
Free Add On
Free Add On

Commerce
TYPO3 4.2.9
OpenCms 7.5
Joomla! 1.5.10
Drupal 6.10
Affiliate Tracking
Free Add On
No
Free Add On
Free Add On
Inventory Management
Free Add On
No
Free Add On
Free Add On
Pluggable Payments
Free Add On
No
Free Add On
Free Add On
Pluggable Shipping
Free Add On
No
Free Add On
Free Add On
Pluggable Tax
Free Add On
No
Free Add On
Free Add On
Point of Sale
No
No
Free Add On
No
Shopping Cart
Free Add On
Free Add On
Free Add On
Free Add On
Subscriptions
No
No
Free Add On
Free Add On
Wish Lists
Free Add On
No
Free Add On
Free Add On