.... or "How Hard Can It Be To Find A Webdeveloper?"
.... or "How To Build A Full-stack Webdev in Two Easy Lessons"
.... or "How I Learnt To Stop Worrying And Love Javascript"
(Based on work from Innovation Week September 2017 at KB-Aarhus.)
Where We Are Now
http://kb-test-adm-001.kb.dk:8078/
...
Let's do it in two stages
Create a Service Layer For the NAS Backend
All communication between the NAS GUI and the backend system should be via a well-defined REST API
- Create new webmodule in the existing NAS GUI
Configure its web.xml to scan for classes that expose REST methods
Code Block <servlet> <servlet-name>Jersey REST Service</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value>dk.netarkivet.common.api</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
Implement some methods
Code Block @Path("/status") public class Status { @GET @Path("/all") @Produces(MediaType.APPLICATION_JSON) public JMXStatusEntry[] getAllStatus() { String query = "dk.netarkivet.common.logging:*,index=0"; ArrayList<JMXStatusEntry> entries = new ArrayList<>(); List<StatusEntry> entries1 = null; try { entries1 = JMXStatusEntry.queryJMX(query); } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } for (StatusEntry entry: entries1) { entry.getLogMessage(Locale.getDefault()); entries.add((JMXStatusEntry) entry); } return entries.toArray(new JMXStatusEntry[]{}); } }
- Profit! http://kb-test-adm-001.kb.dk:8078/rest/rest/status/all
Now Just Write a Modern Dynamic Interactive WebGui ...
On advice I started with jQuery.
...
None of which we have now.
So Where To Now
... or can I really ask the Steering Committee for permission to start a complete frontend rewrite?
The Good Stuff
- This is the result of three days' work by one developer, of which two days were on the backend. Getting started with this web-development stuff isn't as hard as I expected.
- We can leverage a universe of existing solutions to instead of having to reinvent the wheel.
- A clean API should make testing NAS much easier.
- This is already way more fun than hacking through a mess of servlets & jsp and should make it easier to integrate new developers in the project.
The Challenges (not all technical!)
- Known unknowns and unknown unknowns - we need a much longer pilot-program to be able to present a really convincing case. We haven't even looked at interactions yet.
- Is jQuery the right technology?
- How much reskilling do we need to do in the NAS developer group?
- What about "higher level" skillsĀ - how to manage, structure, test, standardise a web-development project? These are not skills we currently have in NAS.
...