mikaelstaldal / lsp Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Is LSP suitable as IDE for ABS language?
I wasn't able to build LSP from sources. It's too complicated and does not include all compile dependencies in repo. I could download JARs but I don't even know which versions you compiled it against last time.
Another thing is putting addons for external libraries (Struts, Maverick) in core library. This should be done as a separate project/module.
I would recommend switching to Maven so that all dependencies are explicit (including version) and downloaded on demand during build. Maven project can consist of modules - ideally there would be lsp-core and other modules dependent on lsp-core (struts, maverick). Building lsp-core would not build Struts which is good.
I don't say you should do this in your repo - just help me to build the project, then I just fork the project and lead it my way. :) It would be great if you told me direct link to each JAR with good version.
JFlex=JFlex.jar
Ant=ant.jar
BCEL=bcel.jar
JUnit=junit.jar
Servlet=servlet.jar
Struts=struts.jar
Maverick=maverick.jar
JDOM=jdom.jar
ZeroTemplate should be moved to its own respository
Currently, enclosing pages are defined during compilation:
lspc -enclose enclose.lsp subpage.lsp
Currently, I am adapting LSPX to compile pages during runtime. (Can you image recompiling and redeploying application every little change to template?) Everything works like a charm now including lsp:import and lsp:include/part.
However, I would really enjoy it if I could define enclosing page directly in subpage content.
<lsp:root extend="ENCLOSE.LSP" xmlns:lsp="http://staldal.nu/LSP/core" xmlns="http://www.w3.org/1999/xhtml" >
<lsp:part name="head">
<meta name="foo" content="bar"/>
</lsp:part>
...
Next step would be chaining enclosing pages.
base.lsp
<html>
<body>
<lsp:include part="menu" />
<lsp:include part="content" />
</body>
</html>
menu.lsp
<lsp:root extend="base.lsp">
<lsp:part name="menu">
<lsp:include part="top" />
<lsp:include part="bottom" />
</lsp:part>
</lsp:root>
actual-page.lsp
<lsp:root extend="menu.lsp">
<lsp:part name="top">
...
</lsp:part>
<lsp:part name="bottom">
...
</lsp:part>
<lsp:part name="content">
......
</lsp:part>
</lsp:root>
I would be really happy if you implemented that.
Thanks for LSPX.
BTW - You may take a look at Open Power Template 2 - a PHP template engine that looks like LSPX... but is way better and used quite often.
UJL should be moved to its own repostory (or prehaps be removed)
We need a way to build documentation (currently stored in src/site) and Javadoc and put all together in a release package as the old Ant script did.
Perhaps by using Maven's site plugin?
Consider classes:
class Profile:
org.joda.time.DateTime getRegisterDate()
class DateTime:
org.joda.time.DateTime.Property era()
And an LSP code:
<lsp:value-of select="$profile.registerDate.era"/>
This won't work because Joda Time does not follow JavaBean specification. Many libraries don't follow JavaBeans convention because of readability. Even Bob Martin is against get prefix, I don't like it either. But this is not important if JavaBeans spec sucks or not. LSP needs to be flexible and allow to call any method within LSP expression.
$profile.registerDate.era
would evaluate this way:
profile.getRegisterDate()
? Yes, there is, executeregisterDate.getEra()
? No, there isn't.registerDate.era()
? yes, there is, execute.Currently, hot compiler won't spot the change when only parent page is changed. Hot compiler should look on parent file modification time too.
I suggest pulling changes from each other instead of creating own commits that are based on each other's repos. This will make merging trivial. Tell me if it is OK for you. I can resign from my own "branding". ;-)
java.lang.NullPointerException
at nu.staldal.util.Environment$Frame.containsKey(Environment.java:229)
at nu.staldal.util.Environment.containsKey(Environment.java:98)
at _LSP_home_lsp271162734295519419._execute(home_lsp271162734295519419.lsp:14003)
at nu.staldal.lsp.LSPPageBase.execute(LSPPageBase.java:155)
at nu.staldal.lsp.LSPHelper.executePage(LSPHelper.java:542)
at nu.staldal.lsp.LSPHelper.executePage(LSPHelper.java:565)
at nu.staldal.lsp.servlet.LSPManager.executePage(LSPManager.java:235)
NPE is thrown when map is null.
boolean contains = map.containsKey(key);
I know I call for problems if I don't provide a map of values... but Spring Web MVC's <mvc:view-controller path="/home.html" view-name="home.lsp"/>
does not provide one (actually it provides null instead of empty map). It would be reasonable to check in static class Frame<K,V>
's constructor for null maps and fall back to Collections.emptyMap()
when null is passed.
Would it be OK if I just changed it myself and sent a pull request?
Possibility to compile LSP pages on-the-fly in runtime after deployment.
This should be a configurable option, and it should still be possible to compile before deployment too.
Integration with Spring 3 Web MVC. As a new module lsp-spring (similar to lsp-struts).
I spotted some Java sources in ujl/ directory. Should I add it to lsp-core or just remove it?
<img>
<lsp:attribute name="alt" value="$user.name" />
<lsp:attribute name="src" value="$user.profile.avatar" />
</img>
I'm quite surprised to see <img alt="$user.name" src="$user.profile.avatar" />
in output.
I see no point in writing <img><lsp:attribute name="alt" value="something"/></img>
. lsp:attribute
make sens when expressions are allowed in value
attribute.
I consider it critical.
Adapt the samples for using Maven
Code completion for LSP files is trivial to achieve thanks to XML Schema.
<html xmlns:lsp="http://staldal.nu/LSP/core" xmlns="http://www.w3.org/1999/xhtml">
IntelliJ IDEA can download XML Schema from http://staldal.nu/LSP/core and start completing the code.
Could you please tell me if you control staldal.nu domain so that we can upload a file to http://staldal.nu/LSP/core? If not, we can switch to my domain (nowaker.net).
Now I'm starting with writing the XML Schema.
LSP file:
© <a href="http://www.nowaker.net/">Damian Nowak</a>
Stacktrace:
java.lang.RuntimeException: /home/nwkr/projekty/java/openrepublik/openrepublik-web/src/main/webapp/WEB-INF/views/layouts/basic/layout.lsp:49:11: The entity "copy" was referenced, but not declared.
nu.staldal.lsp.spring.webmvc.LspHotCompilerHelper.doCompile(LspHotCompilerHelper.java:203)
nu.staldal.lsp.spring.webmvc.LspView.compileLspPage(LspView.java:64)
nu.staldal.lsp.spring.webmvc.LspView.compileOrReuseLspPageClass(LspView.java:54)
nu.staldal.lsp.spring.webmvc.LspView.render(LspView.java:39)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)```
nu.staldal.lsp.LSPException: Convert to string not implemented for type java.sql.Timestamp
at nu.staldal.lsp.LSPPageBase.convertToString(LSPPageBase.java:336)
at _LSP_show_lsp573682768221718806._execute(show_lsp573682768221718806.lsp:26)
at nu.staldal.lsp.LSPPageBase.execute(LSPPageBase.java:155)
at nu.staldal.lsp.LSPHelper.executePage(LSPHelper.java:542)
Is there any reason why <lsp:value-of select="$someObject" />
throws an exception instead of calling someObject.toString()
? I think LSP should automatically use toString()
's result.
LSPPageBase.java line 298 should be return value.toString()
.
I was trying to work-around this with <lsp:value-of select="$someObject.toString()" />
but this didn't work (actually user guide did not mention calling methods so I knew it won't work).
It would be nice with a Maven plugin for the LSP compiler
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.