Wednesday, October 16, 2013

Programmatically creating dynamic multi levels in hierarchy Viewer Component by ADF Oracle.



I want to share you  to how are deploy  dynamic multi  levels  in  hierarchy Viewer Component  using ArrayList class,you can implement normal  hierarchy Viewer  or tree or treeTable by reading oracle documentation.

Actually the  hierarchy Viewer Component show nodes according to the relation between  tables,so if the relation  between emp and dept table show only tow levels

We depend on arraylist class  in java.util package  to create  dynamtic treemodel which are bounded as value to hierarchyViewer Component , so we can create  mutli parent nodes and mutli child  nodes  as in the below picture.


I deploy one project which show all links in determined URL as tree, i depend on json file jar which fetch html code and get all links and pictures  for URL..

In this issue i create recursive function which fetch all the links in URL and insert every link in one hierarchy Viewer Item object in current arraylist and call same function with first one link from current arraylist as parameter . by this  function i create  multi  array list as tree .


public void Serach(ArrayList parent, String url, int k) 
{ Document docWebSite; 
try { //check if Current URL Vaild 
// limited the Recusive to 3 three 
if ((k == 3) || (!isValidURL(url))) 
return; 
//fetch current web site as data 
docWebSite = Jsoup.connect(url).get(); 
// get all links 
Elements links = docWebSite.select("a[href]"); 
for (Element link : links) { 
hierarchyViewerItem node1 = 
new hierarchyViewerItem(link.text(), link.attr("href"), 
docWebSite.body().html()); 
parent.add(node1); 
ArrayList node1Children = 
new ArrayList(); 
node1.setChildren(node1Children); 
// Recusive Function 
Serach(node1Children, link.attr("href"), k + 1); 
} catch (IOException e) { 
e.printStackTrace(); 





Th project show the URL links in hierarchy Viewer Component ,every link represents one node. also show all images in URL  in carousel Component.





The sample can be downloaded from 
             1.ADF Project.
             2.JSoup jar file.
            


To impove this project , we need add image Component  in  hierarchy Viewer Component  which has web page as picture not html code , so  if anyone has experince how we convert web page to picture in ADF , you can write his comments about that.



Regards
Sameer.alwosaby

















   

Saturday, June 15, 2013

How to set locale for af:chooseDate at runtime?




af:chooseDate Component depend on the region and languages options in the client , so sometime the user need to change that according to his  language, we discuss  how we can set date according to selectedlanguage .


1.by Calendar.getAvailableLocales() function the af:selectOneChoice  display  all available countries   ,first value is the default country.

2.On valueChangeListener event, ChangLocale function will be change default locale to selected country.

FacesContext context = FacesContext.getCurrentInstance
) context.getViewRoot().setLocale(lang




3.af:chooseDate  will revalidate when the user change default country .we set partialTriggers  to countries combox id .





Thanks &Regards
Sameer

Saturday, May 25, 2013

Project Chat using ADF ORACLE And Java Message Service (JMS)




I develop one ADF Project chat and want to share all my friends, so please any one has any comments, kindly can you share me.

·        This project use JMS Server to store messages, You see how       configure JMS on Weblogic .
·         There are one event "OnMessage”, this event will fire when message come from server.
·        All messages are saved in array list object, the list view component fetch display messages.
·        execute function called by poll component every 5 second
·        When user press on button "Send", it will call add function to send message to server and store in server.
·        There is one css file which draws bubble on panelGrouplayout.


I already uploaded this project, you can anyone download and update as he see and upload again but should be configure JMS on server.



    link to download 
          





                
Thamk
Sameer















Friday, May 17, 2013

Configuration JavaFX on Jdeveloper11g




In this post, we discuss how we can set JavaFX on jdeveloper11g, so there are need download and install the latest JDK 6  or above and JavaFX packages and make sure you do that.
.

Step 1:
we create new JavaSE version  from application ->Default project properties --> libraries and classpath--> change button -->new.-->browse.




Step 2:
We can go the JavaSE path and from bin Floder select java.exe file .






Step 3:
 After create java project and just only press right click  and choose Project properties-- > libraries and class path--> change > select  Javafx .

.
  






Step4:
When create java class and select Applaction (javafx.Applation)  class as parent . .


Step5:
You can write your code  .




Regards
Sameeralwosaby


Tuesday, May 14, 2013

Generate Barcode on JDeveloper ADF



The barcode Teleology  become of great importance in many areas  on the world, so we discuss in this blog how we can generate the barcode on ADF11g

Firstly we must add one jar file "barcode4j-2.1.jar" to project class path, which has Main class to generate barcode.



Second : we create one servlet class  which receive barcoder as parameter from image component  in the page when we press "generate barcode"  button ,so the generated barcode will convert to  Array of Bytes .
 
now you can change partial trigger  for image component to button  and set true in auto submit property in the button.
 



Now when click on the generate barcode button, the value for barcode text #{pageFlowScope.value }  will be send ImageServlet .



BarcodeOnADF project



Regards
Sameer.alwosaby