How do I insert a Google Document into a Google Site using Google Apps Script - google-docs

Using Google Apps Script, how can I accomplish the same as "Insert" -> "Document" within the Google Sites Editor?
Using GAS, I can obtain the URL and/or the ID of a document, but I cannot create the equivalent of an embedded Google Document within a Google Site Page.
I have been able to insert an <iframe>, but that assumes that the document has been published as a web-document.
I can copy the html from an existing page and using replace() substitute a different ID, but that only appears to work if the original page gadget has borders and title turned on.

I think the approach you mentioned should work. Have a 'template' page with a dummy Google Document inserted in it and then use Apps Script to replace the dummy with your document. Can you put in some code around the replace you have.

Related

How to edit a page in the SharePoint?

I have some custom codes in form of HTML which I wanted to add to the SharePoint. I find out there are two ways to do it, one is using the SharePoint Designer and the other one is uploading the page. However, this is local SharePoint in my Windows Server and I want to modify the page locally because I have limitation when using the Designer and Upload page. I also don't want to add a new page and I would like to modify the current page using my own code.
Are you able to help me out?
Edit the page> insert the Embed Code web part to add custom HTML codes:
More information for your reference:
https://www.c-sharpcorner.com/blogs/how-to-add-html-page-to-sharepoint-site

Passing Parameters into Google Site Iframe Gadget

I'm trying to embed multiple items into a (new version) google site that take a parameter from another embed.
Is there any way to do this in new (not classic) google sites?
For more background:
We have one Tableau workbook that includes parameters the user can select. These selected parameters drive a handful of other unrelated Tableau workbooks and SSRS reports, all of which need to be on the same page.
It doesn't matter whether the user can select their parameters on the first page and then get driven to a second page with all the additional workbooks or whether the workbooks are all on the same page.
New Google Sites insert content from other site feature requires a URL but at this time there is no way to take a parameter from another inserted content.
As usual there is no official documentation on the official help about not available features. The related help article is Add text, images, & other content.

Writing to Google Docs Spreadsheets using Apps Script

I'm trying to integrate Apps Script into my website's (not a Google Site) order page so that a user's order can be written to a Google Doc spreadsheet. I don't know how to go about this because the Apps Script documentation says Apps Script can only be developed and embedded in Google Sites Pages. Is there a way I can achieve this even though my site isn't a Google Site?
I'll appreciate any help at all very much, thanks in advance.
You can write a regular HTML form (not in Apps Script) and set method='post' action='the script url'. That will invoke your script with the data from the form passed into the doGet as parameters.
You can create a data capture spreadsheet, and create a Form for it. You can "clone" the form (field names and form action) into your web site.
Your spreadsheet can have an onFormSubmit action (https://developers.google.com/apps-script/understanding_events) which does whatever you need with the submitted data.

Google docs : does it exist some models in HTML or other webformat to publish a spreadsheet?

I've tested the API of Google to interact with Google doc (Calendar, Spreadsheet, etc) and everything runs correctly. However, I wonder if there is a framework that implements some model in HTML or an other web format to publish/visualize a calendar or a spreadsheet within a web page. My goal is to integrate a spreadsheet/calendar into a web page and then a user can modify the values of this spreadsheet/calendar.
Does it exist something similar to my request?
For spreadsheets, the Google answer Publishing: Embedding a spreadsheet in your blog or webpage explains what you have to do. Especially the last sentence is important:
If you want to embed a form in a
website or blog, click the More
Actions button at the top of the
editor, and select the 'Embed' option
from the drop-down menu.
But don't forget all the steps listed above this.
For Google Calendar, there's Embed on your Website - Google Calendar, another answer from Google, that even contains a slideshow that shows what you have to do.

Communicate with Document Library Browser Web Part

Background
My task is to, in SharePoint, show an image of a process map which should be clickable. Think of an imagemap in html. Some areas take you to other process map images and other brings up a pop-up window.
"Connected" to each process map is a set of documents. These documents are stored in a document library. There are one process map for each folder in the document library. The documents should be shown next to the image. The person clicking either the image or a folder to navigate in the hierarchy should also be able to upload, download and delete the documents.
Question
What would be the easiest solution for this?
My thoughts
... so far is to create a custom web part which I add above the document library browser (the default one in MOSS 2007). This web part reads some xml file pointing out the image to show and the areas which is to be clickable. It listens for some kind of events from the document library, like clicks on folders in the browser or it reads the current URL to know where in the folder hierarchy we are currently, and from that show the correct process map image. When the image is clicked, the web part updates the image and tells the document library to update accordingly.
Is this feasible? Am I on the wrong track? How do I communicate with a document library?
Thanks, Martin
My thoughts are that you create a web part that displays your image map and outputs(provider) the appropriate criteria to a another web part that consumes it and displays the files in a document library.
You can achieve this by creating your own custom webpart that displays a document library based on a CAML query. Each Images sends a different CAML query to the document library webpart.
I hope this helps. Please provide information on how you solved this problem if you have already done so.
Thanks
Long since I've been here... Actually solved this one.
We created two web parts, one for process navigation and one for filtering documents in the document library.
The web part for process navigation is actually just a web part that looks for a specific query parameter in the URL and adds ".html" to it. Then looks for that document in a document library. If found then this document is shown inside an iframe. Simple!
The html documents are produced by Visio and exported to html, then uploaded to SharePoint. The links in the Visio document drives the application with queries.
The web part that shows the corresponding documents also looks for a specific query in the URL then sends filterparameters to the document library through the IfilterProvider interface. I snatched this example IFilterProvider at MSDN and made it look in the URL for parameters and then made the controls invisible to the user.
Really simple solution, though the customer needs to put in a lot of work to incorporate their company processes into it. And it is somewhat error prone and probably a sucker to make changes to data-wise.

Resources