Need info on Date Utility Classes
Hi Experts,
Can someone please suggest me some re-usable date utility classes which I can re-use in my application(preferably date utility classes provided by basis so I dont need to bother about package ) ? What I want to do is pretty simple: Read current date/current month/Year and do basic date calculations.
Best Regards,
Viqar Ali.
Vijay,
I got a few classes(mostly BSP utility classes), but I could not use them due to package dependancy problems. Can somebody please suggest some date utility classes which I can use in my Web-Dynpro applications ?
Best Regards,
Viqar Ali.
Similar Messages
-
1.I have an internal table <b>it_vbak</b> with fields <b>vbeln & auart</b>
2. Select-options: <b>s_auart</b> for <b>vbak-auart</b>
3. I need to retrieve data into <b>it_vbak</b> with the following condition :
VBAK-VBELN = VBFA-VBELV and
VBFA-VBELN = LIKP-VBELN and
( VBTYP_N = 'J' or VBTYP_N ) and
(VBTYP_V ='C' or VBTYP_V ='I') and VBAK-AUART in s_auart.
If I use Inner Join I can't use in s_auart.
...Please let me knowhi,
make use of for all entries
first fetch the data from vbak where auart in s_auart(it_vbak_
and the pass it to vbfa(it_vbfa)using for all entries
the pass vbfa to likp using for all entries(it_likp)
then take one final internal table (it_final) and populate final internal table.
check this example for reference: my requirement si little bit different
*& Report ZRSDREPORT
REPORT ZRSDREPORT LINE-SIZE 230
NO STANDARD PAGE HEADING
MESSAGE-ID ZZ.
Author : Sudha Rani Pathuri *
Date : 07/04/2007 *
Title : DELIVERY STATUS REPORT *
Program Type : Executable Program *
Tables Used: : VBAK,VBAP,LIKP,LIPS,VBFA,VBUP *
Purpose : This report gives the status od the delivery *
based on sales order data *
*& TABLES DECLARATION *
TABLES : VBAK,VBPA,LIKP.
declaraing TYPEPOLL SLIS *
TYPE-POOLS : SLIS.
*& SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN :SKIP 2.
SELECT-OPTIONS: S_VKORG FOR VBAK-VKORG NO-EXTENSION,
S_VTWEG FOR VBAK-VTWEG NO-EXTENSION,
S_SPART FOR VBAK-SPART NO-EXTENSION,
S_KUNNR FOR VBPA-KUNNR,
SO_KUNNR FOR VBPA-KUNNR,
S_VBELN FOR LIKP-VBELN NO-EXTENSION,
S_ERDAT FOR LIKP-ERDAT OBLIGATORY NO-EXTENSION,
SO_ERDAT FOR VBAK-ERDAT NO-EXTENSION.
SELECTION-SCREEN :SKIP 2.
SELECTION-SCREEN END OF BLOCK B1.
*& TYPES DECARATION *
*--types declaration for capturing vbeln from vbak
TYPES : BEGIN OF TY_VBELN,
VBELN TYPE VBELN, "Sales Doc No
END OF TY_VBELN,
*--types declaration for vbap
BEGIN OF TY_VBAP,
VBELN LIKE VBAP-VBELN, "Sales Document
POSNR LIKE VBAP-POSNR, "Sales Document Item
MATNR LIKE VBAP-MATNR, "Material Number
KWMENG LIKE VBAP-KWMENG, "Cumulative order quantity in
"sales units
KDMAT LIKE VBAP-KDMAT, "Material Number Used by Customer
END OF TY_VBAP,
*--types declaration for vbfa
BEGIN OF TY_VBFA,
VBELV LIKE VBFA-VBELV, "Preceding sales and distribution
"document
POSNV LIKE VBFA-POSNV, "Preceding item of an SD document
VBELN LIKE VBFA-VBELN, "Subsequent s and d document
POSNN LIKE VBFA-POSNN, "Subsequent item of an SDdocument
END OF TY_VBFA,
*--types declaration for likp
BEGIN OF TY_LIKP,
VBELN LIKE LIKP-VBELN, "Delivery no
END OF TY_LIKP,
*--types declaration for lips
BEGIN OF TY_LIPS,
VBELN LIKE LIPS-VBELN, "Delivery
POSNR LIKE LIPS-POSNR, "Delivery item
MATNR LIKE LIPS-MATNR, "Material Number
LFIMG LIKE LIPS-LFIMG, "Actual quantity delivered (in
sales units)
vgbel LIKE lips-vgbel, "Document number of the reference
"document
END OF TY_LIPS,
*--types declaration for vbup
BEGIN OF TY_VBUP,
VBELN LIKE VBUP-VBELN, "Sales and Distribution Document
"Number
POSNR LIKE VBUP-POSNR, "Item number of the SD document
LFSTA LIKE VBUP-LFSTA, "Delivery status
WBSTA LIKE VBUP-WBSTA, "Goods movement status
FKSTA LIKE VBUP-FKSTA, "Billing status of delivery
"related billing document
END OF TY_VBUP,
*--types declaration for final internal table for diplaying purpose
BEGIN OF TY_FINAL,
VBELN(10) TYPE C,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
KWMENG LIKE VBAP-KWMENG,
KDMAT LIKE VBAP-KDMAT,
VBELN1 LIKE LIKP-VBELN,
POSNR1 LIKE LIPS-POSNR,
LFIMG LIKE LIPS-LFIMG,
MATNR1 LIKE LIPS-MATNR,
DS(25) TYPE C,
END OF TY_FINAL.
*& CONSTANTS DECARATION *
CONSTANTS: C_DTYPE TYPE C VALUE 'J'.
*& INTERNAL TABLE DECARATION *
DATA : I_VBELN TYPE STANDARD TABLE OF TY_VBELN WITH HEADER LINE,
I_VBAP TYPE STANDARD TABLE OF TY_VBAP WITH HEADER LINE,
I_VBFA TYPE STANDARD TABLE OF TY_VBFA WITH HEADER LINE,
I_LIKP TYPE STANDARD TABLE OF TY_LIKP WITH HEADER LINE,
I_LIPS TYPE STANDARD TABLE OF TY_LIPS WITH HEADER LINE,
I_VBUP TYPE STANDARD TABLE OF TY_VBUP WITH HEADER LINE,
I_FINAL TYPE STANDARD TABLE OF TY_FINAL WITH HEADER LINE.
*& FIELDCATALOG DECARATION *
DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
LT_SORT TYPE SLIS_T_SORTINFO_ALV,
I_LAYOUT TYPE SLIS_LAYOUT_ALV.
*& START-OF-SELECTION *
START-OF-SELECTION.
*--for fetching slaes and delivery data
PERFORM GET_DATA.
*--populating the data into one internal table for output
PERFORM POPULATE_FINAL.
*--for displaying the data using alv
PERFORM CALL_ALV.
*& Form get_data
FORM GET_DATA .
*--for retrieving vbeln from VBAK or VbAP
PERFORM GET_VBELN.
*--retrieving data from VBAP
PERFORM GET_VBAP.
*--fetching delivery document details using VBFA.
PERFORM GET_VBFA.
*--fetching delivery data from LIKP
PERFORM GET_LIKP.
*--fetching delivery data from LIPS
PERFORM GET_LIPS.
*--fetching data from VBUP
PERFORM GET_VBUP.
ENDFORM. " get_data
*& Form get_vbeln
FORM GET_VBELN .
*--retrieving vbeln from either VBAK or VBPA
*--checking whether payer or sold to values in the selection-screen or
give or not
IF S_KUNNR IS INITIAL OR SO_KUNNR IS INITIAL.
*--select statement for retrieving vbeln from vbak
SELECT VBELN
FROM VBAK
INTO TABLE I_VBELN
WHERE VKORG IN S_VKORG AND
VTWEG IN S_VTWEG AND
SPART IN S_SPART AND
ERDAT IN S_ERDAT.
IF SY-SUBRC = 0.
SORT I_VBELN BY VBELN.
ELSE.
MESSAGE I000 WITH TEXT-002.
STOP.
LEAVE LIST-PROCESSING.
ENDIF.
ELSE.
*--select statement for retrieving data from vbpa
SELECT VBELN
FROM VBPA
INTO TABLE I_VBELN
WHERE KUNNR IN S_KUNNR OR
KUNNR IN SO_KUNNR.
IF SY-SUBRC = 0.
SORT I_VBELN BY VBELN.
ELSE.
MESSAGE I000 WITH TEXT-002.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " get_vbeln
*& Form get_vbap
FORM GET_VBAP .
IF I_VBELN[] IS NOT INITIAL.
*--select statement for retrieving data from vbap
SELECT VBELN
POSNR
MATNR
KWMENG
KDMAT
FROM VBAP
INTO TABLE I_VBAP
FOR ALL ENTRIES IN I_VBELN
WHERE VBELN = I_VBELN-VBELN.
IF SY-SUBRC = 0.
SORT I_VBAP BY VBELN POSNR.
ELSE.
MESSAGE I000 WITH TEXT-002.
STOP.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " get_vbap
*& Form get_vbfa
text
--> p1 text
<-- p2 text
FORM GET_VBFA .
*--select statement to retrieve data from VBFA
IF I_VBAP[] IS NOT INITIAL.
SELECT VBELV
POSNV
VBELN
POSNN
FROM VBFA
INTO TABLE I_VBFA
FOR ALL ENTRIES IN I_VBAP
WHERE VBELV = I_VBAP-VBELN AND
POSNV = I_VBAP-POSNR AND
VBTYP_N = C_DTYPE.
IF SY-SUBRC = 0.
SORT I_VBFA ."BY vbelv posnv vbeln posnn.
ELSE.
MESSAGE I000 WITH TEXT-002.
STOP.
ENDIF.
ENDIF.
ENDFORM. " get_vbfa
*& Form get_likp
FORM GET_LIKP .
IF I_VBFA[] IS NOT INITIAL.
*--Fecthing data fron LIKP
SELECT VBELN
FROM LIKP
INTO TABLE I_LIKP
FOR ALL ENTRIES IN I_VBFA
WHERE VBELN = I_VBFA-VBELN.
IF SY-SUBRC = 0.
SORT I_LIKP BY VBELN.
ELSE.
MESSAGE I000 WITH TEXT-002.
STOP.
ENDIF.
ENDIF.
ENDFORM. " get_likp
*& Form get_lips
FORM GET_LIPS .
IF NOT I_LIKP[] IS INITIAL.
*--select statement for retrieving data from LIPS
SELECT VBELN
POSNR
MATNR
vgbel
LFIMG
FROM LIPS
INTO TABLE I_LIPS
FOR ALL ENTRIES IN I_LIKP
WHERE VBELN = I_LIKP-VBELN.
IF SY-SUBRC = 0.
SORT I_LIPS BY VBELN POSNR MATNR.
ELSE.
MESSAGE I000 WITH TEXT-002.
STOP.
ENDIF.
ENDIF.
ENDFORM. " get_lips
*& Form get_vbup
FORM GET_VBUP .
IF I_LIPS[] IS NOT INITIAL.
*--select statement for retrieving delivery status from VBUP.
SELECT VBELN
POSNR
LFSTA
WBSTA
FKSTA
FROM VBUP
INTO TABLE I_VBUP
FOR ALL ENTRIES IN I_LIPS
WHERE VBELN = I_LIPS-VBELN AND
POSNR = I_LIPS-POSNR.
IF SY-SUBRC = 0.
SORT I_VBUP BY VBELN POSNR.
ELSE.
MESSAGE I000 WITH TEXT-002.
STOP.
ENDIF.
ENDIF.
ENDFORM. " get_vbup
*& Form populate_final
FORM POPULATE_FINAL.
*--populating final internal table with sales and delivery data for
displaying purpose
LOOP AT I_LIPS.
I_FINAL-VBELN1 = I_LIPS-VBELN .
I_FINAL-POSNR1 = I_LIPS-POSNR .
I_FINAL-MATNR1 = I_LIPS-MATNR .
I_FINAL-LFIMG = I_LIPS-LFIMG.
READ TABLE I_VBFA WITH KEY VBELN = I_LIPS-VBELN
POSNN = I_LIPS-POSNR BINARY SEARCH.
IF SY-SUBRC = 0.
READ TABLE I_VBAP WITH KEY VBELN = I_VBFA-VBELV
POSNR = I_VBFA-POSNV BINARY SEARCH.
IF SY-SUBRC = 0.
I_FINAL-VBELN = I_VBAP-VBELN .
I_FINAL-POSNR = I_VBAP-POSNR .
I_FINAL-MATNR = I_VBAP-MATNR .
I_FINAL-KWMENG = I_VBAP-KWMENG.
I_FINAL-KDMAT = I_VBAP-KDMAT .
READ TABLE I_VBUP WITH KEY VBELN = I_LIPS-VBELN
POSNR = I_LIPS-POSNR BINARY SEARCH.
IF SY-SUBRC = 0.
IF I_VBUP-WBSTA = 'C'
AND I_VBUP-FKSTA <> ' '.
CONTINUE.
ENDIF.
IF I_VBUP-WBSTA = 'C' AND I_VBUP-FKSTA = ' '.
I_FINAL-DS = 'Shipped but not invoiced'.
ELSEIF I_VBUP-WBSTA <> 'C'.
I_FINAL-DS = 'open'.
ENDIF.
APPEND I_FINAL.
CLEAR I_FINAL.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " populate_final
*& Form call_alv
FORM CALL_ALV .
DATA: CPROG TYPE SY-CPROG.
CPROG = SY-CPROG.
*---populating fieldcatalog
PERFORM POPULATE_FIELDCATALOG.
*-----layout
PERFORM Z_LAYOUT.
*----for sub totals.
PERFORM Z_SORT USING LT_SORT.
*-----calling REUSE_ALV_LIST_DISPLAY
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = CPROG
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_FIELDCAT
IT_SORT = LT_SORT
TABLES
T_OUTTAB = I_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " call_alv
*& Form populate_fieldcatalog
FORM POPULATE_FIELDCATALOG .
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'VBELN'.
W_FIELDCAT-SELTEXT_L = 'Sales Order Number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 1.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'POSNR'.
W_FIELDCAT-SELTEXT_L = 'Order Line Number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 2.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'MATNR'.
W_FIELDCAT-SELTEXT_L = 'MAterial Number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 3.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'KWMENG'.
W_FIELDCAT-SELTEXT_L = 'Qty Ordered'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 4.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'KDMAT'.
W_FIELDCAT-SELTEXT_L = 'Customer PO number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 5.
W_FIELDCAT-OUTPUTLEN = 35.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'VBELN1'.
W_FIELDCAT-SELTEXT_L = 'Delivery Number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 6.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'POSNR1'.
W_FIELDCAT-SELTEXT_L = 'Delivery Line Number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 7.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'MATNR1'.
W_FIELDCAT-SELTEXT_L = 'Material Number'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 8.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'LFIMG'.
W_FIELDCAT-SELTEXT_L = 'Delivery Qty'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 9.
W_FIELDCAT-DO_SUM = 'X'.
APPEND W_FIELDCAT TO I_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-FIELDNAME = 'DS'.
W_FIELDCAT-SELTEXT_L = 'Delivery Status'.
W_FIELDCAT-TABNAME = 'I_FINAL'.
W_FIELDCAT-COL_POS = 10.
APPEND W_FIELDCAT TO I_FIELDCAT.
ENDFORM. " populate_fieldcatalog
*& Form Z_LAYOUT
FORM Z_LAYOUT .
I_LAYOUT-ZEBRA = 'X'.
I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
I_LAYOUT-GET_SELINFOS = 'X'.
ENDFORM. " Z_LAYOUT
*& Form Z_SORT
FORM Z_SORT USING P_LT_SORT.
DATA :LS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR LS_SORT.
LS_SORT-SPOS = '9'.
LS_SORT-FIELDNAME = 'VBELN'.
LS_SORT-TABNAME = 'I_FINAL'.
LS_SORT-UP = 'X'.
LS_SORT-GROUP = 'UL'.
LS_SORT-SUBTOT = 'X'.
APPEND LS_SORT TO LT_SORT.
ENDFORM. " Z_SORT -
Help needed with passing data between classes, graph building application?
Good afternoon please could you help me with a problem with my application, my head is starting to hurt?
I have run into some difficulties when trying to build an application that generates a linegraph?
Firstly i have a gui that the client will enter the data into a text area call jta; this data is tokenised and placed into a format the application can use, and past to a seperate class that draws the graph?
I think the problem lies with the way i am trying to put the data into co-ordinate form (x,y) as no line is being generated.
The following code is from the GUI:
+public void actionPerformed(ActionEvent e) {+
+// Takes data and provides program with CoOrdinates+
int[][]data = createData();
+// Set the data data to graph for display+
grph.showGrph(data);
+// Show the frame+
grphFrame.setVisible(true);
+}+
+/** set the data given to the application */+
+private int[][] createData() {+
+ //return data;+
+ String rawData = jta.getText();+
+ StringTokenizer tokens = new StringTokenizer(rawData);+
+ List list = new LinkedList();+
+ while (tokens.hasMoreElements()){+
+ String number = "";+
+ String token = tokens.nextToken();+
+ for (int i=0; i<token.length(); i++){+
+ if (Character.isDigit(token.charAt(i))){+
+ number += token.substring(i, i+1);+
+ }+
+ } +
+ }+
+ int [][]data = new int[list.size()/2][2];+
+ int index = -2;+
+ for (int i=0; i<data.length;i++){+
+ index += 2;+
+ data[0] = Integer.parseInt(+
+ (list.get(index).toString()));+
+ data[i][1] = Integer.parseInt(+
+ (list.get(index +1).toString()));+
+ }+
+ return data;+
The follwing is the coding for drawing the graph?
+public void showGrph(int[][] data) {+
this.data = data;
repaint();
+} +
+/** Paint the graph */+
+protected void paintComponent(Graphics g) {+
+//if (data == null)+
+ //return; // No display if data is null+
super.paintComponent(g);
+// x is the start position for the first point+
int x = 30;
int y = 30;
for (int i = 0; i < data.length; i+) {+
+g.drawLine(data[i][0],data[i][1],data[i+1][0],data[i+1][1]);+
+}+
+}+Thanks for that tip!
package LineGraph;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.util.List;
public class GUI extends JFrame
implements ActionListener {
private JTextArea Filejta;
private JTextArea jta;
private JButton jbtShowGrph = new JButton("Show Chromatogram");
public JButton jbtExit = new JButton("Exit");
public JButton jbtGetFile = new JButton("Search File");
private Grph grph = new Grph();
private JFrame grphFrame = new JFrame(); // Create a new frame to hold the Graph panel
public GUI() {
JScrollPane pane = new JScrollPane(Filejta = new JTextArea("Default file location: - "));
pane.setPreferredSize(new Dimension(350, 20));
Filejta.setWrapStyleWord(true);
Filejta.setLineWrap(true);
// Store text area in a scroll pane
JScrollPane scrollPane = new JScrollPane(jta = new JTextArea("\n\n Type in file location and name and press 'Search File' button: - "
+ "\n\n\n Data contained in the file will be diplayed in this Scrollpane "));
scrollPane.setPreferredSize(new Dimension(425, 300));
jta.setWrapStyleWord(true);
jta.setLineWrap(true);
// Place scroll pane and button in the frame
JPanel jpButtons = new JPanel();
jpButtons.setLayout(new FlowLayout());
jpButtons.add(jbtShowGrph);
jpButtons.add(jbtExit);
JPanel searchFile = new JPanel();
searchFile.setLayout(new FlowLayout());
searchFile.add(pane);
searchFile.add(jbtGetFile);
add (searchFile, BorderLayout.NORTH);
add(scrollPane, BorderLayout.CENTER);
add(jpButtons, BorderLayout.SOUTH);
// Exit Program
jbtExit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
System.exit(0);
// Read Files data contents
jbtGetFile.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e) {
String FileLoc = Filejta.getText();
LocateFile clientsFile;
clientsFile = new LocateFile(FileLoc);
if (FileLoc != null){
String filePath = clientsFile.getFilePath();
String filename = clientsFile.getFilename();
String DocumentType = clientsFile.getDocumentType();
public String getFilecontents(){
String fileString = "\t\tThe file contains the following data:";
return fileString;
// Register listener // Create a new frame to hold the Graph panel
jbtShowGrph.addActionListener(this);
grphFrame.add(grph);
grphFrame.pack();
grphFrame.setTitle("Chromatogram showing data contained in file \\filename");
/** Handle the button action */
public void actionPerformed(ActionEvent e) {
// Takes data and provides program with CoOrdinates
int[][]data = createData();
// Set the data data to graph for display
grph.showGrph(data);
// Show the frame
grphFrame.setVisible(true);
/** set the data given to the application */
private int[][] createData() {
String rawData = jta.getText();
StringTokenizer tokens = new StringTokenizer(rawData);
List list = new LinkedList();
while (tokens.hasMoreElements()){
String number = "";
String token = tokens.nextToken();
for (int i=0; i<token.length(); i++){
if (Character.isDigit(token.charAt(i))){
number += token.substring(i, i+1);
int [][]data = new int[list.size()/2][2];
int index = -2;
for (int i=0; i<data.length;i++){
index += 2;
data[0] = Integer.parseInt(
(list.get(index).toString()));
data[i][1] = Integer.parseInt(
(list.get(index +1).toString()));
return data;
public static void main(String[] args) {
GUI frame = new GUI();
frame.setLocationRelativeTo(null); // Center the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Clients Data Retrival GUI");
frame.pack();
frame.setVisible(true);
package LineGraph;
import javax.swing.*;
import java.awt.*;
public class Grph extends JPanel {
private int[][] data;
/** Set the data and display Graph */
public void showGrph(int[][] data) {
this.data = data;
repaint();
/** Paint the graph */
protected void paintComponent(Graphics g) {
//if (data == null)
//return; // No display if data is null
super.paintComponent(g);
//Find the panel size and bar width and interval dynamically
int width = getWidth();
int height = getHeight();
//int intervalw = (width - 40) / data.length;
//int intervalh = (height - 20) / data.length;
//int individualWidth = (int)(((width - 40) / 24) * 0.60);
////int individualHeight = (int)(((height - 40) / 24) * 0.60);
// Find the maximum data. The maximum data
//int maxdata = 0;
//for (int i = 0; i < data.length; i++) {
//if (maxdata < data[i][0])
//maxdata = data[i][1];
// x is the start position for the first point
int x = 30;
int y = 30;
//draw a vertical axis
g.drawLine(20, height - 45, 20, (height)* -1);
// Draw a horizontal base line4
g.drawLine(20, height - 45, width - 20, height - 45);
for (int i = 0; i < data.length; i++) {
//int Value = i;
// Display a line
//g.drawLine(x, height - 45 - Value, individualWidth, height - 45);
g.drawLine(data[i][0],data[i][1],data[i+1][0],data[i+1][1]);
// Display a number under the x axis
g.drawString((int)(0 + i) + "", (x), height - 30);
// Display a number beside the y axis
g.drawString((int)(0 + i) + "", width - 1277, (y) + 900);
// Move x for displaying the next character
//x += (intervalw);
//y -= (intervalh);
/** Override getPreferredSize */
public Dimension getPreferredSize() {
return new Dimension(1200, 900); -
Need info on using Kerberos classes
Does anybody know, offhand, a decent site that maybe has a tutorial or some explanation about how to use the Kerberos authentication classes that come with the JDK? I haven't looked around yet, but I was wondering if somebody knew a good place.
Thanks,
Jasonif you go to the top of this page you will notice a search engine, type in Kerberos classes and presto, you will get a result, i am sure if you were to do the same on the google homepage you would be suprised to see many websites with the info you seek.
-
Need info about data recovery services
My main hard drive on my Mac G5 crashed on Saturday, and I'm sending it to Drive Savers today. My question concerns security and confidentiality. I have some files on the drive that I would prefer that no one looks at. To what extent, if any, do these places open and look at the contents of individual files? I can't imagine they look at everything. A typical drive like this will have 100s of thousands if not millions of files.
Thanks for any info.Hi mrsaxde-
The sad reality is that once you hand over your data to anybody you really have no assurance that your files will not be looked at.
Most likely I would suppose that data-recovery services would not want to get a bad reputation as "the company that looks through your personal data", or something similar, and would be sensitive to such things.
I would suggest a Google search of that recovery company and see what folks might have to say.
I have all of my stuff backed u in triplicate, generally due to paranoia about things like this happening. This is unfortunately an expensive and scary lesson in support of a proper backup routine.
Luck-
-DP -
Based on Ingo Hilgefort's Thread, need info abt data federator workarounds
Hi Experts,
We checked a related thread with (Re: Restricted key figures from a Data Federator Universe), with Ingo Hilgefort's reply that we can create filtered measures on universe level, but in our scenario it is not working, since in the generated SQL, all the where conditions created for filtered measures are getting combined with AND operator, and hence not producing any report.
For eg, if we are creating two different filtered measures for sales in US, and sales in UK, the generated SQL will combine the conditions as below:
select sales, sales from <tbl name>
where country = "US" AND country = "UK"
which definitely wouldn't produce any result, since country can be either US or UK, not both for any record.
We need to know how to proceed with this scenario.... will it be by creating aliases for fact table and using different contexts, writing subqueries in custom SQL, or any other workaround...?
Guidance on the same is needed urgently. Please share your experience and thoughts regarding the same.
Regards,
SuzaneHi Experts,
We checked a related thread with (Re: Restricted key figures from a Data Federator Universe), with Ingo Hilgefort's reply that we can create filtered measures on universe level, but in our scenario it is not working, since in the generated SQL, all the where conditions created for filtered measures are getting combined with AND operator, and hence not producing any report.
For eg, if we are creating two different filtered measures for sales in US, and sales in UK, the generated SQL will combine the conditions as below:
select sales, sales from <tbl name>
where country = "US" AND country = "UK"
which definitely wouldn't produce any result, since country can be either US or UK, not both for any record.
We need to know how to proceed with this scenario.... will it be by creating aliases for fact table and using different contexts, writing subqueries in custom SQL, or any other workaround...?
Guidance on the same is needed urgently. Please share your experience and thoughts regarding the same.
Regards,
Suzane -
I am using the JCOP plugin (3.1.0.5) under Eclipse (SDK 3.0.1).
I have a package called 'pkApplets'.
Within this package I have an applet called 'applet1' and within that applet I use a utility class 'Util' for handling some generic functions.
I placed the utility class (normal class) within the package of the applet.
If I now upload the applet, will the utility class than also be placed on the card implicitly, or do I have to do some additional things to upload it on the card.
Thanks beforehand.All classes in the package will be included in the CAP file and thus uploaded. You do not need to instanciate the Utility class in any way, if you only access static methods from your applet.
-
Is there a Java utility class to help with data management in a desktop UI?
Is there a Java utility class to help with data management in a desktop UI?
I am writing a UI to configure a network device that will be connected to the serial port of the computer while it is being configured. There is no web server or database for my application. The UI has a large number of fields (50+) spread across 16 tabs. I will write the UI in Java FX. It should run inside the browser when launched, and issue commands to the network device through the serial port. A UI has several input fields spread across tabs and one single Submit button. If a field is edited, and the submit button clicked, it issues a command and sends the new datum to the device, retrieves current value and any errors. so if input field has bad data, it is indicated for example, the field has a red border.
Is there a standard design pattern or Java utility class to accomplish the frequently encountered, 'generic' parts of this scenario? lazy loading, submitting only what fields changed, displaying what fields have errors etc. (I dont want to reinvent the wheel if it is already there). Otherwise I can write such a class and share it back here if it is useful.
someone recommended JGoodies Bindings for Swing - will this work well and in FX?Many thanks for the reply.
In the servlet create an Arraylist and in th efor
loop put the insances of the csqabean in this
ArrayList. Exit the for loop and then add the
ArrayList as an attribute to the session.I am making the use of Vector and did the same thing as u mentioned.I am using scriplets...
>
In the jsp retrieve the array list from the session
and in a for loop step through the ArrayList
retrieving each CourseSectionQABean and displaying.
You can do this in a scriptlet but should also check
out the jstl tags.I am able to remove this problem.Thanks again for the suggestion.
AS -
I downloaded and installed Airport Express Utility 5.6 to get my old Airport Express to work with the latest Mac OSX 10.7.4, but when I install and run it, it still says my Airport Express is out-of-date and needs the 5.6 utility. What's up?
It is likely that you downloaded AirPort Utility 5.6.1. If you checked the requirements, this only runs on Leopard or Snow Leopard Macs.
You have Lion, so you need AirPort Utility 5.6 for Mac OS X Lion -
I need format for data in excel file load into info cube to planning area.
Hi gurus,
I need format for data in excel file load into info cube to planning area.
can you send me what should i maintain header
i have knowledge on like
plant,location,customer,product,history qty,calander
100,delhi,suresh,nokia,250,2011211
if it is right or wrong can u explain and send me about excel file format.
babuHi Babu,
The file format should be same as you want to upload. The sequence of File format should be same communication structure.
Like,
Initial columns with Characteristics (ex: plant,location,customer,product)
date column (check for data format) (ex: calander)
Last columsn with Key figures (history qty)
Hope this helps.
Regards,
Nawanit -
Need Info on RDA-enabled data source based on FM
Hi,
I need Info on RDA-enabled data source based on Function Module.
How to implement it?
Thanks & Regards,
Rashmi.Hi Rashmi
Check this link
http://help.sap.com/saphelp_nw70/helpdata/EN/52/777e403566c65de10000000a155106/frameset.htm
[under tab Tranferring Transaction Data from Source Systems (RDA)]
http://help.sap.com/saphelp_nw70/helpdata/EN/3f/548c9ec754ee4d90188a4f108e0121/frameset.htm
Regards
Jagadish -
Util class to extract Data from Data base Table.
Is there any Util class to extract all records from Data base table into DAT file.For example(get all amployees from EMPLOYEE table in to employee.DAT )
What is a DAT file?
Anyway, this can be achieved using a shot of JDBC [1] and some business logic [2] to populate/group/concat the data together in a DAT format and writing [3] it to that DAT file.
[1] JDBC tutorial: http://www.google.com/search?q=jdbc+tutorial+site:sun.com
[2] Use your brains and things you ever learnt in maths and basic Java tutorials/books.
[3] I/O tutorial: http://www.google.com/search?q=io+tutorial+site:sun.com -
Upload program for Vendor master Partner Data in XK02 needed info
Hello Experts,
I need to write data uplaod program for XK02 for vendor master Partner functions. ( Basically we created some custom partner functions and attach it to many existing vendors ).
So kindly advice me which is the suitable upload method for this.
1) There is no BAPI available for editing vendors.
2) BDC is not possible because the Vendor partner screen is having table control and some records are already filled. (No of row not fixed).
Is there any IDOC available or any standard input pgm?
Please give suggestion.
Thanks and rgds,
AnandFor the IDOC perspective, you can uses CREMAS.
For the mass maintenance you still have XK99 (which also uses CREMAS internally)
True there is NO BAPI
For the BDC and the table control. Well this is not really true.
In batchinput, instead of maintaining the rows by there Number, you should select it at the first position.
OK-CODE /06 will open a selection screen SAPMF02K 2324. The result of the selection screen goes to the first line of the table control.
Of course this works only in BDC
reward points if helpful
Edited by: Alain Bacchi on Jun 18, 2008 8:48 AM -
Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected]Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected] -
Need to transfer data from one external hd to another hd
Hi, I need to transfer movies from one external hd to another external hd - destination hd is formatted currently as NTSC, source hd is formatted currently as Mac OSx extended (journalled).
I believe I need to transfer data across to different hd before I can reformat source hd to MSDOS - fat. Then after reformatting source hd I want to transfer data back from destination hd to source hd, to allow this to be viewed on TV & PC...
I have tried copying & dragging from one to another, doesn't work (on desktop, or in Finder).
Any help welcome, thank you.When you reformat a drive it erases all data. You'll need to buy a second external drive.
Note: you can reformat a single partition on a drive. More info
I like the Seagate USB 3.0 Backup plus drives. Works on USB 2.0 ports. They come formatted for PC but easy to format in Disk Utility.
I don't recommend Western Digital because of the boot problem with some of their drives. LaCie makes good drives. All Mac formatted drives will cost more and it’s easy to reformat with Disk Utility. Do not use the software that comes with the drives. It’s recommended that you use Apple’s Disk Utility.
Prices vary but this gives you an idea of what you’ll find. As you notice the second and third TB is usually only $15 more per TB. It's not uncommon to find a 1T is more than the 2T
Current Amazon pricing:
Seagate Backup Plus 1 TB USB 3.0 $154.85 (used to be around $85.00)
Seagate Backup Plus 2 TB USB 3.0 $114.95 (used to be around $99.00
Seagate Backup Plus 3 TB USB 3.0 $129.90 (used to be around $115.00)
Locally, Best Buy seems to have the best prices.
Occassionally you'll find the 3T for $99 on sale.
Maybe you are looking for
-
Any converter from PC power adapter to macsafe2
I have a 2013 MBP 15. I want to get an extra power adapter, but the authentic Apple one is too expensive. I have a bunch of old PC adapters lying around. Is there a converter tip that I can buy to use my PC power adapter on the MBP? Thanks!
-
I run Windows 8.1. I have received the result after several attempts uninstalling and reinstalling iTunes, "ITunes was not installed correctly. Please reinstall iTunes. Error 7 (Windows error 127)" What can I do? to solve the problem. Tried to clean
-
Why can't I create a document in my Facebook group on my iPad. It won't let me input any text into the text box field after I create a new document. Thanks.
-
ADF Tree row selection and af:commandLink
Hello, I'm quite new to JDeveloper and ADF. I'm using JDev 11.1.1 and get some issues while trying to set up a "qualifications" selection tree. Here is a summary : I'm dealing with "Qualification" objects. A qualification has an id,name and 'selected
-
I have both the iPhone and New iPad and I was under the impression when sending a text it went from iPhone to iPhone or iPad to iPad. Also, if I send a text from my iPad to someone who only has the iPhone, it comes in on their iPhone. However, I re