Reverting to a different version using subversion is a relatively easy procedure. I had a problem with our project with regards to a colleague commiting to the SVN and creating a lot of errors. This was fixed by reverting the SVN repository to a previous version, checking out his code into a separate directory and merging the files using winmerge.
This is the state of the project before the revert:
The first step is to identify the current revision number and make sure that we have the latest version on the server. To do this, we need to execute the following command:
svn update
In this example, it is revision 9.
The next step, is to actually merge to the previous version. In this example, we want to revert to revision 8. To do this, we execute the following command from within the root working directory:
svn merge -r 9:8 ./
We then need to commit these changes, and we are ready to carry on developing! To commit, execute the following command:
svn commit ./ -m 'reverted'
And that’s it! Here is the result after the revert:
For those that would like to see the whole process, here it is:
After a change in our database today, one of the columns that we use was marked as not mandatory.
This is normally not a problem, as we just open up the EO and uncheck the mandatory flag. Once I ran the application and filled in the form though, I started getting the error: Attribute <attribute_name> in <app_module>.<vo_name> is required.
After checking the View Object, I saw that it was reflecting the changes I had made in the Entity Object. I checked the XML and I saw what the problem was:
Required Flag inside View Object XML
After removing this line, I could insert blank items into that column. No more errors!
After re-syncing my entities with the database, I started running getting this error when I ran my application.
The problem was that after the sync, the package prefixes that I had given for the associations and entities had been lost within the Application Module and Entity Objects.
To solve this issue, open the files and view the xml. If there is a problem in that file, there will be an error warning within JDeveloper.
Valid XML will appear as follows:
Valid XML within an Entity Object
Invalid XML will appear as follows:
Invalid XML within an Entity Object
If there is no indicator, wait for JDeveloper to parse the XML.
Prepend all references to associations and entity objects with the package prefix that describes their location.
For example:
The first step is to create your business components. I will be basing this off of the HR schema, using the employees table.
1) Enter your database details:
2) Click OK.
3) Click OK and shuttle across EMPLOYEES and DEPARTMENTS.
4) Shuttle across the Entity-based View Objects.
5) Add it to your Application Module and click Finish.
6) Open up your Employees_VO, and click the “+” on View Criteria.
7) Click on Add Item, choose ManagerId as the Attribute and choose “Is Blank” for the Operator. Name the View Criteria to something useful (isManager).
8) Open up your AppModule, shuttle the View Objects already there out, and shuttle in Employees with a child object of the Employee View Object. Tip: rename your Data Controls here to make it easier to identify later. I named the objects topManager and employee.
9) Choose the root Employee View Object (named topManager if you renamed), then click Edit… Shuttle across the isManager View Criteria.
10) Drag the topManager Data Control onto a page, and select Tree -> ADF Tree.. When asked for the binding details, shuttle across FirstName and Lastname. As the second level, which can be accessed by pressing the “+” button, select Employees.
11) The bindings should look as follows:
12) If you run the page now, and expand some of the nodes, you should see the following:
This is how to build a multi-leveled tree based off a single View Object.
ADF Recursive Tree: Master Detail-Type form
The remainder of this tutorial will detail how to push the selected node into another Data Control, and to show detail in another component, like a form. This emulates a “master detail” type component.
13) Create a new View Link for the connection between the Employees_VO and the Departments_VO. By default, when ADF creates the link, it creates the relationship as 0..1 to * between Employees and Departments, when it should be * to 1. This is because many employees can belong to 1 department, but 1 employee cannot belong to many departments.
To create a new View Link, right click on your model package, and choose “New View Link…”, name it appropriately (I named it EmpDepCustomFK1). Change the cardinality to many-to-one, then select DepartmentId under Employees as the Source Attribute, and select DepartmentId under Departments as the Destination Attribute. Then click Add.
14) Open your Application Model, and send across an instance of the Employees_VO and an instance of Departments_VO as a child, using the custom View Link that we just created.
15) Click on the “Bindings” tab of the page that the tree was placed on. Click the “+” in the Executables block, and select “iterator”.
16) Choose the newly added Employees Data Control.
17) Drag the Departments1 Data Control onto the page as a form.
18) Go to the Bindings tab again, and edit the topManager binding to edit the tree bindings. Expand the Target Data Source section, and click EL Picker. In the window that pops up, expand “ADF Bindings” -> bindings and choose the newly created iterator. Click OK.
19) Click on the form, and click the drop-down arrow for “PartialTriggers”, then click edit. Find your tree component, and shuttle it across. This will refresh the form whenever a new node is selected. Click OK.
20) Run your new app!
You now have a recursive Tree with a form that updates whenever you click, using only bindings!
This is a quick guide to convert .vdi (VirtualBox) files to .img files and how you convert .img files to .vdi (VirtualBox) files.
To convert a .vdi file to a .img file, you can use these easy steps:
.vdi to .img
Windows
Open up command prompt (click start, then type/click run)
Issue the following command:
VBoxManage clonehd <nameOfOriginalVDI>.vdi <nameOfNewImage>.img --format RAW
Wait for the clone to finish, and presto! You have an image file.
Note: When you do convert a .vdi to a .img, remember that the .img file will be the maximum size that you set your .vdi to grow to.
If VBoxManage is not recognized, navigate to the install directory of VirtualBox or add the install direction to your path.
Linux
The process for conversion is the same on Linux as on Windows.
.img to .vdi
Windows
Open up command prompt (click start, then type/click run)
Wait for the conversion process, and you once again have a lean, trim .vdi!
Note: When converting a .img to a .vdi, the .vdi will shrink in size to accommodate the contents of the VM only.
If VBoxManage is not recognized, navigate to the install directory of VirtualBox or add the install direction to your path.
Linux
The process for conversion is the same on Linux as on Windows.
I hope this helps some of you out there in the deep, dark recesses of the blogosphere!