FatFractal customer forums



Author Topic: Documentation Error  (Read 1549 times)

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Documentation Error
« on: January 31, 2014, 08:57:56 PM »
It looks like the client-side javascript sdk doc is incorrect for grabBagGetAll().

http://www.fatfractal.com/prod/linked_files/FF-Javascript-Client-SDK-2106/FatFractal.html#toc31

It says the success callback is a "Function with one argument - the registered FFUser".  But it seems that it takes at least two arguments - the contents of the grab bag, and a string message about it.

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #1 on: February 01, 2014, 01:34:16 AM »
Here's another: At the top of http://fatfractal.com/prod/docs/application-configuration/ there is a link to "application.ffdl" (within point 3 of the numbered list) which points to "#directory-layout" instead of "#ffdl".

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #2 on: February 01, 2014, 01:10:10 PM »
Here's another: The JS Server Side code for Grab Bag Add has a problem (http://fatfractal.com/prod/docs/data-modeling/#grab-bags).  I don't believe "dawn" will have an ffUrl property for the grabBagAdd calls:

Code: [Select]
// persist Dawn
ff.createObjAtUri(dawn, "/People");

// add Dawn to Steve's siblings grab bag and vice-versa
// these calls automatically persist the change to the backend
ff.grabBagAdd(dawn.ffUrl, steve.ffUrl, "siblings");  // add Dawn to Steve
ff.grabBagAdd(steve.ffUrl, dawn.ffUrl, "siblings");  // add Steve to Dawn

Perhaps the first line should be "dawn = ff.createObjAtUri(dawn, "/People");"?  I haven't looked too closely into what exactly is returned by createObjAtUri, though.  The doc says it returns "the returned object from the your apps backend."  My first guess is that it will be the full "dawn" object, with all of its meta data, but I can't really tell from that description without trying it.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Documentation Error
« Reply #3 on: February 01, 2014, 02:02:15 PM »
Thanks Eric. Have fixed the errors you found in your first post above and published.

The second is deliberate as it is intended to show where the application.ffdl file is placed in your scaffolded directory layout

Re your third post - createObjAtUri will add the metadata into the dawn object

Thanks again!

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #4 on: February 01, 2014, 02:11:09 PM »
Sounds good.

Re the 3rd post - then perhaps there is a bug in whatever version of the server I installed a few weeks ago.  I wrote this into a server extension:
Code: [Select]
var option = {clazz: "Option", name: "temp"}
ff.createObjAtUri(option, "/Options")
ff.logger.info("\n\n" + JSON.stringify(option, null, "\t") + "\n")

And this was printed to the console:
Quote
{
        "clazz": "Option",
        "name": "temp",
        "createdBy": "system"
}

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Documentation Error
« Reply #5 on: February 01, 2014, 02:15:17 PM »
Ah yes. Client-side and server-side differ in behaviour. Client-side APIs use standard asynchronous patterns. Server-side APIs do not. So, server-side, you definitely have to do
Code: [Select]
var foo = {clazz:'Foo'};
foo = ff.createObjAtUri(foo, "/Foos");

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #6 on: February 01, 2014, 02:17:16 PM »
So then my 3rd post was correct.   ;)

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Documentation Error
« Reply #7 on: February 01, 2014, 02:18:53 PM »
Only in the context of server-side code. Client-side, createObjAtUri does not return anything.

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #8 on: February 01, 2014, 02:27:09 PM »
Just to make sure we're on the same page, my post was specifically about the "JS Server Side code".  I copy-pasted the code from the documentation into that post, which I still think has the error I reported.  Maybe you see that and are fixing it, but I just wanted to make sure.
« Last Edit: February 01, 2014, 04:49:17 PM by Eric »

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #9 on: February 11, 2014, 01:41:29 AM »
This isn't an error, really, but I thought you would like to know:

On http://fatfractal.com/prod/docs/myfirstapp/html5/, bullet point #4, the code is wider than the text area, and the text area is taller than my screen.  So, the horizontal scroll bar is off my screen.  I found myself scrolling down to the horizontal bar, moving it, scrolling back up, and losing my place in the code.

Obviously I can copy-paste the code into an editor to browse it, and I will, but FYI.

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #10 on: February 11, 2014, 08:18:53 PM »
Here's another, I think.  From what I can tell getRefUrl() in the server SDK does not increase the API call count, but that is not noted in its documentation.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Documentation Error
« Reply #11 on: February 12, 2014, 04:38:06 PM »
Thanks very much Eric. Will remedy both of these in a couple of days; trying to hit some other deadlines right now :-)

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #12 on: February 22, 2014, 07:12:25 PM »
It looks like some kind of formatting got messed up in the parameter description of ff.sendEmail().

http://www.fatfractal.com/prod/linked_files/FF-Javascript-Server-Side-Docs/global.html#toc43

Also, I assume fields like "username" are optional if "auth" is "false"?  And that at least one of "text" and "html" can be optional (and maybe even must be left out)?

Also, if you like unsolicited advice, it might be nice to put "true" and "false" in quotes for "auth", to match its {string} type.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Documentation Error
« Reply #13 on: February 22, 2014, 08:43:15 PM »
Hi Eric - I don't see any formatting issues ... what browser are you using?

I've updated the documentation a little; sendEmail is now at http://www.fatfractal.com/prod/linked_files/FF-Javascript-Server-Side-Docs/global.html#toc45

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Documentation Error
« Reply #14 on: February 22, 2014, 08:51:37 PM »
I'm using Chrome on Win 7.  I attached a screenshot of what it looks like.  The for-sure error is that the type column for "data" says "string", but the description says it is an object with fields. 

Then - I'm not sure if you mean to have the text "{string}" for each field in the object, or if that should be some directive that gets translated into fancy formatting.  Either way, it is before every field except "host".

 

Copyright © FatFractal customer forums