NetSuite 2015_2 PHP-SDK Two Factor Authentication - netsuite

We currently have Two Factor Authentication working in the 2017_2 release of the NetSuite PHP Toolkit, but we have some code that has broken due to changes between 2015_2 and 2017_2. It seems that in 2017_2 it is also far easier to set up Two Factor Authentication.
Looking at the code, however I do see references to TokenPassport and TokenPassportSignature, which tells me that I should be able to get TBA working in 2015_2, which would give us time to figure out the rest of the issues.
My question is: How would I actually go about that? I have set $service->passport to the generated TokenPassport object. I know that my TokenPassport object works in 2017_2, and I assume it would be the same, but I don't know for sure, and I can't seem to find any information up on Elgoog.
ETA: I have seen examples of this working in 2015_2 in Ruby, but not in PHP. The backend is there, but I can't seem to be able to do this in PHP, and the Ruby examples were only snippets.

Okay, so I solved this for myself, but I may not have done it the "right" way. Here's what I did:
I took the makeSoapCall and setTokenGenerator methods from the new instance of NSPHPClient.php, and I added them to the OLD version. I had to modify the setTokenGenerator method to not require an instance of iTokenPassportGenerator, but I could have just as easily copied over that interface as well.
Basically, all that needs to happen is that we need to send the tokenPassport header, which the older version of the SDK can generate but doesn't have a method to actually send that I could find.

Related

2sxc Content App - Locations - How to convert to Canadian and US Addresses with region/state

I am using the latest versions on 2sxc (11.05) and the Content App on DNN 9.06. The Content-Type for Locations does not have a field for Region (or State). Is there already something in place to account for that to get Canadian or US addresses to output normally? I realize I can add the field and then maybe use the Dropdown from Query to hook it up to DNN's list of Regions, and then modify the Views accordingly...
But that seems like a lot of work for something that might already be built in (and I just don't see it?). Or is there another easy way to tackle this?
Truth be told - we never needed that so far, so it doesn't exist.
Is this necessary for maps to work, or just another field which a standard us-address needs? I'm curious because neither outlook nor SharePoint seem to require such a field, so I never really thought about it.
BUT: if you do implement it, please do share it back with us, so we can publish it.
Note that if this is important, a possibly nicer solution would be to use a public api somewhere which provides this information, as it's most certainly more complete & up to date for this purpose. If this is the case, ping me and I'll implement a string-dropdown-from-json or something like that :)

Office-js doesn't display the properties

