Performance checking inside the source code
performance checking inside the source code who to check it.
thanks and regards
chandra sekhar
I guess you are asking how to check it, then here is the answer
SQL Trace transaction ST05
The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on the SPFLI table in our test program is mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use
Similar Messages
-
Hi Experts,
EP7.0 SP11 ESS1.0 ERP2005, NW2004s.
NWDI is installed successfully and two tracks are created according to the NWDI cookbook for ESS. Development configuration is imported into NWDS. Here our NWDI DEV system is used as local J2EE engine in NWDS for local test purposes.
I also created a project under <b>InActive DCs</b> views in NWDS. In the web dynpro perspective I could see the source of the applications (ex. DC ess~ben). I have read in the forums to check out the source code. Here I do not see any option to check out!! where will I see the option?
when a new project is created in Inactive Dcs view, it should ask for creating an activity, but this did not happen!! should i create a activity in DTR perspective?
it seems to me i can make the changes in the inactive dcs and then activate them later and deploy into local j2ee engine (here NWDI DEV) for test purposes. Is it ok?
Regards!Hi,
WebDynpro should automatically check-out source files if you want to modify something.
If you are not asked for an activity: Or you logged on? You didn't accitdentally check the checkbox "keep local for now" when creating a new DC? Or do you have an activity that is marked as default activity so the NWDS automatically added the files to that activity without an explicit dialog?
Making changes, activating them later and deploying locally built (inactive) deployables into a local/test J2EE engine does make perfect sense to me. You are testing before you commit your changes and publish them to you colleagues (to switch language a bit). Sounds OK to me.
Regards,
Marc -
Check the source code in absence of physical Hardware
For one of my applications, i have to work with 4 counters.So i increased counter input channels from 2 to 4 in the source code. But we are yet to get the hardware as we have a PCI card which can read 2 counters. But before we go for the hardware purchase, i want to make sure my source code which has 4 counters work.
I want to know whether there is any provision to check increased counter channels functioning.
Pls give me suggestion & procedure if you have any for this type of issues.
thank you in advance
-KIRITDo you not know what the typical measurement is supposed to be? By failing data, I mean a measurement that is outside what you would expect. You need this if the count is supposed to be some value and you have code that takes some sort of action when it is outside a limit. If you don't really care, then just set it up to return a range of nominal values.
Below is some simple code to generate a random number between a min and max range. You can replace the min and max with constants or just have the random count be a constant.
I hope you are aware that the simulated count function would be used in place of the DAQmx Read/DAQ Assistant. For counters, you cannot use a simulate DAQmx device to return anything but a 0. You could have a case statement with one case having the DAQmx function and the other case having the simulated data function.
Message Edited by Dennis Knutson on 07-24-2008 01:05 PM
Attachments:
Random Number Between a Range.PNG 3 KB -
Hi Folks,
I know it should be very basic question. I am not a complete technical person, but i am trying to understand the code. Please guide me for the below issues.
How to see the source code for method (which is inside the interface) ?
[SE24 --> Double Click Interface --> Method tab]
I can see code for some method by click the Code button in Class --> Methods. But there are some extra method defined inside the interface. How to see those source code.place the cursor over that method and click the where - used lists button which will show you all the classes that are using this method
Thanks
Bala Duvvuri -
Customize interface without touching the source code
My VP of of marketing is at it again. I have pasted in the exact email that he sent me. If anyone has ideas or suggestions or knows if Forms 9i has this built-in capability, please let me know.
Thanks.
Can you post this on metalink and see if someone at Oracle (or elsewhere) has an answer for us? Somehow, other LIMS developers are distributing LIMS products that allow their users to customize the interface without touching the source code -- no impact on their ability to take new releases. How do they do that?
Here's my question:
Anyone familiar with the Tools / Forms / Design this Form feature in MS Outlook? This allows a mere mortal to actually create and publish a custom Outlook form (could be a Contact, Task, Note, Journal, etc. form) across the organization. Is there such a capability built into Oracle9i Forms? In other words, can a developer easily build and distribute an Oracle software app such that the end-user can use an administrative tool to modify the interface/forms, add fields, change field names, move things around on the form, change colors, etc. -- without needing the Oracle Developer tool used by the original software developer, along with source code?
Here's my original email from a few months ago:
Our VP of marketing has been on my case about the ability to allow customers to "map" a form label (prompt) to a "custom" label of their choosing. The only way I know to do this is to create a "mapping" table and each time a form opens have code in the Post-Query trigger that changes the prompt of each column to the label that is in the "mapper" table. My fear here is Performance. Also, if the user closes that form and comes back to it - that logic has to be executed again - once again Performance. We have thought about the global variable idea, but we have over 100 tables with approx. 20 columns each. That's alot of globals to carry around. What's the overhead of carring around let's say 150 global variables?
My questions to all of you are:
1) Is anyone else doing this exact thing?
2) If so, what is the performance hit?
3) Is there a way to "remember" after the first time it paints - until the application is closed (not just that form) - other than global variables?
4) Is there a solution already in place within Forms for this?
5) Is there newer technology that has overcome this problem?
My VP doesn't like the mapping idea. He wants to know isn't there a better way instead of mapping all the fields. Isn't there some simple utility provided by Oracle that allows the user to simply change the form labels (no, he's not talking about Oracle Developer). He is a real Outlook nut. So he's always comparing everything to how Outlook works. This is how it works in Outlook -- you click on Design Form, modify it, then install it on the machine. Surely Oracle must have something like this. He thinks we're asking the wrong question or not asking it in the right way. I'm not sure how else to ask it. Our users want to see "Date of Birth" spelled out instead of "DOB" as the label for a column on a form. Is there a way for them to take the fmx and change that label? Is there a better way other than storing this in a table and querying it up each time the form opens? Yes, I could use a global so I don't have to query it from the database every time, but I still have to evaluate every time the form is opened during that session to see which label I need to use and then set the prompt accordingly. Our VP doesn't like this, he wants this to be a one time change.
Thanks so much for you help,
TinaHmmm.... either your VP of marketing or the users have too much time on their hands. ;-)
I would go with a lookup table. If your database is responsive and you index the table by form name, you can retrieve a number of rows and setup the screen quickly enough that nobody would notice any time lag.
If there aren't too many titles stored in the form, you could use a PLL library procedure and stuff all of them into a few globals -- just stack them into a single string separated by an odd character, like maybe chr(3). Then when the form is called again, it could first check to see if the globals exist, and parse the titles from there.
But be careful about changing field titles. If they change DOB to Date of Birth, the length changes, and so you need to determine where the extra length goes. The title field must be wide enough and the text justification should be set properly. -
Report for downloading the source code of a Program
Hi.
Need a code to download the source code of a Program in a text file and all the includes of that program in a separate coressponding files. <b>This should be with scan and read report statements.It should be with classe CL_GUI_FRONTEND_SERVICES but not with function modules.</b>
Thanks in advance.
Regards,
AshaHi Asha
Use the below program for your purpose.
Report: ZKBPROGS *
Function : Up/Download ABAP reports complete with texts *
Change Log : *
July 5, 1999 *
- Combined existing programs that did the upload and download into*
- one program. *
- Changed format that the reports are saved in to be compatible *
with Wolfgang Morgenthaler's upload/download program(YSTRASN00 *
at www.antarcon.de). Major differences between this program and*
Wolfgang's are:
- this program does not update TRDIR with the *
TRDIR entries that are in the program uploaded. Instead, *
current users stats are used. *
- this program allows selection of reports from a list or *
a single report can be tuped in and uploaded *
- this program also updates TADIR so that a development class*
is assigned to the program *
- this program checks to see if the program already has a *
TRDIR entry, and if it does, warns the user *
- this program will save/restore the program documenation too*
REPORT ZKBPROGS
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Declare Database Objects *
tables:
DOKIL,
TRDIR.
Constants*
CONSTANTS:
MC_TRDIR_IDENTIFIER(72) TYPE C VALUE '%&%& RDIR',
MC_REPORT_IDENTIFIER(72) TYPE C VALUE '%&%& REPO',
MC_TEXT_IDENTIFIER(72) TYPE C VALUE '%&%& TEXP',
MC_THEAD_IDENTIFIER(72) TYPE C VALUE '%&%& HEAD',
MC_DOC_IDENTIFIER(72) TYPE C VALUE '%&%& DOKL',
MC_TRDIR_SHORT(4) TYPE C VALUE 'RDIR',
MC_REPORT_SHORT(4) TYPE C VALUE 'REPO',
MC_TEXT_SHORT(4) TYPE C VALUE 'TEXP',
MC_THEAD_SHORT(4) TYPE C VALUE 'HEAD',
MC_DOC_SHORT(4) TYPE C VALUE 'DOKP'.
Declare Module level data structures *
DATA: BEGIN OF MTAB_PROGRAM_SOURCE OCCURS 0,
LINE(72) TYPE C,
END OF MTAB_PROGRAM_SOURCE.
DATA: MTAB_PROGRAM_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.
DATA: MTAB_PROGRAM_TEXTS LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
DATA: MSTR_THEAD LIKE THEAD.
DATA: BEGIN OF MTAB_PROGRAM_FILE OCCURS 0,
LINE(275) TYPE C,
END OF MTAB_PROGRAM_FILE.
DATA: BEGIN OF MTAB_DIRECTORY OCCURS 0,
NAME LIKE TRDIR-NAME,
DESC(72) TYPE C,
SAVENAME LIKE RLGRAP-FILENAME,
END OF MTAB_DIRECTORY.
DATA: BEGIN OF MTAB_PROGRAM_DOCUMENTATION OCCURS 0,
LINE(255) TYPE C,
END OF MTAB_PROGRAM_DOCUMENTATION.
Selection Screen *
*-- Options for upload/download of programs
SELECTION-SCREEN BEGIN OF BLOCK FRM_OPTIONS WITH FRAME TITLE TEXT-UDL.
PARAMETERS:
RB_DOWN RADIOBUTTON GROUP UDL DEFAULT 'X'. " Download reports
SELECTION-SCREEN BEGIN OF BLOCK FRM_TRDIR WITH FRAME TITLE TEXT-DIR.
SELECT-OPTIONS:
S_NAME FOR TRDIR-NAME, " Program Name
S_SUBC FOR TRDIR-SUBC " Program Type
DEFAULT 'F' OPTION EQ SIGN E," Exclude Functions by default
S_CNAM FOR TRDIR-CNAM " Created by
DEFAULT SY-UNAME,
S_UNAM FOR TRDIR-UNAM, " Last Changed by
S_CDAT FOR TRDIR-CDAT, " Creation date
S_UDAT FOR TRDIR-UDAT. " Last update date
SELECTION-SCREEN END OF BLOCK FRM_TRDIR.
*-- Options for uploading programs
PARAMETERS:
RB_UP RADIOBUTTON GROUP UDL. " Upload reports
SELECTION-SCREEN BEGIN OF BLOCK FRM_UPLOAD WITH FRAME TITLE TEXT-UPL.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(29) TEXT-SNG.
PARAMETERS:
RB_FILE RADIOBUTTON GROUP HOW DEFAULT 'X'.
SELECTION-SCREEN COMMENT 33(42) TEXT-FNA.
SELECTION-SCREEN END OF LINE.
PARAMETERS:
RB_LIST RADIOBUTTON GROUP HOW.
SELECTION-SCREEN END OF BLOCK FRM_UPLOAD.
SELECTION-SCREEN END OF BLOCK FRM_OPTIONS.
*-- Options for up/downloading programs
SELECTION-SCREEN BEGIN OF BLOCK FRM_FILEN WITH FRAME TITLE TEXT-FIL.
PARAMETERS:
RB_DOS RADIOBUTTON GROUP FIL DEFAULT 'X', " Save to local
RB_UNIX RADIOBUTTON GROUP FIL, " Save to UNIX
P_PATH LIKE RLGRAP-FILENAME " Path to save files to
DEFAULT 'c:\temp\'.
SELECTION-SCREEN END OF BLOCK FRM_FILEN.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-LOW.
CALL FUNCTION 'F4_PROGRAM'
EXPORTING
OBJECT = S_NAME-LOW
SUPPRESS_SELECTION = 'X'
IMPORTING
RESULT = S_NAME-LOW
EXCEPTIONS
OTHERS = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-HIGH.
CALL FUNCTION 'F4_PROGRAM'
EXPORTING
OBJECT = S_NAME-HIGH
SUPPRESS_SELECTION = 'X'
IMPORTING
RESULT = S_NAME-HIGH
EXCEPTIONS
OTHERS = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-LOW.
PERFORM GET_NAME USING 'S_UNAM-LOW'
CHANGING S_UNAM-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-HIGH.
PERFORM GET_NAME USING 'S_UNAM-HIGH'
CHANGING S_UNAM-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-LOW.
PERFORM GET_NAME USING 'S_CNAM-LOW'
CHANGING S_CNAM-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-HIGH.
PERFORM GET_NAME USING 'S_CNAM-HIGH'
CHANGING S_CNAM-HIGH.
TOP-OF-PAGE.
IF RB_LIST = 'X'.
FORMAT COLOR COL_HEADING.
NEW-LINE.
WRITE: AT 3 TEXT-H01,
AT 15 TEXT-H03.
FORMAT COLOR OFF.
ENDIF.
AT LINE-SELECTION.
CHECK RB_LIST = 'X'. " only do in list mode
READ LINE SY-CUROW FIELD VALUE MTAB_DIRECTORY-SAVENAME.
*-- Read file into an internal table
PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
USING MTAB_DIRECTORY-SAVENAME.
*-- Split table into TADIR entry, report lines, and report text
PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
CHANGING TRDIR
MSTR_THEAD.
*-- Save all of the data
PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
USING TRDIR
MSTR_THEAD.
Start of processing *
START-OF-SELECTION.
FORMAT COLOR COL_NORMAL.
IF RB_DOWN = 'X'.
PERFORM DOWNLOAD_REPORTS.
ELSEIF RB_UP = 'X'.
PERFORM UPLOAD_REPORTS.
ENDIF.
END-OF-SELECTION.
IF RB_DOWN = 'X'.
CONCATENATE P_PATH
'directory.txt'
INTO P_PATH.
PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_DIRECTORY
USING P_PATH.
ENDIF.
FORM UPLOAD_REPORTS *
FORM UPLOAD_REPORTS.
*-- Can upload a reports entered in selection criteria or
*-- select from a list. List can be from index.txt in same directory
*-- (created by the download) or by reading the first line of each file
*-- in the directory.
IF RB_FILE = 'X'. " Upload single program from a file
*-- Read file into an internal table
PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
USING P_PATH.
*-- Split table into TADIR entry, report lines, and report text
PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
CHANGING TRDIR
MSTR_THEAD.
*-- Save all of the data
PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
MTAB_PROGRAM_TEXTS
MTAB_PROGRAM_DOCUMENTATION
USING TRDIR
MSTR_THEAD.
ELSEIF RB_LIST = 'X'. " Show list for user to choose from
*-- get list of report names/descriptions from directory text
CONCATENATE P_PATH
'directory.txt'
INTO P_PATH.
PERFORM READ_REPORT_FROM_DISK TABLES MTAB_DIRECTORY
USING P_PATH.
SORT MTAB_DIRECTORY.
*-- Write out list of report names/descriptions
LOOP AT MTAB_DIRECTORY.
WRITE:
/ MTAB_DIRECTORY-NAME UNDER TEXT-H01,
MTAB_DIRECTORY-DESC UNDER TEXT-H03,
MTAB_DIRECTORY-SAVENAME.
ENDLOOP.
*-- Process user selections for reports to upload.
ENDIF.
ENDFORM. " upload_reports
FORM DOWNLOAD_REPORTS *
From the user selections, get all programs that meet the *
criteria, and save them in ftab_program_directory. *
Also save the report to disk. *
FORM DOWNLOAD_REPORTS.
DATA:
LC_FULL_FILENAME LIKE RLGRAP-FILENAME.
*-- The table is put into an internal table because the program will
*-- abend if multiple transfers to a dataset occur within a SELECT/
*-- ENDSELCT (tested on 3.1H)
SELECT * FROM TRDIR
INTO TABLE MTAB_PROGRAM_TRDIR
WHERE NAME IN S_NAME
AND SUBC IN S_SUBC
AND CNAM IN S_CNAM
AND UNAM IN S_UNAM
AND CDAT IN S_CDAT
AND UDAT IN S_UDAT.
LOOP AT MTAB_PROGRAM_TRDIR.
*-- Clear out text and source code tables
CLEAR:
MTAB_PROGRAM_FILE,
MTAB_PROGRAM_SOURCE,
MTAB_PROGRAM_TEXTS,
MTAB_PROGRAM_DOCUMENTATION.
REFRESH:
MTAB_PROGRAM_FILE,
MTAB_PROGRAM_SOURCE,
MTAB_PROGRAM_TEXTS,
MTAB_PROGRAM_DOCUMENTATION.
*-- Get the report
READ REPORT MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_SOURCE.
*-- Get the text for the report
READ TEXTPOOL MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_TEXTS.
*-- Get the documentation for the report
CLEAR DOKIL.
SELECT * UP TO 1 ROWS FROM DOKIL
WHERE ID = 'RE'
AND OBJECT = MTAB_PROGRAM_TRDIR-NAME
AND LANGU = SY-LANGU
AND TYP = 'E'
ORDER BY VERSION DESCENDING.
ENDSELECT.
*-- Documentation exists for this object
IF SY-SUBRC = 0.
CALL FUNCTION 'DOCU_READ'
EXPORTING
ID = DOKIL-ID
LANGU = DOKIL-LANGU
OBJECT = DOKIL-OBJECT
TYP = DOKIL-TYP
VERSION = DOKIL-VERSION
IMPORTING
HEAD = MSTR_THEAD
TABLES
LINE = MTAB_PROGRAM_DOCUMENTATION
EXCEPTIONS
OTHERS = 1.
ENDIF.
*-- Put the report code and texts into a single file
*-- Put the identifier line in so that the start of the TRDIR line
*-- is marked
CONCATENATE MC_TRDIR_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the TRDIR line
MTAB_PROGRAM_FILE-LINE = MTAB_PROGRAM_TRDIR.
APPEND MTAB_PROGRAM_FILE.
*-- Put the identifier line in so that the start of the report code
*-- is marked
CONCATENATE MC_REPORT_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the report code
LOOP AT MTAB_PROGRAM_SOURCE.
MTAB_PROGRAM_FILE = MTAB_PROGRAM_SOURCE.
APPEND MTAB_PROGRAM_FILE.
ENDLOOP.
*-- Put the identifier line in so that the start of the report text
*-- is marked
CONCATENATE MC_TEXT_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the report texts
LOOP AT MTAB_PROGRAM_TEXTS.
MTAB_PROGRAM_FILE = MTAB_PROGRAM_TEXTS.
APPEND MTAB_PROGRAM_FILE.
ENDLOOP.
*-- Put the identifier line in so that the start of the THEAD record
*-- is marked
CONCATENATE MC_THEAD_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
MTAB_PROGRAM_FILE = MSTR_THEAD.
APPEND MTAB_PROGRAM_FILE.
*-- Put the identifier line in so that the start of the report
*-- documentation is marked
CONCATENATE MC_DOC_IDENTIFIER
MTAB_PROGRAM_TRDIR-NAME
INTO MTAB_PROGRAM_FILE-LINE.
APPEND MTAB_PROGRAM_FILE.
*-- Add the report documentation
LOOP AT MTAB_PROGRAM_DOCUMENTATION.
MTAB_PROGRAM_FILE = MTAB_PROGRAM_DOCUMENTATION.
APPEND MTAB_PROGRAM_FILE.
ENDLOOP.
*-- Make the fully pathed filename that report will be saved to
CONCATENATE P_PATH
MTAB_PROGRAM_TRDIR-NAME
'.txt'
INTO LC_FULL_FILENAME.
PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_PROGRAM_FILE
USING LC_FULL_FILENAME.
*-- Write out message with Program Name/Description
READ TABLE MTAB_PROGRAM_TEXTS WITH KEY ID = 'R'.
IF SY-SUBRC = 0.
MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
MTAB_DIRECTORY-DESC = MTAB_PROGRAM_TEXTS-ENTRY.
MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
APPEND MTAB_DIRECTORY.
WRITE: / MTAB_PROGRAM_TRDIR-NAME,
MTAB_PROGRAM_TEXTS-ENTRY(65) COLOR COL_HEADING.
ELSE.
MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
MTAB_DIRECTORY-DESC = 'No description available'.
MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
APPEND MTAB_DIRECTORY.
WRITE: / MTAB_PROGRAM_TRDIR-NAME.
ENDIF.
ENDLOOP.
ENDFORM. " BUILD_PROGRAM_DIRECTORY
FORM SAVE_TABLE_TO_FILE *
--> FTAB_TABLE *
--> F_FILENAME *
FORM SAVE_TABLE_TO_FILE TABLES FTAB_TABLE
USING F_FILENAME.
IF RB_DOS = 'X'. " Save file to presentation server
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = F_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = FTAB_TABLE
EXCEPTIONS
OTHERS = 4.
IF SY-SUBRC NE 0.
WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
F_FILENAME COLOR COL_NEGATIVE.
ENDIF.
ELSE. " Save file to application server
OPEN DATASET F_FILENAME FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC = 0.
LOOP AT FTAB_TABLE.
TRANSFER FTAB_TABLE TO F_FILENAME.
IF SY-SUBRC NE 0.
WRITE: / 'Error writing record to file;' COLOR COL_NEGATIVE,
F_FILENAME COLOR COL_NEGATIVE.
ENDIF.
ENDLOOP.
ELSE.
WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
F_FILENAME COLOR COL_NEGATIVE.
ENDIF.
ENDIF. " End RB_DOS
ENDFORM. " SAVE_PROGRAM
FORM READ_REPORT_FROM_DISK *
Read report into internal table. Can read from local or *
remote computer *
FORM READ_REPORT_FROM_DISK TABLES FTAB_TABLE
USING F_FILENAME.
DATA:
LC_MESSAGE(128) TYPE C.
CLEAR FTAB_TABLE.
REFRESH FTAB_TABLE.
IF RB_DOS = 'X'.
TRANSLATE F_FILENAME USING '/\'. " correct slash for Dos PC file
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = F_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = FTAB_TABLE
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC >< 0.
WRITE: / 'Error reading file from local PC' COLOR COL_NEGATIVE.
ENDIF.
ELSEIF RB_UNIX = 'X'.
TRANSLATE F_FILENAME USING '\/'. " correct slash for unix
OPEN DATASET F_FILENAME FOR INPUT MESSAGE LC_MESSAGE IN TEXT MODE.
IF SY-SUBRC = 0.
DO.
READ DATASET F_FILENAME INTO FTAB_TABLE.
IF SY-SUBRC = 0.
APPEND FTAB_TABLE.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET F_FILENAME.
ELSE.
WRITE: / 'Error reading file from remote computer'
COLOR COL_NEGATIVE,
/ LC_MESSAGE,
/ F_FILENAME.
SY-SUBRC = 4.
ENDIF.
ENDIF.
ENDFORM. " READ_REPORT_FROM_DISK
FORM SPLIT_INCOMING_FILE *
--> FTAB_PROGRAM_FILE *
--> FTAB_PROGRAM_SOURCE *
--> ` *
--> FTAB_PROGRAM_TEXTS *
FORM SPLIT_INCOMING_FILE TABLES FTAB_PROGRAM_FILE
STRUCTURE MTAB_PROGRAM_FILE
FTAB_PROGRAM_SOURCE
STRUCTURE MTAB_PROGRAM_SOURCE
FTAB_PROGRAM_TEXTS
STRUCTURE MTAB_PROGRAM_TEXTS
FTAB_PROGRAM_DOCUMENTATION
STRUCTURE MTAB_PROGRAM_DOCUMENTATION
CHANGING FSTR_TRDIR
FSTR_THEAD.
DATA:
LC_DATATYPE(4) TYPE C, " Type of data, REPO, TEXP, RDIR
LC_PROGRAM_FILE LIKE MTAB_PROGRAM_FILE.
LOOP AT FTAB_PROGRAM_FILE.
LC_PROGRAM_FILE = FTAB_PROGRAM_FILE.
CASE LC_PROGRAM_FILE(9).
WHEN MC_TRDIR_IDENTIFIER.
LC_DATATYPE = MC_TRDIR_SHORT.
WHEN MC_REPORT_IDENTIFIER.
LC_DATATYPE = MC_REPORT_SHORT.
WHEN MC_TEXT_IDENTIFIER.
LC_DATATYPE = MC_TEXT_SHORT.
WHEN MC_DOC_IDENTIFIER.
LC_DATATYPE = MC_DOC_SHORT.
WHEN MC_THEAD_IDENTIFIER.
LC_DATATYPE = MC_THEAD_SHORT.
WHEN OTHERS. " Actual contents of report, trdir, or text
CASE LC_DATATYPE.
WHEN MC_TRDIR_SHORT.
FSTR_TRDIR = FTAB_PROGRAM_FILE.
WHEN MC_REPORT_SHORT.
FTAB_PROGRAM_SOURCE = FTAB_PROGRAM_FILE.
APPEND FTAB_PROGRAM_SOURCE.
WHEN MC_TEXT_SHORT.
FTAB_PROGRAM_TEXTS = FTAB_PROGRAM_FILE.
APPEND FTAB_PROGRAM_TEXTS.
WHEN MC_THEAD_SHORT.
FSTR_THEAD = FTAB_PROGRAM_FILE.
WHEN MC_DOC_SHORT.
FTAB_PROGRAM_DOCUMENTATION = FTAB_PROGRAM_FILE.
APPEND FTAB_PROGRAM_DOCUMENTATION.
ENDCASE.
ENDCASE.
ENDLOOP.
ENDFORM. " SPLIT_INCOMING_FILE
FORM INSERT_NEW_REPORT*
--> FTAB_PROGRAM_SOURCE *
--> FTAB_PROGRAM_TEXTS *
--> F_TRDIR *
FORM INSERT_NEW_REPORT TABLES FTAB_PROGRAM_SOURCE
STRUCTURE MTAB_PROGRAM_SOURCE
FTAB_PROGRAM_TEXTS
STRUCTURE MTAB_PROGRAM_TEXTS
FTAB_PROGRAM_DOCUMENTATION
STRUCTURE MTAB_PROGRAM_DOCUMENTATION
USING FSTR_TRDIR LIKE TRDIR
FSTR_THEAD LIKE MSTR_THEAD.
DATA:
LC_OBJ_NAME LIKE E071-OBJ_NAME,
LC_LINE2(40) TYPE C,
LC_ANSWER(1) TYPE C.
*-- read trdir to see if the report already exists, if it does, prompt
*-- user to overwrite or abort.
SELECT SINGLE * FROM TRDIR WHERE NAME = FSTR_TRDIR-NAME.
IF SY-SUBRC = 0. " Already exists
CONCATENATE 'want to overwrite report'
FSTR_TRDIR-NAME
INTO LC_LINE2 SEPARATED BY SPACE.
CONCATENATE LC_LINE2
INTO LC_LINE2.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
DEFAULTOPTION = 'N'
TEXTLINE1 = 'The selected report already exists, do you'
TEXTLINE2 = LC_LINE2
TITEL = 'Report already exists'
CANCEL_DISPLAY = SPACE
IMPORTING
ANSWER = LC_ANSWER
EXCEPTIONS
OTHERS = 1.
ELSE.
LC_ANSWER = 'J'.
ENDIF.
IF LC_ANSWER = 'J'.
*-- Create the TADIR entry. (TRDIR entry created by INSERT REPORT)
LC_OBJ_NAME = TRDIR-NAME.
CALL FUNCTION 'TR_TADIR_POPUP_ENTRY_E071'
EXPORTING
WI_E071_PGMID = 'R3TR'
WI_E071_OBJECT = 'PROG'
WI_E071_OBJ_NAME = LC_OBJ_NAME
WI_TADIR_DEVCLASS = '$TMP'
EXCEPTIONS
EXIT = 3
OTHERS = 4.
IF SY-SUBRC = 0.
*-- Create Report
INSERT REPORT FSTR_TRDIR-NAME FROM FTAB_PROGRAM_SOURCE.
*-- Create Texts
INSERT TEXTPOOL FSTR_TRDIR-NAME FROM FTAB_PROGRAM_TEXTS
LANGUAGE SY-LANGU.
*-- Save Documentation
CALL FUNCTION 'DOCU_UPDATE'
EXPORTING
HEAD = FSTR_THEAD
STATE = 'A'
TYP = 'E'
VERSION = '1'
TABLES
LINE = FTAB_PROGRAM_DOCUMENTATION
EXCEPTIONS
OTHERS = 1.
ELSE.
WRITE: / 'Error updating the TADIR entry' COLOR COL_NEGATIVE,
'Program' COLOR COL_NEGATIVE INTENSIFIED OFF,
FSTR_TRDIR-NAME, 'was not loaded into SAP.'
COLOR COL_NEGATIVE INTENSIFIED OFF.
ENDIF.
ELSE.
WRITE: / FSTR_TRDIR-NAME COLOR COL_NEGATIVE,
'was not uploaded into SAP. Action cancelled by user'
COLOR COL_NEGATIVE INTENSIFIED OFF.
ENDIF.
ENDFORM. " INSERT_NEW_REPORT
FORM GET_NAME *
--> VALUE(F_FIELD) *
--> F_NAME *
FORM GET_NAME USING VALUE(F_FIELD)
CHANGING F_NAME.
DATA: LTAB_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
LC_PROG LIKE D020S-PROG,
LC_DNUM LIKE D020S-DNUM.
TRANSLATE F_FIELD TO UPPER CASE.
refresh ltab_fields.
LTAB_FIELDS-FIELDNAME = F_FIELD.
append ltab_fields.
LC_PROG = SY-REPID .
LC_DNUM = SY-DYNNR .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = LC_PROG
DYNUMB = LC_DNUM
TABLES
dynpfields = ltab_fields
EXCEPTIONS
OTHERS = 01.
read table ltab_fields index 1.
IF SY-SUBRC EQ 0.
F_NAME = LTAB_FIELDS-FIELDVALUE.
refresh ltab_fields.
ENDIF.
CALL FUNCTION 'F4_USER'
EXPORTING
OBJECT = F_NAME
IMPORTING
RESULT = F_NAME.
ENDFORM. " GET_NAME
Regards,
Sree -
I am running 10.6.8 and using iweb for my web site. After several SEO analysis they all indicate I need H1-6 header tags. After looking at the source code I see there are none in iweb. Are they necessary to add? Why would one add these tags and how do I add H Tags to iweb? And are there examples to look at? I am slowly learning about simple web design and assumed that iweb was stand alone without having to write code. Is this one of the reasons iweb is no longer supported? Thanks for looking at this!
A simple text page like this:
Heading
sub heading
text paragraph ....
Is traditionally represented by html tags like:
<h1>Heading</h1>
<h2>sub heading</h2>
<p>text paragraph ... </p>
I would guess that the use of h1-h6 tags helps search engines to understand the structure of a page as the tags imply a certain structure.
This can be compared to more generic tags like <div> that could represent any kind of content - and may be what iWeb uses (you'll have to check yourself).
I would generally recommend that you use some kind of up to date blog/site building tool, perhaps Wordpress or Squarespace (I haven't used either one myself) that support current web technologies - this should reduce your SEO issues and make it easier to properly support mobile/tablet users. -
How to display the source code for this friggin' file.
Below is a rather lengthy bit of code that provides the behavior and attributes of a web server for OpenCyc. I need to know if I can enter some java to have the HTML source code displayed in a separate text file whenever this class returns some resulting webpage. If you have any ideas it will be greatly appreciated.
-"Will code for foo."
package org.opencyc.webserver;
* Class WebServer is simple multithreaded HTTP server
* with CGI limited to a Cyc connection on default port 3600.
* <p>
import java.net.*;
import java.io.*;
import java.util.*;
import java.util.jar.*;
import java.text.*;
import org.opencyc.util.*;
public class WebServer extends Thread {
* Singleton WebServer instance.
public static WebServer current;
* Default HTTP port.
protected static int DEFAULT_PORT = 80;
* Default Cyc base port.
protected static int DEFAULT_CYC_PORT = 3600;
* Default directory to serve files from on non-Windows OS.
protected static String DEFAULT_DIR = "/";
* Default directory to serve files from on Windows.
//protected static String DEFAULT_WIN_DIR = "C:\\";
protected static String DEFAULT_WIN_DIR = "k:\\opencyc\\run\\httpd\\htdocs";
* File cache capacity.
protected static final int CACHE_CAPACITY = 100;
* File cache to improve file serving performance.
protected static Hashtable fileCache = new Hashtable(CACHE_CAPACITY);
* Number of files served from this web server.
protected static long nbrFilesServed = 0;
* Number of files served from this web server that were found in the cache.
protected static long nbrCacheHits = 0;
* Server socket for accepting connections.
protected ServerSocket server;
* Directories to serve files from.
protected ArrayList dirs;
* Map from String (jar root) to JarFile[] (jar class path).
protected HashMap map;
* Webserver HTTP port.
protected int port;
* Cyc HTML host.
protected String cycHost = "localhost";
* Cyc HTML port.
protected int cycPort;
* Expand jar tress.
protected boolean trees;
* Requests flag.
protected boolean traceRequests;
* Constructs a WebServer object.
* @param port the port to use
* @param directories the directory to serve files from
* @param trees true if files within jar files should be served up
* @param traceRequests true if client's request text should be logged.
* @exception IOException if the listening socket cannot be opened, or problem opening jar files.
public WebServer() throws IOException {
getProperties();
server = new ServerSocket(port);
processDirectories();
* Class Task processes a single HTTP request.
protected class Task extends Thread {
* Socket for the incoming request.
protected Socket sock;
* Client socket to the Cyc KB HTML server.
protected Socket cycHtmlSocket;
* Output tcp stream.
protected DataOutputStream out;
* Contains the file request path for a not-found error message.
protected String notFoundPath;
* Contains the first line of a request message.
protected String methodLine;
* Contains the body of a POST method.
protected String bodyLine;
* Constructs a Task object.
* @param sock the socket assigned for this request.
public Task(Socket sock) {
this.sock = sock;
* Processes the HTTP request.
public void run() {
if (traceRequests)
Log.current.println("connection accepted from " + sock.getInetAddress());
notFoundPath = "";
try {
out = new DataOutputStream(sock.getOutputStream());
try {
getBytes();
catch (Exception e) {
Log.current.println("file not found: " + notFoundPath);
try {
out.writeBytes("HTTP/1.1 404 Not Found\r\n");
out.writeBytes("Server: Cyc WebServer\r\n");
out.writeBytes("Connection: close\r\n");
out.writeBytes("Content-Type: text/html\r\n\r\n");
out.writeBytes("<HTML><HEAD>\n");
out.writeBytes("<TITLE>404 Not Found</TITLE>\n");
out.writeBytes("</HEAD><BODY>\n");
out.writeBytes("<H1>404 - Not Found</H1>\n");
out.writeBytes("</BODY></HTML>");
out.flush();
catch (SocketException se) {
catch (Exception e) {
Log.current.printStackTrace(e);
finally {
try {
sock.close();
catch (IOException e) {
* Reads the HTTP request and obtains the response.
* @exception IOException when HTTP request has an invalid format.
private void getBytes() throws IOException {
// Below logic is complex because web browsers do not close the
// socket after sending the request, so must parse message to find
// the end.
BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
ArrayList inBytes = new ArrayList(200);
int ch = 0;
boolean postMethod;
methodLine = in.readLine();
//if (traceRequests)
// Log.current.println("methodLine=" + methodLine);
bodyLine = "";
if (methodLine.startsWith("POST /"))
postMethod = true;
else
postMethod = false;
//if (traceRequests)
// Log.current.println("postMethod=" + postMethod);
int ch1 = -1;
int ch2 = -1;
int ch3 = -1;
int ch4 = -1;
// Read the HTTP request headers.
while (true) {
ch = in.read();
inBytes.add(new Integer(ch));
ch1 = ch2;
ch2 = ch3;
ch3 = ch4;
ch4 = ch;
if (ch1 == '\r' && ch2 == '\n' && ch3 == '\r' && ch4 == '\n')
break;
if ((! postMethod) &&
(! in.ready()) &&
ch1 == -1 &&
ch2 == -1 &&
ch3 == '\r' &&
ch4 == '\n') {
inBytes.add(new Integer('\r'));
inBytes.add(new Integer('\n'));
break;
byte[] byteArray = new byte[inBytes.size()];
for (int i = 0; i < inBytes.size(); i++) {
Integer ich = (Integer) inBytes.get(i);
byteArray[i] = ich.byteValue();
String headers = new String(byteArray);
if (postMethod) {
String lcHeaders = headers.toLowerCase();
int i = lcHeaders.indexOf("content-length: ");
String contentLength = lcHeaders.substring(i + 16);
int j = contentLength.indexOf("\r\n");
contentLength = contentLength.substring(0, j);
int bodyLen = (new Integer(contentLength)).intValue();
for (int k = 0; k < bodyLen; k++) {
bodyLine = bodyLine + (new Character((char) in.read())).toString();
String line = methodLine + "\r\n" + headers + bodyLine;
if (traceRequests)
Log.current.println(line);
if (postMethod)
processHttpPost();
else
if (line.startsWith("GET /"))
processHttpGet(line.substring(4));
else {
Log.current.println("Invalid request = " + line);
throw new IOException();
* Processes an HTTP GET method.
* @param httpGetPath the path of the file to get.
* @exception IOException if the file is not found.
private void processHttpGet(String httpGetPath) throws IOException {
int i = httpGetPath.indexOf(' ');
if (i > 0)
httpGetPath = httpGetPath.substring(0, i);
Log.current.println(methodLine + " from " + sock.getInetAddress().getHostName());
i = httpGetPath.indexOf("cg?");
if (i > 0) {
cycHtmlRequest(httpGetPath.substring(i + 3));
return;
notFoundPath = httpGetPath;
i = httpGetPath.indexOf('/');
if (i < 0 || map == null) {
if (map == null || httpGetPath.endsWith(".jar")) {
for (int j = 0; j < dirs.size(); j++) {
String dir = (String) dirs.get(j);
String nativePath = dir + httpGetPath;
nativePath = nativePath.replace('/', File.separatorChar);
if (fileCache.containsKey(nativePath)) {
writeDataBytes((byte[]) fileCache.get(nativePath));
Log.current.println("...cached");
nbrCacheHits++;
nbrFilesServed++;
return;
try {
File f = new File(nativePath);
byte[] fileBytes = getBytes(new FileInputStream(f), f.length());
writeDataBytes(fileBytes);
if (fileCache.size() >= CACHE_CAPACITY)
fileCache.clear();
fileCache.put(nativePath, fileBytes);
Log.current.println("...from " + nativePath);
nbrFilesServed++;
return;
catch (IOException e) {
throw new IOException();
String jar = httpGetPath.substring(0, i);
httpGetPath = httpGetPath.substring(i + 1);
JarFile[] jfs = (JarFile[]) map.get(jar);
if (jfs == null)
throw new IOException();
for (i = 0; i < jfs.length; i++) {
JarEntry je = jfs.getJarEntry(httpGetPath);
if (je == null)
continue;
writeDataBytes(getBytes(jfs[i].getInputStream(je), je.getSize()));
nbrFilesServed++;
return;
throw new IOException();
* Processes an HTTP POST method.
* @exception IOException if the file is not found.
private void processHttpPost() throws IOException {
Log.current.println("POST " + bodyLine + " from " + sock.getInetAddress().getHostName());
cycHtmlRequest(bodyLine);
* Reads the specified number of bytes and always close the stream.
* @param in the file to be read for subsequent downloading.
* @param length the number of bytes to read from the file.
* @return An array of bytes from the file.
* @exception IOException if an error occurs when processing the file.
private byte[] getBytes(InputStream in, long length) throws IOException {
DataInputStream din = new DataInputStream(in);
byte[] bytes = new byte[ (int) length];
try {
din.readFully(bytes);
finally {
din.close();
return bytes;
* Sends the HTML request to Cyc.
* @param cycPath the portion of the URL which is given to the Cyc HTML server.
private void cycHtmlRequest(String cycPath) {
String request = sock.getInetAddress().getHostName() + "&" + cycPath + "#";
System.out.println("request=" + request);
ArrayList bytes = new ArrayList(10000);
try {
cycHtmlSocket = new Socket(cycHost, cycPort);
System.out.println("cycHost=" + cycHost + " cycPort=" + cycPort);
BufferedReader cycIn = new BufferedReader(new InputStreamReader(cycHtmlSocket.getInputStream()));
PrintWriter cycOut = new PrintWriter(cycHtmlSocket.getOutputStream(), true);
cycOut.println(request);
cycOut.flush();
int ch = 0;
while (ch >= 0) {
ch = cycIn.read();
bytes.add(new Integer(ch));
catch (Exception e) {
Log.current.printStackTrace(e);
byte[] byteArray = new byte[bytes.size()];
for (int i = 0; i < bytes.size() - 1; i++) {
Integer ich = (Integer) bytes.get(i);
byteArray[i] = ich.byteValue();
try {
writeTextBytes(byteArray);
catch (Exception e) {
Log.current.println(e.getMessage());
* Responds to the HTTP client with data content from the requested URL.
* @param bytes the array of bytes from the URL.
* @exception IOException if there is an error writing to the HTTP client.
public void writeDataBytes(byte[] bytes) throws IOException {
out.writeBytes("HTTP/1.1 200 OK\r\n");
out.writeBytes("Server: Cyc WebServer\r\n");
out.writeBytes("Connection: close\r\n");
out.writeBytes("Content-Length: " + bytes.length + "\r\n");
String prefix = (new String(bytes)).toLowerCase();
if (prefix.indexOf("<html>") > -1)
out.writeBytes("Content-Type: text/html\r\n\r\n");
else
out.writeBytes("Content-Type: application/java\r\n\r\n");
out.write(bytes);
out.flush();
* Respond to the HTTP client with text content from the requested URL.
* @param bytes the array of bytes from the URL.
* @exception IOException if there is an error writing to the HTTP client.
public void writeTextBytes(byte[] bytes) throws IOException {
out.writeBytes("HTTP/1.1 200 OK\r\n");
out.writeBytes("Server: Cyc WebServer\r\n");
out.writeBytes("Connection: close\r\n");
out.writeBytes("Content-Length: " + bytes.length + "\r\n");
out.writeBytes("Content-Type: text/html\r\n\r\n");
out.write(bytes);
out.flush();
* Gets properties governing the web server's behavior.
private void getProperties() {
port = DEFAULT_PORT;
String portProperty = System.getProperty("org.opencyc.webserver.port", "");
if (! portProperty.equalsIgnoreCase(""))
port = (new Integer(portProperty)).intValue();
Log.current.println("Listening on port " + port);
cycPort = DEFAULT_CYC_PORT;
String cycPortProperty = System.getProperty("org.opencyc.webserver.cycPort", "");
if (! cycPortProperty.equalsIgnoreCase(""))
cycPort = (new Integer(cycPortProperty)).intValue();
Log.current.println("Cyc connections directed to port " + cycPort);
String dirsProperty = System.getProperty("org.opencyc.webserver.dirs", "");
dirs = new ArrayList(3);
StringTokenizer st = new StringTokenizer(dirsProperty, ";", false);
while (st.hasMoreTokens()) {
String dir = st.nextToken();
dirs.add(dir);
trees = false;
String treesProperty = System.getProperty("org.opencyc.webserver.trees", "");
if (! treesProperty.equalsIgnoreCase(""))
trees = true;
traceRequests = false;
String traceRequestsProperty = System.getProperty("org.opencyc.webserver.traceRequests", "");
if (! traceRequestsProperty.equalsIgnoreCase("")) {
traceRequests = true;
Log.current.println("tracing requests");
* Adds transitive Class-Path jars to jfs.
* @param jar the jar file
* @param jfs the list of jar files to serve.
* @param dir the jar file directory.
* @exception IOException if an I/O error has occurred with the jar file.
private void addJar(String jar, ArrayList jfs, String dir) throws IOException {
Log.current.println("Serving jar files from: " + dir + jar);
JarFile jf = new JarFile(dir + jar);
jfs.add(jf);
Manifest man = jf.getManifest();
if (man == null)
return;
Attributes attrs = man.getMainAttributes();
if (attrs == null)
return;
String val = attrs.getValue(Attributes.Name.CLASS_PATH);
if (val == null)
return;
dir = dir + jar.substring(0, jar.lastIndexOf(File.separatorChar) + 1);
StringTokenizer st = new StringTokenizer(val);
while (st.hasMoreTokens()) {
addJar(st.nextToken().replace('/', File.separatorChar), jfs, dir);
* Administrative accessor method that obtains list of directories from which files are served.
public ArrayList getDirs() {
return dirs;
* Administrative method that updates the list of directories from which files are served.
public synchronized void setDirs(ArrayList dirs) throws IOException {
this.dirs = dirs;
fileCache.clear();
processDirectories();
* Administrative accessor method that obtains number of files served.
* @return The number of files served.
public long getNbrFilesServed() {
return nbrFilesServed;
* Administrative accessor method that obtains number of files served from cache.
* @return The number of files served from the cache.
public long getNbrCacheHits() {
return nbrCacheHits;
* Administrative method that clears the file cache.
public synchronized void clearFileCache() {
Log.current.println("Clearing file cache");
fileCache.clear();
nbrFilesServed = 0;
nbrCacheHits = 0;
* Processes the directories from which files are served, expanding jar trees if
* directed.
* @exception IOException if problem occurs while processing the jar files.
private void processDirectories() throws IOException {
if (dirs.size() == 0)
if (File.separatorChar == '\\')
dirs.add(DEFAULT_WIN_DIR);
else
dirs.add(DEFAULT_DIR);
Iterator directories = dirs.iterator();
while (directories.hasNext())
Log.current.println("Serving from " + directories.next());
if (trees) {
map = new HashMap();
for (int j = 0; j < dirs.size(); j++) {
String dir = (String) dirs.get(j);
String[] files = new File(dir).list();
for (int i = 0; i < files.length; i++) {
String jar = files[i];
if (!jar.endsWith(".jar"))
continue;
ArrayList jfs = new ArrayList(1);
addJar(jar, jfs, dir);
map.put(jar.substring(0, jar.length() - 4), jfs.toArray(new JarFile[jfs.size()]));
* Provides the command line interface for creating an HTTP server.
* The properties are:
* <pre>
* org.opencyc.webserver.port=<HTTP listening port>
* </pre>
* which defaults to 80.
* <pre>
* org.opencyc.webserver.cycPort=<Cyc connection port>
* </pre>
* which defaults to 3600.
* <pre>
* org.opencyc.webserver.dirs=<path>;<path> ... ;<path>
* </pre>
* with the argument enclosed in quotes if any path contains an
* embedded space.
* The default directory on Windows is C:
* and the default on other systems is / the default
* can be overridden with this property. By default, all files
* under this directory (including all subdirectories) are served
* up via HTTP. If the pathname of a file is <var>path</var> relative
* to the top-level directory, then the file can be downloaded using
* the URL
* <pre>
* http://<var>host</var>:<var>port</var>/<var>path</var>
* </pre>
* Caching of file contents is performed.
* <pre>
* org.opencyc.util.log=all
* </pre>
* If the all value is given, then all attempts to download files
* are output.
* <pre>
* org.opencyc.webserver.traceRequests
* </pre>
* If this property has any value, then the client HTTP requests are
* output.<p>
* <pre>
* org.opencyc.webserver.trees
* </pre>
* This property can be used to serve up individual files stored
* within jar files in addition to the files that are served up by
* default. If the property has any value, the server finds all jar files
* in the top-level directory (not in subdirectories). For each
* jar file, if the name of the jar file is <var>name</var>.jar, then any
* individual file named <var>file</var> within that jar file (or within
* the jar or zip files referenced transitively in the Class-Path manifest
* attribute, can be downloaded using a URL of the form:
* <pre>
* http://<var>host</var>:<var>port</var>/<var>name</var>/<var>file</var>
* </pre>
* When this property has any value, an open file descriptor and cached
* information are held for each jar file, for the life of the process.
* @param args an unused array of command line arguments.
public static void main(String[] args) {
Log.makeLog();
System.out.println("OpenCyc Web Server");
try {
// Launch thread to accept HTTP connections.
current = new WebServer();
current.start();
catch (IOException e) {
e.printStackTrace();
* Just keep looping, spawning a new thread for each incoming request.
public void run() {
try {
while (true) {
// Launch thread to process one HTTP request.
new Task(server.accept()).start();
catch (IOException e) {
e.printStackTrace();JLundan,
I want to thank you for responding to the thread I started on the forum at java.sun.com. Your solution to my problem of needing to print the code of the html pages that the file I included generates was just what I was looking for. However, I have some further questions to ask, if you don't mind. To clarify my task I should say that your rephrasing of the problem is accurate: "You wan't to display the contents of the HTML file that the web server produces in response of client's request?"
Yes, this is what I need to do, but also it needs to display the source code of that html file that the server produces in response to the client's request. Also, in this case, I am the client requesting that the server return some html file, and I'm not sure where the server is. But the webserver.java file that I shared on the forum is on my local machine. I was wondering if I could modify this webserver.java file at my home so that any html file the server returns to me would automatically display the source code. This is a school project of mine and I am stuck on this one thing here.
Further, where would I put the "foo.html" file so it can be written to?
FileOuputStream fos = new FileOutputStream("foo.html");
fos.write(bytes);
fos.close();
Thanks so much for your help. I look forward to your response, at your convenience.
Regards -
I need to know the differnece between the Numeric Limit Test between the TestStand version 3.0 to 3.1. If there is any differnec in the source code how to find it out? If somebody has the code can you share it?
Thanks,
JeyanHi,
I don't believe there are any differences between the two versions. But you can check the source code for the Numeric Limit Test in TestStand\Components\NI\StepTypes\CommonSubsteps. But the main part of the step is the Code Module and this bit the users supplies this.
What has prompted this question?
Regards
Ray Farmer
Regards
Ray Farmer -
Hi Frendz..
I want to know how we can build a callable obj which have a two buttons those r Accept n Reject accordiing to the actions on these buttons flow should forward to next screen(approver ) r sent back to the sender(screen with reject).
I gone thru the Leave process(Time-Off process) which is very suitable for my requirment but in this app there r using predefined CO(com.sap.caf.eu.gp.example.tiimeoff.wd.create).How we see the source code of this predefined CO.
Thanks in Advance
Regards
RajeshHi,
check [this|Re: Source of Time-off Request Project].
Regards,
Naga -
Can you share the source code for Customer ToughDay stress test tool?
Hello,
I would like to try Customer ToughDay tool (http://dev.day.com/docs/en/cq/current/testing/tough-day.html) for load testing of our author instances of CQ5. While I am able to execute the application, the logging with log4j seems to be configured incorrectly.
Can you share the source code for toughday-5.5.jar? I think it can be a very good starting point for those of us who are new to CQ5 and need to load test it.
Thank you!Hi,
I don't believe there are any differences between the two versions. But you can check the source code for the Numeric Limit Test in TestStand\Components\NI\StepTypes\CommonSubsteps. But the main part of the step is the Code Module and this bit the users supplies this.
What has prompted this question?
Regards
Ray Farmer
Regards
Ray Farmer -
New Front-End Editor is Dumping when I try to check an ABAP source code
Hi Experts
I'm trying to check the source code of any ABAP in SE38 with the new front-end editor, but I'm facing a dump, maybe there is missing a patch or something like that. if any of you have information about that I really appreciate your aswers.
I reinstalled the SAP GUI and still have the issue.
part of the dump is here
Runtime Errors MESSAGE_TYPE_X
Date and Time 04/09/2008 15:12:51
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Error analysis
Short text of error message:
Control Framework : Error processing control
Long text of error message:
Diagnosis
An error occurred when the system tried to process the commands
from the Automation Queue on the presentation server.
There are several possible reasons for this:
- The installation of the SAP GUI on the presentation server is
faulty or obsolete.
- There is an error in the application program
- There is an error in the SAPGUI or an integrated controlHernan Enriquez ,
Hi you can try the below things :
1) You need have the latest patch of the SAP GUI installed.
2) If you have the above try to re-install the GUI from the scratch. It might be courrupted.
3) If VISTA need to check the GUI compatibility.
Thanks,
Greetson -
How to See and Change the Source Code of Spawned Concurrent Program.
Hello Team,
There is one requirement in which we have to add some condition in the Concurrent Program.But the Type of that concurrent Program is ,"Spawned ".
Please suggest me , how can i check the Source code for this type of Concurrent Program and how can i make the changes to satisfy the requirement.
Thanks & RegardsThere is one requirement in which we have to add some condition in the Concurrent Program.But the Type of that concurrent Program is ,"Spawned ".
Please suggest me , how can i check the Source code for this type of Concurrent Program and how can i make the changes to satisfy the requirement.Please see old threads, it should answer your question -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Spawned+AND+Concurrent+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Default implementations of JPDK V2 classes and interfaces - is the source code?
Hi
Is the source code for all the default implementations of the JPDK interfaces, renderers etc. available somewhere?
Regards
HarryPlease find jpdk samples sources for jpdk implementation under src.zip inside PDK.zip
In addition, one can many articles related to PDK under articles folder. -
Has there been any type of methodology for taking a labview executible and extrapolating the source code VIs used for creating the VI?
Solved!
Go to Solution.Officially they are embeded in the exe in an undocumented way. So you can't easily get at them. But you can always attach a remote debug session and get into the diagrams that way. That is if the diagrams were not removed during the build, which requires a conscious and extra action by the person to remove the according check mark in the build options of the project. So by default all diagrams are totally gone and are definitely not possible to get back from the executable, unless as smercurio has mentioned your name might be Carnac
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions
Maybe you are looking for
-
Can no longer authorise my computer. Get error -42408
I can no longer play my protected iTunes content, music or videos. When I try to authorise ( or de-authorise) I get the "Unknown error occurred -42408" This would appear to be since upgrading to iTunes 9.0.3 this week.
-
Empty page Cache When Page is left
Hi I have an Application that it is working correctly but needs a little enhancement. My report Page has a Reset Button (which clears all the Cache for Items on the Page). What I would like to do is clear the cache but only whenever somebody leaves t
-
In a worksheet ran a statement that selected almost a million rows. Then attempted an export in .xls format. The export didn't even create a .xls file. When a second attempt was made to export in csv format the data file got the column headings, but
-
I need to package my files today for an online class using InDesign CC 2014 and I keep getting this error message: Where and how do I either install or activate this plugin? Thank you for any help provided on this matter.
-
I have purchased Photoshop Elements and Lightroom and installed them in my table Mac. Now I'm going on travelling and would need them with me also in my laptop (MacBook Pro). Is there any chance to update my current purchases so that I could use the