Can I control filenaming when archiving files using the file adapter?
Hi folks,
Is there anyway to control the filename used when the File Adapter writes out to an archive?
Second question, I also need to be able to pass a "filename" to the adapter from an "input file." Is there a way to do this in the file adapter?
Sincerely,
lpac
Hi,
I have done that with the ftp adapter. In the .xsl file I wrote the following after the <xsl:stylesheet version="1.0" ....> tag:
<xsl:variable name="INFILENAME" select="ehdr:getRequestHeader('/fhdr:InboundFTPHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
<xsl:template match="/">
<xsl:variable name="OUTFILENAME"
select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr:fileName', $INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>
<opaque:opaqueElement>
<xsl:value-of select="/opaque:opaqueElement"/>
</opaque:opaqueElement>
</xsl:template>
</xsl:stylesheet>
To use this with the file adapter, you would have to wirte file where is written ftp.
Hope this helps,
Zaloa
Similar Messages
-
When should I use the power adapter?
I just installed a wireless router. Should I use the power adapter when I'm not going to use the Macbook for several hours? Does the Macbook drain the battery when it is shut down or sleeping?
When should I use the power adapter?
Whenever you are near a power outlet. Not 100% of the time, of course (you have to flex the battery sometimes) but as often as possible.
Should I use the power adapter when I'm not going to use the Macbook for several hours?
If you are near an outlet, yes.
Does the Macbook drain the battery when it is shut down or sleeping?
When sleeping, it drains a negligible amount.
Further reading:
http://support.apple.com/kb/HT1446
http://support.apple.com/kb/HT1490 -
ADF mobile: how do I upload a file using the rest adapter api
Hello,
I want to upload files using the rest adapter. How would I upload files such as pdfs, images (png, jpg ..) etc.. Some code would be appreciated.
Thanks,Thanks Frank,
The back-end is functioning in the following way (using Jersey and handling input streams):
@POST
@Path("/uploadFile")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response uploadFile(@FormDataParam("file") InputStream uploadedInputStream, @FormDataParam("file") FormDataContentDisposition fileDetail) {
String uploadedFileLocation = "D:\\temp\\uploadsTest\\" + fileDetail.getFileName();
// save it (this function reads from the input stream)
writeToFile(uploadedInputStream, uploadedFileLocation);
String output = "File uploaded to : " + uploadedFileLocation;
return Response.status(200).entity(output).build();
Is there a way to send data over a stream?
Thanks, -
Cannot process a Fixed Field Length file using the File Adapter (Sender)
Hi -
I have checked throughout these posts and blogs but I still have not been able to find a solution to my issue. When using the File Adapter (Sender) I get a Conversion initialization failed with "xml.keyfieldName", no value found. Why would I require a key field when I am using fixed field lenghts? The file is comprised of 2 structures - 1 header and multiple details (see below). There are no key fields in the flat file that I would be able to use. Any suggestions?
011000390 Customer Americas 20080605164317 000000000000000800000008000000000016000000
12345678 100500 100500 Supplier 1 0000000000030000002008040400
12345678 100501 100501 Supplier 2 0000000000052000002008042100
The File Adapter is configured as follows:
Document Name = Rfchke00
Document Namespace = 'my namespace'
Recordset Name = Rfchke00
Recordset Structure = Dtachkh,1,Dtachkp,*
Recordset Sequence = Ascending
Recordsets per Message = 1
Key Field Type = String (Case-Sensitive)
Dtachkh.fieldFixedLengths = 15,25,8,6,1,8,8,8,15,3,31
Dtachkh.fieldNames = F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11
Dtachkh.processFieldNames = fromConfiguration
Dtachkp,fieldFixedLengths = 18,13,13,35,15,3,8,2,21
Dtachkp,fieldNames = F1,F2,F3,F4,F5,F6,F7,F8,F9
Dtachkp,processFieldNames = fromConfiguration
Thanks,
DaveHi,
you can use the module from which u can convert your structure to
H011000390 Customer Americas 20080605164317 000000000000000800000008000000000016000000
D12345678 100500 100500 Supplier 1 0000000000030000002008040400
D12345678 100501 100501 Supplier 2 0000000000052000002008042100
Please note the extra H,D in the struture added by the module.
You can then use them as your key fieldValues.. The module should be deployed in Visual Admin and then can be used in the Module tab of your adapter CC
While writing the content conversion after that please dont forget about the added new characters
Please note also that i can find that the word supplier kept repeating in all the Dtachkp records
Please use that
Also if you feel that the field is of 13 characters and that would cause a problem dont worry... create a dummy field eg split tht 13 to two fields and use the common one as key field Value and identifier... as i see in ure case its like 500 Supplier , 502 Supplier . u can split the first 4 char and the remaing 9 char are key field value.
try this out
Rgds
Aditya -
Which user is used to pick-up and archive files using the file adapter?
Hi guys,
which one it is? is it XIPADM?
thank you,
OlianHi! Olian,
You can get archive the file from FTP Server also or else even you can kept the folderrs in your local machine also....its your choice..
Suppose if you want to Keep and archive directory or else a folder of another copy at which you are sending files from XI you can follow the below steps...
1. While configuring the Sender File Adapter you can select the option of ARchive directory ....there in File Adapter Parameters..
2. Select that radio button and then create first one seperate folder in FTP location and then you can enter that directory path name in the Archive directory 3. Also if you want to delete the files from where the XI is picking the files from the source directory means select option called Delete.......
3. Then automatically it will be deleted once the file is picked and also it can maintain another copy file in the archive folder or directory...
I hope it can be useful to you.and this is sufficent to you...
Regards:
Amar Srinivas Eli -
How to rename a XML file using the file/FTP adapter
Dear All,
I am trying to rename a file using VARIABLE NAME SUBSTITUTION.
My structure:
<ns1:MSg xmlns:ns1="http://www.mycomp.inf.br/msr">
<ns1:MSgVal type="A" Id="188549">
<ns1:cab>
<ns1:PO>4500000000</ns1:cPO>
<ns1:BI>90000000011</ns1:cBI>
</ns1:cab>
</ns1:MSgVal>
</ns1:MSg>
How do I do to get the value 188549 from the field Id that is into the tag MSgVal?
I created a variable var1 and my reference is:
var1 --> payload:ns1:MSg,1,ns1:MSgVal,1,Id@,1
I am getting the error:
Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
Regards,
FernandoHi,
Like pinted by Michal, use Adapter Specific Identifers.
In your mapping set the file name using the code in this link and then in your Receivr File Adapter select the Adapter Specific Identifiers --> FileName .
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Regards
Bhavesh -
NMH405 - Unable to view any files using the FIle Browser
Hello,
I logged in to the FIle Browser, hoping to delete some photos from my media hub. However, I am unable to view any music, photo, or video files on this page, nothing listed. All blank when I clicked on these 3 folders.
No problems accessing the actual files in their respective pages. I could play the music and video files, and view the photos. But I can't carry out any maintenance on them via the File Browser.
Checked the User Guide, but couldn't find any clues to this problem. Could someone please help me?
Thanks!Hi there,
Files that were imported and stored on the Import Folder won't be detected on the NMH File Browser. You may only see them if you manually classify the files to it's corresponding folder.
It means, you need to move the files based on their file type. AVIs, WMV, etc. should be placed on your Videos folder .. Mp3s, Wavs, etc. should be moved to the Music folder .. Jpgs, Gifs, etc. should be moved to Pictures folder ..
Hope this clarifies your concern.
Cheers! -
Can I have onDemand pooling from AQ using the AQ Adapter partner link?
Hi,
In my requirment, there is a legacy system which puts (Enque) the messages into AQ between 6PM to 7PM. So after that I have a requirement to pool the queue (Deque) in the evening 7PM daily. How to controle my ADAPter to pool only in the evening?
I can sehedule my orocess for 7PM daily, but the ADAPTER continiously starts pooling, is there a way to controle this?
Thanks
KhaleelI thought of a better solution but it will require a minor adjustment to the source systems process. Before the process starts it stops disables dequeueing. Then it enqueues the messages
PROCEDURE DBMS_AQADM.STOP_QUEUE
(queue_name => my_queue,
enqueue => false,
dequeue => true);
Once it is completed it enables the queues
PROCEDURE DBMS_AQADM.START_QUEUE
(queue_name => my_queue,
enqueue => true,
dequeue => false);
you still have the issue of clearing the queue of failed process but you have that issue now so I assume you have a solution for this.
hope this helps
cheers
James -
Send a XML file using the mail adapter
HI ,
I have to send an incoming xml message as a attachment in the mail using mail adapter .
how can I achieve this .
Thanks
NikhilHi Nikhil,
Just check with this blog-
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
Creating mails with attachments from flat text files
Hope this helps..
Regards,
Moorthy -
Can't save a pdf file using the 'File' tab in FF4.
Clicking "Save Page As..." in the Firefox menu should work fine. However, if the server you are downloading from is set up incorrectly, Firefox might recommend a filename which does not have the ".pdf" extension (e.g. "get_file.php"). In this case type ".pdf" at the end of the file name.
-
Reading a multiple record types from a single File using BPEL file adapter
Hi all.
We have a requirement where we want to read a CSV file using the BPEl adapter.
Following is the sample of csv file
HDR,1,2,3
---- First transaction starts----
TH,1,2,3
RSD,1,1
RSD,1,1
TD,1
-------Second transaction starts---
TH,1,2,3
RSD,1,1
RSD,1,1
RSD,1,1
RSD,1,2
TD,1
TD,1
-------------Third Transaction starts---
TH,1,2,3
RSD,1,1
TD,1
TD,1
TD,1
TD,1
-------------Fourth Transaction starts---
TH,1,2,3
LN,1,1,1,1,2
-----End of File---
TAIL
I have modified the file with some comments to have some clear understanding.
Basically our file is a transactions file from legacy system & contains mutliple transactions
First line will be a Header record starting "HDR" & contains all summary details about the file.
After it is details of all transactions thorughout the day, each transaction begins with record starting "TH".As shown in all transactions above.EAch transaction can have other multiple records like the RSD & TD shown above.
Our need is to read each transaction from the file & create an instance.How can we configure BPEL to grab the data starting with TH till it encounter's another TH.
Please advise
KrunalYou can't use the wizard to create a schema if a file as complex as this. the good news is that you can create one yourself. What you need to do is create standard xsd that will handle your file, then what you do is add the terminators that determine when a field stops.
Here is an example, hopefully this provides you enough infor for you to make your own.
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
targetNamespace="http://Invoice"
xmlns:tns="http://Invoice"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
nxsd:encoding="ASCII"
nxsd:stream="chars"
nxsd:version="NXSD">
<xsd:element name="Invoice">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InvoiceHeader" nxsd:startsWith="000" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="tns:InvoiceHeaderDetails" />
<xsd:element ref="tns:LineItem" nxsd:startsWith="001" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="InvoiceHeaderDetails">
<xsd:complexType>
<xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
<xsd:element name="BusinessUnit" type="xsd:string" nxsd:style="fixedLength" nxsd:length="13" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="InvoiceNo" type="xsd:string" nxsd:style="fixedLength" nxsd:length="16" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="InvoiceDate" type="xsd:string" nxsd:style="fixedLength" nxsd:length="15" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="VendorNo" type="xsd:string" nxsd:style="fixedLength" nxsd:length="29" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="OriginCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="OperatorID" type="xsd:string" nxsd:style="fixedLength" nxsd:length="8" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="LineCount" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="34" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="GrossAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="17" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="DiscountAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="50" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="FreightAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="93" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="TaxAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="50" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="DiscountFlag" type="xsd:string" nxsd:style="fixedLength" nxsd:length="1" nxsd:paddedBy=" " nxsd:padStyle="tail" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="LineItem">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="LineItemDetails">
<xsd:complexType>
<xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
<xsd:element name="BusinessUnit" type="xsd:string" nxsd:style="fixedLength" nxsd:length="13" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="InvoiceLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="DistributionCount" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="BusinessUnitPO" type="xsd:string" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="PONo" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="POLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="38" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="InvoiceLineAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="17" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element ref="tns:Distribution" nxsd:startsWith="002" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Distribution">
<xsd:complexType>
<xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
<xsd:element name="BusinessUnit" type="xsd:string" nxsd:style="fixedLength" nxsd:length="13" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="InvoiceLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="DistributionLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="10" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="GLAccountCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="84" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
<xsd:element name="DistributionAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="162" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="DistributionTaxAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="62" nxsd:paddedBy=" " nxsd:padStyle="tail" />
<xsd:element name="GLDepartmentCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
cheers
James -
hi,
as part of my requirement , i have to perform read and write operations of few files [ using the file upload control in my custom visual web part] and on submit button click.
but while writing these files - with the help of fileupload control - and when i use myfileupload.saveas(mylocation);
- i am saving these files into my D:\ drive of my server , where i am executing my code -, am getting access denied error.
it throws system.unauthorizedexception.
i have given full control on that folder where i was trying to store my attached files. and also after following asp.net forums,
i have added iusr group added and performed all those steps such that, the file is saved in my D:\ drive.
but unfortunately that didnt happen.
also
a) i am trying the code with runwithelevatedprivileges(delegate() ) code
b) shared the drive within the d :drive where i want o save the files.
c) given the full privieleges for the app pool identity- in my case , its
network service.
the other strange thing is that, the same code works perfectly in other machine, where the same sp, vs 2012 etc were installed .
would like to know, any other changes/ steps i need to make it on this server, where i am getting the error.
help is appreciated!vishnuS1984 wrote:
Hi Friends,
I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
public static void copyFiles(File src, File dest) throws IOException
// dest is a 'File' object but represents the C:\GetMe1 directory, right?
fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
BTW, this is awful:
catch (IOException e)
IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
wrapper.initCause(e);
wrapper.setStackTrace(e.getStackTrace());
throw wrapper;
}1) You're hiding the original IOException and replacing it with your own? For what good purpose?
2) Even if you had a good reason to do that, this would be simpler and better:
throw new IOException("your custom message goes here", e);
rather than explicitly invokign initCause and setStackTrace. Yuck! -
How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.
I don't think Finder does this (I've tried).
iTunes does though. Where you can set artwork or the "poster frame"...
This may not be what you want but if it helps, I know 2 ways do this is
Open the video in QuicktimePlayer7 | View | Set Poster Frame (even then, you might need to save it as .mov (ie in a 'mov container').
Drag the file into iTunes and set the artwork (as in http://www.dummies.com/how-to/content/adding-album-cover-art-or-images-in-itunes .html)
From there, iTunes will use that frame as the "poster frame" ie the photo/frame that shows when you browse your videos. Which is what you want, but limited to iTunes.
When I do either of these above, the frame I set does not show when exploring files in "Finder" (or in the other Explorer tool I use called "Pathfinder").
So it maybe, that exactly what you want, is not possible. -
Can the file extension be removed when using the File Special Field?
I placed a Special Field on the top of my topics that gives
me the filename for that specific topic. I used the Insert >
Field > Special Field > File and the File Name is inserted
where I want it. The problem is that i don't want the file
extension to show, just the name. I can't figure out how to do
this...Any suggestions....anyone? Maybe a Script or an applet? Any
input will be greatly appreciated...Thank you for your response. I did try something similar to
what you suggested but the problem is that whatever I modify it
automatically puts it back like it was as soon as I try to save it.
This is probably because I used the Insert Special Field commands
from the Menu. It automatically places this on the code:
<!--kadov_tag{{<variable name=file
x-format=default
x-value=017.htm>}}-->017.htm<!--kadov_tag{{</variable>}}-->
Where 017.htm is the actual name of the file for the specific
topic. This means that it's apparently doing this on the background
somewhere I can't see and inserting the value on the code for the
topic...
I hope that made sense! Again, I thank you in advance for any
suggestions... -
New iMac. Flash drive is primary for OS and apps. I want to use my HD 2 (1 TB hard drive) for my bulky photo and music files. Can I direct iPhoto and iTunes to use the larger hard drive as the primary target when importing?
Yes. Unfortunately, I don't know the specifics because I don't use iPhoto anymore and I completely copied over 15 years of MP3 files recently when I installed 10.7. Needless to say, I have not opened iTunes since and probably never will again - not because of iTunes but because of my stupidity. I did have some of the files backed up but I hadn't backed up in a while.......anyway....
When I imported my CD's, I had them go directly to my external firewire. I can't remember exactly how to set it, but in the preference section of iTunes you can specify an import destination to any drive that's available to your machine. I did this with iPhoto as well way back at one point when I was using Tiger, but I don't remember the specifics on that either. I can't imagine they would have discontinued support for that feature since then.
Sorry I couldn't help more.
Maybe you are looking for
-
Hi all, I have some questions regarding the system privilege. Also I would like to thank you for your help in advance. In environment 1, I have a Win2k Sever and a Oracle 9i. I put my NT login under the DBA group in NT security. However, I still cann
-
Hello, I have yosemite if I add an imap account, I don't found how to access smtp parameter after closing and open mail app it is same for gmail account, once added, can't find where to modify smtp thanks
-
Credit Risk Analyzer -- Cannot update limit utilization
I want to use Credit risk analyzer to set limit to some specific transaction. When I create a MM transaction with start term before today, the amount will be checked and the utilization is updated, but when a transaction with start term in the future
-
Custom LAF - Transparent Checkboxes
Ok.. so after fixing my other bug, ive discovered that i want checkboxes to be completely transparent. ive tried setting the JComponent not to be opaque using the setOpaque(false) method, but to no avail. The code works fine except for the fact that
-
Bridge CS6 has become very buggy and creates blurry previews, so I think the best is to uninstall and reinstall. How much uninstall do I need? There's the Adobe uninstaller in the Utilities/Adobe Installers folder. Is this enough, or should I also us