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


Permlink Replies: 23 - Pages: 2 [ 1 2 | Next ] - Last Post: 06-Apr-2020 22:03 Last Post By: Laza Threads: [ Previous | Next ]
MarkusD

Posts: 514
Registered: 13-Apr-2006
Include, Exclude Tags
Posted: 17-Mar-2020 18:43
 
  Click to reply to this thread Reply
Hello,

in my albums (using the Tiger skin) I use keywords to give the viewer an easy way to view the objects (mostly pictures and videos) in a targeted way. So you don't have to click through different folder structures unnecessarily. Example:
2020 01 24 Hahnstätten - Hjørring
2020 01 25 Hjørring - Vågsli
2020 01 26 Vågsli - Bergen
2020 01 27 Florø - Trondheim
2020 01 28 Trondheim - Storjord i Tysfjord
2020 01 29 Presteid - Tromsø
2020 01 30 Tromsø - Longyearbyen
2020 01 31 Longyearbyen
2020 02 01 Longyearbyen
2020 02 02 Longyearbyen - Tromsø
2020 02 03 Tromsø - Vuollerim
2020 02 04 Vuollerim - Östersund
2020 02 05 Östersund - Sunne
2020 02 06 Sunne - Malmö
2020 02 07 Malmö - Hahnstätten

All these folders contain pictures and videos. All objects have the keyword "2020", the videos also have the keyword "Video". And there are more keywords like "Norge", "Sverige", "Danmark" and "Suomi". If you now choose "2020" in the tag cloud you have all objects, pictures and videos from all countries.

Example

So far, so good. But maybe you only want to see the pictures and no videos. Or just pictures from Norway and Sweden. Now it would be good if you could use a keyword to filter or restrict objects from a displayed data set. I'm not familiar with the possibilities of JSON as a database, but it should be possible to create a query that has "2020" as a keyword, but not "video".

I hope I could make my request understandable. It would be nice if you could tell me if such a feature is possible. Thanks a lot in advance.

Edited by: RobM on 17-Mar-2020 19:33
Moved to Tiger forum.
jGromit

Posts: 7,669
Registered: 31-Jan-2006
Re: Include, Exclude Tags
Posted: 17-Mar-2020 20:36   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Edited by: RobM on 17-Mar-2020 19:33
Moved to Tiger forum.

I was just trying to do the same thing!

To repeat something I've said before, other than widget code, the jAlbum core doesn't produce a single line of HTML, CSS, or Javascript. Only a skin can provide album searching capabilities.
MarkusD

Posts: 514
Registered: 13-Apr-2006
Re: Include, Exclude Tags
Posted: 17-Mar-2020 20:40   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Edited by: RobM on 17-Mar-2020 19:33
Moved to Tiger forum.

I was just trying to do the same thing!

To repeat something I've said before, other than widget code, the jAlbum core doesn't produce a single line of HTML, CSS, or Javascript. Only a skin can provide album searching capabilities.


Well, then consider my question a requirement for the Tiger skin. ;-)
jGromit

Posts: 7,669
Registered: 31-Jan-2006
Re: Include, Exclude Tags
Posted: 17-Mar-2020 20:41   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Yes, that's why RobM moved the thread.
Laza

Posts: 2,333
Registered: 6-Sep-2005
Re: Include, Exclude Tags
Posted: 18-Mar-2020 07:20   in response to: MarkusD in response to: MarkusD
Helpful
  Click to reply to this thread Reply
Hi Markus,

The problem is you put all the data in a single variable - keywords. This does not allow for complex filtering.

However you can use this tool to dig out some data (and assign to custom variables) from keywords and other fields:
http://jalbum.net/forum/thread.jspa?threadID=55903&tstart=0
Custom variables can then be used in the filtering (and) sort.

Some are already available in jAlbum, e.g. fileCategory, which can be "video" or "image" (besides other types).

Let me know which data contains the important pieces and I can possibly help.

You might want to read this blog post on filtering too:
https://jalbum.net/blog/entry/meet-the-new-rating-widget-and-play-with-photo-data
MarkusD

Posts: 514
Registered: 13-Apr-2006
Re: Include, Exclude Tags
Posted: 19-Mar-2020 20:03   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
The problem is you put all the data in a single variable - keywords. This does not allow for complex filtering.

However you can use this tool to dig out some data (and assign to custom variables) from keywords and other fields:
http://jalbum.net/forum/thread.jspa?threadID=55903&tstart=0
Custom variables can then be used in the filtering (and) sort.

Some are already available in jAlbum, e.g. fileCategory, which can be "video" or "image" (besides other types).

Let me know which data contains the important pieces and I can possibly help.

You might want to read this blog post on filtering too:
https://jalbum.net/blog/entry/meet-the-new-rating-widget-and-play-with-photo-data

Hi Laza,

thanks a lot for the links. However, the solutions described there are already quite complex. If I have any questions I will come back to you.

Maybe once again an example how I imagine the query.

Here formulated as SQL:
select * from objects where (keyword = '2020') and (keyword <> 'video') and (keyword = 'norge')

select * from objects where (keyword = '2020') and (keyword <> 'video') and (keyword = 'norge') and (latitude >= 69)

Would something like this be possible with the JSON database? Surely you have to think about how the GUI has to look like for the user of an album to be able to click such complex queries together. But first of all it's all about whether this works with the JSON database at all.

Thanks, Markus
Laza

