How to check external file (logo) existence?
Hello all,
We use BIP 11.1.1.6 (build 5.12.110)
In our rtf template, we use external logo with command :
<fo:external-graphic src="url('{xdoxslt:get_variable($_XDOCTX, 'LOGOFILE')}')"/>That works perfectly.
But, we would like to check existence of the logo file before printing it, and if the logofile doesn't exist then display a default logo.
Is it possible to check file existence in this situation ?
Thanks in advance,
Olivier
Hello AlexAnd,
I tried to put together all what you said, but as soon as I used <image>, the engine sends this error below:
Here is my code :
<?xdoxslt:set_variable($_XDOCTX, 'OU', substring(IdReference/Description, 1, 4))?>
OU:<?xdoxslt:get_variable($_XDOCTX, 'OU')?>
<?xdoxslt:set_variable($_XDOCTX, 'LOGOFILE', concat( 'C:\GFS\images\', xdoxslt:get_variable($_XDOCTX, 'OU'),'.jpg'))?>
LOGOFILE:<?xdoxslt:get_variable($_XDOCTX, 'LOGOFILE')?>
<?xdoxslt:set_variable($_XDOCTX, 'DEFAULTLOGO', concat( 'C:\GFS\images\', 'Default','.jpg'))?>
DEFAULTLOGO:<?xdoxslt:get_variable($_XDOCTX, 'DEFAULTLOGO')?>
<image><fo:external-graphic src="url('{xdoxslt:get_variable($_XDOCTX, 'LOGOFILE')}')"/></image>
<defaultimage><fo:external-graphic src="url('{xdoxslt:get_variable($_XDOCTX, 'DEFAULTLOGO')}')"/></defaultimage>The error comes before the 2 if commands.
Here is the error detail:
[052413_003637400][oracle.xdo.template.FOProcessor][EXCEPTION] oracle.xdo.XDOSAXException: org.xml.sax.SAXException: element image is not supported yet.
at oracle.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:421)
at oracle.xdo.template.FOProcessor.generate(FOProcessor.java:1218)
at RTF2PDF2.runRTFto(RTF2PDF2.java:473)
at RTF2PDF2.runXDO(RTF2PDF2.java:337)
at RTF2PDF2.main(RTF2PDF2.java:230)
Caused by: org.xml.sax.SAXException: element image is not supported yet.
at oracle.xdo.template.fo.FOHandler.startElement(FOHandler.java:285)
at oracle.xdo.common.xml.XSLTHandler$SEEntry.sendEvent(XSLTHandler.java:542)
at oracle.xdo.common.xml.XSLTMerger.startElement(XSLTMerger.java:51)
at oracle.xdo11g.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:182)
at oracle.xdo11g.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1322)
at oracle.xdo11g.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:366)
at oracle.xdo11g.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:312)
at oracle.xdo11g.parser.v2.XMLParser.parse(XMLParser.java:218)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at oracle.xdo.common.xml.XDOSAXParser.invokeParse(XDOSAXParser.java:166)
at oracle.xdo.common.xml.XDOSAXParser.parse(XDOSAXParser.java:122)
at oracle.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:407)
... 4 more
[052413_003637402][oracle.xdo.template.FOProcessor][ERROR] End Memory: max=227MB, total=98MB, free=47MBI may not clearly translate what you suggested, I think about the setting of <image> and <defaultimage> with command fo:external-graphic, but this came as an immediate thought.
Any suggestion ?
Can you help ?
Thanks,
Olivier
Similar Messages
-
How to call external files from java?
How to call external files in java. For example how to call a *.pdf file to open in its default editor(say Acrobat), or a *.html file to open in the default browser or a *.txt file in a notepad etc..,
In my program i have *.chm (Compiled Windows HTML Help) help file. how to open it in its default editor it?Jayarathina_Madharasan wrote:
no one answered my questionHi what wrong did i do...basically insulted all the volunteers here who took the time to consider your question and try to offer you help. Other than that, you did nothing wrong.
From JavaRanch :
And even if an answer doesn't solve your problem, even if it should totally miss the point - the best thing to do to motivate others to continue trying to help you is showing respect and gratitude for the investment of time that was put into dealing with your issue.
Edited by: Encephalopathic on Apr 14, 2008 10:01 AM -
How to Check a file in the directory..
Dear,
Pl. do suggest me how to check a file (e.g. abc.txt) is in the directory (say d:\Print).
Do tell me how to check whether this file is exist in the directory or not???
Thanx in Advance.
BhaveshHi
You can use Win_Api_Utility.Copy_File cmd. IF the file does not exist r the file was not copied to the destination properly, it will raise no_data_found error. See Forms help - Find option for syntax & more details.
I've used it & works well.
Regards
APK -
How to include external files in JSP
hi,
How to include external files like image or javascript in to jsp pages.
I am using MVC frame work. So i have to use request dispatcher. While calling the pages trough dispatcher the external files are missing from the output. Also am using tomcat as server,web.xml(deployment descriptor ) is also configured.
regards
sreeWhen you use the request dispatcher, the relative path for all your ressources becomes the relative path of your calling serlvet and not the JSP/servlet that you call. Make sure to use the full relative path such as:
/PATH_TO_YOUR_DIRECTORY/myRessource.ext
NOT
SOME_DIRECTORY/myRessource.ext
Jeff -
How to check amsilent file in Sun Access manager patch or redeploying WAR's
h1. How to check amsilent file in Sun Access manager patch or redeploying WAR's
I had a hard time getting all the passwords correct, so I wrote a shell (bash) script that uses most passwords and other parameters in searches and queries. It let's you know before you start if a value is wrong. It does not change anything, only queries.
h2. One pitfall I found ...
during the postinstall of patch 05. I told Sun about it, but I suspect it was too late and is also an issue with patch 06:
Look at the documentation regarding amconfig and the amsilent file:
http://docs.sun.com/app/docs/doc/819-2137/adsav?l=en&q=amconfig&a=view
Two problems that are clear to me now:
1. ADMINPASSWD in practice, this password is used for cn=puser, not amadmin as it says. Perhaps there is something that makes them the same. It was the same for me, so it probably does not matter.
2. AS81_ADMINPASSWD is not the same as ADMINPASSWD using either my definition or the document's definition. However, in the amsilent template, it is set like this, which I found is incorrect and the cause of my recent hair loss:
<blockquote>AS81_ADMINPASSWD="$ADMINPASSWD"</blockquote>
Also, this one if you use the web server:
<blockquote>WL8_PASSWORD="$ADMINPASSWD"</blockquote>
Delete the $ADMINPASSWD and replace it with the password for the app/web server.
h2. The Script.
It tests for the above problem, but I just realized it does not check $ADMINPASSWD. If that is set incorrectly in your amsilent, you'll get errors immediately from amconfig, so no big deal. If you make improvements, please post a reply!
Paste this into a file named checkamsilent. LDAP and appserver must be running. It reads /opt/SUNWam/amsilent. Run it as root or use sudo:
sudo ./checkamsilent
#!/usr/bin/bash
echo "This will test several important parameters of the amsilent file "
echo "run this as root."
echo "### read in the amsilent parameters"
echo "source /opt/SUNWam/amsilent "
source /opt/SUNWam/amsilent
echo "### look for the *server port* with LISTNER, otherwise it's not listening. "
echo "netstat -a | grep $SERVER_PORT "
echo "--------------"
netstat -a | grep $SERVER_PORT
echo "--------------"
echo "."
echo "### *admin port* with LISTNER, otherwise it's not listening. "
echo "netstat -a | grep $ADMIN_PORT "
echo "--------------"
netstat -a | grep $ADMIN_PORT
echo "--------------"
echo "."
echo "### Expect to see a line of XML, otherwise the SERVER_PORT is incorrect in the amsilent file."
echo "grep $SERVER_PORT ${AS81_INSTANCE_DIR}/config/domain.xml "
echo "--------------"
grep $SERVER_PORT ${AS81_INSTANCE_DIR}/config/domain.xml
echo "--------------"
echo "."
echo "### Expect to see a line of XML, otherwise the ADMIN_PORT is incorrect in the amsilent file."
echo "grep $ADMIN_PORT ${AS81_INSTANCE_DIR}/config/domain.xml "
echo "--------------"
grep $ADMIN_PORT ${AS81_INSTANCE_DIR}/config/domain.xml
echo "--------------"
echo "."
echo "### bind as the directory manager "
echo "ldapsearch -v -h $DS_HOST -p 3892 -L -s sub -D \"$DS_DIRMGRDN\" -w \"$DS_DIRMGRPASSWD\" -b 'dc=nsf, dc=gov' \"cn=amldapuser\""
ldapsearch -v -h $DS_HOST -p 3892 -L -s sub -D "$DS_DIRMGRDN" -w "$DS_DIRMGRPASSWD" -b 'dc=nsf, dc=gov' "cn=amldapuser"
echo "."
echo "### check the amldapuser password. "
echo "ldapsearch -w $AMLDAPUSERPASSWD -v -h $DS_HOST -p 3892 -L -s sub -D cn=amldapuser,ou=DSAME Users,dc=nsf,dc=gov -b ou=DSAME Users,dc=nsf,dc=gov cn=* cn "
ldapsearch -w "$AMLDAPUSERPASSWD" -v -h $DS_HOST -p 3892 -L -s sub -D "cn=amldapuser,ou=DSAME Users,dc=nsf,dc=gov" -b "ou=DSAME Users,dc=nsf,dc=gov" cn=* cn
echo "."
echo "### check the app server admin: AS81_ADMIN password: AS81_ADMINPASSWD and port: ADMIN_PORT "
echo "### That's actually a bug in the template. "
echo "### Do not use AS81_ADMINPASSWD=\$ADMINPASSWD Make sure they are different passwords! Don\'t use the default!"
echo "Expect to see a WARNING about --password option. "
echo "/opt/SUNWappserver/appserver/bin/asadmin list-http-listeners --user $AS81_ADMIN --port $ADMIN_PORT -w $AS81_ADMINPASSWD "
/opt/SUNWappserver/appserver/bin/asadmin list-http-listeners --user $AS81_ADMIN --port $ADMIN_PORT -w "$AS81_ADMINPASSWD"
echo "done!"I change the product machine from LG optimus to Samsung Galaxy but the file writing is not working, too.
I copied the source code from Adobe website about FileStream but it is needless too.
-----------------program code------------------------
import flash.filesystem.*;
import flash.filesystem.FileStream;
import flash.events.Event;
//txtFld is a standard textField component
txtFld.text = "Start";var file:File = new File();
//btnSaveFile is a standard button component
btnSaveFile.addEventListener(MouseEvent.CLICK,handlerBtnSaveFile);
function handlerBtnSaveFile(e:Event){
txtFld.text = "Pressed";
file = File.documentsDirectory;
file = file.resolvePath("test.txt");
var fileStream:FileStream = new FileStream();
fileStream.openAsync(file, FileMode.WRITE);
fileStream.writeUTFBytes("Hello");
txtFld.text = file.nativePath.toString();
//fileStream.addEventListener(Event.CLOSE, fileClosed);
fileStream.close();
fcnFileName();
function fcnFileName(){
txtFld.text = file.name.toString();
function fileClosed(event:Event):void {
trace("closed");
txtFld.text = "FileClosed"; -
How to include external files when building installer for a standalone executable?
Hi,
I was trying to build a stand alone executable from my Labview project and I was able to do it successfully. Now I would like to include a few external .txt files in the installer. Those .txt files have parameters/constants that will be used by the program, and my program needs to load/read them when running. For now I have to manually copy/paste them into the target machine, but I really hope the installer can do it automatically. I see there is a "data" folder in the installer, and that's where I hope those .txt files can be added into.
How can I do it? Can anyone give me some suggestions? Thanks!
Rgds
Harry
Solved!
Go to Solution.Norbert,
I could not find "Add file" when right clicking the project. See attached image please. Under "Project" I do have a "Add to project" but there is no option for external files. I did not find "Source" location either.
What did i do wrong? Is there any version requirement here? I have a 2010 base version. Thanks for your help.
Rgds,
Harry -
CVAPI_DOC_CHECKOUTVIEW - how to check´out files to a SAP directory
Hello,
I have an issue with understanding and providing the FM CVAPI_DOC_CHECKOUTVIEW to check out files from KPRO to a SAP directory.
I use CV120_KPRO_CHECKOUT to checkout files to local PC and this runs fine, but not for checking out files to SAP directories. So I found the API.... FM.
But I am confused about the data required to run the FM CVAPI_DOC_CHECKOUTVIEW . I tried several times but it does not work either for check out to clnt nor to SAP server.
Parameters for DOKAR, DOKNR, DOKVR and DOKTL are clear to me. PF-CONTENT_PROVIDE is CLNT for PC check out and SRV for Server checkout. But what about the rest?
I am not sure how to provide the tables and the fields PF_FTP_DEST / PF_HTTP_DEST / PF_HOSTNAME and the PS_API_CONTROL.
Can anybody help me with the required import data.
Best regards
DirkHi Dirk.
We are using bapi to get the document file (original)
Look our usage of pf_http_dest and pf_ftp_dest.
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = vl_dokar
documentnumber = vl_doknr
documentpart = vl_doktl
documentversion = vl_dokvr
getactivefiles = 'X'
getdocdescriptions = 'X'
getdocfiles = 'X'
TABLES
documentfiles = t_document.
READ TABLE t_document INTO wa_document INDEX 1.
CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'
EXPORTING
documenttype = vl_dokar
documentnumber = vl_doknr
documentpart = vl_doktl
documentversion = vl_dokvr
documentfile = wa_document
originalpath = 'your SAP directory'
pf_http_dest = 'SAPHTTPA'
pf_ftp_dest = 'SAPFTPA'
IMPORTING
return = wa_return
TABLES
documentfiles = tl_files.
Darley -
How to check out files from DTR
Dear all,
I've check in files and activated it to the DTR. but somehow the transportation to production server was not complete coz it said that the DC built failed...how should i resovled this problem? What is the steps to check out files from DTR..and what is the steps to delete a DC from DTR? thank youHi
see the following link ,it will be helpful for u.
[Working with the Design Time Repository |http://help.sap.com/saphelp_nwce10/helpdata/en/83/74c4ce0ed93b4abc6144aafaa1130f/content.htm]
Thanks
Hazrath -
How to check Fla file version?
Hi Guys,
I installed on my system Adobe flash cs3. but when i opened my Fla file that time getting the following error.
So how to check the Fla file version??
Thanks in Advance..
JaxNaFLA Version Checker and Launcher
http://www.peterelst.com/blog/2005/10/02/flavor-fla-version-checker/http://www.northcode.com/blog.php/2007/07/27/FLA-Version-Checker-and-Launcher -
How to check the file size before loading it to the context
Hello,
I have an application to upload a file and write it to the server using the FileUpload UI and IWDResource Interface.
I would like to limit the size of the file the user is uploading to, say, 2MB.
The problem is that the current API doesn't allow me to check the file size before I store it in IWDResource. The API available for IWDResource:
IWDResource resource = ...
InputStream stream = resource.read(false);
size = stream.available();
Is working on the file only AFTER storing it in the context and the server's memory. This way, if a user decides to upload 1GB file for example, he can easily crash the server.
I am already familiar with <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71">this</a> arcticle but it doesn't answer this question as well, all it does is calculating the file size only after storing it in the context.
Any ideas...?
RoyHi Ram,
Have you activated your Objects ?
You need to activate your objects in order to see them in RWB.
Thanks & Regards,
Varun Joshi -
How to print external file using ABAP program
Hello
I want to print an external file which is located in server (
20.99.0.18\GUI\xyz\8.0QUALITY\QM_TS.DOC) .....i want to print these kind of files(which i have retrieved from table 'DRAW' field 'filep' )......i need to print these files using ABAP program.
thank you
Vikram.
Message was edited by:
Vikram Bojjaextract the data and pass to script or smartform for printing
-
How to check if file is in correct format
Hi,
I want to check if file is in below format via pl/sql
SCE_ YYYYMMDD
and throw an error if not. If
vsFileName:= 'SCE_20080204';
select TO_DATE(SUBSTR(vsFileName, 5, 8), 'YYYYMMDD') - 1 from dual
woudl return 2/3/2008. This is okay
vsFileName:= ''SCE_TEST0204';This is not okay; and would like to trap the error with file name is not correct
Thanks,
VSAre you just looking for some exception handling?
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 v_filename VARCHAR2(20) := 'SCE_TEST0204';
3 v_dt DATE;
4 v_err BOOLEAN := FALSE;
5 BEGIN
6 BEGIN
7 v_dt := TO_DATE(SUBSTR(v_filename, 5), 'YYYYMMDD');
8 EXCEPTION
9 WHEN OTHERS THEN
10 v_err := TRUE;
11 END;
12 IF v_err THEN
13 DBMS_OUTPUT.PUT_LINE('Filename is incorrect');
14 ELSE
15 DBMS_OUTPUT.PUT_LINE('Filename is OK');
16 END IF;
17* END;
SQL> /
Filename is incorrect
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 v_filename VARCHAR2(20) := 'SCE_20080204';
3 v_dt DATE;
4 v_err BOOLEAN := FALSE;
5 BEGIN
6 BEGIN
7 v_dt := TO_DATE(SUBSTR(v_filename, 5), 'YYYYMMDD');
8 EXCEPTION
9 WHEN OTHERS THEN
10 v_err := TRUE;
11 END;
12 IF v_err THEN
13 DBMS_OUTPUT.PUT_LINE('Filename is incorrect');
14 ELSE
15 DBMS_OUTPUT.PUT_LINE('Filename is OK');
16 END IF;
17* END;
SQL> /
Filename is OK
PL/SQL procedure successfully completed.
SQL> -
How to check external disk capacity?
Hi,
Can someone tell me how can I check the free space capacity of an external disk connected to my MacBook Air?
Thx, HansHI
Open Finder.
In left column, click on your external drive to hi-light it.
Now select File in top of screen menu, then select Get Info, about half way down the drop down menu.
This will show all features of your external drive.
Cheers -
How to Check Images File Exist? in different server
Hi,
I have 10 different coldfusion server.
for example 9 server is for the web application site - for
example
http://myserverone/studentweb
the other one is for images website, just for displaying
student picture - for example
http://myserverimage/studentpicture.
the purpose of this website is to display student picture
that i store as gif files.
from my studentweb website i will call the images from
studentpicture website as source for my image placeholder.
for example this is my code i'm calling form
http://myserverone/studentweb
website:
<img src="
http://myserverimage/studentpicture/#studentnumber#.gif"
alt="" name="studentpicture" width="160" height="200">
my problem is, if there is no specific student picture in my
studentpicture website, then the placeholder will display an X (
mean the images not found )
how do i prevent the X to display?
how do i using coldfusion or any kind of way to check if the
images exist on that website ( different server ), so if the images
is not found, i can display a default images? i can do this if i'm
calling the website in the same server, but not using a different
server.
this is like using other website images for your own personal
website and sometimes the owner delete the images from their
website, and i want to display my own images if that images been
removed from the source website.
anyone have done this before?
thanks for suggestion and guide...
haire1. Use CFHTTP with method="HEAD".
2. See, if the HTTP status code is 200.
The head-method is of course more efficient, as it doesn't
need to "get" the message body. However, a status code of 200 is
possible even when the requested image file is no longer on the
server. -
How to check pc file path validity?
Hi,
In my program I have to extract so much SAP data and write in a file in the fornt-end PC. In the selection screen I will input the filepath\name to write the data.
But how should I check whether the filepath is valid or not in the 'AT SELECTION-SCREEN' event itself? so that if it is not valid path, I can give an error message before extracting all the SAP data.
Thank you!
Sunitha.Hi Sunitha,
Please check the following sample code from other thread at selection screen value request event.
Using ABAP Objects:
PARAMETER : p_file LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR path.
DATA: directory TYPE string,
filetable TYPE filetable,
line TYPE LINE OF filetable,
rc TYPE i.
CALL METHOD cl_gui_frontend_services=>get_temp_directory
CHANGING
temp_dir = directory.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'SELECT THE FILE'
initial_directory = directory
file_filter = '*.XLS'
multiselection = ' '
CHANGING
file_table = filetable
rc = rc.
IF rc = 1.
READ TABLE filetable INDEX 1 INTO line.
P_FILE = line-filename.
ENDIF.
Using Normal ABAP:
DATA: P_FILE LIKE RLGRAP-FILENAME,
DPATH LIKE RLGRAP-FILENAME,
UPATH LIKE RLGRAP-FILENAME,
MODE TYPE C,
FLG_UD TYPE C.
CALL FUNCTION 'WS_ULDL_PATH'
IMPORTING
DOWNLOAD_PATH = DPATH
UPLOAD_PATH = UPATH.
IF FLG_UD <> 'D'.
DPATH = UPATH.
MODE = 'O'.
ELSE.
MODE = 'S'.
ENDIF.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = '*.XLS'
DEF_PATH = DPATH
MASK = ',*.XLS,*.*,*.*.'
MODE = MODE
IMPORTING
FILENAME = P_FILE
EXCEPTIONS
SELECTION_CANCEL = 3.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
Hope this will help.
Regards,
Ferry Lianto
Maybe you are looking for
-
HT204053 I have separate ID for myself and husband. Can we share apps ?
I have a separate Apple ID from my husbands. Can we share apps or do Ihave to reload and/or rebuy?
-
No puedo suscribirme al adobe creative suite 5 master collection
Hola, no estoy pudiendo inciar la suscripcion al adobe creative suite 5 master collection Tengo el numero de serie que me da correcto pero cuando tengo que poner mi adobe id me aparece el siguiente recuadro. Por favor necesito utilizar el photoshop e
-
Can i install a copy of photoshop cs6 on my laptop
This year I downloaded Photoshop CS6 for my desktop and now want to add a copy to my laptop. Please tell me how to do this. Thanks.
-
Material Dynamic Re-order Quantity
Dear Masters, I have a requirement here for Material based MRP planning where I want to have a dynamic re-order quantity. The requirement is as below: 1. Suppose I have 5 Equipments in Plant P1. 2. Now, I am creating Equipment BOM for each Equipments
-
Hi everybody A real problem has developed today. When I click on file info to either read a caption or write one instead of the normal box it opens a blank white box with just one green button on it (to expand it to fill screen) I can not type in the