How to insert Page Break to google document by PHP code - google-docs-api

I want to add PageBreak after Some Text in Google Docs API PHP.
I got reference Insert page break into google document in insertText(), that \f will add page break; But it is not working for me.

Finally i Got my Answer after a long Research.
Google PHP API CLIENT for Google Docs is still under development. In GitHub Repo https://github.com/googleapis/google-api-php-client-services/tree/v0.93/src/Google/Service/Docs , you will see that in Tag 0.93 Branch There is class for InsertPageBreakRequest in batchUpdate, and still not merge with master Branch. Clone tag v0.93 Repo and get it done.

Related

Google reCAPTCHA v3 can't find any token

So it's the first time I'm trying to use the google reCAPTCHA v3 (actually it's the first time I'm using any kind of captcha).
I followed the documentation and a very basic tutorial.
What I understand is that I should be able to see the token in my browser inspector.
The first issue is that i can see the logo on the bottom right of my screen, but there is definitely no token in my input.
The second issue comes from the browser console which indicates 3 kind of errors.
I'm working with Symfony Framework on a local environment.
Any clue would be much appreciated !
My twig & javascript files
Browser screenshot
Content-Security-Policy issues
So i figured out how to get the token....
I just had to remove those lines in the js file:
function onclick(e) {
e.preventDefault();
I still didn't find about the Content-Policy issues.

Getting file version from TFS rest API Get Item

I am pulling a file from on premise TFS source control using the Rest API. I can't find on premise specific documentation, but it seems to be very close to version 4.1 of the Azure Get Item call. According to this documentaiton, it should return a TfvcItem object which has a lot of metadata including the version. However, when I make the call it only returns the file contents (the content field of the documentation's TfvcItem).
How do I get the current version of the file?
I need the version when I check itin with create changeset. I don't need it for any other reason, so if you know another way to check in an edited file that would help.
Instead of using Get Item API, some related REST APIs are not documented. For these REST APIs we can use tools such as Fiddler or directly press F12 - network in Chrome to track them.
You should use below API to fetch latest changeset version of a file:
post https://dev.azure.com/{organizationname}/{Projectname}/_api/_versioncontrol/history?__v=5
For body:
{"repositoryId":"","searchCriteria":"{\"itemPath\":\"$/MyFirstProject/Main/1.txt\",\"itemVersion\":\"T\",\"top\":50}"}
itemPath is your server path of the file.
From the response, you will get the version info such as "version": "139", instead of the file content.
Not sure your detail version of TFS, I was using Azure DevOps Service for an example. There maybe some difference for different TFS version. You could track the detail API on your own side.
More detail info kindly take a look at this question: VSTS Release API Documentation
Had the same issue. You can get item metadata by specifying "scopePath" URI parameter, instead of "path". Microsoft example in API documentation seems incorrect, as it indeed returns only item content: https://learn.microsoft.com/en-us/rest/api/azure/devops/tfvc/items/get?view=azure-devops-rest-6.0#get-item-metadata-and/or-content-for-a-single-item.

Spree commerce Google analytics update

I need to update Spree Commerce web-shop's Google Analytics code to be able to track demographics.
https://support.google.com/analytics/answer/2819948
I have the full source code of website downloaded.
When I do a text search over the whole code I am unable to find anything Google related, or even a string "ga.js". Obviously I am missing something, but how do I go about even to start figuring this out?
Any help much appreciated.
Search over a local clone of spree. https://github.com/spree/spree.git
Grep for ga.js
You will find this file: core/app/views/spree/shared/_google_analytics.html.erb
Copy it to your own code base at: app/views/spree/shared/_google_analytics.html.erb
Change what you need to change.

Google oAuth example

I'm looking for a worked example of how to call into Googles oAuth service with a view to simply uploading a txt file. On googles docs I have the followed the example
http://code.google.com/p/google-api-java-client/wiki/OAuth2
but it won't compile .... CalendarScopes.CALENDAR is the problem and I can't see what Jar contains this class. I imported every Jar in the google-oauth-java-client-1.12.0-beta download (Also every jar in google-api-java-client-1.12.0-beta ) I dobn't understand the diff between these but that is for another day.
Any pointers would be welcome.
CalendarScopes.CALENDAR that you mentioned is not a part of a jar file but a scope for Calendar API provided by Google. For a sample to show how to implement that, here is one.
In the meanwhile, I would also suggest going over the following links to develop an understanding of the OAuth and how to use it with the different APIs.
OAuth Playground - This is very helpful when trying to learn about different API and permissions relating to those.
OpenID Connect Official Documentation
Hope this helps.

Trac to Jira migration: Converting a text in webpage to hyperlink on pageload

We are in a process of migrating trac to jira(defect management tool). I have imported data from Trac to Jira. The changesets that were present in the trac tickets are seen as plain text after importing them to Jira. On verifying the page source, the class name of all such spans is changed as error. Below is part of page source:
<a class="user-hover user-avatar" rel="username1" style="background-image:url(/secure/useravatar?size=small&avatarId=10122);" id="commentauthor_402362_verbose" href="/secure/ViewProfile.jspa?name=username1">username1</a>
added a comment - <span class='commentdate_402362_verbose subText'><span class='date user-tz' title='28/Oct/11 5:53 AM'><time datetime='2011-10-28T05:53+0530'>28/Oct/11 5:53 AM</time></span></span> </div>
<div class="action-body flooded"><p>(In <span class="error">[12345]</span>) refs AGLBD-16096</p>
Here [12345] is my changeset number. What would be the best way for me to make that changeset number appear as hyperlink instead of text. This should also be working with any ticket that a user opens. All the corresponding changeset numbers should be changed to hyperlinks on every page.
This was one of the most valuable things we also needed when importing our trac issue and comment history to JIRA was to preserve the changeset links made via autocommit hooks from subversion commits. We also had multiple repositories enabled in trac which made the link conversion tricky. Unfortunately the JIRA trac import doesn't seem to support any kind of repository changeset link conversion at all, including to Fisheye if you have that imported and enabled already.
Here's the PHP script I ended up writing to patch the sqlite3 trac.db file before import. I've included our user story, some sample SQL commands used for user conversion and our trac.db schema for reference at the bottom of the script for reference. I hope this is useful for others converting from trac to JIRA.
Are this "changeset" equivalent to JIRA's issue key?
If so, the JIRA will change any JIRA issue key to link to issue automatically, if the user that is browsing the issue have right's to display the mention issue.
For example in your jira you have an project TST, with link to browse it: http://jira.example.com/browse/TST . Issue 1 would have link: http://jira.example.com/browse/TST-1
Any occurrence of text "TST-1" in comments, description, JIRA will automatically change to link to issue TST-1 if, and only if user that is reading text TST-1 has enough permission to browse issue TST-1.
You may also need free plugin : application links

Resources