Posts: 2,333
Registered: 6-Sep-2005
Re: Include, Exclude Tags
Posted: 20-Mar-2020 07:08   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
No, sorry, JSON is not mySQL. The search can only do A or B, A and B and "A B" (exact). Nothing else is possible.
Laza

Posts: 2,333
Registered: 6-Sep-2005
Re: Include, Exclude Tags
Posted: 20-Mar-2020 07:10   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Perhaps the filtering looks complicated at first glance, the end result will be easy to handle for any visitor, not like with mySQL.
MarkusD

Posts: 514
Registered: 13-Apr-2006
Re: Include, Exclude Tags
Posted: 27-Mar-2020 19:53   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
No, sorry, JSON is not mySQL. The search can only do A or B, A and B and "A B" (exact). Nothing else is possible.
That is really a pity.
MarkusD

Posts: 514
Registered: 13-Apr-2006
Re: Include, Exclude Tags
Posted: 27-Mar-2020 19:56   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
OK, i tried to play a little.

This site:
https://jalbum.net/blog/entry/meet-the-new-rating-widget-and-play-with-photo-data

says, that „fileCategory“ is of data type „Single/multiple string“. But when I use „fileCategory“ as Filter in Tiger I get an error:

„jAlbum - Der Java Webalbum-Generator JAlbum\Neuigkeiten

Encountered a:se.datadosen.jalbum.Category as: folder that isn't JSON seriazable.

Try:

1) ...
2) ...
3) ...
4) ...“

What have I done wrong?

On this site:
http://jalbum.net/help/en/Variables

there is a list of all variables. What is missing here is what kind of data type are the variables.

Message in the error console:

Sample expressions:
4*(3+2); // Basic calculations
engine.getSkin(); // Use of implicit object
for (AlbumObject ao : selectedObjects) System.out.println(ao); // Iterate over selected objects
window.messageBox("You can interact with any Java object");
Skin loading: 2.855s
Skin loading: 0.369s
{"keywords":{"label":"Schlüsselwort","type":"multiple_string"},"fileSize":{"label":"Dateigröße","type":"numeric"},"rating":{"label":"Benotung","type":"numeric"},"videoDuration":{"label":"videoDuration","type":"single_string"},"fileCategory":{"label":"fileCategory","type":"multiple_string"}}
{"keywords":{"label":"Schlüsselwort","type":"single_string"}}
Make changes
{"keywords":{"label":"Schlüsselwort","type":"multiple_string"},"fileSize":{"label":"Dateigröße","type":"numeric"},"rating":{"label":"Benotung","type":"numeric"},"videoDuration":{"label":"videoDuration","type":"single_string"},"fileCategory":{"label":"fileCategory","type":"multiple_string"}}


Edited by: MarkusD on 27-Mar-2020 20:04
Laza

Posts: 2,333
Registered: 6-Sep-2005
Re: Include, Exclude Tags
Posted: 28-Mar-2020 07:51   in response to: MarkusD in response to: MarkusD
Helpful
  Click to reply to this thread Reply
Sorry, some variables are not having the same name in the JSON file. I don't know why David chose this approach, but fileCategory is simply category in the JSON file.

Other than this you should be able to use any variable - at least the skin allows it. Even fileCategory provided jAlbum could convert that into String automatically. Now it's of type "Category" and Java is so fussy about variable types it won't convert to String even if it's basically a String. Unfortunately, the skin can't tell jAlbum how to convert its internal variables when it writes the JSON file.
MarkusD

Posts: 514
Registered: 13-Apr-2006
Re: Include, Exclude Tags
Posted: 28-Mar-2020 09:33   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
Sorry, some variables are not having the same name in the JSON file. I don't know why David chose this approach, but fileCategory is simply category in the JSON file.
Ahh, OK, good to hear. Yes, category will do the trick. ;-)

So, this for example works fine:
skin.filterData=Schl\u00FCsselwort\tkeywords\tMULTIPLE_STRING\nDateigr\u00F6\u00DFe\tfileSize\tNUMERIC\nBenotung\trating\tNUMERIC\nKategorie\tcategory\tMULTIPLE_STRING


Other than this you should be able to use any variable - at least the skin allows it. Even fileCategory provided jAlbum could convert that into String automatically. Now it's of type "Category" and Java is so fussy about variable types it won't convert to String even if it's basically a String. Unfortunately, the skin can't tell jAlbum how to convert its internal variables when it writes the JSON file.

Next question. I would like to try videoDuration but I get error messages with every data type. For example the error message reads „Encountered a: se.datadosen.jalbum.TimeCode as: 00:04:40.320 that isn't JSON serializable.“

Thanks, Markus
Laza

Posts: 2,333
Registered: 6-Sep-2005
Re: Include, Exclude Tags
Posted: 28-Mar-2020 10:18   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
I guess we should ask David to loosen Java's strict typing, so it could get over such silly errors, and put the String value in such cases.
RobM

Posts: 3,225
Registered: 4-Aug-2006
Re: Include, Exclude Tags
Posted: 28-Mar-2020 12:30   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Not tried it but the API for timeCode shows a
toString()
method
davidekholm

Posts: 3,398
Registered: 18-Oct-2002
Re: Include, Exclude Tags
Posted: 28-Mar-2020 15:16   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
This should be fixed in jAlbum 19.4b7 now, available if you replace the file lib/jalbum-core.jar with this one: http://jalbum.net/download/beta/jalbum-core.jar

What I've done is to map both TimeCode variables and Enum type variables (like Category) to their most relevant string.
Legend
Forum admins
Helpful Answer
Correct Answer

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