This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Pages: 1 - Last Post: 19-Oct-2017 22:01 Last Post By: RobM
drmikey

Posts: 867
Registered: 22-Dec-2006
label variable not generated in json file?
Posted: 19-Oct-2017 05:53
 
  Click to reply to this thread Reply
I am wondering if it is just my glitch or if the generated json data, data1.json, does not contain the image +label+? I see name and if I add a title, it is generated but no label. (basically I want the image name without the extension to be accessible in the json data).
Looked at a simple gallery generated with minimalJSON, but no label in that file either.

Edited by: drmikey on 19-Oct-2017 06:34
RobM

Posts: 4,384
Registered: 4-Aug-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 16:29   in response to: drmikey in response to: drmikey
 
  Click to reply to this thread Reply
drmikey wrote:
I am wondering if it is just my glitch or if the generated json data, data1.json, does not contain the image +label+? I see name and if I add a title, it is generated but no label. (basically I want the image name without the extension to be accessible in the json data).
Looked at a simple gallery generated with minimalJSON, but no label in that file either.

Edited by: drmikey on 19-Oct-2017 06:34

It is not your glitch ;) If you don't want to extract the label from the name you will need to include the label variable in the Jason data.

depending on the JASON method used either in init.bsh
jm = new JSONMaker(engine);
jm.setIncludes(new String[] { "label" });
dataTree = jm.getTreeAsString(rootFolder);
or in data-config.json
{
"paging":	0,
  "include":	[
	"label"
  ]
}
drmikey

Posts: 867
Registered: 22-Dec-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 16:42   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Thanks. I had already tried
jm = new JSONMaker(engine);
jm.setIncludes(new String[] { "label" });
dataTree = jm.getTreeAsString(rootFolder);
as well as the data-config.json method but no luck showing in the json output.
RobM

Posts: 4,384
Registered: 4-Aug-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 16:54   in response to: drmikey in response to: drmikey
 
  Click to reply to this thread Reply
drmikey wrote:
…no luck showing in the json output.
Strange. I tested it using the code in init.bsh and in index.htt adding
        <script>dataTree = ${dataTree};</script>
<% System.out.println(dataTree); %>

That result in, for example
{"path":"thumbs\/Broken%20Top.jpg",
"width":204,
"height":160},
"fileSize":7807024,
"name":"Broken Top.jpg",
"fileDate":"2012-08-08T20:14:38.0Z",
"label":"Broken Top",
"category":"image"},
So label is clearly being generated.
drmikey

Posts: 867
Registered: 22-Dec-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 17:04   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Looks like it requires a bit more investigation on my end. Thanks!
RobM

Posts: 4,384
Registered: 4-Aug-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 19:00   in response to: drmikey in response to: drmikey
 
  Click to reply to this thread Reply
drmikey wrote:
Looks like it requires a bit more investigation on my end. Thanks!
When you said ‘but no luck showing in the json output.’ what did you mean, where were you looking for label?
drmikey

Posts: 867
Registered: 22-Dec-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 20:27   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Looking in my generated json file using
${dataTree}
.
RobM

Posts: 4,384
Registered: 4-Aug-2006
Re: label variable not generated in json file?
Posted: 19-Oct-2017 22:01   in response to: drmikey in response to: drmikey
 
  Click to reply to this thread Reply
drmikey wrote:
Looking in my generated json file using
${dataTree}
.
I think there might be a bug, try deleting the son files and then make the album again, or check the created/modified file dates - if they exist they don't seem to be getting updated on a make/make all - with no other changes.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums