Updating a file using FileManager updateDocument
How can I update a file that has already been uploaded to CS. I have categories and attributes on this file and wish to retain all of this. I just want to change the file itself. If I try to use the updateDocument method as I have below I receive the following error:
Exception caught in INT AxisFault.java: makeFault: Line: 101: java.io.IOException: No serializer found for class oracle.adfinternal.view.faces.webapp.UploadedFileImpl$BufferIS in registry org.apache.axis.encoding.TypeMappingDelegate@580
NamedValue[] documentDef =
new NamedValue[] {
new NamedValue(Options.CONTENTSTREAM, inputStream),
new NamedValue(Attributes.DESCRIPTION, description)};
Item newDoc = fm.updateDocument(doc.getId(), documentDef, null);
Any help would be greatly appreciated.
Hi Sapan
Thanks for your feedback.
well, in some other similar systems (e.g. sharepoint) it is possible to overwrite contents if needed.
I can imagine many cases that one would want to update the content of certain version without changing the version.(if there is a concept of history of activities on the document then this can be logged or traced there).
Or sometime one might want to disable versioning for a certain document or folder completely in the system.
Anyway, I don't want to question UCM's approach but more to know the boundaries.
You mentioned it might be possible through Java. Do you mean CIS package or something else?
can you please elaborate more on this.
Regards,
Similar Messages
-
How to update XML file using XSLT
Hi there,
I have a "small" issue with exporting data to an XML file using XSLT.
A two steps process is needed to import data from a non-hierarchical XML file into ABAP, change the data, and then update the XML file with new values. The problem is not trivial, since the format of the XML file is a complex one: there are many interdependent elements on the same level, pointing to each other by using id and ref attributes. Based on these values the data can be read and written into an internal table. I use XSLT and XPath for that. So the inbound process is done and seems to work correctly. I have to mention that the file contains much more data than I need. I am working only with a small part of it.
Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT? I can pass only the internal table to the transformation, so how do I access the XML file in order to update it? I have tried to use the <B>xsl:document()</B> function to access the content of the file store locally on my PC, but it fails each time by throwing and URI exception. I have tried the absolute path without any addition and the path with the file:/// addition. Same result. Please advise.
Many thanks,
Ferenc
P.S. Please provide me with links only if they are relevant for this very matter. I will not give points for irrelevant postings...Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
XSLT approach: check these online tutorial
http://www.xml.com/pub/a/2000/08/02/xslt/index.html
http://www.xml.com/pub/a/2000/06/07/transforming/index.html
ABAP approach:
for example you have the xml (original) in a string called say xml_out .
data: l_xml type ref to cl_xml_document ,
node type ref to if_ixml_node .
create object l_xml.
call method l_xml->parse_string
exporting
stream = xml_out.
node = l_xml->find_node(
name = 'IDENTITY'
ROOT = ROOT
l_xml->set_attribute(
name = 'Name'
value = 'Charles'
node = node
(the above example reads the element IDENTITY and sets attribute name/value to the same)
like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
so how do I access the XML file in order to update it?
you have already read this XML into a ABAP variable right?
Sorry couldnt understand your whole process, why do you need to read local XML file?
Raja -
How to update pdf file using adobe exportpdf
can you update a pdf if you only have the export pdf product? thx
Hi canusbau
You Cannot Edit a PDF File Using Export PDF. You can Convert PDF into other formats using this Service,
Though You can Convert it to Word or any Other format, Make Changes in the Document and then Use MS Office Save as Adobe PDF option to Create PDF again. -
Updating XML file using DOM parser
Hi,
Can someone help me, how to update following XML file using DOM parser.
The following is my XML file.
<students>
<student>
<id>1</id>
<name>abc</name>
</student>
<student>
<id>2</id>
<name>xyz</name>
</student>
<student>
<id>3</id>
<name/>
</student>
<student>
<id>4</id>
<name>ijk</name>
</student>
<student>
<id>5</id>
<name></name>
</student>
</students>Consider, I will input 2 fields, ie., id & name. For the matching Id, the name has to be updated.
Though, I have achieved this, but I am unable to update the value for 3rd record, & 5th record ie., id=3 & id=5. Since, these are blank.
Thanks.Some <name> elements have a child node which is a text node. From what you say it appears you know how to change those text nodes.
The other <name> elements don't have any child nodes. But you want one. This suggests to me that you need code that creates a text node and adds it to the <name> element as its child. -
No Contents in Software Update Cache File Using 10.4.11
When running Software Update in 10.4.9, a "Software Update" cache file would be created in User-Library-Caches. The file would collect and retain cache data until cleared. Using 10.4.11, the cache file is created but there are no actual contents i.e. Zero KB. Has anyone else noticed this or do I have a unique problem? And if I do, can it be fixed? Of course this is not a big problem and everything else is working fine. I just wanted to understand the change if I could. Thanks for any help.
Regular Guy wrote:
It just seems strange that Software Update would create cache folders and leave them empty. In my case this started with 10.4.11.
Unfortunately, I never gave it any thought, and just assumed the software updates were being deleted after they were installed. So I never looked in those folders to see and don't have anything to compare it to.
I thought that the actual payload of the software updates went into the /var/tmp directory, since I once had a problem with a software update and part of the fix involved messing about in that directory. But that was a long time ago, with 10.3 or earlier. If they do go into /var/tmp then I'm sure they'd be deleted at the next reboot.
But you are right, it is a bit odd to put empty folders in that cache folder. Or, if they aren't empty to start with, to have them be emptied, but not delete the folders themselves...
charlie -
Hi,
Is there any CIS API that lets you overwrite an existing file in the UCM. the idea is, not to checkin a new revision but to overwrite the exiting one.
I looked at update API (ISCSDocumentUpdateAPI ) but it can only update the attributes of document not the file that is associated with it.
I also couldn't update it through the UCM web interface, so I'm thinking that maybe UCM does not allow such a thing and you always have to create a new revision no matter what. Is this a right conclusion? I hope not.
Any feedback is appreciated.Hi Sapan
Thanks for your feedback.
well, in some other similar systems (e.g. sharepoint) it is possible to overwrite contents if needed.
I can imagine many cases that one would want to update the content of certain version without changing the version.(if there is a concept of history of activities on the document then this can be logged or traced there).
Or sometime one might want to disable versioning for a certain document or folder completely in the system.
Anyway, I don't want to question UCM's approach but more to know the boundaries.
You mentioned it might be possible through Java. Do you mean CIS package or something else?
can you please elaborate more on this.
Regards, -
Hi
I have created a java class that uses JButton to bring up JFileChooser. I then select a file and add the file details to a xml file. below is the code showing how I capture this information and add to xml:
if(file != null && state==JFileChooser.APPROVE_OPTION)
String name= file.getName();
String directory = file.getPath();
long length = file.length();
// convert file length into
long kb= length/1024;
String s= new String();
String a=s.valueOf(kb);
UploadFiles uploadFiles = new UploadFiles();
uploadedFiles.addFileElement(name,directory,a);
addFileElement(...) is a method that add the above information to xml file. however, when I select a file, the file details are not added to the xml file; and i also get some errors.
But I know that my addFileElement(..) method is correct since if I use the following code , I am able to write to a xml file:
uploadedFiles.addFileElement("xml.java","directory","size");
So does anyone know why my addFileElement(...) is not working properly.
thanks
QasimBelow is my code for addFileElement method.First of all I was using DOM, but since this method was not working properly I switched to JDOM. I wrote the same code in Jdom, and now it is working.
public void addFileElement(String name, String directory, String size)
this.name=name;
this.directory=directory;
this.size=size;
//create a file element to hold information about a file
Element fileElement=document.createElement("file");
//create attributes for name
Attr nameAtt = document.createAttribute("name");
nameAtt.setValue(name);
//set directory attribute
Attr directoryAtt = document.createAttribute("directory");
directoryAtt.setValue(directory);
//size attribute for the file
Attr sizeAtt = document.createAttribute(size);
sizeAtt.setValue(size);
//add teh above attributes to the file element
fileElement.setAttributeNode(nameAtt);
fileElement.setAttributeNode(directoryAtt);
fileElement.setAttributeNode(sizeAtt);
//decide where we want to put this element. first get the 'files' element reference and insert this new element after it.
NodeList newfile = document.getElementsByTagName("file");
Element firstFile=(Element)newfile.item(0);
firstFile.getParentNode().insertBefore(fileElement, firstFile);
try
((XmlDocument) document).write(new FileOutputStream("UploadedFiles.xml"));
catch (IOException io)
System.err.println("Problem with writing to file " );
io.printStackTrace();
-
OAM Context showing error when updating context file on 11i apps
HI,
When i am trying to update context file using OAM, i am getting following error.
Failed when writing Context Configuration files back to file system. Possible causes: An error occurred while attempting to establish an Applications File Server connection with the node FNDFSP_dbora12. There may be a network configuration problem, or the TNS listener on node FNDFSP_dbora12 may not be running. Please contact your system administrator. . However, you still can run AutoConfig and restart services to make sure these settings take effects.Sawwan,
What is the application release? OS?
HP Unix
Has this ever worked? If yes, what changes have been done recently?
This is cloned environment.
Do you have proper entry in the hosts file?
yes
Is the application listener up and running? Can you view the concurrent requests log/output files? If not, please see (Note: 117012.1 - Troubleshooting the "Error Occurred While Attempting to Establish an Applications File Server Connection").
yes application listener is up and running.
Is the value "FNDFSP_dbora12" correct or it points to the source instance in case this is a cloned one? If the value is incorrect, please validate the entries in FND_NODES table (purge the table and run AutoConfig -- I believe you are familiar with the steps
Value of RRA: Service Prefix is FNDSP_ not FNDSP_dbora12. -
Dreamweaver asks to update template files twice
This has bothered me forever. I change a template and save.
Dreamweaver updates the files using that template. I goto my
browser and check out the changes. I go back to DW and the update
templates dialog pops up again. WTF?? Why does it do this? Please
help it is driving me crazy and has for a few years now.This has bothered me forever. I change a template and save.
Dreamweaver updates the files using that template. I goto my
browser and check out the changes. I go back to DW and the update
templates dialog pops up again. WTF?? Why does it do this? Please
help it is driving me crazy and has for a few years now. -
How to Update existing XML File Using Java Swing
Hi,
I am reading XML file and getting keywords into JList. When i add some keywords into JList through textfield and remove keywords JList, then after click on save button it should update xml file. How can i do it ?
Please provide me some code tips for updating xml file
This is the code that i am using for reading XML File:
import javax.swing.*;
import java.awt.event.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.util.*;
import java.text.Collator;
import java.util.regex.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;
public class getKeywords extends JFrame implements ActionListener
static JPanel p;
static JLabel lbl;
static JButton btnSave,btnAdd,btnRemove;
static String path;
static Vector v;
static JList lstCur;
static JTextField txtKey;
Document dom;
static image imgval;
NodeList nodelstImage;
static AnchorLayout anchorLay;
private DefaultListModel lstCurModel;
public getKeywords()
super("Current Keywords");
v=new Vector();
p=new JPanel();
txtKey=new JTextField(10);
btnAdd=new JButton("Add");
btnRemove=new JButton("Remove");
btnSave=new JButton("Save");
lbl=new JLabel("Current Keywords");
lstCurModel=new DefaultListModel();
lstCur=new JList();
JScrollPane scr=new JScrollPane(lstCur);
runExample();
lstCur.setModel(lstCurModel);
p.add(lbl);
p.add(scr);
p.add(txtKey);
p.add(btnAdd);
p.add(btnRemove);
p.add(btnSave);
add(p);
btnAdd.addActionListener(this);
btnRemove.addActionListener(this);
btnSave.addActionListener(this);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
public static void main(String arg[])
getKeywords g=new getKeywords();
g.resize(250,400);
g.setVisible(true);
public void actionPerformed(ActionEvent ae)
if(ae.getSource()==btnAdd)
lstCurModel.addElement(txtKey.getText());
if(ae.getSource()==btnRemove)
lstCurModel.remove(lstCur.getSelectedIndex());
if(ae.getSource()==btnSave)
//Code to Write
public void runExample()
//Parse the XML file and get the DOM object
ParseXMLFile();
//Get the Detail of the Image Document
parseImageDocument();
//Get the Detail of the LML Document
//parseLMLDocument();
//System.out.println(lmlval.Title);
public void ParseXMLFile()
//Get the Factory
DocumentBuilderFactory builderFac = DocumentBuilderFactory.newInstance();
try
//Using factory get an instance of the Document Builder
DocumentBuilder builder = builderFac.newDocumentBuilder();
//parse using builder to get DOM representation of the XML file
dom = builder.parse("LML.xml");
catch(ParserConfigurationException pce)
pce.printStackTrace();
catch(SAXException sax)
sax.printStackTrace();
catch(IOException ioex)
ioex.printStackTrace();
public void parseImageDocument()
//Get the root element
Element docImgEle = dom.getDocumentElement();
//Get a nodelist for <Image> Element
nodelstImage = docImgEle.getElementsByTagName("Image");
if(nodelstImage != null && nodelstImage.getLength() > 0)
for(int i = 0; i < nodelstImage.getLength(); i++)
//Get the LML elements
Element el = (Element)nodelstImage.item(i);
//Get the LML object
getImage myImgval = new getImage();
imgval = myImgval.getimage(el);
v.addElement(new String(imgval.Thumb));
String[] x = Pattern.compile(",").split(imgval.Keys);
for (int s=0; s<x.length; s++)
lstCurModel.addElement(x[s].trim());
//System.out.println(x[s].trim());
} Thanks
NitinYou should update your DOM document to represent the changes that you want made.
Then, using the Transformation API you simply transform your document onto a stream representing your file. Something like this:
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
// TODO - set indentation amount!
Source source = new DOMSource(dom);
Result result = new StreamResult(file);
transformer.transform(source, result);Hope this helps. -
Using File Browse to update stored file
Hi all,
I have a form with a File Browse item on it which is (surprisingly!) used to upload a file and associate with a record. The filename is stored in a varchar column in the table. This works fine when I create (INSERT) the initial record and I can retrieve the stored file just fine. However the problem I have is when I want to update the uploaded file. It seems the normal mechanisms for update / save requests don't apply to uploaded files. My other attributes get updated fine but the new uploaded filename is not reflected in the table.
I've put together a simple example of this on a when apex.oracle.com :
http://apex.oracle.com/pls/otn/f?p=40740
Which has two fields, a file name and an 'attribute'. Try as I might I can't update the file name although the attribute changes just fine.
Any suggestions will be much appreciated. I realise I may be missing something fundamental here and am more than happy to be enlightened.
FYI, the purpose for such functionality is to allow users of our system to store a photograph of themselves along with their details. This functionality is required to allow the photograph to be updated if required.
Thanks,
SteveIf i am not mistaking, using a file browser item type will not set the uploaded file (blob) in this item, to be processed in the standard processing on you're page.
In a recent project i wrote a stored procedure for handling with uploaded files. This procedure, which based on the filename ( Fnnnn/<filename> ) , select the uploaded content through apex_application_files, the location apex saves the files. and procedure outputted the file as a blob, which then can be used to insert/update in youre table
Hope this example code will help you:
procedure upload_bestand( p_file_name in varchar2
, p_file out nocopy blob
, p_filetype out nocopy varchar2 )
is
-- Cursor voor bepalen bestand uit apex_application+files
cursor c_file ( b_file_name in varchar2)
is
select aaf.filename
, aaf.mime_type
, aaf.blob_content
from apex_application_files aaf
where aaf.name = b_file_name
r_file c_file%rowtype;
begin
open c_file ( b_file_name => p_file_name );
fetch c_file into r_file;
if c_file%notfound
then
-- Upload van bestand niet geslaagd
close c_file;
raise e_file_err;
end if;
close c_file;
-- Geupload bestand uit temp_upload tabel verwijdern
delete from apex_application_files
where name = p_file_name
commit;
p_file := r_file.blob_content;
p_filetype := r_file.mime_type;
end upload_bestand; -
Update purchase Order using offline file
Hi Experts
How to create and update purchase Order using offline file. How to execute offline API from program in batch ?Hi Experts
How to create and update purchase Order using offline file. How to execute offline API from program in batch ? -
How to update the value in xml file using transformer after setNodeValue
Hi,
This is my code
I want to set update the values in xml file using transformer..
Any one can help me
This is my Xml file
<?xml version="1.0" encoding="UTF-8"?>
<place>
<name>chennai</name>
</place>
Jsp Page
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="javax.xml.parsers.DocumentBuilderFactory,
javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<% String str="";
String str1="";
try
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
out.println("Before change");
NodeList n11 = doc.getElementsByTagName("name");
Node n22= n11.item(0).getFirstChild();
str1 = n22.getNodeValue();
out.println(str1);
out.println("After change");
String name = "Banglore";
NodeList nlst = doc.getElementsByTagName("name");
Node node= nlst.item(0).getFirstChild();
node.setNodeValue(name);
NodeList n1 = doc.getElementsByTagName("name");
Node n2= n1.item(0).getFirstChild();
str = n2.getNodeValue();
out.println(str);
catch(Exception e)
out.println(e) ;
%>
<h1><%=str%></h1>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
</body>
</html>hi check this exit...
IWO10012 -
Just got a new MacMini. Migrated files using Time Machine. However, now, on Launchpad, I see several Firmware updates that were relevant for the old machine, but not for the new one. How do I get rid of these updates? They won't delete!
Only thing I can think of is trying this Lion trick...
http://www.cultofmac.com/106030/how-to-nuke-lions-launchpad-and-start-over/10603 0/ -
Revision: 3037
Author: [email protected]
Date: 2008-08-29 06:54:15 -0700 (Fri, 29 Aug 2008)
Log Message:
Update flex-config.xml files used by the team and qa webapps to use the {targetPlayerMajorVersion} token instead of a hardcoded player version in the library-path and external-library-path. This will allow the correct playerglobal.swc to be located when the target player version is set in the flex-config.xml or passed to mxmlc or compc.
Modified Paths:
blazeds/trunk/apps/team/WEB-INF/flex/flex-config.xml
blazeds/trunk/qa/resources/config/flex-config.xmlUnfortunately I don't have the
"org.eclipse.swt.win32.win32.x86_3.1.2.jar" file. On my computer
the folder is not set up the same way (C:\Program Files\Adobe\Flex
Builder 2\plugins) instead it is set up as (C:\Program
Files\Adobe\Flex Builder 2\metadata\plugins) but I've looked in
everything and that file just isn't in there. I've re downloaded it
twice. Still not there. Is there anything else i can do.
Maybe you are looking for
-
Report - P&L Report by Profit Center
Hi All, Have a reporting reqmt in BPC 10 for which trying to figure out the best way. There are about 20 profit centers and wrt every profit centers, there would be certain GL accounts which need to be considered while being displayed in report. Ex -
-
Error in Import phase DISASSEMBLE when implementing KB70022
I'm trying to implement XI/PI netweaver 7.00 SAPKB70022 patch: Always stays in the 'DISASSEMBLE' phase, the following log shows: Saving the current Queue OCS (17.09.2010, 13: 34: 16) 001: SAPKB70022 - Support Package for SAP_BASIS Release 700 Import
-
please help me how to authorize my computer as it always say The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.
-
Set default directory/path for SaveAs Dialog using WPG_DOCLOAD
Hi, im trying to set the default directory/path for the SaveAs Dialog called by wpg_docload.download_file. I'm not able to find where I can specify the default path. Is it something like "htp.p('Content-Disposition: attachment; path=:PX_OUTPUT_DIR" ?
-
What does it mean when it says '' the safety of this file cannot be determi
I'm relatively new to the apple experience, and earlier today when I was trying to download the new Windows Media Player, it said "the safety of this file cannot be determined". When it finished downloading it just appeared to be a blank file that I