ADF: How do I add a node to a selected root in a TreeModel
I've created a TreeModel with something that follows:
1.) Loop through a List and build the Roots:
for (TransactRow transactionRootRow : transactionResults) {
TransactionNode transactionRootItem = new
TransactionNode(transactionRootRow.getTransactKey(), transactionRootRow.getParentKey());
transactionRoot.add(transactionRootItem);
this.setTransactModel(new ChildPropertyTreeModel(transactionRoot, "children") {
public boolean isContainer() {
return ((TransactionNode)getRowData()).getChildCount() > 0;
This works great.
What I need to do next is "click" on any of the Roots and add a node to the selected Root.
I might have:
|-Root1 (rowKey="r1", rowIndex=0)
But, when I click on Root1, I should have:
|-Root1 (rowKey="r1", rowIndex=0)
| |-Folder1 (rowKey="r1f1", rowIndex=0)
I am at the point that when I can get the current root in Java code, but how do I go about adding a node to the current root in a TreeModel?
Thanks,
--Todd
This is JSF - ADF specific, but I'm not using JDeveloper.
Similar Messages
-
How can I add a node with with a user-chosen name to JTree in one action
The functionality that I would like to implement is to add a new node to a tree (JTree with DefaultTreeModel), that during the adding process of the the new node the user will type the node name.
I am using the following documentation as a reference: http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#select
but in this example (as well as all the other examples that I found on net) the user can add first a new node with a constant name (like "NewNode").
and then in a seperated action the user can edit this node. I'd like to perfrom it in one action.
one solution that could be implemented is on the end of the adding node invoking beginning of editing action that will be triggered in code instead of forcing the user to click with the mouse on the selected node. The question is how can I do it? how can I trigger an edit action on a selected node in a JTree?
Edited by: Rotshield on Aug 23, 2008 2:21 AM
Edited by: Rotshield on Aug 23, 2008 2:24 AM
Edited by: Rotshield on Aug 23, 2008 2:29 AM
Edited by: Rotshield on Aug 23, 2008 2:29 AMAh, well.
You can lead a horse to the water but you can't make it drink.
Just to provide some background, I'm not a developer, just a hobby programmer and first took up Java less than 14 months ago. I didn't know the answer to your problem, but on reading the API it was fairly clear which method I'd have to make use of. In less than half an hour of coding, I had a JFrame with a JTree and a JButton to add a node, which was immediately in editing condition.
Try to find another profession, Rotshield. Or at least don't disgrace the community by calling yourself a Java developer (for 4 years lol) until (if ever) you learn how to read and apply an API.
db -
How do I add compute nodes to increase resources for virtual routers?
I am running CML.vT328 on ESXi 5.5. How do I add resources for virtual routers using other ESXi hosts in my compute environment?
Welcome to the group, glkkaufma. Some folks will stop by your thread shortly and probably ask you some more questions. In the meantime you may well be able to get some additional assistance by checking out some of the videos in the video section of the group. Also, check out the documentation links in the Links section on the group home page too.
David N Martin
Community Manager -
Hi am new at java and I was wondering what would be a code to remove it if i provide the coeff
I know is
-Given the index you want to remove
-set the node at the previous index to point to the node at the next index
-set the index you want to remove as pointing to nothing, this includes setting its previous and next nodes to null
Can someone code this for me to see
// Polynomial.java
public class Polynomial
private int degree;
private Node head;
public static Polynomial addPolys(Polynomial poly1, Polynomial poly2)
Polynomial polyRes = new Polynomial();
int power = (poly1.degree > poly2.degree) ? poly1.degree : poly2.degree;
while (power >= 0)
Node n1 = poly1.head;
while (n1 != null)
if (n1.power == power)
break;
n1 = n1.next;
Node n2 = poly2.head;
while (n2 != null)
if (n2.power == power)
break;
n2 = n2.next;
if ((n1 != null) && (n2 != null))
polyRes.addNode(n1.coeff + n2.coeff, n1.power);
else if (n1 != null)
polyRes.addNode(n1.coeff, n1.power);
else if (n2 != null)
polyRes.addNode(n2.coeff, n2.power);
power--;
return polyRes;
public void addNode(int coeff, int power)
if (head == null) // start the list
head = new Node(coeff, power, null);
degree = power;
else
Node n = head;
Node last = null;
while (n != null)
if (power > n.power) // insert in list
if (last == null)
head = new Node(coeff, power, n);
else
last.next = new Node(coeff, power, n);
degree = power;
break;
last = n;
n = n.next;
if (n == null) // append to list
last.next = new Node(coeff, power, null);
public String toString()
StringBuffer strBuf = new StringBuffer();
Node n = head;
boolean first = true;
while (n != null)
int absCoef = n.coeff;
if (!first)
if (n.coeff >= 0)
strBuf.append(" + ");
else
absCoef = -absCoef;
strBuf.append(" - ");
strBuf.append(absCoef).append("x^^").append(n.power);
first = false;
n = n.next;
return strBuf.toString();
public class Node
public int coeff;
public int power;
public Node next;
public Node(int coeff, int power, Node next)
this.coeff = coeff;
this.power = power;
this.next = next;
// PolyTest.java
public class PolyTest
public static void main(String[] args)
Polynomial poly1 = new Polynomial();
poly1.addNode(3, 2);
poly1.addNode(4, 1);
poly1.addNode(4, 0);
Polynomial poly2 = new Polynomial();
poly2.addNode(3, 3);
poly2.addNode(-4, 2);
poly2.addNode(3, 0);
Polynomial poly3 = Polynomial.addPolys(poly1, poly2);
System.out.println(poly3);
}ok sorry this is what i go so far
public void removeNode(int indexnumber)
Node n = head;
int i;
while (i < indexnumber - 1){
n = n.next;
if(n.next == null)
//throw exception
++i;
A = n;
//(if we encounter a node with the next node pointing to null, thow an exception)
B = A.next; //B is the node we want to remove
C = B.next; //C is the node right after the node we want to remove
A.next = C;
B.next = null;
}but am getting an error with
A = n;
//(if we encounter a node with the next node pointing to null, thow an exception)
B = A.next; //B is the node we want to remove
C = B.next; //C is the node right after the node we want to remove
A.next = C;
B.next = null; -
How to get all tree node parents upon select
I have a tree, and when user clicks an item in the tree, I want to get all the parents of the selectedItem node.
So if I have this XML:
<products>
<item>
<sku>1001</sku>
<quantity value="100" />
</item>
<item>
<sku>2001</sku>
<quantity value="250" />
</item>
<item>
<sku>3001</sku>
<quantity value="300" />
</item>
</products>
If user clicks on the 1001 sku, I want to get something like this:
<products><item><sku>
Also if I have a custom component, perhaps based on tree or but maybe not, and if this custom component shows the actual XML and used can click on XML elements or XML attributes, how can I use the selected item to get the parent nodes, so if they click on the value="100", I want to get this:
<products><item><sku><quantity>
I need this because I have a set of fields, and users will drag their XML node elements or attributes to my fields, to define a mapping between their XML and my fields.
The selectedItem is just a snippet of XML cut off from its source XMLListCollection, and I might be able to search the XMLListCollection, but what if there were say <sku> elements at more than one level in the XML? I'm guessing a search might return multiple hits for a selected element, when I want the actual parent nodes for the actual selected node.
Thanks very much!var path:Array=[]
var parent:XML = xxxx.selectedItem.parent()
while(parent){
path.push(parent.localName())
parent = parent.parent()
Or, i didn't get your question and xxxx.selectedItem is "detached" XML snippet ? -
How can I add a new field in selection screen for this report
*& Report ZGS_BARKODLA_HIZLI_GIRIS
report zgs_barkodla_hizli_giris.
tables: mara,
mseg,
mch1,
*mch1,
mkpf,
mchb ,
makt.
type-pools: esp1.
data: i_message_tab type esp1_message_tab_type,
wa_message_tab type esp1_message_wa_type ,
sc_count type i.
ALV
type-pools: slis, kkblo.
data: gs_layout type slis_layout_alv ,
gt_fldcat type slis_t_fieldcat_alv with header line,
gt_header type slis_t_listheader with header line,
gt_sortin type slis_t_sortinfo_alv with header line,
g_repid like sy-repid .
define add-fieldcat.
gt_fldcat-fieldname = &1.
gt_fldcat-ref_tabname = &2.
gt_fldcat-seltext_s = &3.
gt_fldcat-seltext_m = &3.
gt_fldcat-seltext_l = &3.
gt_fldcat-reptext_ddic = &3.
gt_fldcat-ddictxt = 'M'.
append gt_fldcat.
clear gt_fldcat.
end-of-definition.
types: begin of titab,
sel type xfeld,
matnr type matnr,
maktx type maktx,
charg type charg_d,
menge type menge_d,
erfmg type erfmg,
end of titab.
data : witab type titab.
data : itab type table of titab.
data : ok_code type sy-ucomm.
controls: tc_itab type tableview using screen 0100.
data: gv_header like bapi2017_gm_head_01,
gv_code like bapi2017_gm_code.
BAPI export parameters
data: gv_headret type bapi2017_gm_head_ret,
gv_matdoc type bapi2017_gm_head_ret-mat_doc,
gv_matyear type bapi2017_gm_head_ret-doc_year.
data : lv_objek like inob-objek .
data : ls_inob like inob .
data : imseg type ty_t_mseg.
data : wmseg type mseg.
data : answer.
data : count type i.
data : v_atinn type atinn.
BAPI movement details
data: i_goodsmvt_items type bapi2017_gm_item_create occurs 0
with header line.
data: i_return type bapiret2 occurs 0 with header line.
start-of-selection.
call function 'CONVERSION_EXIT_ATINN_INPUT'
exporting
input = 'Z_ORAN'
importing
output = v_atinn.
call screen 100.
*& Module status_0100 OUTPUT
module status_0100 output.
set pf-status '100'.
set titlebar '100'.
mseg-werks = 1000.
mseg-umwrk = 1000.
**added
sc_count = sc_count + 1.
if sc_count eq 1.
mseg-bwart = 313.
endif.
mkpf-budat = sy-datum.
**added
describe table itab lines tc_itab-lines.
endmodule. " status_0100 OUTPUT
*& Module user_command_0100 INPUT
module user_command_0100 input.
data field(20).
data: line_t like sy-index.
data: lines like sy-index.
data line_count like sy-loopc.
data: begin of cols,
screen like screen,
index type i,
selected(1) type c,
vislength like icon-oleng,
invisible(1) type c,
end of cols.
case ok_code.
when 'DELE'.
delete itab where sel eq 'X'.
when 'ENTE'.
check *mch1-charg is not initial.
read table itab into witab with key charg = *mch1-charg.
if not sy-subrc is initial.
witab-charg = *mch1-charg.
select single matnr from mch1 into witab-matnr
where charg eq witab-charg.
if not syst-subrc is initial.
set cursor field '*MCH1-CHARG'.
message e115(12) with *mch1-charg.
endif.
select single maktx from makt into witab-maktx
where matnr eq witab-matnr
and spras eq syst-langu.
witab-erfmg = 1.
concatenate witab-matnr witab-charg into lv_objek .
clear ls_inob .
select single * into ls_inob
from inob
where objek = lv_objek and
klart = '023' and
obtab = 'MCH1' .
select single atflv from ausp into witab-menge
where objek = ls_inob-cuobj and
klart = '023' .
append witab to itab.
**added
clear *mch1-charg.
**added
endif.
when 'SAVE'.
if mkpf-budat is initial.
set cursor field 'MKPF-BUDAT'.
message e055(00).
endif.
if mseg-lgort is initial.
set cursor field 'MSEG-LGORT'.
message e055(00).
endif.
if mseg-umlgo is initial.
set cursor field 'MSEG-UMLGO'.
message e055(00).
endif.
if mseg-bwart is initial.
set cursor field 'MSEG-BWART'.
message e055(00).
endif.
refresh imseg.
loop at itab into witab.
move-corresponding witab to wmseg.
append wmseg to imseg.
endloop.
call function 'ZMM_POPUP_WITH_DATA'
exporting
imseg = imseg
importing
answer = answer.
if answer eq 'Y'.
perform create_goods_movement.
endif.
when 'P--'.
clear ok_code.
perform paging using 'P--'.
set cursor field 'MARA-MATNR' line 1.
when 'P-'.
clear ok_code.
perform paging using 'P-'.
set cursor field 'MARA-MATNR' line 1.
when 'P+'.
clear ok_code.
clear lines.
perform paging using 'P+'.
set cursor field 'MARA-MATNR' line 1.
when 'P++'.
clear ok_code.
perform paging using 'P++'.
set cursor field 'MARA-MATNR' line 1.
when 'SORA'.
read table tc_itab-cols into cols with key selected = 'X'.
if sy-subrc is initial.
field = cols-screen.
field = field+5(10).
sort itab ascending by (field).
endif.
when 'SORZ'.
read table tc_itab-cols into cols with key selected = 'X'.
if sy-subrc is initial.
field = cols-screen.
field = field+5(10).
sort itab descending by (field).
endif.
when 'PRNT'.
perform write_alv.
endcase.
endmodule. " user_command_0100 INPUT
*& Module read_table OUTPUT
module read_table output.
mara-matnr = witab-matnr.
makt-maktx = witab-maktx.
mch1-charg = witab-charg.
mseg-menge = witab-menge.
mseg-erfmg = witab-erfmg.
line_count = sy-loopc.
endmodule. " read_table OUTPUT
*& Module write_table INPUT
module write_table input.
witab-matnr = mara-matnr.
witab-maktx = makt-maktx.
witab-charg = mch1-charg.
witab-menge = mseg-menge.
witab-erfmg = mseg-erfmg.
modify itab from witab index tc_itab-current_line.
endmodule. " write_table INPUT
*& Module exit INPUT
module exit input.
leave to screen 0 .
endmodule. " exit INPUT
*& Form create_goods_movement
form create_goods_movement .
clear : gv_header, i_return[], i_goodsmvt_items[].
gv_header-doc_date = gv_header-pstng_date = mkpf-budat.
gv_header-pr_uname = sy-uname.
GM with reference to reservation
loop at itab into witab.
i_goodsmvt_items-material = witab-matnr.
i_goodsmvt_items-entry_qnt = witab-erfmg.
i_goodsmvt_items-entry_uom = 'ST'.
i_goodsmvt_items-move_type = mseg-bwart.
i_goodsmvt_items-plant = mseg-werks.
i_goodsmvt_items-stge_loc = mseg-lgort.
i_goodsmvt_items-move_plant = mseg-umwrk.
i_goodsmvt_items-move_stloc = mseg-umlgo.
i_goodsmvt_items-batch = witab-charg.
append i_goodsmvt_items.
endloop.
find BAPI processing transaction
if gv_code is initial.
perform determine_bapi_code using mseg-bwart
changing gv_code.
endif.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gv_header
goodsmvt_code = gv_code
importing
goodsmvt_headret = gv_headret
materialdocument = gv_matdoc
matdocumentyear = gv_matyear
tables
goodsmvt_item = i_goodsmvt_items
return = i_return[].
cancel blocking process
loop at i_return where type eq 'E' or type eq 'A' or type eq 'X'.
exit.
endloop.
if sy-subrc ne 0.
refresh i_message_tab.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
wa_message_tab-msgid = 'M7'..
wa_message_tab-msgty = 'S'.
wa_message_tab-msgno = '060'.
wa_message_tab-msgv1 = gv_matdoc.
wa_message_tab-msgv2 = ''.
wa_message_tab-msgv3 = ''.
wa_message_tab-msgv4 = ''.
append wa_message_tab to i_message_tab.
else.
refresh i_message_tab.
call function 'BAPI_TRANSACTION_ROLLBACK'.
write a message as there is an unexpected error.
loop at i_return.
wa_message_tab-msgid = i_return-id.
wa_message_tab-msgty = i_return-type.
wa_message_tab-msgno = i_return-number.
wa_message_tab-msgv1 = i_return-message_v1.
wa_message_tab-msgv2 = i_return-message_v2.
wa_message_tab-msgv3 = i_return-message_v3.
wa_message_tab-msgv4 = i_return-message_v4.
append wa_message_tab to i_message_tab.
endloop.
endif.
call function 'C14Z_MESSAGES_SHOW_AS_POPUP'
tables
i_message_tab = i_message_tab.
endform. " create_goods_movement
*& Form determine_bapi_code
form determine_bapi_code using p_bwart type bwart
changing p_code type bapi2017_gm_code.
data: lt_t158b type table of t158b with header line.
clear p_code.
select tcode from t158b into corresponding fields of table lt_t158b
where bwart eq p_bwart.
loop at lt_t158b.
select single gmcode from t158g into p_code
where tcode eq lt_t158b-tcode.
if sy-subrc is initial.
exit.
endif.
endloop.
endform. " determine_bapi_code
*& Form paging
form paging using code.
data: i type i,
j type i.
case code.
when 'P--'. tc_itab-top_line = 1.
when 'P-'.
tc_itab-top_line = tc_itab-top_line - line_count.
if tc_itab-top_line le 0.
tc_itab-top_line = 1.
endif.
when 'P+'.
i = tc_itab-top_line + line_count.
j = tc_itab-lines - line_count + 1.
if j le 0.
j = 1.
endif.
if i le j.
tc_itab-top_line = i.
else.
tc_itab-top_line = j.
endif.
when 'P++'.
tc_itab-top_line = tc_itab-lines - line_count + 1.
if tc_itab-top_line le 0.
tc_itab-top_line = 1.
endif.
endcase.
endform. " paging
*& Form write_alv
form write_alv .
perform find_list_header.
perform fill_field_cat.
perform fill_sortinfo.
g_repid = sy-repid.
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
answer = 'Y'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = ''
i_callback_program = g_repid
i_save = 'A'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = gs_layout
it_fieldcat = gt_fldcat[]
it_sort = gt_sortin[]
tables
t_outtab = itab[].
endform. " write_alv
Form find_list_header
form find_list_header.
data : v_datum(10),
v_datlo(10),
v_dathi(10),
v_uzeit(8).
clear: gt_header, gt_header[].
gt_header-typ = 'H'.
gt_header-info = sy-title.
append gt_header.
clear gt_header.
gt_header-typ = 'S'.
gt_header-key = 'Çalıştırma Zamanı : '.
write syst-datum to v_datum.
write syst-uzeit to v_uzeit.
concatenate v_datum '/' v_uzeit into gt_header-info.
append gt_header.
endform. " find_list_header
Form fill_field_cat
form fill_field_cat.
refresh gt_fldcat.
clear gt_fldcat.
gt_fldcat-key = 'X'.
add-fieldcat 'MATNR' 'MARA' ''.
add-fieldcat 'MAKTX' 'MAKT' ''.
add-fieldcat 'CHARG' 'MSEG' ''.
gt_fldcat-do_sum = 'X'.
add-fieldcat 'MEINS' 'MARA' 'Olcu Birimi '.
gt_fldcat-do_sum = 'X'.
add-fieldcat 'ERFMG' 'MSEG' 'Adet'.
endform. " fill_field_cat
Form fill_sortinfo
form fill_sortinfo.
gt_sortin-up = 'X'.
gt_sortin-fieldname = 'MATNR'. append gt_sortin.
endform. " fill_sortinfo
Form top_of_page *
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'ZKUTAS'
it_list_commentary = gt_header[].
endform. " top_of_pageHI,
if it is a normal report program then you can directly create a Selection screen field.
After the Type-pool you can use Parameters or Select-options to create the selection screen field..
If it is a Modulpool program then you can create a selection scren field like
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
PARAMETERS: p1(10) TYPE c.
SELECTION-SCREEN END OF SCREEN 1100.
defines a selection screens 1100 as subscreens.
The next screen number of screen 100 is 100 (statically-defined).
PROCESS BEFORE OUTPUT.
MODULE status_0100.
CALL SUBSCREEN area INCLUDING sy-repid number.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
CALL SUBSCREEN area.
MODULE user_command_0100.
look at the below link
http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
Regards
Sudheer -
How do you add pictograph favorites to font selection when composing mail messages?
I located the desired symbols from the "Characters" selection when I chose the Format menu and opened the gear symbol on the bottom lefthand of the pulldown menu. Now I do not understand how to place these "Favorite" symbols I identified placed into my Font selection for easy access or use when composing mail messages.
Hi skrug1967!
I have an article for you that I believe can address this question for you:
OS X Mountain Lion: Enter special characters and symbols
http://support.apple.com/kb/PH10758
Take care, and thanks for visiting the Apple Support Communities.
Cheers,
Braden -
How can I add applications not listed in the root Applications folder?
I'm running in a non-administrative (i.e. not the first) user account, I have my own Applications folder with apps that I have downloaded and installed myself. Is it possible to add these apps to the list in Automator?
I believe he was answering what you were implying by implying that Automator would automatically be aware of the actions once you've used the application.
If it doesn't have any actions, then the app won't show up in Automator. If you've downloaded actions for an app separate from it, you can add the actions using an option in Automator's File menu. More about that here.
http://docs.info.apple.com/article.html?path=Automator/1.0/en/ensm1010.html
Just to be clear, it shouldn't matter where the app is installed, just make sure you've used the app so the system will know about more about the app. The same thing goes for Spotlight, file types, services (application menu > Services), and so on. It shouldn't matter where the app is located, the system will discover what the app has available when you open that app.
If you believe an app should have Automator actions, then review the website of the developer of that app for info about what the actions are and whether they made them separate from the app for some reason. Another possibility is the actions might be available only in certain versions of the app you've installed. Definitely check the the app's developer's website for info about its actions. -
How can i add formula to waveform data type?
I want to interpolate my acquired data in terms of voltage to temperature. For this i need to use polynomial equation, but i am not able to directly attach formula node to the waveform data type. I want to know how can i add formula node to waveform data, and then also have it real time.
One additional thought that may be helpful. Once you get the Y component of the waveform graph you are going to attempt to wire this into a formula node. You can do one of two things with that array. Put a for loop around the formula node and index the array into and out of the for loop. This allows you to do scalar math on the data. It is also possible to index and array in a formula node. The following KnoledgeBase demonstrates how to do this: http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9d72b6069346942386256a0d00604ed4?OpenDocument
-
Add new node on vehicle master
Hello experts,
We have many custom fields on vehicle master and we can't add more than 99 custom fields on same screen (SAP restriction)
Now I want to add new node (like we have data Entry, Service, Document flow)
Once I add new node, we know how to add new tab and fields. But How can we add new node no Vehicle master?
Do we need to use one of below mentioned BAdI or some other and how to do it step by step.
BAdI: Exchange Vehicle Data Screen in Vehicle Detail
Or
BAdI: Exchange Configuration Screen in Vehicle Detail
Please advice.
ThanksHi ,
do you want to enhance DBM vehicle master or VMS ?
Regards
Ganesh -
How do I add a variable into an object as xml
I have a xml document with 2 protection order numbers. I want to get the information for one of them which is **protectionOrderNumber="1400042"**. I would like to add strPoNumber variable to the object objXmlCaseDoc. Inside this object is the xml
that was read and put inside the object. I want at the beginning of the xml code inside the objXmlCaseDoc to add the protectionOrderNumber at the end of the first line. This should be added at the beginning of the xml document. In my object (objXmlCaseDoc)
there is no variable strPoNumber. This is why I want to add it at the top. The object has xml document in it.
It should look like this:
<Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" protectionOrderNumber="1400042">
My vb code: I have the variable strPoNumber and the object where the xml document is. Object name is objXmlCaseDoc
I want to add the line of code where I have comment Tranform case information into the output format near the bottom of the code.
Option Strict On
Option Explicit On
Imports System.Xml
Public Class BcaPoRequests
Shared Sub Main()
Dim objMessageProcessor As New MessageProcessor
Dim objSchemasCollection As New Msc.Integration.MessageBroker.Library.v4.SchemasCollection
Dim objTransformsCollection As New Msc.Integration.MessageBroker.Library.v4.TransformsCollection
objMessageProcessor.ProcessInputQueue(False, False, objSchemasCollection, objTransformsCollection)
End Sub
Private Class MessageProcessor
Inherits Msc.Integration.ServiceCatalog.Library.v4.SoapMessageProcessor
Protected Overrides Sub ProcessMessage(ByRef aobjBroker As ServiceCatalog.Library.v4.Broker, ByRef aobjXMLInputSoapEnvelopeDoc As System.Xml.XmlDocument, ByRef aobjInstantiatedObjectsCstrollection As Microsoft.VisualBasic.Collection, ByRef aobjConsumer As ServiceCatalog.Library.v4.Consumer)
MyBase.ProcessMessage(aobjBroker, aobjXMLInputSoapEnvelopeDoc, aobjInstantiatedObjectsCollection, aobjConsumer)
Dim objXmlMessageDoc As XmlDocument
Dim objXmlMessageNode As XmlNode
Dim objNameTable As NameTable
Dim objXMLNameSpaceManager As XmlNamespaceManager
Dim objXMLSchemaException As Xml.Schema.XmlSchemaException
Dim strCaseNumber As String
Dim strPoNumber As String
Dim objXmlCaseDoc As XmlDocument
'create a namespace manager used for queries into inputmessage (because of namespace)
objNameTable = New NameTable
objXMLNameSpaceManager = New XmlNamespaceManager(objNameTable)
objXMLNameSpaceManager.AddNamespace("ext", "http://www.courts.state.mn.us/ProtectionOrderExtension/1.0")
objXMLNameSpaceManager.AddNamespace("exc", "http://www.courts.state.mn.us/ProtectionOrderQuery/1.0")
objXMLNameSpaceManager.AddNamespace("soap", "http://www.w3.org/2003/05/soap-envelope")
objXMLNameSpaceManager.AddNamespace("wsa", "http://schemas.xmlsoap.org/ws/2004/08/addressing")
objXmlMessageNode = aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Body/exc:ProtectionOrderQueryRequest", objXMLNameSpaceManager)
objXmlMessageDoc = New XmlDocument
objXmlMessageDoc.LoadXml(objXmlMessageNode.OuterXml)
'Check authorization
'Validate the input message
objXMLSchemaException = aobjBroker.ValidateXmlDocument(objXmlMessageDoc, "ProtectionOrderQuery_1_0.xsd", "NiemExchanges\ProtectionOrders\Exchange", , False)
If Not objXMLSchemaException Is Nothing Then
'return fault if invalid
aobjBroker.Reply(aobjBroker.CreateSoapFault(Msc.Integration.Utility.Library.v4.Soap.udtSoapCodes.Sender, Msc.Integration.Utility.Library.v4.Xml.FormatXmlSchemaValidationErrorText(objXMLSchemaException), Msc.Integration.Utility.Library.v4.Soap.udtSoapRoles.RoleUltimateReceiver, aobjXMLInputSoapEnvelopeDoc, "soap:InvalidMessage", "soap:Body", Msc.Integration.Utility.Library.v4.Soap.GetReplyEndpointReference(aobjXMLInputSoapEnvelopeDoc), aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Header/wsa:MessageID", objXMLNameSpaceManager).InnerText, aobjConsumer))
Exit Sub
End If
'Get the case number and the PO number from the input message
strCaseNumber = objXmlMessageDoc.DocumentElement.SelectSingleNode("ext:CourtFileNumber", objXMLNameSpaceManager).InnerText
strPoNumber = objXmlMessageDoc.DocumentElement.SelectSingleNode("ext:ProtectionOrderID", objXMLNameSpaceManager).InnerText
'Get the case information from Mncis
'Code for calling the case
objXmlCaseDoc = Msc.Integration.Mncis.Library.v4.Case.GetIxmlForCaseNumber(strCaseNumber, "CourtCaseHeader,ProtectionOrder,SubjectParties,HearingTrialSetting", False)
'Tranform case information into the output format
End Sub
End Class
End Class
xslt code
<?xml version="1.0" encoding="UTF-8"?>
<?altova_samplexml file:///Z:/Training%20with%20Tim%20XML%20code%20various/BcaRequestIxml.xml?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:poq="http://www.courts.state.mn.us/ProtectionOrderQuery/1.0" xmlns:ext="http://www.courts.state.mn.us/ProtectionOrderExtension/1.0" xmlns:nc="http://niem.gov/niem/niem-core/2.0" xmlns:j="http://niem.gov/niem/domains/jxdm/4.1" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:exsl="urn:schemas-microsoft-com:xslt" extension-element-prefixes="exsl" exclude-result-prefixes="mscef msxsl exsl">
<xsl:import href="../General/ExtensionFunctions.xsl"/>
<xsl:import href="MNCIS_PO_BCA_ProtectionOrder_1_0.xsl"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<!-- Path to environment folder used by document function. Relative to location of stylesheet. -->
<xsl:param name="gEnvPath">../..</xsl:param>
<xsl:template match="/">
<xsl:variable name="vPoNumber">
<xsl:value-of select="Integration/@protectionOrderNumber"/>
</xsl:variable>
<poq:ProtectionOrderQueryResponse>
<xsl:for-each select="//Integration/ProtectionOrder[ProtectionOrderNumber=$vPoNumber]">
<xsl:call-template name="ProtectionOrder"/>
</xsl:for-each>
</poq:ProtectionOrderQueryResponse>
</xsl:template>
</xsl:stylesheet>
XML document output from my xslt code
<?xml version="1.0" encoding="UTF-8"?>
<poq:ProtectionOrderQueryResponse xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:poq="http://www.courts.state.mn.us/ProtectionOrderQuery/1.0" xmlns:ext="http://www.courts.state.mn.us/ProtectionOrderExtension/1.0" xmlns:nc="http://niem.gov/niem/niem-core/2.0" xmlns:j="http://niem.gov/niem/domains/jxdm/4.1">
<ext:ProtectionOrder xmlns:exc="http://www.courts.state.mn.us/ProtectionOrderServiceExchange/1.0" xmlns:s="http://niem.gov/niem/structures/2.0" xmlns:usps="http://niem.gov/niem/usps_states/2.0">
<j:CourtOrderEnforcementAgency>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN0700000</nc:IdentificationID>
</nc:OrganizationIdentification>
</j:CourtOrderEnforcementAgency>
<ext:ForeignOrderIdentification>
<nc:IdentificationID/>
<ext:ForeignOrderIdentificationTypeCode/>
</ext:ForeignOrderIdentification>
<ext:HearingHeldIndicator>false</ext:HearingHeldIndicator>
<nc:Location s:id="DB1618611387">
<nc:LocationAddress>
<nc:StructuredAddress>
<nc:LocationStreet>
<nc:StreetFullText>3434 Bohnsack Way</nc:StreetFullText>
<nc:StreetFullText>Unit 75 B</nc:StreetFullText>
<nc:StreetFullText/>
</nc:LocationStreet>
<nc:LocationCityName>New Prague</nc:LocationCityName>
<nc:LocationStateUSPostalServiceCode>MN</nc:LocationStateUSPostalServiceCode>
<nc:LocationPostalCode>56071</nc:LocationPostalCode>
</nc:StructuredAddress>
</nc:LocationAddress>
</nc:Location>
<ext:ProtectedParty>
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="true">1987-11-21</ext:PersonBirthDate>
<nc:PersonName>
<nc:PersonGivenName>Jennifer</nc:PersonGivenName>
<nc:PersonMiddleName>Marie</nc:PersonMiddleName>
<nc:PersonSurName>O'Brien</nc:PersonSurName>
<nc:PersonNameSuffixText/>
<nc:PersonFullName>O'Brien, Jennifer Marie</nc:PersonFullName>
</nc:PersonName>
<ext:PersonRaceCode/>
<nc:PersonSexCode>F</nc:PersonSexCode>
<ext:PetitionerIndicator>true</ext:PetitionerIndicator>
</ext:ProtectedParty>
<ext:ProtectedParty>
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="true">2008-03-24</ext:PersonBirthDate>
<nc:PersonName>
<nc:PersonGivenName>Eli</nc:PersonGivenName>
<nc:PersonMiddleName>Rose</nc:PersonMiddleName>
<nc:PersonSurName>Noir</nc:PersonSurName>
<nc:PersonNameSuffixText/>
<nc:PersonFullName>Noir, Eli Rose</nc:PersonFullName>
</nc:PersonName>
<ext:PersonRaceCode/>
<nc:PersonSexCode>F</nc:PersonSexCode>
<ext:PetitionerIndicator>false</ext:PetitionerIndicator>
</ext:ProtectedParty>
<ext:ProtectionOrderBradyIndicator>N</ext:ProtectionOrderBradyIndicator>
<ext:ProtectionOrderCondition>
<ext:ConditionText>Respondent must not have any contact with the Protected Person(s) whether in person, with or through other persons, by telephone, mail, e-mail, through electronic devices, social media, or by any other means except as follows: [] </ext:ConditionText>
<ext:ConditionCode>08</ext:ConditionCode>
</ext:ProtectionOrderCondition>
<ext:ProtectionOrderCondition>
<ext:ConditionText>Respondent must stay a reasonable distance away from the residence(s) of the Protected Person(s), specifically as follows: [distance]; and Respondent must stay a reasonable distance away from ANY FUTURE RESIDENCES of the Protected Person(s). </ext:ConditionText>
<ext:ConditionCode>04</ext:ConditionCode>
</ext:ProtectionOrderCondition>
<ext:ProtectionOrderCondition>
<ext:ConditionText>Respondent shall not call or enter Petitioner's place of employment which includes all land, parking lots, and buildings at: </ext:ConditionText>
<ext:ConditionCode>04</ext:ConditionCode>
</ext:ProtectionOrderCondition>
<ext:ProtectionOrderExpirationDate>2015-12-22</ext:ProtectionOrderExpirationDate>
<ext:ProtectionOrderFinding>
<ext:FindingText>Respondent personally appeared or had reasonable notice and opportunity to be heard. The procedures for service upon Respondent set forth in the Minnesota Domestic Abuse Act (Minn.Stat. 518B.01) were followed, and the court has jurisdiction over the parties and subject matter. </ext:FindingText>
<ext:FindingCode>OAH1</ext:FindingCode>
</ext:ProtectionOrderFinding>
<ext:ProtectionOrderFinding>
<ext:FindingText>Acts of domestic abuse have occurred, including the following: [] </ext:FindingText>
<ext:FindingCode>OAH4A</ext:FindingCode>
</ext:ProtectionOrderFinding>
<ext:ProtectionOrderID>1400042</ext:ProtectionOrderID>
<ext:ProtectionOrderIssuingCourt>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN070015J</nc:IdentificationID>
</nc:OrganizationIdentification>
<ext:CourtFaxNumber>
<nc:TelephoneNumberFullID>952-496-8211</nc:TelephoneNumberFullID>
</ext:CourtFaxNumber>
<ext:CourtTelephoneNumber>
<nc:TelephoneNumberFullID>952-496-8200</nc:TelephoneNumberFullID>
<nc:TelephoneSuffixID/>
</ext:CourtTelephoneNumber>
</ext:ProtectionOrderIssuingCourt>
<ext:ProtectionOrderIssuingDate>2014-12-22</ext:ProtectionOrderIssuingDate>
<ext:ProtectionOrderIssuingJudicialOfficial>
<nc:PersonName>
<nc:PersonGivenName>Do</nc:PersonGivenName>
<nc:PersonMiddleName>P.</nc:PersonMiddleName>
<nc:PersonSurName>Ande</nc:PersonSurName>
<nc:PersonNameSuffixText/>
<nc:PersonFullName>Ande, Do P.</nc:PersonFullName>
</nc:PersonName>
</ext:ProtectionOrderIssuingJudicialOfficial>
<ext:ProtectionOrderOtherIdentification>
<nc:IdentificationID>12345</nc:IdentificationID>
<ext:ProtectionOrderOtherIdentificationTypeCode>NCICNUM</ext:ProtectionOrderOtherIdentificationTypeCode>
</ext:ProtectionOrderOtherIdentification>
<ext:ProtectionOrderService>
<ext:ProtectionOrderServiceAgency>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN0191000</nc:IdentificationID>
</nc:OrganizationIdentification>
</ext:ProtectionOrderServiceAgency>
<ext:ProtectionOrderServiceDate>2015-01-10</ext:ProtectionOrderServiceDate>
<ext:ProtectionOrderServiceTime>16:25:00-06:00</ext:ProtectionOrderServiceTime>
<ext:ProtectionOrderServiceToCode>Respondent</ext:ProtectionOrderServiceToCode>
<ext:ProtectionOrderServiceTypeCode>BYPUB</ext:ProtectionOrderServiceTypeCode>
</ext:ProtectionOrderService>
<ext:ProtectionOrderService>
<ext:ProtectionOrderServiceAgency>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN0191000</nc:IdentificationID>
</nc:OrganizationIdentification>
</ext:ProtectionOrderServiceAgency>
<ext:ProtectionOrderServiceDate>2015-01-10</ext:ProtectionOrderServiceDate>
<ext:ProtectionOrderServiceTime>16:25:00-06:00</ext:ProtectionOrderServiceTime>
<ext:ProtectionOrderServiceToCode>Respondent</ext:ProtectionOrderServiceToCode>
<ext:ProtectionOrderServiceTypeCode>BYPUB</ext:ProtectionOrderServiceTypeCode>
</ext:ProtectionOrderService>
<ext:ProtectionOrderService>
<ext:ProtectionOrderServiceAgency>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN0191000</nc:IdentificationID>
</nc:OrganizationIdentification>
</ext:ProtectionOrderServiceAgency>
<ext:ProtectionOrderServiceDate>2015-01-10</ext:ProtectionOrderServiceDate>
<ext:ProtectionOrderServiceToCode>Respondent</ext:ProtectionOrderServiceToCode>
<ext:ProtectionOrderServiceTypeCode>BYPUB</ext:ProtectionOrderServiceTypeCode>
</ext:ProtectionOrderService>
<ext:ProtectionOrderService>
<ext:ProtectionOrderServiceAgency>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN0250800</nc:IdentificationID>
</nc:OrganizationIdentification>
</ext:ProtectionOrderServiceAgency>
<ext:ProtectionOrderServiceDate>2015-01-09</ext:ProtectionOrderServiceDate>
<ext:ProtectionOrderServiceToCode>Respondent</ext:ProtectionOrderServiceToCode>
<ext:ProtectionOrderServiceTypeCode>BYMAIL</ext:ProtectionOrderServiceTypeCode>
</ext:ProtectionOrderService>
<ext:ProtectionOrderService>
<ext:ProtectionOrderServiceAgency>
<nc:OrganizationIdentification>
<nc:IdentificationID>MN0720100</nc:IdentificationID>
</nc:OrganizationIdentification>
</ext:ProtectionOrderServiceAgency>
<ext:ProtectionOrderServiceDate>2014-12-22</ext:ProtectionOrderServiceDate>
<ext:ProtectionOrderServiceToCode>Respondent</ext:ProtectionOrderServiceToCode>
<ext:ProtectionOrderServiceTypeCode>BYPUB</ext:ProtectionOrderServiceTypeCode>
</ext:ProtectionOrderService>
<ext:ProtectionOrderStatus>
<ext:ProtectionOrderStatusCode>SBJO</ext:ProtectionOrderStatusCode>
<ext:ProtectionOrderStatusDate>2014-12-22</ext:ProtectionOrderStatusDate>
</ext:ProtectionOrderStatus>
<ext:ProtectionOrderTypeCode>OFP</ext:ProtectionOrderTypeCode>
<ext:QualifyingRelationship>
<ext:QualifyingRelationshipCode>LIVTOGTHR</ext:QualifyingRelationshipCode>
<ext:QualifyingRelationshipText>Lived Together</ext:QualifyingRelationshipText>
</ext:QualifyingRelationship>
<ext:Respondent>
<nc:PersonEthnicityCode/>
<nc:PersonEyeColorCode/>
<nc:PersonHairColorCode>XXX</nc:PersonHairColorCode>
<nc:PersonHeightMeasure>
<nc:MeasureText>71</nc:MeasureText>
<nc:MeasureUnitText>inches</nc:MeasureUnitText>
<nc:LengthUnitCode>INH</nc:LengthUnitCode>
</nc:PersonHeightMeasure>
<ext:PersonRaceCode>W</ext:PersonRaceCode>
<nc:PersonSexCode>M</nc:PersonSexCode>
<nc:PersonWeightMeasure>
<nc:MeasureText>210</nc:MeasureText>
<nc:MeasureUnitText>pounds</nc:MeasureUnitText>
<nc:WeightUnitCode>LBR</nc:WeightUnitCode>
</nc:PersonWeightMeasure>
<ext:AddressReference ext:currentIndicator="true">
<nc:LocationReference s:ref="DB1618611387"/>
</ext:AddressReference>
<ext:PersonBirthDate ext:approximateDateIndicator="true" ext:currentIndicator="false">1990-12-23</ext:PersonBirthDate>
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="false">1989-12-23</ext:PersonBirthDate>
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="true">1991-12-23</ext:PersonBirthDate>
<ext:PersonName ext:currentIndicator="true">
<nc:PersonGivenName>Guy</nc:PersonGivenName>
<nc:PersonMiddleName>Andr</nc:PersonMiddleName>
<nc:PersonSurName>Noir</nc:PersonSurName>
<nc:PersonNameSuffixText>Jr.</nc:PersonNameSuffixText>
<nc:PersonFullName>Noir Jr , Guy Andr</nc:PersonFullName>
</ext:PersonName>
</ext:Respondent>
<ext:RespondentPresentAtHearingIndicator>false</ext:RespondentPresentAtHearingIndicator>
</ext:ProtectionOrder>
<ext:SupersededProtectionOrderID xmlns:exc="http://www.courts.state.mn.us/ProtectionOrderServiceExchange/1.0" xmlns:s="http://niem.gov/niem/structures/2.0" xmlns:usps="http://niem.gov/niem/usps_states/2.0"/>
<ext:Hearing xmlns:exc="http://www.courts.state.mn.us/ProtectionOrderServiceExchange/1.0" xmlns:s="http://niem.gov/niem/structures/2.0" xmlns:usps="http://niem.gov/niem/usps_states/2.0">
<ext:HearingDateTime>2015-01-20T09:00:00-06:00</ext:HearingDateTime>
<ext:HearingLocationText>Scott County</ext:HearingLocationText>
</ext:Hearing>
</poq:ProtectionOrderQueryResponse>Inert to root as first nood.
http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.insertbefore(v=vs.110).aspx
Dim doc As New XmlDocument()
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" & _
"<title>Pride And Prejudice</title>" & _
"</book>")
Dim root As XmlNode = doc.DocumentElement
'Create a new node.
Dim elem As XmlElement = doc.CreateElement("price")
elem.InnerText = "19.95"
'Add the node to the document.
root.InsertBefore(elem, root.FirstChild)
Console.WriteLine("Display the modified XML...")
doc.Save(Console.Out)
remember make the reply as answer and vote the reply as helpful if it helps. -
How can I add more items to an array?
hi there
I have a file chooser to select files. and store them in a File[] listfile. but if I need to add some more files to this listfile, how can I add them without deleting previous selected files? I know I can use List class to do this, can I just use listfile directly?
thank youYou can't change the size of an array once you have created it. You can use a List, as you say, or you can copy the array entries to a new array of a different size.
-
Hello,"
How can I add own steps to the selection menu, so that I can insert them with "Insert Steps" in my sequence?
regards
samuelThank you Mike,
I have now the problem, that all properties of the created step(steps created with CVI) which I add with "specify module" (double klick on the new created step in Type palett->Substeps->Specify Module ) are not available when I add this step in my sequence. what is the problem here?
regards samuel -
How can I add an attribute to a node?
Hi,
How can I add an attribute to a node of a DOM Document?
I want to add attribute Maximum="6" for all Grade node as <Grade Maximum="6">.
Grade is a third level node in my document.
ThanksHi,
How can I add an attribute to a node of a DOM
Document?
I want to add attribute Maximum="6" for all Grade node
as <Grade Maximum="6">.
Grade is a third level node in my document.
ThanksGet the father of "Grade" elements as an element. Then get all elements named "Grade", and for each one set attribute "Maximum" with value "6". If you read api documentation you will know which methods to use.
But for helping you in getting the "Grade" parent.
1) get the root element of the Dom Doc
2)get the father of the "Grade" father: getElementsBytagName("his name") -> it will return a Node List get the first element casting as Element if there's only one, or elese if not case
3)the same method in 2 get the "Grade" father
4)getElementByTagName("Grade") over the "Grade" father -> for each "grade" element on nodelist do whatever you need
i hope u understood... -
How to Implement Add User Functionality in ADF
Hi,
I already setup my web app to use ADF security and the sample user's and groups that I have created in jazn-data.xml is already
functioning as expected.
I just need to add the functionality on how to programmmaically add user in my weblogic internal LDAP realm
and assign them to the currently configured user groups.
This would be available to Admin Level user.
Anybody has good site or link on how to accomplish this in my ADF Web Application?
Thanks
JDEV 11G PS3Hi Arun,
Jdev Version 11.1.1.6.0
I have one table already created in a hosted db.It has some columns namely Component,Manager,%CodeCoverage,TotalLines,Covered Lines.One manager has 5-6 components under him.
What I want is to have a table having manager name and if I click on manager,it should show components under him with all the details mentioned above.
I wanted to achieve it through tree table but don't know how to proceed
Maybe you are looking for
-
How to compare the data in a view with data present in a master data?
Hi All, We have loaded some data into a Master Data Object (YMETADATA) in Development system. Now, the same data can be present in a view RSDVCHA. Our aim is to write a ABAP program, which would read a record from RSDVCHA and look into Master Data re
-
How to configure standby database in a single machine
I am in Windows XP professional and oracle 9i . I want to configure a standby database for a database called proddb in the same machine. For doing this, I created a standby controlfile. But this work for the same name standby database?. How this happ
-
iTunes will not install on my computer (Windows 8) and i tried everything in "Issues installing iTunes or QuickTime for Windows" but nothing worked. any help?
-
How do I save my new data into a new .xls file? i am running my VI in a continious mode
I am using a Data Acquisition Board to get my pressure and displacement signals. Have to measure it continiously. I am able to save the data continiously but not in new XLS file for new experiment. If any of you could hepl me with it
-
Where can I get a cheap old iPod
Hi, Christmas is coming and I wanted to buy a family member an iPod shuffle that looks like the one in the attached image. I also wanted to know what some other cheap iPods are. I don't have that much money so $25 is kinda my limit Thanks in advance,