Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / May 2007

Tip: Looking for answers? Try searching our database.

Guardar Infopath en lista Sharepoint

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gonzalez_karlos@hotmail.com - 09 Apr 2007 19:21 GMT
Estoy intentando crear una página web aspx donde una persona sin
permisos para ver un documento Infopath, pueda a través de
impersonación editar dicho documento y guardarlo.
Todo funciona bien, uso un control XmlFormView con la propiedad
XmlLocation="/Form library/infopathForm.xml"

Pero el botón save implementado dentro del control XmlFormView
devuelve error de permisos puesto que invoca directamente un
webService del servidor sharepoint y no se ha realizado impersonación
con permisos adecuados.

Otra aproximación es crear un botón que guarde el formulario
modificado. Al tratarse el Button.click en servidor, se ha impersonado
a una cuenta con privilegios. Accedo al formulario
XmlFormView1.DataBind();
XmlForm xmlForm= XmlFormView1.XmlForm();
xmlForm.save(); // Devuelve error "The method or operation is not
implemented"
Esto devuelve el error del comentario.

Otra aproximación es obtener la representación xml del formulario y
guardarlo como el contenido xml del fichero que aloja el fichero
infopath original
SPWeb activeSite= new SPSite( fileUrl).OpenWeb();
SPFile spFile= activeSite.GetFile( fileUrl);
spFile.SaveBinary( binXml, false);

, pero tampoco funciona puesto que devuelve
The security validation for this page is invalid. ...

¿Alguien podría sugerirme alguna aproximación que funcione?
gonzalez_karlos@hotmail.com - 09 Apr 2007 19:29 GMT
English version

I am trying to create an aspx page where a person without privileges
will be able through impersonation to edit and save an infopath
document.
Everything is working fine using an XmlFormView control setting its
XmlLocation="/Form library/infopathForm.xml"

But the save button implemented inside the XmlFormView control returns
an error related with the permissions of the user given that the
button directly invokes a webService on the sharepoint server giving
no chance of making impersonation with the proper rights.

Other approach was to create a button to save on the server the
modified form. The impersonation takes place but...

- When acceding the form using this code:
XmlFormView1.DataBind();
XmlForm xmlForm= XmlFormView1.XmlForm();
xmlForm.save(); // Devuelve error "The method or operation is not
implemented"

The method save return the commented error!!!

- Other approach is to obtain the xml representation of the modified
form and save it as the content of the file that holds the infopath
form using this code:

SPWeb activeSite= new SPSite( fileUrl).OpenWeb();
SPFile spFile= activeSite.GetFile( fileUrl);
spFile.SaveBinary( binXml, false);

. This does not work neither given that it throws this exception
"The security validation for this page is invalid". ...

Could someone suggest me other approach or the error I am making to
make this work?
leikas@gmail.com - 16 May 2007 12:02 GMT
On 9 huhti, 21:29, gonzalez_kar...@hotmail.com wrote:
> English version
>
[quoted text clipped - 33 lines]
> Could someone suggest me other approach or the error I am making to
> make this work?

You've probably already gotten help for this, but for the sake of
search engines, at least the last approach should work when you set:

activeSite.AllowUnsafeUpdates = true;

E.g.

SPWeb activeSite= new SPSite( fileUrl).OpenWeb();

activeSite.AllowUnsafeUpdates = true ;

SPFile spFile= activeSite.GetFile( fileUrl);
spFile.SaveBinary( binXml, false);

HTH,
Jarno
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.