Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have to assign a task to a team member to programatically write data to Microsoft NAVision and also read from it. Specifically we will be writing data that is in one of our systems into the customers NAVision financials module, and this will be on a periodic batch basis, say on a weekly basis.
I have programmed against Sage before where I have provided an XLS output that has been in the expected format by Sage and the system administrator imports from Sage.
Is there a similar process for Navision? Sepcifically fincancials?
I would prefer to write my data to a file and have someone else input that data to NAVision. Would also prefer a data dump from NAVision (Excel or XML) so that I can read it back into our system. I don't want the risks associated with pumping data directly into a financial system.
Our system is Java based and would prefer not to have to use .NET if possible.
Options?
The first thing you need to find out is what version of NAV the customer is using.
Earlier versions (I think pre 4) only allowed data to be imported or exported via a Dataport object. This supported delimited file structures csv, tab e.t.c
Later versions of the software also now have XMLPorts, which as the name suggests allows XML files to be imported or exported.
Both of these solutions would require development work inside of NAV as there are very few standard import/export objects of either Dataport or XMLPort.
These are normally written by the NAV solution center that provides support for the system or occasionally some companies I have worked with do have internal staff with this knowledge.
Expanding further on this there is also capability to read and write directly to Excel spreadsheets, but this approach can be painfully slow as it uses the Excel COM Interop objects to achieve it.
It really depends on the version of Navison you are using and if your customer has programming rights in the system at all(!). It is very likely that they don't.
It also depends if the weekly import is done by hand each week or if it should be 100% automated. Manually started imports/exports work well with dataports.
Often in booking systems imported data is imported in to special tables ("ledger") from where it is booked into the real system that counts after someone has looked at them. As you can discard the data from those ledgers I would not worry too much about pumping data into a live system this way.
If your licence allows programming, you could write/read from/to text files and write your own import/export, which will be more flexible. I'm personally created all kinds of imports and exports. We have one example where Navision pulls a certain email address and looks for special email attachments which it then imports. We have called web services or provided our own. The older "Classic Client" versions also offers read and write access via a C/FRONT interface. This way you can automate data import/export completely. Most of these rely on .net modules, however.
Hope this helps. If not, post the version of Navision and decribe the planned export-/import in detail.
In my java apps, I always comment my classes and methods to indicate what they are all about. The problem I often have however is documenting a complete process whereby the process is spread over several classes. I need to document how all the pieces work together to give an easy overview of how something works.
What I find problematic is WHERE I write this documentation. I could just as well write it in a separate file such as a Word document but the documentation tends to become alienated from the actual code and it is possible to get out of sync. On the other hand, if I document it in a single java code file, it makes it difficult for someone reading one of the dependent classes to know how that class fits into the overall process unless they are aware of the documentation in the class where I wrote it. A possible solution is just to include a reference in each class that makes up the entire process and just designate one of the classes as the "primary" class where the documentation originates from.
Or is there a better alternative approach on how I should be doing this?
EDIT:
An example is where you have a mobile app that uploads data to the server and then you download data from the server to another device. You have a process that covers three components (a sending mobile device, the server and the receiving mobile device). None of these can be really considered the "starting point in the overall data transfer process, so when documenting this process, where would this documentation go?
I'm currently developing a GUI for a Java-application that I've created. I would like to keep the GUI in a separate process from the rest of the client. The rationale behind this is:
Reduced risk of crashing. E.g. a OutOfMemoryError in the GUI won't crash the rest of the client.
I get an API "for free". If I later on want to allow other people to programmatically access the client I can just let them use the same API that the GUI is using.
I'm writing the GUI in SWT and the client is created using IntelliJ. Since Eclipse has a lot better SWT-support it makes sense to keep them separate, so that I can use Eclipse for the GUI-code and IntelliJ for the rest.
My question is now: what technology should I use to expose the client's interface to the GUI? RMI is what came to mind first. However, that has the disadvantages of restricting the API to be Java only. I'm also not sure about how well suited RMI is for large scale deployment (e.g. how does it handle local firewalls?). However, I don't want to rule it out just yet.
I should also mention that I have some deployment-requirements as well:
Must be able to run as non-admin.
Must be able to handle restrictive local firewall-restrictions.
Deployment must be automatic (it's a large scale consumer-app) and work on Windows, Mac OS X and Linux.
Given these restriction what solution would you use?
I faced this same situation a while back, except that the back-end was in Python, and the GUI was in java.
Important points to consider:
how flexible and granular the interface between the GUI and the back-end needs to be. Do you want to be able to do one thing from the GUI? 5 different things? 10? 50? How tightly coupled is the GUI -- will it know about/be calling individual methods in the back-end?
how the output gets from the back-end to the GUI. Can it simply write to STDOUT or to temp files? Does it need something more elaborate?
the format of the output. Ideally, it should be easily parseable, which indicates XML or JSON may be your best bet.
You might find JSON-RPC useful: it's a standard for remote method calls to separate programs.
All in all, it's hard for me to say what would be best for you. I ended up avoiding RPC, and gave the back-end a simple command-line interface; output was written to temp files and STDERR, as JSON objects. I feel that this was a good decision because it kept the interface between the programs very simple and uncoupled.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How do I effectively use the "Scripting Engine" inside Java?
What are all the right use-cases to use the scripting engine?
Is there an open source project using "Scripting Engine"?
One thing comes to mind is "Closure, Functional programming" support is possible, but it is more of technical use than "Application Requirement".
Configurable plugins are OK. But still so many patterns (visitor, decorator) on high level can do the same.
I don't know the requirement well... how effectively it could be used in Java EE patterns... where it could complement with the existing patterns.
Moreover I would like to see more answers with some business usecases. Maybe like finding a complex discount for a product during sale based on membership or location. Finding ranking for a complex algorithm. Especially why not Java in some scenario? (or C# in .NET world)
In Java 6, scripting engine support is built in. For example,
// Create a script engine manager
ScriptEngineManager factory = new ScriptEngineManager();
// Create a JavaScript engine
ScriptEngine engine = factory.getEngineByName("JavaScript");
// Evaluate JavaScript code from String
engine.eval("print('Hello, World')");
Why would you use one? Some reasons:
you have a library in a scripting language that you want to use in Java (e.g. a Python library that you could run via Jython)
You want to provide a configurable programming mechanism for customers, such that they can provide short code snippets. For example, I've done this in the past allowing customers to write filters using JavaScript (e.g. is x < 2 and y > 5 and z > 10 ?).
You can implement more complex logic in tools like Ant by scripting directly in the configuration file
You can implement solutions in a language more suited to that domain (e.g. using lambdas via Clojure), but maintain your reliance on the JVM.
Implementations include Rhino (a Java implementation of Javascript), Jython (a Java Python) and many more.
Here are some cases where I've used it.
1) Java wants to call scripting language, example 1. I have a Java app that accepts user comments via the WMD JavaScript widget. (Same widget that StackOverflow uses, actually.) User enters comments in the Markdown format and a JavaScript library called Showdown converts it to HTML in two places: (1) on the client, to support real-time previews; and (2) on the server, since I want the client to send pure Markdown to the server and store that there so the user can edit the Markdown later (instead of having to somehow reverse the HTML into Markdown). When storing the comment on the server, I do run the conversion there as well, and I store the HTML alongside the Markdown so I don't have to dynamically convert the Markdown when displaying comment lists. To ensure that the HTML on the server matches the HTML on the client, I want to use the exact same Showdown library. So I run Showdown server-side inside the Rhino JavaScript engine.
2) Java wants to call scripting language, example 2. I'm working on a deployment automation application that involves stakeholders across different roles, such as developers, sysadmins and release engineers. The overall app (workflow and UI) is a Java app, but at various locations it calls various scripts (e.g. Ruby, bash), such as for pushing packages, verifying configuration, installing packages, smoke testing, etc. This is partly because script is better/more economical for expressing directory creation, copying, moving, wgetting, etc., and partly because the people who own that particular piece of the pie know how to work with scripting languages but not Java. So we invoke scripts here using Java's Scripting API. Admittedly in this case we could just execute the scripts outside of Java but see #3 below.
3) Scripting language wants to call Java. In the aforementioned deployment application, we have web-based deployment logs, and we put a lot of effort into making the deployment logs as easy to read and understand as possible, because a large developer/SQA/release engineer population consumes the logs, and not everybody understands all the details of what exactly goes on with a deployment. Pretty-printing and color-coding are part of the approach. We implemented a pretty-printing deployment log API in Java but we want to be able to have the scripts call that. So for example when the Ruby push script runs, we want it to log its progress to the pretty-printer. Running Ruby inside JRuby allows the Ruby script to see the Java pretty-printer API.
"What are all the right use-case to use scripting engine?" This is a pretty vague question. There are many use cases. Here are just a few I can think of right away:
Plugin/extension system
IDE
Programming tutorial with live demos
I am assuming you are referring to JSR 223 in particular. If so, you should look at scripting.dev.java.net
I haven't used JavaScript specifically, but I've integrated Groovy into my application framework to provide a domain specific language (DSL). I've created functions and classes that hook into my application.
The user is allowed to script common operations within the application (macros) as well as implement lightweight processing to avoid the much heavier code-compiler-jar-deploy solution. If the user has an idea for a plugin to my processing framework they can prototype via Groovy in realtime and move back to Java (maybe even native) when there is time (or when speed is needed). Keep in mind that scripting is typically orders of magnitude slower than Java/C#/C/C++
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Unfortunately, sometimes the only way to debug a program is by going through its long log files.
I searched for a decent log viewer for a while now, and haven't found a real solution. The only program that seemed to be most appropriate was Chainsaw with its Socket connector but after a few short uses the program proved to be buggy and unresponsive at best.
For my purposes, a log viewer should at least be able to mark log levels (for example with different colors) and perform easy filtering based on packages and free-text.
Is there any other (free) log viewer? I'm looking for anything that could work well with log4j.
Just wanted to say that I've finally found a tool that I can get along with just fine...
It's called LogExpert (see http://www.log-expert.de/) and is free. Besides the usual tail function, it also has a filter and a search function - two crucial things that are missing from BareTail. And if you happen to want to customize the way it parses columns further, it's dead simple. Just implement an interface in .NET and you're done (and I'm a Java/Flex programmer...)
I'm using OtrosLogViewer. You can mark log events manually or using string/regular expression. You can filter events based on level, time thread, string or regular expression. Logs can be imported by listening on socket or connecting to Log4j SocketHubAppender
You can take a look at Youtube video or screenshots:
Disclaimer: I am the author of OtrosLogViewer
You didn't mention an OS, so I'll mention this though it is only on Windows.
Bare Metal Software makes a product called BareTail that has a nice interface and works well. They have a free version with a startup nag screen, a licensed version with no nag, and a pro version with additional features. It has configurable highlighting based on matching lines against keywords.
They also have a BareGrep product too, which provides similar grep capabilities. Both are excellent and very stable and better than anything I've seen on Windows. I liked them so much I bought the bundle with both pro versions for $50.
I am using Notepad++ with my custom log file highlighting UDL. Looks like this:
You can try logFaces, it has fantastic real-time log viewer based on eclipse-like design.
Disclosure: I am the author of this product.
Consider to use Log4j viewer eclipse plugin - that was fork of Ganemede plugin in the begging and now have more features and stability was improved significantly, and still in active development and free :)
I've always used 'tail -f | grep re' or occasionaly 'awk'.
LogSaw based on Eclipse and free. Log4j log file analyzer, simple to use with easy filtering. Supports several flavors of log4j log files: JBoss, Log4j pattern layout, Log4j XML layout, WebSphere. Works like a charm. After couple of hours googling and trying several recommended free log4j viewers, this one was pleasant surprise. Have tried Chainsaw, BareTail, Insight, LogExpert, logview4j. It is released weeks ago, and I guess still builds its way up on google.
I've rolled out Splunk (http://www.splunk.com/) for log viewing and searching with great success. The free version can be used locally and the paid version can collect all your logs into one location. We use it mostly for Log4J logs but with lots of other formats as well.
Beyond tail and grep support (without needing to know grep...) it automatically indexes logs and allows easy analysis (e.g. # of events in last xx timeframe) as well as basic charting, alerting, and event aggregation.
I won't say that the app is perfect or that the company has matured yet. But I don't hesitate at all to recommend that you try it.
I'll add that for Windows, WireShark makes for a handy syslog viewer, ironically enough. I've tried several other syslog tools, and really, Kiwi is the best for syslog out there, but the "free" version is a bit nerfed. Others I ran into were either poorly programmed (crashing on minor issues -- logview4net), had a poor interface (Star SysLog Daemon Lite), or didn't even run (nxlog)
You can use WireShark's filter language to drill down on log data. It's overkill, but until someone writes a free syslog viewer/collector for Windows and makes it decent, this is one field that will be a hard one for most people.
Example:
# Display level 6 alerts from 192.168.5.90 in WireShark
syslog.level == 6 && ip.addr == 192.168.5.90
LogMX is a crossplatform tool that parses any log format from any source, then displays log entries with many features. By default, it handles formats like Log4j, LogFactor, syslog,... and can read from local file or SFTP, FTP, HTTP... but you can write your own pluggins if your format is another one or if your logs cannot be accessed through classical protocols.
You can monitor logs in realtime like 'tail' or load a whole log file and stop monitoring it.
www.logmx.com
Depending on what platform you are running on and what other log viewing tools you have available, you can just use the appropriate log4j appender (syslog, Windows Event Logger) and just use your platform log viewing tools.
Other than that I have usually seen custom solutions developed.
Something that will drive your solution is what your overall system is like. Are you trying to aggregate logs from several computers? Or just view the logs from a single remote process?
You may want to use a custom log viewer that just works on files. I like Kiwi Log Viewer or Ganymede (an Eclipse plugin), but it's not hard to put a simple Swing app together that reads from the socket.
Take a look to http://jlogviewer.sourceforge.net/ or http://sourceforge.net/projects/jlogviewer/
Java log viewer is lightweight GUI to easily view the java application
logs generated by the "java.util.logging" package.
It's open source!!
You can use MindTree Insight, it is open source, efficient, and specific for that use case : analyze log4j files.
Another good log viewer is Lilith (http://sourceforge.net/projects/lilith/ and http://lilithapp.com/). It is open source and works well with Logback, log4j & java.util.logging.
Just published a node module for color highlighting log output log-color-highlight.
echo "this string" | lch -red.bold this -blue string
Works well on unix/linux/windows and supports config file for complex logging scenarios.
For windows I use it in combination with file-tail
I have written a custom tool for that: https://plus.google.com/u/0/102275357970232913798/posts/Fsu6qftH2ja
Alfa is a GUI tool for analyzing log files. Usually you are forced to search for data in them using editors. You open a log, press Ctrl-F and the "Next" button again and again, then reload the file as it was modified, and repeat the search. Alfa maps a log file to a database allowing you to use standard SQL queries to get data without any superfluous actions.
UPD: Google killed Google+ so please use other link: https://drive.google.com/drive/folders/0B-hYEtveqA0aN1E3Ul9NVlFlYWM