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


Permlink Replies: 15 - Pages: 2 [ 1 2 | Next ] - Last Post: 1 Jan 26, 21:05 Last Post By: RobM Threads: [ Previous | Next ]
MarkusD

Posts: 937
Registered: 13-Apr-2006
Error with Views and Keywords („*“)
Posted: 24 Dec 25, 12:21
 
  Click to reply to this thread Reply
Hi David,

just gave the Views another try and got this
 
An unexpected error occurred. Please see detailed description below:
 
java.lang.RuntimeException: Error processing D:\Users\MDrück\Pictures\2025 01 24 Norge\Nach Stichwörtern\*****
	at se.datadosen.jalbum.AlbumBean.registerVariables(AlbumBean.java:3372)
	at se.datadosen.jalbum.AlbumObjectImpl.getVars(AlbumObjectImpl.java:3258)
	at org.openjdk.nashorn.internal.scripts.Script$Recompilation$125$114264AD$util.getDropdownMenu#getSubMenu(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\lib\util.js:4586)
	at org.openjdk.nashorn.internal.scripts.Script$Recompilation$125$114264AD$util.getDropdownMenu#getSubMenu(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\lib\util.js:4593)
	at org.openjdk.nashorn.internal.scripts.Script$Recompilation$125$114264AD$util.getDropdownMenu#getSubMenu(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\lib\util.js:4593)
	at org.openjdk.nashorn.internal.scripts.Script$Recompilation$123$113298AAAAADZAA$util.getDropdownMenu(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\lib\util.js:4622)
	at org.openjdk.nashorn.internal.scripts.Script$Recompilation$106$9069A$init.processFolder#L:278(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\init.js:442)
	at org.openjdk.nashorn.javaadapters.java_util_function_Consumer.accept(Unknown Source)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at org.openjdk.nashorn.internal.scripts.Script$Recompilation$98$6829A$init.processFolder(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\init.js:278)
	at org.openjdk.nashorn.internal.scripts.Script$97$predir.:program(C:\Users\MDrück\AppData\Roaming\JAlbum\bundled-skins\Tiger\predir.js:5)
	at org.openjdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:646)
	at org.openjdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:506)
	at org.openjdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:519)
	at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:415)
	at org.openjdk.nashorn.api.scripting.NashornScriptEngine$1.eval(NashornScriptEngine.java:476)
	at java.scripting/javax.script.CompiledScript.eval(Unknown Source)
	at se.datadosen.jalbum.AlbumBean.processExpression(AlbumBean.java:3560)
	at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:3482)
	at se.datadosen.jalbum.AlbumBean.makeAlbumForFolder(AlbumBean.java:1991)
	at se.datadosen.jalbum.AlbumBean.makeAlbum(AlbumBean.java:3877)
	at se.datadosen.jalbum.AlbumBean.smartMakeAlbum(AlbumBean.java:3713)
	at se.datadosen.jalbum.JAlbumFrame$7.run(JAlbumFrame.java:1213)
Caused by: java.nio.file.InvalidPathException: Illegal char <*> at index 0: *****
	at java.base/sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
	at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
	at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
	at java.base/sun.nio.fs.WindowsPath.parse(Unknown Source)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
	at java.base/java.nio.file.Path.resolve(Unknown Source)
	at se.datadosen.jalbum.AlbumBean.addImageLinks(AlbumBean.java:2758)
	at se.datadosen.jalbum.AlbumBean.addImageLinks(AlbumBean.java:2709)
	at se.datadosen.jalbum.AlbumBean.registerVariables(AlbumBean.java:3354)
	... 22 more


I do have a keyword which is „*****“, which works fine:
https://www.markus-drueck.de/public/2025%2001%2024%20Norge/2025%2001%2024%20Norge/index.html#label=*****

No hurry with this one!

Merry Christmas.

Cheers, Markus
JeffTucker

Posts: 8,576
Registered: 31-Jan-2006
Re: Error with Views and Keywords („*“)
Posted: 24 Dec 25, 14:52   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
That will almost certainly never be "fixed." The view is trying to create a subfolder for each keyword. An asterisk is not allowed in the name of a directory or file in any operating system, so it can't create the subfolder for this keyword. This can't be made to work.

It works just as a keyword when there is no view, because the skin isn't trying to create a folder or file with an asterisk in its name. But even that is not advised, because an asterisk is usually used for a wildcard.

The important part of "keyword" is word. ;)
JeffTucker

Posts: 8,576
Registered: 31-Jan-2006
Re: Error with Views and Keywords („*“)
Posted: 24 Dec 25, 15:09   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
David: rather than trying to deal with illegal characters in a view, I think I'd be inclined to restrict the assignment of keywords to start with. Don't let someone enter a keyword like my#big?adventure$$. It's just asking for trouble.
RobM

Posts: 4,087
Registered: 4-Aug-2006
Re: Error with Views and Keywords („*“)
Posted: 24 Dec 25, 16:15   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
David: rather than trying to deal with illegal characters in a view, I think I'd be inclined to restrict the assignment of keywords to start with. Don't let someone enter a keyword like my#big?adventure$$. It's just asking for trouble.
Related: if illegal characters in a file name are detected instead of the yellow warning triangle put up a red one and don’t make the album. The yellow warning triangle is often ignored or simply overlooked.
MarkusD

