Sharepoint 2010 : Using infopath form content type on a document set - sharepoint-2010

Here is the situation :
- Created a web-enabled form using InfoPath and published it to the Sharepoint site as a content type named PAF Cost , uploaded the model form as well in a library on the site.
- Created a document set named PAF, which containes the PAF Cost splitting content type.
- Created a library Forms in which i allowed the document set PAF content type
When I create a new document set say PAF1, i go inside it and i go to the ribbon document/new document command and i can create one new PAF Cost frame. I can edit this form through the web interface which is correct.
Now i want this form to be automatically created when i create a new document set PAF1,
To do this i specified a template for the default content type in the document set PAF settings, and i give the .XNS form file as a template. The form gets automatically created in the document set, but when i click on it it launches Infopath, and does not open as a web form. The icon as well is different from the manual y created form which open as a web form.
How can i make this automatically created form to open as a web form ?

I haven't found a way to make it work with a .xns as template. But if you specify the .xml (just creat an empty form in the library, it's an -xml with the .xns as reference) as the template within the documentset it works fine.
(Same goes for infopath documents created from code - I hade to use the .xml as template, to have it open in thw browser by default.)

Related

Generating PDF in Orbeon

We would like to generate a PDF without using the existing "PDF" button, but we would like to add our own button that gets a custom template and generates a document filled by the data in the form.
Which Orbeon API we can use for this purpose? This API will get the form id and the PDF template and will generate the document.
The API should give us the possibility to :
Map data to the PDF.
Save the PDF in a given directory.
Sdd some changes to the PDF like adding an image and save the document (this will be our custom code).
Download the PDF after process.
What you're looking for sounds very much like Orbeon Forms' PDF template feature. With Form Runner, you can add your own buttons to the form, and those buttons can have their own label and "logic". The latter is defined in a process, which is a sequence of actions. One of those actions is send(), which as its name implies, "sends" some information related to the form to a service you provide.
You can configure that action to send a PDF generated by "filling" a PDF template with the data entered by users in the form by using send(content = "pdf"). You can find more about this in the documentation for the send() action.

Moodle PHP filehandeling

My problem is that we have made an block that opens a page witha a mform on it. And we use the editor element to start the tinyMCE editor, on the page. But when we save the output, the images oploaded to the text field is only viewable to the admin (the person who uploaded it) and in the mdl_files it sets it to be a draft file. I have been through the documentation, and i might have lost the context on the new page, but im not sure.
In Moodle, files uploaded to a form (either to a filemanager element or a text editor) are stored in a temporary 'draft' area while the form is being edited.
This is so that the actual files are not changed until the form is submitted (e.g. if an admin changed the image embedded in some text, deleting the original, you do not want anyone viewing the page during the editing to see a broken image link).
When working with files embedded in a text editor in Moodle, you need to make sure you copy all existing files into the 'draft' area before you show the form, then copy the 'draft' images into the real area, after the form is submitted.
See https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#editor for details about how to do this.
Please also note that your plugin will also need a PLUGINTYPE_PLUGINNAME_pluginfile() function in its lib.php, in order to authenticate any file requests from the user's browser and return the file contents. See any of the core activities for examples of this (e.g. mod/data/lib.php - function data_pluginfile()).

How to programmatically update content in a SharePoint 2010 content editor Web Part using the CSOM?

So I have no clue where to even start with this. I have tried Google to no avail.
My boss had me add a scrolling marquee to one of our SharePoint sites, using a content editor web part. He now wants me to be able to update it once a day from an excel document on a shared drive. I can open and read the excel file with no issue. The thing is that I only have access to what can be done via the CSOM, and so far I can't find a way to update this web part that way.
Anything would be great!
Get XmlString for content editor webpart using webservice "_vti_bin/WebPartPages.asmx". If you want to see all methods of this web service then navigate to "Sharepointsiteurl/_vti_bin/WebPartPages.asmx".
There is a method GetwebPart2 . Using this method retrieve xmlstring. This XmlString contains all information including content of content editor webpart.
3.You have to replace your old content with your new content.
4.Save webpart using savewebpart method with your new xmlString

New document-button behave as the Transfer documents-button

In an ordinary document list in SharePoint 2010 there are two buttons for adding documents: “New document” and “Transfer documents”. New document usually opens a blank word document, and Transfer documents usually gives the possibility to choose a document to add to the list.
In a document library in our environment, the New document button opens the form to upload an existing file rather then open an empty word document.
Why does this happen? Is there a setting that specifies this behavior?
It happens when there are no default templates, possible due to custom content types with no set default document template (word, excel, etc) pherhaps due to upgrade from SP 2007 to 2010?
Quick fix: Add document template to the custom content type and add document should reappear.

How to get the template path of a word 2003 document

When I create a new document based on a template (*.dot), I need to know on which template is the document based on.
Is there a way to find out with VBA which template was used for creating this new document? I need the complete path to the template.
ActiveDocument.AttachedTemplate.FullName
You may also use a built-in document property to access the template name: ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)
I don't remember why theres has been sometimes differences between the two results; you must try it out. please be aware that accessing sometimes the built-in properties sets the document in a dirty state, so that it is useful to save the ActiveDocument.Saved state before and reset it after having accessed the property.
[UPDATE]
I've had again a look into the way you're creating the documents. If it's at your customer with 38.000 templates, I guess your problem are "fake" templates. I've just did a test with Office 2003:
Create a new document "TestTemplate.doc" with same content and save it as doc file. Close it.
Go to Windows Explorer and rename the document to "TestTemplate.dot". This provokes Windows Explorer to treat it as a template, not as a document. The default DDE command for templates is not "OPEN", but "NEW", what you can also see if you do a right-click on the file ("New" is bold, while with documents "Open" is bold).
Double-click the fake template: Word creates a copy of the document, so a new file named "Document2" or whatsoever.
Go to the VBA Editor, and type ?ActiveDocument.AttachedTemplate, and you'll see "Normal" as answer. Type ?activedocument.Type = wdTypeTemplate and you'll see "False" as answer.
Sp I guess the documents "Without template" are only copies of other documents, and not of templates. So you have no way to find the base template.