I was trying to repro a tutorial about the creation of an Excel Add-in when something get wrong with the IntelliSense of Visual Studio. I was writing this code:
function updateStocks() {
Excel.run(function (ctx) {
var **range** = ctx.workbook.names.getItem("Stocks")
At this step, everything was fine, but after the getItem, I have tried to add .getRange() at which point the IntelliSense was not able to understand anything related to my variable range.
Screenshot
What is really "funny" is the fact that even if the properties are not displayed, when I write the code of the tutorial manually, the code is executed without mistake.
Why does this behavior occur and how can I correct it?
Are you able to see IntelliSense for other types within that .run? I.e., do you have everything up to the point where you get a Range from a named item? If you were to obtain the range differently (e.g., context.workbook.getSelectedRange()), do you get IntelliSense then?
This might be related to an issue (now fixed) where the CDN accidentally had the namedItem.getRange method removed (it was the only one that was affected, and we've put in measures to ensure we catch those in the future). See "Can't get range from a defined name". The CDN has been patched a couple weeks ago, but the JS IntelliSense file ("VSDOC") probably hadn't. If that's the case, it's a point-in-time issue that should resolve itself very very soon, as new deployments of the CDN will have the getRange method both in the VSDOC and everywhere else.
FWIW, you may still run into limitations of the JS IntelliSense engine (there are plenty, unfortunately: for example, trying to pass values across Promises, or passing in API objects as parameters to functions). The only true good workaround for this is using TypeScript, which allows you to declaratively assert to the compiler/IntelliSense-engine that "I know this type is an Excel.Range!") -- and offers a number of other goodies, async/await being a very major one. I personally believe that if you really want a "premier" Office.js-coding experience, TypeScript is the way to go. To that end, I describe how to use TypeScript in my book, "Building Office Add-ins using Office.js" (full disclosure, I am the author; but I've had many readers comment on how helpful of a resource it's been to them). The book is very much TypeScript-oriented, IntelliSense being one of the reasons (and async/await and let being the primary others) -- though I also offer an Appendix where I describe the JavaScript-only way of accomplishing the same Office.js tasks. It takes only a small amount of effort to get started with using TypeScript, and once you do, I don't think you'll look back.

Is there any difference for XPages urls using action=openDocument and action=readDocument?

Most times I've seen urls written to open an XPage in read-mode using action=openDocument, but occasionally, I've see action=readDocument used. Just curious if there are pros/cons in using one vs. the other.
I don't know of a difference. Honestly I never use these URL's anymore myself. So it's really not a big deal very likely.
Keep in mind, you don't need to use these at all of you don't want. You can pass your own parameter in the URL and then via SSJS access any parameters with the param object. You can also get the parameters in Java easily enough.
Just a thought.

Liferay Structure Predefined Value

Which table in Liferay stores the predefined values given for a structure.
Also is there a facility in Liferay to populate these values dynamically using webservices?
The API used to be JournalStructureService, however, as the documentation states, this has been replaced with the Dynamic Data Display API, which, for example, you can find under DDMStructureService in version 6.2.
This gives you a hint where to find the underlying data, however, you don't want to manually write to the database. You do want to use the API to change values. Trust me. Consider the database to be an implementation detail and leave it alone - if nothing else to make your next upgrade experience easier. You should never change any values in the database manually without knowing exactly what you're doing. And, trust me, the keyword here is "exactly", and you'll fail to know all the possible side effects. Don't touch it.
As said #Olaf, depends on Liferay version you will need to use the JournalStructureService or the DDMStructureService. So, if you want to use the Liferay Service by web api you have two options the Axis api where you can obtain WSDL (domain:port/api/axis) or you can use the Json api (domain:port/api/axis). In many cases you are going to need a token to use this services.

Google docs viewer url parameters

Is there any sort of documentation on exactly what parameters you can put in the url of Google viewer?
Originally, I thought it was just url,embedded,chrome, but I've recently come accross other funny ones like a,pagenumber, and a few others for authentication etc.
Any clues?
One I know is "chrome"
If you've got https://docs.google.com/viewer?........;chrome=true
then you see a fairly heavy UI version of that doc, however with "chrome=false" you get a compact version.
But indeed, I'd like a complete list myself!
I know this question is very old and perhaps you already solved your issue, but for anyone on the internet who might be looking for an answer...
I have been looking for this recently, following a guide I found on GitHub Gist
https://gist.github.com/tzmartin/1cf85dc3d975f94cfddc04bc0dd399be
More specifically, the option to embed a certain page of pdf using
<iframe src="https://docs.google.com/viewer?srcid=[put your file id here]&pid=explorer&efh=false&a=v&chrome=false&embedded=true" width="580px" height="480px"></iframe>
The best I could fing was this article (I suppose from a long time now)
https://weekly-geekly.github.io/articles/111647/index.html
HOWEVER, I tried modifying the attributes and the result was simply a redirect to
https://drive.google.com/file/d/[ID]/edit
https://drive.google.com/file/d/[ID]/preview or
https://drive.google.com/file/d/[ID]/view
AS OF MAY 2020, THIS SOLUTION PROBABLY DOESN'T WORK
I'm also on a quest to discover some of the parameters of the viewer.
the "chrome" parameter doesn't seem to do anything, though. Is this
supposed to be the same as embedded=true?
Parameters I know of:
url= (obviously)
embedded= (obviously)
hl= set language of UI (tooltips)
#:0.page.1 = jump to page 2 (page 1 is numbered 0) - this is unreliable and often requires a refresh after the first load,
defeating the purpose.
That said, when I use the Google Docs viewer on my site, "fit page to
screen" is the default view without any parameters. So maybe I'm
misunderstanding your question.
Source: For convenience, this is a full quote of the sole answer (it is from user k3david) to the crosspost of this question #Doc has posted to the Google support forum in 2011.
You can pass q=whatever to pass a search query to the viewer.

Resources