Uploading files to KM repository using Webdynpro APIs
Hi All,
I was reading the following blog /people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis and I was trying to upload a document from a URL for example http:/ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif
So far I am getting the following error:
http:/ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif (No such file or directory (errno:2))
Any Ideas?
Regards,
Orlando Covault
Hi Jay,
So far I think I followed all the intructions given in the links you provide. This is the snipped code
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
String path = "/documents";
IResourceContext resourceContext = buildResourceContext();
// get a resource factory
IResourceFactory resourceFactory = ResourceFactory.getInstance();
// Get a RID from the current path to display the according content
RID pathRID = RID.getRID(path);
// Get a Iresource object to work on
ICollection folder =
(ICollection) resourceFactory.getResource(
pathRID,
resourceContext);
String templateUrl =
WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
"PositionModPDFView_InteractiveForm.xdp");
File file = new File(templateUrl);
FileInputStream template = new FileInputStream(file);
manager.reportWarning(template.toString());
if (template != null) {
template.read();
Content content = new Content(template, "byte", -1L);
manager.reportWarning(content.getContentType());
IResource newResource =
folder.createResource("sap_logo1.gif", null, content);
template.close();
}else{
manager.reportException("Documento Vacio",false);
} catch (ResourceException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (IOException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (ContentException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
} catch (WDAliasResolvingException e) {
// TODO Auto-generated catch block
manager.reportException(e.getLocalizedMessage(), false);
But I am still getting the same error: http://ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif(No such file or directory (errno:2)) . Any Idea of what could be wriong?
Regards,
Orlando Covault
Similar Messages
-
I want to upload files in sap-directories using webdynpro abap.
My requirement is i need to read the filess from the local system in a folder and save those files in the sap directories(AL11).Need help .
Thanks.Hi Dear,
U have to use File upload UI element , then read the file then follow the code for transfering into SAP directories:
check this
*Declare T_UPLOAD , W_UPLOAD itab and wa with your file heading structure
DATA:L_LINE TYPE STRING.
P_FLNAME = 'Test123'. " file name
OPEN DATASET P_FLNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CHECK SY-SUBRC = 0.
LOOP AT T_UPLOAD INTO W_UPLOAD.
CONCATENATE W_UPLOAD-Field1
W_UPLOAD-Field2
W_UPLOAD-Field3
W_UPLOAD-Field4
W_UPLOAD-Field5
INTO L_LINE
SEPARATED BY ','.
TRANSFER L_LINE TO P_FLNAME.
ENDLOOP.
CLOSE DATASET P_FLNAME.
I think it may help u a lot..
Regards
Aisurya -
Uploading images whit thumbnail to MDM repository using Java API
Hello,
can someone tell me how to upload images whit thumbnail to MDM repository using Java API?
i get following message using setHasThumbnail(true):
com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Ungültiger Wert für Parameter
thanksYou can upload images to MDM via the API, but the only way to create thumbnails is via the MDM Data Manager application which uses some embedded libraries to do the work.
Walter -
Sending uploaded file to the approver using GP Process
Hai all,
i my project i need to send the resource files for approver ...
in my application i have created three actions under one sequencial block ..i need to send the user uploaded files to the three approvers .....Hi Ravi,
You can send email with attachment to multiple approver's using webdynpro api. Please check below link -
http://wiki.sdn.sap.com/wiki/display/WDJava/Sendmailwithattachmentusingwebdynpro+API%27s
Regards,
Sen -
Down-/Upload files via Web Services using a NON-SAP system!?
Hello,
is it possible to down-/upload files via web services using a NON-SAP system!?
Regards,
JensHi Jens,
I am not sure about your requirement here. What i could understand is that you want to check whether service could handle file processing?
1) Uploading file - You can build a Webservice which has import/export parameters as the file structures and implement the proxy class in such a way that the passed data is written to application server.
2) Downloading file - Same as uploading file, but the proxy class would have the code to extract data from the application server and pass them as output parameter.
Functionality of Non SAP system: The system which calls these services should be able to convert the output of proxy data into file in case of downloading the file and it should be able to convert the file data into export parameters in case of uploading file.
Hope this helps.
Regards,
Prasanna -
How to upload files from a form using pl/sql ?
Hi
Is it possible to upload the physical files outside the database (under UNIX server)using pl/sql? I already know how to store the files inside the database(wwwdoc_documents$) but I didn't find any documentation about storing the physical files outside the database.
I have in my form the following component:
<input type="file" name="upload">
and I want to let the user browse for the file on his/her disc that he want to use. What I want to do next is to save a copy of that file on our file-server, and then use it in my application. How do I do that in pl/sql?
Any help will be appreciated.
Sebas.Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
ajt -
Uploading files a landing server using webutil
dear all,
i have the current situation and i'm looking for solution.
i'm using the webutil in order to upload files from the client side to a landing server, the situation here is :
when i use the following code
webutil_file_transfer.Client_To_AS_with_progress
(clientFile => :upload.file_name
,serverFile => 'd:\temp\'||l_bare_filename
,progressTitle => 'Upload to Application Server in progress'
,progressSubTitle => 'Please wait'
,asynchronous => false
,callbackTrigger => null
where d:\temp is alocal directory on the AS
but if i change the server file to a drive mapping i'll have the following error
WUT-132, my question here is it possible for the webutil to upload a file to another landing server other than AS?
how can i do it without making a hidden share to the folder ?
the other question if i have a firewall between the client and the AS, will it prevent the webutil uploading process ?i want to add another point, when we make hidden share to the map drive the uploading worked successfuly.
what i need here is a way to access the map drive without making hidden share to the map drive? -
Uploading file problem in JSF using myfaces-extensions.jar.
Dear All,
I'm new to JSF and trying to upload files using myfaces-extensions-1.0.9.jar and commons-fileupload-1.2.1.jar.
I have upload.jsp and result.jsp and a bean named MyBean.java. after press the submit button it should navigate to result.jsp and shows some info.
My problem is that it successfully run but when submit its not working and remain same page.
upload.jsp:
{<%@page contentType="text/html" pageEncoding="windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<h:form id="MyForm" enctype="multipart/form-data" >
<h:messages globalOnly="true" styleClass="message"/>
<h:panelGrid columns="3" border="0" cellspacing="5">
<h:outputLabel for="myFileId" value="File: "/>
<x:inputFileUpload id="myFileId"
value="#{myBean.myFile}"
storage="file"
required="true"/>
<h:message for="myFileId"/>
<h:outputLabel for="myParamId" value="Param: "/>
<h:selectOneMenu id="myParamId"
value="#{myBean.myParam}"
required="true">
<f:selectItem itemLabel="" itemValue=""/>
<f:selectItem itemLabel="MD5" itemValue="MD5"/>
<f:selectItem itemLabel="SHA-1" itemValue="SHA-1"/>
<f:selectItem itemLabel="SHA-256" itemValue="SHA-256"/>
<f:selectItem itemLabel="SHA-384" itemValue="SHA-384"/>
<f:selectItem itemLabel="SHA-512" itemValue="SHA-512"/>
</h:selectOneMenu>
<h:message for="myParamId"/>
<h:outputText value=" "/>
<h:commandButton id = "test" value="Submit"
action="#{myBean.processMyFile}"/>
<h:outputText value=" "/>
</h:panelGrid>
</h:form>
</f:view>
faces-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<managed-bean>
<managed-bean-name>myBean</managed-bean-name>
<managed-bean-class>
com.devsphere.articles.jsfupload.MyBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/upload.jsp</from-view-id>
<navigation-case>
<from-outcome>OK</from-outcome>
<to-view-id>/result.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Can anybody there for help me whats the problem. I'm using netbeans 6.1 with bundled tomcat 6.0 and no error is shown.Hey All,
I've got my solve. Now Its working. -
How streaming an audio or video files from google drive using google api objective-c client?
I have implemented streaming an audio or video files by mpmovieplayer from Dropbox. For this purpose I am using Dropbox sdk. Audio or video files are playing with no problem from dropbox in my app.
But, I can not implement the same functionality from Google drive. I am using alternateLink,webcontentLink,EmbedLink,Exportlink that we get from google drive. But mpmovieplayer does not play audio or video. So how can get any link from google drive,by which i can streaming an audio or video file from google drive. I have listed all google drive files in a table view. I am using google api objective-c client. So please help me. Thanks in advance.Hello,
I'm giving a try at your application and so far, it is great!
I understand that you're working on a way to help moving back files to google drive. Actually, I can copy / paste, but it always renames the files, so I end up with both a "copy of" and my original file.
could you save and overwite the original file when it already exists ? (perhaps an option in the settings) ?
Thanks! -
Error while Uploading the docs into KM using webdynpro for java
In My view I have create a context node(ctx_va_FileData) with value attribute (ctx_va_FileResource) of type ,Resource.
Select the Simple Type, navigate to Dictionaries u2192 Local Dictionary u2192com.sap.ide.webdynpro.uielementdefinitions and select Resource.
In View part of Layout :Create one u201CFileUpload u201C UI with Create one LinkToAction IU element and assign u201CaUploadFileinto_KMu201D action to this action
Coding Part in Web Dynpro java
Step 1:
Go to the wdDoInit() method and paste the following code
public void wdDoInit()
//@@begin wdDoInit()
try {
IPrivateUploadFile_KMView.ICtx_vn_FileDataElement element = wdContext.createCtx_vn_FileDataElement();
if (element != null)
wdContext.nodeCtx_vn_FileData().bind(element);
}catch (Exception e) {
wdComponentAPI.getMessageManager().reportSuccess("Error: " + e.getCause().toString());
//@@end
Go to the onActionaUploadFileinto_KM and paste the following code
public void onActionaUploadFileinto_KM(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionaUploadFileinto_KM(ServerEvent)
msgMgr = wdComponentAPI.getMessageManager();
IPrivateUploadFile_KMView.ICtx_vn_FileDataElement element =
wdcontext.currentCtx_vn_FileDataElement();
IWDResource resource = element.getCtx_va_FileResource();
if(resource!=null){
try {
//To get the Current User
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
WPUMFactory.getUserFactory().getEP5User(sapUser);
ResourceContext resourseContext = new ResourceContext(ep5User);
//Portal KM Path
RID pathRID = RID.getRID("/documents/SDN"); //Root Directory
IResourceFactory resourseFactory =
com.sapportals.wcm.repository.ResourceFactory.getInstance();
ICollection collection = (ICollection)resourseFactory.getResource(pathRID,
resourseContext);
//Read the File
InputStream stream = resource.read(true);
String resourceName = resource.getResourceName();
String resourceExtn = resource.getResourceType().getFileExtension();
//KM Content
Content cont = new Content(stream,"application/octet-stream",-1,"UTF-16");
//create a file in above mentioned path in KM
com.sapportals.wcm.repository.IResource new_resource =
(com.sapportals.wcm.repository.IResource)collection.
createResource(resourceName, null, cont);
//Get the File length
long contentLen = new_resource.getContent().getContentLength();
//If no data in file
if(contentLen <= 0){
msgMgr.reportException("No data in file" , true);
}else {
msgMgr.reportMessage(IMessageUploadFile_KMComp.SF__UPLOAD,
new Object[] {resourceName},true);
} catch (NotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AccessDeniedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ContentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UserManagementException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}else
msgMgr.reportException("No file Selected ,Browse the file!",true);
element.setCtx_va_FileResource(null);
}//End of Action
But in the onActionaUploadFileinto_KM part IUser is deprecated and i m stuck at that point.
Plz provide me the solution and is there ant alternative solution for this and MY Portal is EP6 Nwds version is 7.0.9Hi Sukalyan,
Have you checked the below links?
These will give you step by step implementation procedure.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a099a3bd-17ef-2b10-e6ac-9c1ea42af0e9?quicklink=index&overridelayout=true
http://wiki.sdn.sap.com/wiki/display/WDJava/KmuploadusingWebdynproapplication
Regards,
Sandip -
Upload document to Temp Folder using Rest API not working
I am using Poster in Firefox to upload an xml document to document Temporary Folder. Response I'm getting is 400 Bad Request. Is this a problem with Poster not supporting file upload to UCCX or are there parameters i'm missing for this?
Url=http://<uccx fqdn>/adminapi/document/uploadFile
User Auth=Administrator user
File=xml file stored on my computer
Content Type=multipart/form-data
Action=POST
Everything else is blank.
Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiErrors><apiError><errorData>Bad Request</errorData><errorMessage>The request could not be understood by the server due to malformed syntax</errorMessage><errorType>400</errorType></apiError></apiErrors>
Finnurquery = "Select SI_ID,SI_NAME FROM CI_INFOOBJECTS "
+ " where SI_ID='" + SelectedReportDetails.Rows[i]["ID"].ToString() + "'";
Change this to a Select *... Since your only bringing back Si_ID and Si_Name.. your not bringing back other properties it needs to make a successful copy.. -
Uploading file to Application Server using Tcode: CG3Z
Hi Friends,
I am facing a weird problem when uploading a file(PIPE delimited format) to application server
using the transaction CG3Z. The data is getting truncated at the end of each row and the file size
doesn't match with the one i had uploaded.
Can anyone resolve this issue.
Thanks in advance.
MurthyHi Friends
I wrote the custom program to upload the file on application server.
Thanks for your time.
Murthy -
Cannot upload file to Oracle DB using blob datatype
Hi
I am uploading a file to Oracle DB through JAVA. I am inserting the file as
a BLOB datatype. I am using JRUN 4 . But when I am uploading the file to the DB through my application it is not showing anything in the DB. The samp application is working fine on my QA environment on the same server . Is there some setting that needs to be done . Could this be a problem with the version of classes12.zip.
Also when i try to view the file it is giving me this error
ORA-06550: line 1, column 13:
PLS-00201: identifier 'DBMS_LOB' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Please helpNot sure afterall if you mean that you are having a pblm uploading (from what kind of file BTW?) or viewing after upload?
Try these tutorials - I found them very helpful. Also, do you have the 'PL/SQL Programming' book from Oracle Press? That has an entire chapter devoted to LOB types.
[url http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/blob/blob.html] How to deploy a PL/SQL function returning BLOB as Web Service
[url http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html]LOBsample
HTH -
Error creating files in KM repository using templates
Hi,
We are having trouble creating files using templates.
It was working fine in NW 4 SP11. Following error is occuring after upgrading to SP14.
#1.5#0003BA0ED352001F000000000000733E00040871DB567309#113
5185011045#com.sapportals.wcm.util.logging.CatchBlockHand
ler#sap.com/irj#com.sapportals.wcm.util.logging.CatchBloc
kHandler.ResourceImpl#testuser#3930##winserver_NW1_611512
151#testuser#3f492260723d11dacdc90003ba0ed352#SAPEngine_A
pplication_Thread[impl:3]_20##0#0#Error##Plain###[ECB]
Can't move /documents/Templates/SingleTemplates/New
Document Number Required_Engr Spec.doc to /my_content/test folder/New Document Number required_Engr Spec_1_.doc: com.sapportals.wcm.repository
.NotSupportedException: Can't move /documents/Templates/SingleTemplates/New Docu
ment Number Required_Engr Spec.doc to /my_content/test folder/New Document Number Required_Engr Spec_1_.doc
at com.sapportals.wcm.repository.ResourceException.fillInStackTrace(Reso
urceException.java:400)
at java.lang.Throwable.<init>(Throwable.java:195)
at java.lang.Exception.<init>(Exception.java:41)
at com.sapportals.wcm.WcmException.<init>(WcmException.java:59)
at com.sapportals.wcm.util.content.ContentException.<init>(ContentExcept
ion.java:38)
at com.sapportals.wcm.repository.ResourceException.<init>(ResourceExcept
ion.java:163)
at com.sapportals.wcm.repository.NotSupportedException.<init>(NotSupport
edException.java:64)
at com.sapportals.wcm.repository.manager.cm.CmNamespaceAndContentManager
.copy(CmNamespaceAndContentManager.java:1313)
at com.sapportals.wcm.repository.ResourceImpl.internalCopyManager(Resour
ceImpl.java:3142)
at com.sapportals.wcm.repository.ResourceImpl.internalCopy(ResourceImpl.
java:3232)
at com.sapportals.wcm.repository.ResourceImpl.copy(ResourceImpl.java:204
1)
at com.sapportals.wcm.repository.ResourceImpl.copy(ResourceImpl.java:201
4)
at com.sapportals.wcm.rfadapter.CopyUtility.copy(CopyUtility.java:116)
at com.sapportals.wcm.service.template.TemplateService.createFromTemplat
e(TemplateService.java:409)
Any help in this regard is appreciated!!
Thanks
KiranHi Kiran,
looks like your repository 'my_content' doesn't support the copy of the desired template 'New Document Number Required_Engr Spec_1_.doc from the template storage into the target path. Does the creation of a new file from this template work in the documents repository?
Is the my_content repostiory may be a file system repostory and doesn't support files with a space in their names.
Kind regards,
Michael -
How to upload files in ipad apps using new iTunes?
After iTunes 11.0.0.163, the interface has changed so much that it is difficult to do even regular operations with windows pcs. How do we transfer files from pc to ipad using iTunes? Any help pl?
Sorry to come back, though I could now see the side bar and app menu, it only gives the option to remove the app through a button against each app. In earlier version if I double click a particular app, it will open up a dialogue box asking for add files and one could drag drop files from pc to iTunes.
This is not happening now. So the problem still remains unresolved.
Any help pl!
Maybe you are looking for
-
IPod Touch 4th Gen 8G Not connecting to PC at ALL
Hello. So I ran into a problem. I have a jailbroken iPod 4 Gen, and it connected to the computer and works properly. Charges. Connects to itunes. Everything. So i was looking around on safari and all of a sudden, The DREADED 20% Battery left alert ap
-
Deleting & renaming files - is there a shortcut to finder?
I am a recent convert from PC to Mac. So far so good. However, one thing starts to drive me up the wall which is deleting/renaming files in programs such as photoshop, word, excel etc.etc. As far as I can tell, this is only possible in the finder men
-
Unable to mount samba share file for xbox 360
I want to be able to stream music from a directory in my arch linux computer (xfce4) to my xbox using samba on a local network using ethernet cables and a router not connected to the internet. I've been able to get samba to startup and I see the fold
-
Help: Multi-language Support in Jdeveloper 9i Log Window
I have basically solved the multi-language display problem in code editor, compiling and run. If I send the output out of JDeveloper, it's displayed well. However, if I run or debug in JDeveloper and want to see the result in JDeveloper log window, t
-
Printer screen only lets me hit save, no print button available
Today I tried to print a page online and the only option available on the print screen was "save." There was no "print" button to click. How can I get my print screen to have a "print" button again? Thanks for your time.