How to know the dynamic values for this :AND category_id_query IN (1, :3, )
Hi Team,
R12 Instance :
Oracle Installed Base Agent User Responsibility --> Item Instances -->
Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
In the above page there are two table regions.
Notes.
-------------------------------------Table Region---------------------------
Attachments
-------------------------------------Table Region---------------------------
--the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
I want to know what are the document types are displayed in this page ?
--We developed a custom program to attach the attachments to the services contracts and the above seeded OAF page displays those ..as needed.
But after recent changes..the Attachments--> table region is not showing the attachments.
I have verified the query..and could not find any clue in that..
but i need some help if you guys can provide..
SELECT *
FROM
*(SELECT d.DOCUMENT_ID,*
d.DATATYPE_ID,
d.DATATYPE_NAME,
d.DESCRIPTION,
DECODE(d.FILE_NAME, NULL,
*(SELECT message_text*
FROM fnd_new_messages
WHERE message_name = 'FND_UNDEFINED'
AND application_id = 0
AND language_code = userenv('LANG')
*), d.FILE_NAME)FileName,*
d.MEDIA_ID,
d.CATEGORY_ID,
d.DM_NODE,
d.DM_FOLDER_PATH,
d.DM_TYPE,
d.DM_DOCUMENT_ID,
d.DM_VERSION_NUMBER,
ad.ATTACHED_DOCUMENT_ID,
ad.ENTITY_NAME,
ad.PK1_VALUE,
ad.PK2_VALUE,
ad.PK3_VALUE,
ad.PK4_VALUE,
ad.PK5_VALUE,
d.usage_type,
d.security_type,
d.security_id,
ad.category_id attachment_catgeory_id,
ad.status,
d.storage_type,
d.image_type,
d.START_DATE_ACTIVE,
d.END_DATE_ACTIVE,
d.REQUEST_ID,
d.PROGRAM_APPLICATION_ID,
d.PROGRAM_ID,
d.category_description,
d.publish_flag,
DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
d.URL,
d.TITLE
FROM FND_DOCUMENTS_VL d,
FND_ATTACHED_DOCUMENTS ad
WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
*) QRSLT*
WHERE ((entity_name ='OKC_K_HEADERS_V'-- :1
AND pk1_value IN ( 600144,599046) --:2
AND category_id_query IN (1, :3, :4, :5, :6, :7) )
AND datatype_id IN (6,2,1,5)
AND (SECURITY_TYPE =4
OR PUBLISH_FLAG ='Y')))
--='000180931' -- 'ADP118'
The above seeded query is the one which is used for table region to retrieve the data..
how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
--Sridhar
Hi Patricia,
is it working for restricted key figure and calculated key figure ??
Note Number Fisc Period Opening Days
1 1 2
2 1 3
3 1 0
because I have other restriction, so I create two restricted key figure..
RK1 with restriction : Total Number of Note,
RK2 with restriction : Total Opening Days ,
then I Created a calculated key figure, average opening days in a period
CK1 = RK2 / RK1..
in this case, I am not sure if it will work or not..
for example, during RK2 calclation, it might be this 2+3 = 5, the line with 0 will be ignored..
during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
could you please confirm..
Similar Messages
-
How to know the right value for SHMMAX and SHMALL for ia64 memory 32Gb
Dear all,
I want to install Oracle database 10g R2 on RHEL 5 ia64.
Here the server specification :
Proc : itanium64 ( montecito )
Mem : 32Gb
# getconf PAGE_SIZE = 16384
Metalink says, that SHMMAX should be half of physical memory and SHMALL = SHMMAX / PAGE_SIZE.
kernel.shmmax = 17179869184
kernel.shmall = 1048576
My Question is this is right value for SHMMAX and SHMALL on my server..??
Thank youif shmmax is half the ram then what should be sga
sga size should anyhow should be less then shmmax ,means we cannot increase sga size more than half the ram
then how ROT for SGA that should be 70% of RAM hold good -
How to write the dynamic code for RadioGroupByKey and Check Boxes?
Hi,
Experts,
I have created a WD ABAP application in that i have used RadioGroupByKey and CheckBox Ui elements but i want how to write the dynamic code to that i want to display male and female to RadioGroupByKey and 10 lables to check boxs.
Please pass me some idea on it and send any documents on it .
Thanks in advance ,
Shabeer ahmed.Refer this for check box:
Do check :
bind_checked property is bind to a node with cardinality of 1:1
CHECK_BOX_NODE <---node name
-CHECK_BOX_VALUE <--attribute name of type wdy_boolean
put this code under your WDDOMODIFYVIEW:
DATA:
lr_container TYPE REF TO cl_wd_uielement_container,
lr_checkbox TYPE REF TO cl_wd_checkbox.
get a pointer to the RootUIElementContainer
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_checkbox = cl_wd_checkbox=>new_checkbox(
text = 'WD_Processor'
bind_checked = 'CHECK_BOX_NODE.CHECK_BOX_VALUE'
view = view ).
cl_wd_matrix_data=>new_matrix_data( element = lr_checkbox ).
lr_container->add_child( lr_checkbox ).
Refer this for Radiobutton :
dynamic radio button in web dynpro abao
Edited by: Saurav Mago on Jul 17, 2009 10:43 PM -
Please help how to pass the dynamic value to VO -- Urgent.
Hi,
I have an Oracle Standard VO( SQL Query). As per my requriemnt i extended standard VO with one new feild.Now i want to query the new VO dynamically.
How to pass the dynamic values to new query?
for refence i am giving my old query.
select
secondary_inventory_name as SubInventoryName,
description as Description,
from mtl_secondary_inventories
my new Query is like this:
select
secondary_inventory_name,
description,
Item
from mtl_secondary_inventories
where item='123456'
I want to pass this "where item="123456" as dynamically. please help where i will do the change's.
Thanks,
Sekhar.Hi,
thanks pratap for quick response...but i am extending VO from Standard VO.
I have a Standard VO which contains a bind variable suppose :1.
I have extended this above standard VO and i want to add another bind variable say :2 to the custom VO.
Please tell me how will i pass bind parameter value to the bind variable in runtime ?
what are files i want to change?
Thanks,
Sekhar. -
How to assign the two values for constant (same key)
How to assign the two values for constant (same key)
CONSTANTS: c_pstkey TYPE bschl VALUE '09',
c_splgl TYPE umskz VALUE 'I',
c_buzei TYPE buzei VALUE '001'.
using BSCH1 again i have two asign vaue
can you just let me know
Edited by: sravya_se38 on Nov 23, 2010 12:14 AMYou can create a structure for that constant .
You can define in this way
CONSTANTS : BEGIN OF c_pstkey,
01 TYPE bschl VALUE '01',
02 TYPE bschl VALUE '02',
END OF c_pstkey.
and can access using...
c_pstkey-01, c_pstkey-02 ........ -
How to find the ASCII value for an alphabet.
How to find the ASCII value for an alphabet.
How can I get Ascii value of any letter
How can I get Ascii value of any letter. Is there any function?
This is how you do it :
report demtest.
data : c.
field-symbols : <n> type x.
data : rn type i.
c = 'A'.
assign c to <n> casting.
move <n> to rn.
write rn.
This will convert 'A' to 65.
Tom Demuyt
How to convert ascii value to character.
If I give input as 65 (ascill value) I want display 'A'.
Below logic is for convert from character to ascii value , now I want to know how to convert ascii value to character.
Naveen
report demtest.
*going from A to 65
data : c value 'A'.
field-symbols : <n> type x.
data : rn type i.
assign c to <n> casting.
move <n> to rn.
write rn.
*going from 66 to B
data : i type i value 66.
data : x type x.
field-symbols : <fc> type c.
move i to x.
assign x to <fc> casting type c.
move <fc> to c.
write c. -
SRM 4.0- How to set the default values for product type (01) only for SC
The radio button Service should not be visible.
Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
How to set the default values for product type (01) only for SC
We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
Here we can set defalut value 01 but it is not correct one since same search help is using several places.
We need to limit the search help results only for SC.
Kindly help out me ASAP.The easiest way to set defautl values is to edit the batch class.
Goto the characteiristic and go to update values.
In here you probably have something like 0 - 100 as a spec range.
On the next line enter the default value within this range. At the end of the line, click in the box in the column labelled "D". This indicates the defautl value for the characteristic.
If you need to you can do this in the material classification view as well.
Just to be clear, these values will only show up in the batch record. You can not have defautl values in resutls recording screens.
FF -
How to set the Default values for Info Objects in Data Selection of InfoPac
Hi All,
Flat file Extracion:
How to set the Default values for Info Objects in Data Selection Tab for Info Package
ex: Fiscal Year Variant Info Object having values 'K4' 'Y2' etc in Flat file
Initially default value(not constant) for this info Object value should be 'K4' in Info Package
If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
Rgds,
CVHi,
suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
haritha -
My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!
Hi,
You could use FND_FLEX_LOADER_APIS.UP_VALUE_SET_VALUE to upload them from staging table (I suppose you mean value set values...).
You can find a sample scripts if you google around.
What do you mean "how to map any API to our staging table" ?
You should do at least the following mapping (which column(s) in the staging table will provide these information):
- the 3 value sets name which you're going to update/upload (I suppose these are existing value sets or which have been already created)
- the value set values and description
Try to start with something and if there is any issues the community could then help... but for the time being with the description of the problem you have provided, that's the best I can do... -
How to maintain the dynamic description for a workitem ?
Hi everyone ,
How to maintain the dynamic description for a workitem ?
Thanks ,
Naval BhattOPen PFTC Txn
Enter the TAsk ID and openit in change mode
declare a container element in the task container and the same element in the workflow too.
Now from the workflow pass the value to the task container by using binding.
and in the workitem text of the task conatiner.
For e;g
if you want to display the workitem id in the task decription
open the task in the pftc and add the element in the workitem text and then pass the element value , so that the value that you have passed will be displayed in the workitem text.
*&WORKITEMID& Add * -
How to know the output type for particular tcode
Hi
how to know the output type for the VL10D & VAL TCODES.
Can anybody help me out.
Thanks and Regards
KrishnaraoHi Krishna,
GO to NACE and select your application and click on output types and in the next screen select your output type and and dbl click on Processing routines.
Here you will come to know about which driver program is used for which smartform or Script.
and for Program details you can refer table: REPOSRC
Regards,
Sachin -
How to know the process chain start time and end time
Hi Experts,
How to know the process chain start time and end time .
Thanks in advance
Regards
Gutti
Edited by: guttireddy on Feb 23, 2012 11:30 PMHi Reddy,
You may find the run time of a PC using below steps.
1. Call SE38 > /SSA/BWT > Execute > Enter your PC , choose the date and time > Execute. Here Run-time of a PC is displayed. (or)
2. Call RSPC1 > Enter your PC > Execute > Goto Log view > Right click on the start Variant > Displaying Messages > Note down the start time in Chain Tab. Now Right click on the last Process type of the PC > Displaying Messages > Note down the End time in Chain Tab. The Difference b/w start time and end time gives the Run-time of your PC.
Hope this helps.
Regards
Sai -
How to Use the language function for assignment and validation
Hi All,
If anyone can explain me in details with example ,how to use the language function for assignments and validations?
Thanks
ArnabHi Arnab,
The expression is checked only for the current MDM session.
If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
Try connecting to the DM with the XYZ language.
It should go to the if part rather than else.
Hope it helps.
Thanks,
Minaz -
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 -
- How to Display Sales Qty & Value for This Year & Last Year in 2 Columns -
Dear All,
I'm having trouble in extracting the last year figures based date entered. I'm actually would like to create a query where I'm able to know the "TOP 10 item sold based item category". I've created a query, which show the top10 item sold (total quantity & value) for this year, but not able to display the last year figure (quantity). Please advise & thanks for your help and time.
SET ROWCOUNT 10
SELECT T1.ItemCode, T2.ItemName, T3.ItmsGrpNam, SUM(T1.Quantity) as "Total Qty Sold", SUM(T1.TotalSumSy) as "Total Amount"
FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.DocDate >='[%0]' AND T0.DocDate <='[%1]' AND T3.ItmsGrpNam ='[%A]'
GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
ORDER by SUM(T1.Quantity) DESC
I wish to have the output as follow
Item Qty (2008) Qty (2007) Value(2008) Value(2007)
A 300 150 1000 500
B 250 300 800 650
C 100 250 700 550
Currently, My results display:
Item Qty (2008) Value(2008)
A 300 1000
B 250 800
C 100 700
Cheers,
SereneHi,
if you want more flexible, you could try this modified Istvan's query:
SELECT top 10 T1.ItemCode, T2.ItemName, T3.ItmsGrpNam, SUM(T1.Quantity) as "Total Qty Sold",
SUM(T1.TotalSumSy) as "Total Amount" ,
(select sum (r.Quantity) from ODLN h
inner join DLN1 r on h.DocEntry=r.DocEntry
where h.DocDate>='[%4]' and h.DocDate<='[%5]'
and r.ItemCode=T1.ItemCode) '2007 Sold',
(select sum (r.TotalSumSy) from ODLN h
inner join DLN1 r on h.DocEntry=r.DocEntry
where h.DocDate>='[%6]' and h.DocDate<='[%7]'
and r.ItemCode=T1.ItemCode) '2007 Amount'
FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.DocDate >='[%0]' AND T0.DocDate <='[%1]' AND T3.ItmsGrpNam between '[%2]' and '[%3]'
GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
ORDER by SUM(T1.Quantity) DESC
Rgds,
Maybe you are looking for
-
Read table data and fetch file from path specified in table column
Hi, I have a situation where file path information is stored in database table along with other columns - I need to read data from SQL Server table row by row, go to the path identified by the record, check for existance of the file - if the file is
-
hi i am adding new field to my existing package which is char(10). getting this error: [Flat File Destination [139]] Error: Data conversion failed. The data conversion for column "MEMBER_ID" returned status value 4 and status text "Text was truncated
-
Exchange rate questions...
Hi, This is not exactly a ABAO question but a general SAP question. What is the differnerce between average exchange rate 'M', buying exchange rate and selling exchange rate ? Why do we need to use translation ration for exchange rates ? What is the
-
What is the Smartnet service for the 2504 license upgrade LIC-CT2504-UPG ?
Hi guys, Can some one explain me what is this service for ? I have the LIC-CT2504-UPG, with the LIC-CT2504-5A (5 AP licenses adder) and I don't understeand what are the SMARTNet services for this licenses ? Are they needed if I already have the SMART
-
Classical report printout problem
Hi Classical report printout is coming landscap while i want it to come in portrait. Any idea ???