-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodesearch.sql
1378 lines (1349 loc) · 43.7 KB
/
codesearch.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 08, 2012 at 05:11 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `codesearch`
--
-- --------------------------------------------------------
--
-- Table structure for table `codepattern`
--
CREATE TABLE IF NOT EXISTS `codepattern` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`content` longtext NOT NULL,
`type` varchar(25) NOT NULL,
`summary` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=174 ;
--
-- Dumping data for table `codepattern`
--
INSERT INTO `codepattern` (`id`, `title`, `content`, `type`, `summary`) VALUES
(129, 'Dynamic UI Layout Using the ADF Faces Switcher Component', 'LPoNKM5FdQk', 'VIDEO', 'Grant Ronald shows how to dynamically render layout using af:switcher. This is required when we need to change the set of components being displayed based on some factors. An af:switcher component is similiar to having a if statement in the page (A Switch statement actually, but you can make it work like an if statement). The af:switcher contains facets, each having a facetname. The facet being displayed is determined by the value held in the af:switcher component. '),
(130, 'Using af:iterator to Dynamically Render an Image', 'LxfoFuIiZ9g', 'VIDEO', 'Grant Ronald shows how to use an af:iterator component to dynamically render images on a page. An af:iterator component is like having a for loop within a page. A Collection (ArrayList) will be passed as value to the iterator and number of elements in the collection decides the number of times it iterates. This example shows how to display different number of images based on the rating of an Employee. '),
(131, 'Implementing Sequences in an ADF Application', 'QIkwwdzYmJE', 'VIDEO', 'Grant Ronald shows how to assign unique id to primary key attribute using DBSequence. There are two ways of doing this. First way is to programmatically get a sequence number using SequenceImpl and updating the key attribute with this number. This can be implemented in the create method of EntityImpl. The second way is to defer this to the commit stage by using a database trigger. For this, the attribute type should be DBSequence, set updateable to never ,set Refresh After to Update.'),
(133, 'Programmatic PPR : Refresh a ui component programmatically', 'AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();\r\nadfFacesContext.addPartialTarget(component); // pass java binding of ui component', 'CODE', ''),
(134, 'Programmatically iterating through rows in a view object', 'fEswwpwwhoI', 'VIDEO', 'Grant Ronald shows how to programmatically iterate through the rows in a viewobject. A very simple and important technique. Its probably the most used piece of code by ADF developers to achieve various business scenarios. In this example, Grant Ronald shows how to iterate through all employees in a department and give a pay rise to each one.'),
(135, 'Using Secondary RowSetIterator to iterate rows of View Object', 'http://adfcodebits.blogspot.in/2010/04/bit-4-iterating-view-object-using.html', 'BLOG', 'If your View Object is used in the UI, then make sure you dont use the default rowsetiterator to iterate through rows. The ui iterator bindings use the default rowsetiterator. So if you use the default rowset iterator it will change row currency in the ui as well. In this blogpost Nick Haralabidis shows the correct way to iterate through rows of a view object by using a secondary rowsetiterator.'),
(136, 'Iterating a View Object using a secondary RowSetIterator', ' RowSetIterator iterator = vo.createRowSetIterator(null);\r\n iterator.reset();\r\n while (iterator.hasNext()) {\r\n Row row = iterator.next(); \r\n // process the row here\r\n }\r\n iterator.closeRowSetIterator();', 'CODE', 'http://adfcodebits.blogspot.in/2010/04/bit-4-iterating-view-object-using.html'),
(137, 'Apply a View Criteria programmatically', 'ViewObjectImpl vo = getEmployeesVO();\r\nViewCriteria vc = vo.getViewCriteria("FilterByDepartmentId");\r\nvo.setNamedWhereClauseParam("Bind_DeptId",deptId);\r\nvo.applyViewCriteria(vc);\r\nvo.executeQuery();\r\n\r\n//Append one more criteria:\r\nViewCriteria vc = vo.getViewCriteria("FilterByJobId");\r\nvo.setNamedWhereClauseParam("Bind_JobId",jobId);\r\nvo.applyViewCriteria(vc,true);\r\nvo.executeQuery();\r\n\r\n//create custom criteria:\r\nViewCriteria vc = vo.createViewCriteria();\r\nViewCriteriaRow vcRow = vc.createViewCriteriaRow();\r\nvcRow.setAttribute("Salary",">=" + sal);\r\nvc.add(vcRow);\r\nvo.applyViewCriteria(vc,true);\r\nvo.executeQuery();\r\n', 'CODE', ''),
(138, 'Programmatically access a view criteria', '04ZpxEn-xeA', 'VIDEO', 'Grant Ronald shows how to filter rows in a view object programmatically by applying a view criteria. A view criteria is a predefined filter that can be applied to your view object. In this example, we see how to filter employees based on department id and job id. First get a handle to the viewCriteria by using getViewCriteria() method. Then we programmatically set the bind variables using setNamedWhereClauseParam. After that apply the viewcriteria to the ViewObject using applyViewCriteria. Finally execute query to filter the results. You can also append viewcriteria using applyViewCriteria and passing second argument as true. Use removeApplyViewCriteria() to remove a ViewCriteria.'),
(139, 'Dependent List Of Values', '94PrwXWDEjI', 'VIDEO', 'Grant Ronald shows how to create a dependent LOV. A Dependent LOV, as the name suggests, is an LOV whose values depend on the value selected from another LOV. In this example, we see how to filter out values in a Locations LOV based on values in Country LOV. This is done using a viewcriteria with bindvariable taking its value based on value in Country LOV.'),
(140, 'Creating a Custom View Criteria', 'ViewObjectImpl vo = getEmployeesVO();\r\nViewCriteria vc = vo.createViewCriteria();\r\nViewCriteriaRow vcRow = vc.createViewCriteriaRow();\r\nViewCriteriaItem jobItem = vcRow.ensureCriteriaItem("Job");\r\njobItem.setOperator("=");\r\njobItem..setValue("MANAGER");\r\nvc.add(vcRow);\r\n\r\nvcRow = vc.createViewCriteriaRow();\r\nViewCriteriaItem salItem = vcRow.ensureCriteriaItem("Sal");\r\nsalItem.setOperator(">");\r\nsalItem.setValue(new Integer(2500));\r\nvc.add(vcRow);\r\n\r\nvcRow = vc.createViewCriteriaRow();\r\nViewCriteriaItem deptItem = vcRow.ensureCriteriaItem("DepartmentId");\r\ndeptItem.setIsBindVarValue(true); //Using Bind variable here\r\ndeptItem.setValue(":DeptId");\r\n//By default conjunction is AND. Changing it to use OR\r\nvc.setConjunction(ViewCriteriaComponent.VC_CONJ_OR);\r\nvc.add(vcRow);\r\n\r\nvo.applyViewCriteria(vc);', 'CODE', ''),
(141, 'Hiding Unwanted Operators in Advanced mode of af:query Component', 'http://jobinesh.blogspot.in/2012/06/hiding-unwanted-operators-in-advanced.html', 'BLOG', 'By default all operators will be shown in query panel for advanced mode. You might want to remove some operators. In this blogpost, Jobinesh shows how you can create custom operators or remove built in operators for each view criteria item by using CompOper. This needs to be done manually in the XML as there is no editor support. If you set a ToDo property of CompOper to -1 it will hide that operator. '),
(142, 'Using Array of values as a Where clause parameter', '//For this to work type FND_TABLE_OF_VARCHAR2_255 needs to be defined in your database:\r\n//CREATE OR REPLACE TYPE "FND_TABLE_OF_VARCHAR2_255" as table of varchar2(255);\r\n\r\n String[] categoryName = {"Large","Medium" };\r\n Array arr = new Array(categoryName);\r\n HashMap context = new HashMap();\r\n context.put(DomainContext.ELEMENT_SQL_NAME,"FND_TABLE_OF_VARCHAR2_120");\r\n context.put(DomainContext.ELEMENT_TYPE, String.class);\r\n arr.setContext(null, null, context);\r\n vo.defineNamedWhereClauseParam("Bind_Category_Name", null, null);\r\n vo.setWhereClause("CATEGORY_NAME IN (SELECT * FROM TABLE(CAST(:Bind_Category_Name AS FND_TABLE_OF_VARCHAR2_255)))");\r\n vo.setNamedWhereClauseParam("Bind_Category_Name", arr); \r\n vo.executeQuery();', 'CODE', ''),
(143, 'Passing multiple values in bind variable for an SQL IN clause', 'http://jobinesh.blogspot.in/2010/12/using-oraclejbodomainarray-with.html http://jobinesh.blogspot.in/2011/07/tips-on-using-oraclejbodomainarray-as.html', 'BLOG', 'Jobinesh shows how you can add an IN clause to your viewcriteria. In the first blogpost there is an example which takes a comma separated list of departments as input, converts it into an array and adds it as a bindvariable to the viewcriteria. getCriteriaItemClause method is overridden to add custom where clause. In the second blogpost Jobinesh talks about how to dynamically create an array type bindvariable and use it in the where clause ie: some key things to do before setNamedWhereClauseParam.'),
(144, 'Find a row in Entity Cache by Primary key', 'EntityDefImpl employeeDef = EntityDefImpl.findDefObject("oracle.apps.myproject.model.EmployeeEO");\r\nLong empId = new Long(100);\r\nKey key = new Key(new Object[] { empId });\r\nEmployeeEOImpl employee = (EmployeeEOImpl)employeeDef.findByPrimaryKey(getDBTransaction(),key);', 'CODE', ''),
(145, 'Create an Entity row programmatically', 'EntityDefImpl employeeDef = EntityDefImpl.findDefObject("oracle.apps.myproject.model.EmployeeEO");\r\nAttributeListImpl attributeList = new AttributeListImpl();\r\nattributeList.setAttribute("EmployeeId",empId);\r\nEmployeeEOImpl employee = (EmployeeEOImpl) employeeDef.createInstance2(getDBTransaction(),attributeList);\r\n\r\n//Set more attributes as required.\r\nemployee.setName(name);\r\n', 'CODE', ''),
(146, 'Getting a String from a ResourceBundle programmatically', 'ResourceBundle bundle=BundleFactory.getBundle("myapps.project.BundleName");\r\nString str = bundle.getString("Key.of.String"); ', 'CODE', ''),
(148, 'SecurityContext EL Expressions', '#{securityContext.authenticated}\r\n\r\n#{securityContext.userName}\r\n\r\n#{securityContext.userInRole[''roleList'']}\r\n\r\n#{securityContext.userInAllRoles[''roleList'']}\r\n\r\n#{securityContext.taskflowViewable[''/WEB-INF/yourTaskFlow.xml#yourTaskFlow'']}\r\n\r\n#{securityContext.regionViewable[''your.page.targetPageDef'']}\r\n\r\n#{securityContext.userGrantedResource[''permission'']}\r\n\r\n#{securityContext.userGrantedPermission[''permission'']} ', 'CODE', 'http://www.oracle.com/technetwork/issue-archive/2012/12-jan/o12adf-1364748.html'),
(149, 'Checking for security within a JSF page', 'http://adfcodebits.blogspot.in/2010/05/bit-17-using-securitycontext-bean-in.html', 'BLOG', 'Nick Haralabidis shows how to check for security within a jsf page. We can use the securityContext bean and use any of its available methods to get relevant security data. eg: #{securityContext.authenticated} will return whether the user is authenticated or not. #{securityContext.userInRole[SomeRole]} will return true if user is assigned the specific role.'),
(150, 'Setting a RequestScope variable', 'Map<String, Object> requestScope = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();\r\nrequestScope.put("var", 123);\r\nrequestScope.get("var"); //Similiarly getting a request scope variable value.', 'CODE', ''),
(151, 'Getting/Setting an EL Expression value', 'FacesContext facesContext = FacesContext.getCurrentInstance();\r\nELContext elContext = facesContext.getELContext();\r\nExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();\r\nValueExpression exp = expressionFactory.createValueExpression(elContext, "#{pageFlowScope.var}", Object.class);\r\nexp.setValue(elContext, "1234");\r\n\r\nFacesContext facesContext = FacesContext.getCurrentInstance();\r\nELContext elContext = facesContext.getELContext();\r\nExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();\r\nValueExpression exp = expressionFactory.createValueExpression(elContext,"#{pageFlowScope.var}", Object.class);\r\nexp.getValue(elContext);', 'CODE', ''),
(152, 'Execute a Method EL Expression Programmatically', 'FacesContext facesContext = FacesContext.getCurrentInstance();\r\nELContext elContext = facesContext.getELContext();\r\nExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();\r\n//In createmethodExpression you need to pass the return classtype and parameter classtypes\r\nMethodExpression exp = expressionFactory.createMethodExpression(elContext,"#{bindings.EmpQuery.processQuery}" ,\r\nObject.class,new Class[] { QueryEvent.class });\r\nexp.invoke(elContext,new Object[] { queryEvent });\r\n', 'CODE', ''),
(153, 'Implement makeCurrent in Selection Listener for ADF bound Tables', 'public void makeCurrent(SelectionEvent selectionEvent){\r\nRichTable _table = (RichTable) selectionEvent.getSource();\r\nCollectionModel _tableModel= (CollectionModel)_table.getValue();\r\nJUCtrlHierBinding _tablebinding = (JUCtrlHierBinding) _tableModel.getWrappedData();\r\nDCIteratorBinding _tableIteratorBinding = _tableBinding.getDCIteratorBinding();\r\nObject _selectedRowData = _table.getSelectedRowData();\r\nJUCtrlHierNodeBinding _nodeBinding = (JUCtrlHierNodeBinding) _selectedRowData;\r\nKey _rwKey = _nodeBinding.getRowKey();\r\n_tableIteratorBinding.setCurrentRowWithKey(_rwKey.toStringFormat(true)); \r\n} ', 'CODE', 'http://www.oracle.com/technetwork/developer-tools/adf/learnmore/23-generic-table-selection-listener-169162.pdf'),
(154, 'PartialSubmit Vs AutoSubmit', 'https://blogs.oracle.com/jdevotnharvest/entry/partial_submit_vs_auto_submit', 'BLOG', 'Frank Nimphius explains about the difference between partialSubmit and autoSubmit. Partial submit is actually a complete form submit that does not require a page refresh. You can decide which components to refresh by specifying the partialTrigger property or doing a programmatic ppr. autoSubmit, on the other hand does not submit the entire form but only the component that triggers the submit plus components referenced it in their PartialTriggers property.'),
(155, 'Programmatic Partial Page Refresh', 'QcAVuzWQhNI', 'VIDEO', 'Grant Ronald shows how to implement a partial page refresh programmatically. A Partial Page Refresh (PPR) allows us to refresh components in a page without having to submit the whole page. ADF provides a declarative way using autosubmit and partialTrigger. However in some cases we might have to perform refresh programmatically. For this we need to get a handle to AdfFacesContext - which contains information about the current page. We also need access to the ui component which needs to be refreshed and make that as target to the ppr operation. In this example, we see how to refresh a table programmatically from a button actionlistener.'),
(156, 'Create an Application Module instance programmatically', 'String amDef = "myproject.apps.model.EmployeeAM";\r\nString amConfig = "EmployeeAMLocal";\r\nEmployeeAMImpl am = (EmployeeAMImpl)Configuration.createRootApplicationModule(amDef, amConfig);\r\n//Do something here then release the am\r\nConfiguration.releaseRootApplicationModule(am,false);\r\n\r\n//Getting an AM instance using BindingContext\r\nDCDataControl dcDataControl = BindingContext.getCurrent().findDataControl("EmployeeAMDataControl");\r\nEmployeeAMImpl am = (EmployeeAMImpl))dcDataControl.getApplicationModule();\r\n', 'CODE', ''),
(157, 'Setting/Getting a pageflowscope variable', 'ADFContext adfContext = ADFContext.getCurrent();\r\nMap pageFlowScope = adfContext.getPageFlowScope();\r\npageFlowScope.put("var",1234);\r\n\r\n//Similiarly getting a pageflowscope variable\r\nObject val = pageFlowScope.get("var");', 'CODE', ''),
(158, 'How to set default values for View object row attributes', 'http://jdeveloperfaq.blogspot.in/2011/06/faq-35-how-to-set-default-values-for.html', 'BLOG', 'Nick Haralabidis shows different ways to default a view object attribute. First way is to override the create() method and set a value for the attribute within the method. The most preferred way is to use a Groovy expression to default the attributes. Another way is to override the getter method of the attribute and return a specific value.'),
(159, 'Accessing ADF Binding Layer from Java', 'ccLaPFkeyv0', 'VIDEO', 'Frank Nimphius shows how to access adf binding layer from java in a managed bean. Every ui component is bound to a binding file called pagedef file or binding container. At design time the bindings are represented in metadata - pagedef. At runtime they are represented by java objects. The Binding container is represented by bindingcontainer interface class or DCBindingContainer implementation class. Iterator by DCIteratorBinding, attributes by AttributeBinding, methods by OperationBinding etc.. This example shows how to execute a method : executeWithParams programmatically from bean.'),
(160, 'Testing an Application Module for activation-safe', 'http://jdeveloperfaq.blogspot.in/2010/02/faq-14-how-to-test-application-module.html', 'BLOG', 'You might have come across a situation where your application was working perfectly fine during development but gave errors in production environment. Chances are that your issue is related to AM passivation. In this blog post, Nick Haralabidis gives a very good explanation about am pooling and passivation/activation cycle. You can test if your AM is activation safe by disabling AM pooling. (Djbo.ampool.doampooling=false). This will force a Passivation to occur at the end of each request. Testing your AMs for activation-safe is a must if you are using transient variables, private member variables in AMs, VOs or EOs, custom data in the Session hashtable.'),
(161, 'Programmatically setting a unique id using DBSequence', 'SequenceImpl s = new SequenceImpl("nameofSequence",getDBTransaction());\r\nsetDepartmentId(s.getSequenceNumber());', 'CODE', ''),
(162, 'Passing Data within a Task Flow using pageFlowScope', 'wrpciIzIN9A', 'VIDEO', 'Grant Ronald shows how to pass data between taskflow activities using pageflowscope. Pageflowscope memory exists during the life of the taskflow. In this example, we see how data from a search form gets passed to a method call and results page using a pageflowscope variable.'),
(163, 'Conditionally displaying search form parameters', 'http://jobinesh.blogspot.in/2009/12/conditional-display-of-search-form.html', 'BLOG', 'Jobinesh explains how you can modify query parameters in the search form. The query panel is backed by a ViewCriteria and each query parameter displayed in af:query is modeled by a ViewCrieteriaItem instance. You can make use of the ViewCriteriaItemHints to control the display properties. Jobinesh gives an example project in which he shows how to hide departmentId from search parameter by modifying its ViewCriteriaItemHints programmatically.'),
(164, 'Modifying View Criteria Programmatically to hide search parameters', ' ViewObjectImpl vo = getEmployeesVO();\r\n ViewCriteria vc = vo.getViewCriteria("EmployeesSearchCriteria");\r\n ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();\r\n ViewCriteriaItem deptVci = vcr.getCriteriaItem("DepartmentId");\r\n deptVci.setProperty(ViewCriteriaItemHints.CRITERIA_RENDERED_MODE,\r\nViewCriteriaItemHints.CRITERIA_RENDERED_MODE_NEVER);\r\n vc.saveState();\r\n \r\n//You might not know which viewcriteria row the parameter exist. So better to loop through the rows.\r\n ViewObjectImpl vo = getEmployeesVO();\r\n ViewCriteria vc = vo.getViewCriteria("EmployeesSearchCriteria");\r\n while (vc.hasNext()) {\r\n ViewCriteriaRow vcr = (ViewCriteriaRow)vc.next();\r\n ViewCriteriaItem[] vcis = vcr.getCriteriaItemArray();\r\n for (int j = 0; j < vcis.length; j++) {\r\n ViewCriteriaItem vci = vcis[j];\r\n if (vci != null && "DepartmentId".equals(vci.getName())) {\r\n vci.setProperty(ViewCriteriaItemHints.CRITERIA_RENDERED_MODE,\r\nViewCriteriaItemHints.CRITERIA_RENDERED_MODE_NEVER);\r\n vc.saveState();\r\n }\r\n }\r\n } ', 'CODE', ''),
(165, 'Executing a method Binding from Bean', 'DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();\r\nOperationBinding operation = bindings.getOperationBinding("ExecuteWithParams");\r\noperation.getParamsMap().put("deptId",value); // passing arguments for method\r\nObject result = operationBinding.execute();\r\nif(!operationBinding.getErrors().isEmpty()){\r\n JboException ex=new JboException(operationBinding.getErrors());\r\n throw ex;\r\n}', 'CODE', ''),
(166, 'Get Actual Value Of SelectOneChoice ', 'public void onValueChange(ValueChangeEvent valueChangeEvent) {\r\nvalueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());\r\nDCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();\r\nJUCtrlListBinding selectListBinding = (JUCtrlListBinding)bindings.getControlBinding("ListBinding");\r\n//You can get indexes this way: (But thats not what we need)\r\nInteger NewIndex =(Integer)valueChangeEvent.getNewValue();\r\nInteger OldIndex =(Integer)valueChangeEvent.getOldValue();\r\n\r\nObject value = selectListBinding.getAttributeValue(); // This will give actual value\r\n\r\n//You can get the selected row and get other attributes.\r\nRow row = (Row)selectListBinding.getSelectedValue();\r\nString value = (String)row.getAttribute("Name");\r\n}', 'CODE', ''),
(167, 'Tree Table Component in ADF', 'http://andrejusb.blogspot.jp/2009/11/tree-table-component-in-oracle-adf.html', 'BLOG', ''),
(168, 'Using the af:poll component', '4vJuHXL4uho', 'VIDEO', 'Shay Shmeltzer shows how to use a poll component in this video. A poll component can be used to refresh parts of the page or execute custom java code within specific time intervals. The poll interval decides the time interval. Once the poll expires an event gets raised and you can attach a method to the pollListener. In this video, you get to see how to refresh a graph component periodically to get latest updates on employee data.'),
(169, 'Show Faces Message in UI programmatically', '//Need to get error string from somewhere. Getting it from bundle here:\r\nResourceBundle bundle = BundleFactory.getBundle("your.package.Bundle");\r\nString message = bundle.getString("Error_Message");\r\n\r\nFacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,null,message);\r\n//Other possible Severity values :SEVERITY_FATAL, SEVERITY_ERROR, SEVERITY_WARN, SEVERITY_INFO\r\n\r\nFacesContext facesContext = FacesContext.getCurrentInstance();\r\nfacesContext.addMessage(null, msg);\r\n\r\n//Or if you want to show for a specific ui component\r\nfacesContext.addMessage(uiComponent.getClientId(facesContext), msg);', 'CODE', ''),
(170, 'setAttribute Vs setAttributeInternal Vs populateAttributeAsChanged Vs populateAttribute', 'setAttribute(): This is the generated accessor method which inturn calls setAttributeInternal. \r\nYou can override this to have programmatic validation.\r\n\r\nsetAttributeInternal(): using this method will perform declarative attribute validations \r\non the attribute and then call populateAttributeAsChanged. \r\n\r\npopulateAttributeAsChanged(): using this will avoid all attribute validations but will mark the attribute \r\nas changed so that this value is picked up in entity DML when \r\nentity is posted. Primary key attributes should not be set using populateAttribute apis.\r\n\r\npopulateAttribute(): to simply set an attribute value without generating any change notifications \r\nnor marking the attribute as modified in this entity. This method is primarily used for \r\npopulating attribute values when data is fetched for an entity.', 'CODE', 'http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/server/EntityImpl.html'),
(171, 'Getting Old (Posted) value of Entity object attributes', 'In EOImpl:\r\nObject postedEmployeeId = getPostedAttribute(this.getAttributeIndexOf(EMPLOYEE_ID));\r\n\r\nGroovy:\r\nadf.object.getPostedAttribute(adf.object.getAttributeIndexOf(model.EmployeesImpl.EMPLOYEE_ID))\r\n\r\nGroovy in EO Declarative Validators:\r\noldValue - posted value , newValue - newly entered value', 'CODE', 'http://one-size-doesnt-fit-all.blogspot.in/2009/11/adf-bc-groovy-showing-old-values-along.html'),
(172, 'Get Original Value of Entity Object Attribute from DB - getPostedAttribute()', 'http://adfcodebits.blogspot.in/2010/07/bit-22-using-getpostedattribute-to.html http://jobinesh.blogspot.in/2010/10/public-api-to-get-value-originally-read.html', 'BLOG', 'If an entity attributes value has been changed in the current transaction, when you call the attribute getter method for it you will get this pending changed value. Using the getPostedAttribute() method, your entity object business logic can consult the original value for any attribute as it was read from the database before the entity row was modified. Nick Haralabidis gives an example use case in his blog post.'),
(173, 'Refreshing Single Row Without Full Rollback', 'http://andrejusb.blogspot.in/2012/05/refreshing-single-row-without-full.html http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/Row.html#REFRESH_UNDO_CHANGES', 'BLOG', 'Most of the times we perform a Rollback operation to undo all the changes made by the transaction. However we might want to limit this rollback operation to a certain row rather than the entire transaction. This is possible by using the refresh() method of Row. In this blogpost Andrejus Baranovskis shows how to implement single row refresh by calling refresh operation with REFRESH_UNDO_CHANGES and REFRESH_WITH_DB_FORGET_CHANGES arguments - this will force to reload current row cache.');
-- --------------------------------------------------------
--
-- Table structure for table `component`
--
CREATE TABLE IF NOT EXISTS `component` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`parentid` bigint(20) NOT NULL,
`shortcode` varchar(25) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
--
-- Dumping data for table `component`
--
INSERT INTO `component` (`id`, `name`, `parentid`, `shortcode`) VALUES
(1, 'ADF Business Components', 0, 'adfbc'),
(2, 'ADF Model', 0, 'adfm'),
(3, 'ADF Controller', 0, 'adfc'),
(4, 'ADF Faces', 0, 'adffaces'),
(5, 'Entity Object', 1, 'eo'),
(6, 'View Object', 1, 'vo'),
(7, 'Application Module', 1, 'am'),
(8, 'ADF Security', 0, 'security'),
(9, 'View Criteria', 6, 'vc'),
(10, 'Passivation', 7, 'passivation'),
(11, 'Bean', 4, 'bean');
-- --------------------------------------------------------
--
-- Table structure for table `cpcomponent`
--
CREATE TABLE IF NOT EXISTS `cpcomponent` (
`codepatternid` bigint(20) NOT NULL,
`componentid` bigint(20) NOT NULL,
PRIMARY KEY (`codepatternid`,`componentid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `cpcomponent`
--
INSERT INTO `cpcomponent` (`codepatternid`, `componentid`) VALUES
(129, 4),
(130, 4),
(131, 1),
(131, 5),
(133, 4),
(133, 11),
(134, 1),
(134, 6),
(135, 1),
(135, 6),
(136, 1),
(136, 6),
(137, 1),
(137, 6),
(137, 9),
(138, 1),
(138, 6),
(138, 9),
(139, 1),
(139, 4),
(139, 6),
(139, 9),
(140, 1),
(140, 6),
(140, 9),
(141, 1),
(141, 4),
(141, 6),
(141, 9),
(142, 1),
(142, 6),
(142, 9),
(143, 1),
(143, 6),
(143, 9),
(144, 1),
(144, 5),
(145, 1),
(145, 5),
(146, 4),
(146, 11),
(148, 4),
(148, 8),
(149, 4),
(149, 8),
(150, 4),
(150, 11),
(151, 4),
(151, 11),
(152, 4),
(152, 11),
(153, 2),
(153, 4),
(153, 11),
(154, 4),
(155, 4),
(155, 11),
(156, 1),
(156, 7),
(157, 3),
(157, 4),
(157, 11),
(158, 1),
(158, 6),
(159, 2),
(159, 4),
(159, 11),
(160, 1),
(160, 7),
(160, 10),
(161, 1),
(161, 5),
(162, 3),
(162, 4),
(162, 11),
(163, 1),
(163, 4),
(163, 6),
(163, 9),
(164, 1),
(164, 6),
(164, 9),
(165, 2),
(165, 4),
(165, 11),
(166, 4),
(166, 11),
(167, 4),
(168, 4),
(169, 4),
(169, 11),
(170, 1),
(170, 5),
(171, 1),
(171, 5),
(172, 1),
(172, 5),
(173, 1),
(173, 5);
-- --------------------------------------------------------
--
-- Table structure for table `cptag`
--
CREATE TABLE IF NOT EXISTS `cptag` (
`codepatternid` bigint(20) NOT NULL,
`tagid` bigint(20) NOT NULL,
PRIMARY KEY (`codepatternid`,`tagid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `cptag`
--
INSERT INTO `cptag` (`codepatternid`, `tagid`) VALUES
(0, 6),
(0, 10),
(0, 12),
(0, 62),
(0, 69),
(0, 70),
(0, 77),
(0, 102),
(0, 173),
(0, 174),
(0, 175),
(0, 176),
(0, 177),
(0, 178),
(0, 179),
(0, 180),
(0, 181),
(0, 182),
(0, 183),
(0, 184),
(0, 185),
(0, 198),
(0, 201),
(0, 202),
(0, 203),
(0, 224),
(0, 272),
(0, 273),
(0, 274),
(0, 275),
(0, 276),
(0, 277),
(0, 278),
(0, 279),
(0, 280),
(0, 281),
(0, 282),
(0, 283),
(0, 284),
(0, 285),
(129, 3),
(129, 5),
(129, 6),
(129, 20),
(129, 21),
(129, 22),
(129, 23),
(129, 24),
(129, 25),
(129, 26),
(130, 1),
(130, 2),
(130, 3),
(130, 4),
(130, 5),
(130, 6),
(130, 7),
(130, 8),
(130, 9),
(131, 48),
(131, 49),
(131, 50),
(131, 51),
(131, 52),
(131, 53),
(131, 54),
(131, 55),
(131, 56),
(131, 57),
(131, 326),
(133, 3),
(133, 4),
(133, 6),
(133, 27),
(133, 28),
(133, 57),
(133, 67),
(133, 68),
(133, 81),
(133, 82),
(133, 83),
(133, 84),
(133, 85),
(133, 86),
(133, 87),
(133, 88),
(134, 2),
(134, 16),
(134, 27),
(134, 28),
(134, 29),
(134, 30),
(134, 31),
(134, 32),
(134, 33),
(134, 34),
(134, 35),
(134, 36),
(134, 37),
(134, 38),
(134, 101),
(135, 2),
(135, 16),
(135, 27),
(135, 28),
(135, 30),
(135, 31),
(135, 32),
(135, 33),
(135, 35),
(135, 37),
(135, 94),
(135, 101),
(135, 109),
(135, 186),
(135, 187),
(135, 188),
(135, 189),
(135, 190),
(136, 2),
(136, 16),
(136, 27),
(136, 28),
(136, 29),
(136, 30),
(136, 31),
(136, 32),
(136, 33),
(136, 35),
(136, 37),
(136, 94),
(136, 101),
(136, 109),
(136, 118),
(136, 168),
(136, 186),
(136, 187),
(136, 188),
(136, 189),
(136, 190),
(137, 14),
(137, 15),
(137, 16),
(137, 17),
(137, 18),
(137, 19),
(137, 27),
(137, 28),
(137, 31),
(137, 32),
(137, 35),
(137, 37),
(137, 90),
(137, 94),
(137, 104),
(137, 105),
(137, 107),
(137, 109),
(137, 116),
(137, 117),
(137, 118),
(137, 119),
(137, 120),
(138, 14),
(138, 15),
(138, 16),
(138, 17),
(138, 18),
(138, 27),
(138, 28),
(138, 31),
(138, 32),
(138, 35),
(138, 37),
(138, 94),
(138, 103),
(138, 104),
(138, 105),
(138, 106),
(138, 107),
(138, 108),
(138, 109),
(138, 110),
(138, 111),
(139, 10),
(139, 11),
(139, 12),
(139, 13),
(139, 14),
(139, 18),
(139, 19),
(139, 105),
(139, 135),
(140, 14),
(140, 15),
(140, 16),
(140, 17),
(140, 27),
(140, 28),
(140, 35),
(140, 94),
(140, 107),
(140, 109),
(140, 111),
(140, 116),
(140, 117),
(140, 118),
(140, 120),
(140, 128),
(140, 136),
(140, 137),
(140, 138),
(141, 15),
(141, 16),
(141, 17),
(141, 35),
(141, 37),
(141, 121),
(141, 122),
(141, 123),
(141, 124),
(141, 127),
(141, 134),
(141, 139),
(141, 140),
(141, 141),
(141, 142),
(141, 143),
(141, 144),
(141, 145),
(141, 146),
(141, 147),
(142, 13),
(142, 15),
(142, 16),
(142, 17),
(142, 18),
(142, 19),
(142, 35),
(142, 37),
(142, 62),
(142, 105),
(142, 135),
(142, 148),
(142, 149),
(142, 150),
(142, 151),
(142, 152),
(142, 153),
(142, 154),
(142, 155),
(142, 156),
(143, 13),
(143, 15),
(143, 16),
(143, 17),
(143, 18),
(143, 19),
(143, 35),
(143, 37),
(143, 62),
(143, 105),
(143, 135),
(143, 148),
(143, 149),
(143, 150),
(143, 151),
(143, 152),
(143, 153),
(143, 154),
(143, 155),
(143, 156),
(143, 157),
(144, 31),
(144, 32),
(144, 35),
(144, 55),
(144, 58),
(144, 158),
(144, 159),
(144, 160),
(144, 161),
(144, 162),
(144, 163),
(144, 164),
(144, 165),
(144, 166),
(144, 167),
(145, 27),
(145, 28),
(145, 31),
(145, 32),
(145, 35),
(145, 55),
(145, 56),
(145, 58),
(145, 94),
(145, 109),
(145, 118),
(145, 162),
(145, 165),
(145, 167),
(145, 168),
(145, 169),
(145, 170),
(145, 171),
(145, 172),
(146, 27),
(146, 28),
(146, 69),
(146, 70),
(146, 94),
(146, 109),
(146, 191),
(146, 192),
(146, 193),
(146, 194),
(146, 195),
(146, 196),
(146, 197),
(148, 6),
(148, 102),
(148, 173),
(148, 174),
(148, 175),
(148, 176),
(148, 177),
(148, 178),
(148, 179),
(148, 180),
(148, 181),
(148, 182),
(148, 183),
(148, 184),
(148, 185),
(148, 198),
(148, 201),
(148, 202),
(148, 203),
(148, 272),
(148, 273),
(148, 274),
(148, 275),
(148, 276),
(149, 6),
(149, 102),
(149, 173),
(149, 174),
(149, 175),
(149, 176),
(149, 177),
(149, 178),
(149, 179),
(149, 180),
(149, 181),
(149, 182),
(149, 183),
(149, 184),
(149, 185),
(149, 198),
(149, 201),
(149, 202),
(149, 203),
(149, 327),
(150, 4),
(150, 19),
(150, 42),
(150, 59),
(150, 60),
(150, 67),
(150, 68),
(150, 69),
(150, 70),
(150, 94),
(150, 112),
(150, 113),
(150, 114),
(150, 115),
(151, 27),
(151, 28),
(151, 59),
(151, 60),
(151, 62),
(151, 69),
(151, 70),
(151, 94),
(151, 109),
(151, 114),
(151, 199),
(151, 200),
(151, 201),
(151, 202),
(151, 203),
(151, 204),
(151, 205),
(151, 206),
(151, 207),
(151, 208),
(152, 27),
(152, 28),
(152, 72),
(152, 73),
(152, 80),
(152, 94),
(152, 109),
(152, 114),
(152, 199),
(152, 200),
(152, 201),
(152, 202),
(152, 203),
(152, 204),
(152, 206),
(152, 207),
(152, 208),
(152, 209),
(152, 210),
(152, 211),
(152, 212),
(153, 2),
(153, 4),
(153, 6),
(153, 27),
(153, 28),
(153, 31),
(153, 32),
(153, 67),
(153, 68),
(153, 77),
(153, 94),
(153, 98),
(153, 109),
(153, 213),
(153, 214),
(153, 215),
(153, 216),
(153, 217),
(153, 218),
(153, 219),
(153, 220),
(153, 221),
(153, 222),
(153, 223),
(153, 224),
(153, 225),
(153, 226),
(153, 227),
(153, 228),
(153, 229),
(153, 230),
(153, 231),
(154, 6),
(154, 57),
(154, 84),
(154, 85),
(154, 86),
(154, 102),
(154, 124),
(154, 198),
(154, 232),
(154, 233),
(154, 234),
(154, 235),
(154, 236),
(154, 237),
(154, 238),
(155, 4),
(155, 6),
(155, 27),
(155, 28),
(155, 67),
(155, 68),
(155, 83),
(155, 84),
(155, 85),
(155, 87),
(155, 94),
(155, 102),
(156, 4),
(156, 27),
(156, 28),
(156, 67),
(156, 69),
(156, 70),
(156, 77),
(156, 94),
(156, 109),
(156, 118),
(156, 168),
(156, 178),
(156, 239),
(156, 240),
(156, 241),
(156, 242),
(156, 243),
(156, 244),
(156, 245),
(156, 246),
(156, 247),
(156, 248),
(156, 249),
(156, 250),
(156, 251),
(156, 252),
(156, 253),
(156, 254),
(156, 255),
(156, 256),
(157, 4),
(157, 19),
(157, 27),
(157, 28),
(157, 39),
(157, 40),
(157, 41),
(157, 42),
(157, 43),
(157, 59),
(157, 60),
(157, 65),
(157, 66),
(157, 67),
(157, 68),
(157, 69),
(157, 70),
(158, 16),
(158, 35),
(158, 36),
(158, 37),
(158, 59),
(158, 60),
(158, 61),
(158, 62),
(158, 269),
(158, 270),
(158, 271),
(159, 4),
(159, 27),
(159, 28),
(159, 67),
(159, 68),
(159, 69),
(159, 70),
(159, 77),
(159, 78),
(159, 89),
(159, 90),
(159, 91),
(159, 92),
(159, 93),
(159, 94),
(159, 95),
(159, 96),
(159, 97),
(159, 98),
(159, 99),
(159, 100),
(160, 239),
(160, 240),
(160, 241),
(160, 242),
(160, 244),
(160, 257),
(160, 258),
(160, 259),
(160, 260),
(160, 261),
(160, 262),
(160, 263),
(160, 264),
(160, 265),
(160, 266),
(160, 267),
(160, 268),
(161, 27),
(161, 48),
(161, 50),
(161, 51),
(161, 52),
(161, 55),
(161, 56),
(161, 58),
(161, 59),
(161, 60),
(161, 61),
(161, 62),
(162, 6),
(162, 19),
(162, 39),
(162, 40),
(162, 41),
(162, 42),
(162, 43),
(162, 44),
(162, 45),
(162, 46),
(162, 47),
(162, 64),
(163, 5),
(163, 15),
(163, 16),
(163, 17),
(163, 27),
(163, 28),
(163, 43),
(163, 94),
(163, 109),
(163, 121),
(163, 122),
(163, 123),
(163, 124),
(163, 125),
(163, 126),
(163, 127),
(163, 128),
(163, 129),
(163, 130),
(163, 131),
(163, 132),
(163, 133),
(163, 134),
(164, 5),
(164, 15),
(164, 16),
(164, 17),
(164, 27),
(164, 28),
(164, 43),
(164, 94),
(164, 109),
(164, 121),
(164, 122),
(164, 123),
(164, 124),
(164, 125),
(164, 126),
(164, 127),
(164, 128),
(164, 129),
(164, 130),
(164, 131),
(164, 132),
(164, 133),
(164, 134),
(165, 4),
(165, 27),
(165, 28),
(165, 67),
(165, 68),
(165, 69),
(165, 70),
(165, 72),
(165, 73),
(165, 74),
(165, 75),
(165, 76),
(165, 77),
(165, 78),
(165, 79),
(165, 80),
(165, 97),
(165, 253),
(166, 4),
(166, 10),
(166, 12),
(166, 62),
(166, 67),
(166, 68),
(166, 69),
(166, 70),
(166, 77),
(166, 224),
(166, 277),
(166, 278),
(166, 279),
(166, 280),
(166, 281),
(166, 282),
(166, 283),
(166, 284),
(167, 3),
(167, 6),
(167, 215),
(167, 225),
(167, 226),
(167, 286),
(167, 287),
(167, 288),
(167, 289),
(167, 290),
(168, 3),
(168, 6),
(168, 84),
(168, 102),
(168, 198),
(168, 291),
(168, 292),
(168, 293),
(168, 294),
(168, 295),
(168, 296),
(168, 297),
(169, 6),
(169, 102),
(169, 114),
(169, 193),
(169, 198),
(169, 298),
(169, 299),
(169, 300),
(169, 301),
(169, 302),
(169, 303),
(169, 304),
(169, 305),
(169, 306),
(169, 307),
(170, 13),
(170, 35),
(170, 55),
(170, 56),
(170, 58),
(170, 59),
(170, 60),
(170, 61),
(170, 62),
(170, 162),
(170, 165),
(170, 308),
(170, 309),
(170, 310),
(170, 311),
(170, 312),
(170, 313),
(170, 314),
(171, 13),
(171, 35),
(171, 53),
(171, 54),
(171, 55),
(171, 56),
(171, 58),
(171, 61),
(171, 62),
(171, 70),
(171, 162),
(171, 165),
(171, 271),
(171, 320),
(171, 321),