Posts: 937
Registered: 13-Apr-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 09:20   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
JeffTucker wrote:
David: rather than trying to deal with illegal characters in a view, I think I'd be inclined to restrict the assignment of keywords to start with. Don't let someone enter a keyword like my#big?adventure$$. It's just asking for trouble.
Related: if illegal characters in a file name are detected instead of the yellow warning triangle put up a red one and don’t make the album. The yellow warning triangle is often ignored or simply overlooked.
I vote for this, makes sense to me.
MarkusD

Posts: 937
Registered: 13-Apr-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 09:23   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
That will almost certainly never be "fixed." The view is trying to create a subfolder for each keyword. An asterisk is not allowed in the name of a directory or file in any operating system, so it can't create the subfolder for this keyword. This can't be made to work.

It works just as a keyword when there is no view, because the skin isn't trying to create a folder or file with an asterisk in its name. But even that is not advised, because an asterisk is usually used for a wildcard.

The important part of "keyword" is word. ;)


What I don't like are statements like, "A user isn't allowed to do this or that." That's the completely wrong approach. If a user can do something with software that will later cause a problem, then the software — at the point where the foundation for the error is laid — must ensure that the user can't enter any data that leads to the error. It's that simple.
RobM

Posts: 4,087
Registered: 4-Aug-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 10:14   in response to: MarkusD in response to: MarkusD
Helpful
  Click to reply to this thread Reply
If the aim is to show the best images, those rated 5 stars, then why not use the custom view ‘Top rated’ instead of using asterisks in keywords?
MarkusD

Posts: 937
Registered: 13-Apr-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 10:22   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
If the aim is to show the best images, those rated 5 stars, then why not use the custom view ‘Top rated’ instead of using asterisks in keywords?
That is a good point! On the other hand I still like the 5 star „keyword“, because it is abvious what it stands for.
RobM

Posts: 4,087
Registered: 4-Aug-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 10:42   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
…On the other hand I still like the 5 star „keyword“, because it is obvious what it stands for.
Famous last words ;) What’s obvious to you might be a mystery to others.
MarkusD

Posts: 937
Registered: 13-Apr-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 10:44   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I fully agree! :-) As I wrote in another thread, I create those albums for myself. ;-))
JeffTucker

Posts: 8,576
Registered: 31-Jan-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 14:35   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
JeffTucker wrote:
That will almost certainly never be "fixed." The view is trying to create a subfolder for each keyword. An asterisk is not allowed in the name of a directory or file in any operating system, so it can't create the subfolder for this keyword. This can't be made to work.

It works just as a keyword when there is no view, because the skin isn't trying to create a folder or file with an asterisk in its name. But even that is not advised, because an asterisk is usually used for a wildcard.

The important part of "keyword" is word. ;)

What I don't like are statements like, "A user isn't allowed to do this or that." That's the completely wrong approach. If a user can do something with software that will later cause a problem, then the software — at the point where the foundation for the error is laid — must ensure that the user can't enter any data that leads to the error. It's that simple.


So when keywords were added to jAlbum many, many years ago, we should have anticipated that in 2025, views would be introduced. And since one of those views would be trying to create folders named for the keywords, the software, in 2015, should have restricted the form of keywords. Got it.

MarkusD

Posts: 937
Registered: 13-Apr-2006
Re: Error with Views and Keywords („*“)
Posted: 29 Dec 25, 20:20   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
MarkusD wrote:
JeffTucker wrote:
That will almost certainly never be "fixed." The view is trying to create a subfolder for each keyword. An asterisk is not allowed in the name of a directory or file in any operating system, so it can't create the subfolder for this keyword. This can't be made to work.

It works just as a keyword when there is no view, because the skin isn't trying to create a folder or file with an asterisk in its name. But even that is not advised, because an asterisk is usually used for a wildcard.

The important part of "keyword" is word. ;)

What I don't like are statements like, "A user isn't allowed to do this or that." That's the completely wrong approach. If a user can do something with software that will later cause a problem, then the software — at the point where the foundation for the error is laid — must ensure that the user can't enter any data that leads to the error. It's that simple.

So when keywords were added to jAlbum many, many years ago, we should have anticipated that in 2025, views would be introduced. And since one of those views would be trying to create folders named for the keywords, the software, in 2015, should have restricted the form of keywords. Got it.

No, of course not!

Following your logic, the software developer isn't responsible for providing a consistently coherent user environment. But that's precisely what they are. If I acted the way you're describing, my clients would kill me. What's the problem with ensuring that, during the album creation process, checks are made to prevent any results that don't comply with the rules, regardless of the underlying conditions?

I'm sure that translation issues on my end are also obscuring things and causing us to misunderstand each other.

I stand by my statement: software must never produce anything based on user input that could later lead to errors.
davidekholm

Posts: 4,023
Registered: 18-Oct-2002
Re: Error with Views and Keywords („*“)
Posted: 31 Dec 25, 09:50   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
I agree that we should add more sanity checks to the keyword view. I put it on the todo.
JeffTucker

Posts: 8,576
Registered: 31-Jan-2006
Re: Error with Views and Keywords („*“)
Posted: 31 Dec 25, 15:05   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Maybe lump all of the keywords that would blow up the OS into an "other" folder at the end of the view?

But the error correction really needs to happen earlier, by restricting the allowable keywords. In short, no punctuation in keywords - only letters and numbers.

ETA: Well, at least disallow keywords containing characters that are on the "forbidden" list.
davidekholm

Posts: 4,023
Registered: 18-Oct-2002
Re: Error with Views and Keywords („*“)
Posted: 1 Jan 26, 19:16   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
My idea is to convert illegal characters to dashes but leave the original keyword in the title.
Legend
Forum admins
Helpful Answer
Correct Answer

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