Projects:Image Reference BLOB
Contents |
Implement new type of Image Reference - Functional Specifications
Overview
Purpose
The purpose of this project is to implement a new type of Image Reference, which has two key properties:
- Generated windows can contain fields of this kind of reference, and the image is displayed in the window when the user views it.
- The user can upload the image through the Openbravo User Interface when editing records, can re-upload a new image if he wants to change it, and can also delete the image.
Functional Requirements
Business process definition
- Developers should be able to select the new reference when creating new fields
- The image should be displayed in the window when the user is in editing view
- The user should be able to upload a new image through the user interface, re-upload an image when the image needs to be changed, and delete it
Functional requirements based on business processes
Num | Requirement | Importance | Status |
1.1 | Openbravo developers can define new fields using the new image reference | Must Have | |
1.2 | Openbravo users can upload new images through the user interface, can re-upload them to change them, and can delete them, while working with a generated window in editing view | Must Have |
User Interface Mockups
A field of image BLOB type reference:
This is the window that opens if the user clicks the image field:
Open Discussion Items
- None
Closed Discussion Items
- None
Testcases
Add Image Reference BLOB field to an existing window
Steps to execute:
- Add a new database column for the image field to the c_bpartner table
- ALTER table c_bpartner add column image_id varchar(32) references ad_image(ad_image_id);
- Login into openbravo
- Switch to System Administrator role
- Set module core to in development
- Goto Application Dictionary -> Tables and Columns
- Goto the record: 'Business Partner'
- Click the button 'Create Columns from DB' and confirm process in the popup
- The process should finish and display 'Created 1'
- Goto to 'Columns' tab of this record
- Navigate to the record with the 'DB Column Name' 'Image_ID'
- Change its reference to 'Image BLOB' and save changed record
- Goto Application dictionary -> Windows, Tabs & Fields
- Navigate to the record 'Business Partner'
- Navigate to its tab 'Business Partner'
- Open its tab: Fields
- Click new record
- Enter name: Image
- Select column: Image_ID
- Save new record and logout
- Recompile the 'Business partner' window and redeploy changes to tomcat
- Login into openbravo
- Switch role to Openbravo Admin
- Goto Masterdata Management -> Business Partner
- Check that the window has a new column for the Image reference and does display the picture for 'no image'.
- Check that when clicking on the 'no image' picture the 'Image Selector' is opened
- The selector should not display an image
Upload a new image to a record not having an image
Steps to execute:
- Go to Masterdata Management -> Business Partner
- Navigate to the first record
- Click on the 'no image' picture of the new field to open the 'Image Selector' popup
- Click on browse and select an png-type image from your system in the file browse dialog
- Click the upload button
- The image selector popup should automatically close and the 'Business Partner' record should now display the uploaded image in the new field
- Click save to save the modified business partner record
Replace an existing image
- Go to MasterData Management -> Business Partner
- Navigate to the record which has the image attached
- Click on the displayed image for the new field to open the 'Image Selector' popup
- Check that the image selector does display the image and has a 'Delete' button showing next to it
- Click browse and select a different png-type image from your system in the file browse dialog
- Click Upload
- The image selector popup should automatically close and the business partner record should now display the newly uploaded image.
- Click save to save the modified business partner record
- Go to another window (Masterdata Management -> Product)
- Go back to the 'Business Partner' window
- The business partner record should still display the newly uploaded image
Delete an existing image
- Go to MasterData Management -> Business Partner
- Navigate to the record which has the image attached
- Click on the displayed image for the new field to open the 'Image Selector' popup
- Check that the image selector does display the image and has a 'Delete' button showing next to it
- Click the delete button
- The image selector popup should automatically close and the business partner record should now show the picture for 'no image'
- Click save to save the changes business partner record
- Go to another window (Masterdata Management -> Product)
- Go back to the 'Business Partner' window
- The business partner record should still display the picture for 'no image'
Check that Export Client / Import Client preserve images
- Go to General Setup -> Export Client
- Select the client you did the tests in
- Click OK
- Check that a file ${source.path}/referencedata/client_data.xml was created
- Move the file in the referencedata/importclient folder
- Switch role to System Administrator
- Go to General Setup -> Client -> Import Client
- enter a new name for the client (i.e. newtest)
- Click OK to import the client
- Relogin and switch role to 'newtest admin'
- Go to Masterdata Management -> Business Partner
- Navigate to the Record which has the image attached
- Check that the uploaded image is present in the new field