Boris Golman

Ranch Hand
+ Follow
since Apr 24, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Boris Golman

I am currently modifying the logic for generating a PDF report, using itext package (itext-2.1.7.jar). The report is generated first, then - table of contents (TOC) and then TOC is inserted into the report file, using PdfStamper and it's method - replacePage:



However, I wanted TOC to also have internal links to point to the right chapter. Using replacePage() method, unfortunately, removes all links and annotations, so I tried another way. I've used a method I've found to merge the report file and the TOC file. It did the trick, meaning that the links were now preserved, but they don't seem to work, the user can click them, but nothing happens. I've placed internal links on other places in the report file, for testing purposes, and they seem to work, but they don't work when placed on the actual TOC. TOC is generated separately, here's how I've created the links (addLeadingDots is a local method, not pertinent to the problem):



And this is how I've created anchor destinations on the chapters in the report file:



Finally, here's the method that supposed to merge report file and the TOC:



So, the main question is, what happens to the links, after both pdf documents are merged and how to make them work? I'm not too experienced with itext, so any help is appreciated.

Thanks for your help
7 years ago
I was using flash uploader on the app, deployed using the pom file I've posted here. When I'm trying to upload a file, that's when the exception is thrown in the log file. I've tried adding logging to jboss-deployment-structure, now I'm getting this exception (axis.jar is included in my ear file):


8 years ago
Hello, everybody. I have another issue I need help with. We've recently converted from JBoss to Wildfly 8. Currently I'm trying to build an ear file in order to deploy it to Wildfly 8. It builds and deploys fine, but when I'm using an uploader, which is a part of the application, it gives me the following exception:



Looks like it's complaining about commons-logging jar, which I included as a dependency (I tried marking it as provided, but to no avail). Here's my pom.xml file, to give a better picture. Thanks in advance.

8 years ago
Hi, everybody.

My JSP pages use YUI 2.7.0 file uploader, which, unfortunately, I'm not familiar with at all. As I've been told, this uploader worked before, but now it's not doing anything: it allows the user to choose a file, adds a file to the list, shows an empty progress bar, and that's it. Using Firebug, I've found that the error has been thrown, which says: "Failed conversion between PP_Var and V8 value. " Here's what my code looks like. First, the JSP page (${config.yahooRoot} is the location for YUI 2.7.0, including the uploader, at this point I keep it locally):



And here is the javascript file multiFileUpload.js:



Most of those methods don't even get used, everything seems to stop at the upload() method in the JSP page, when it tries to call uploader.uploadAll method, that's where the error gets thrown. And it looks like it complains about the vars parameter, it tries to pass to uploadAll(), but I have no idea what does the error mean and if there's any way to fix it. If anyone here knows anything about YUI uploader, I could use some help or at least some advise on how to debug this.

Thanks for your help

Darryl Burke wrote:Given that scenario, I can't see a way to create a single typesafe method. In the absence of a common superclass (other than Object) Generics becomes irrelevant.



Well, this seemed to work. Seems rather dirty (like explicit casting to T), but that's all I could think of. If anyone knows a better way, it'll be great. ;)

8 years ago

Darryl Burke wrote:Do DBClass1 and DBClass2 extend a common supertype?

What does serverCall.findAll(ids) return?



To answer your first question - no. It would be simpler if they would, of course.

Now, your second question: findAll methods return the list of DBClass1 and the list of DBClass2, respectively. I should've been clearer, I do apologize. The instances "serviceCall" are different service calls and should be named differently. So, bottom line: one returns the list of DBClass1 objects, another one - list of DBClass2 objects.
8 years ago
Hello everybody,

I'm trying to grasp a better context of using generics in Java. I've got two methods, which, eventually, hit the database (serviceCall.findAll method) and retrieve a set of either DBClass1 (from one database table) or DBClass2 (from another table).
As you can see, both methods are, pretty much exactly the same, except for the return type - a set of different classes, which represent the database record (the classes have the same properties, they just, as I've already mentioned, reprensent results
from different tables). Is there a way, perhaps using generics, to use one method instead, where I can pass some kind of a flag that will tell it which set to return? Thanks in advance.

8 years ago
And you're using IE10 (or anything that's not IE8) for your app?
10 years ago
JSF
I'm not quite worried about IE10, we should upgrade by then. IE8 is what we're currently aiming towards. I was just hoping that I can at least get rich:editor to work properly with a4j:commandButton. Or, at least, find some workaround to do so.
10 years ago
JSF
Apparently, this "Permission Denied" problem appears independently from jquery. Back to my code: I have a list of items, each represented by rich:editor component. I also have a4j:commandButton the user clicks. It should update the table and (for this simple example) display a new rich:editor component that has just been added. And it works perfectly in FireFox, but not in IE (I'm using IE8). In IE you click the a4j button once, the table gets updated and rerendered properly, the second time nothing happens and I get the same exact "Permission Denied" error. I have a nasty suspicion that it's an IE bug, possibly requiring for IE upgrade or RichFaces upgrade, or both. Is there at least some kind of a workaround to get this to work? Here's the code (I've simplified for this particular example):



It's clear that rich:editor doesn't work well with AJAX (at least in IE8, RichFaces 3, and JSF 1.2 combination), I was just hoping that there's some workaround to resolve this issue (or if it's even going to be fixed after the full upgrade).

Thanks again for all your help.
10 years ago
JSF

Tim Holloway wrote:I'm afraid the sad truth is that HTML is too stupid to be able to do stuff like this. HTML isn't even as smart as the basic UI toolkit for most IDEs, and even HTML5 (which isn't an option here) isn't much better. Consider, for example, that there's no HTML ComboBox control.

A functional solution would probably have to be one of the following:

1. Use a Java applet. Normally I'd go with this, but considering all the security issues with client-side Java lately, it gives one pause.

2. Do it as a Flash plugin. Same issues as #1. Plus Flash. Yuck. Plus Apple mobile devices (among other platforms) refuse to support Flash.

3. Do it in JavaScript. You're a braver person than me. You probably won't be able to leverage tinyMCE, since what you really need is the ability to break the control text into segments, with each segment having the appropriate attributes. I think tinyMCE just lets HTML tags handle that, with results that you've already seen.

No easy solution, alas.



So, the way I understood you:

1) IE 8 is using HTML 4, which, I guess somehow, for some bizarre reason still allowed me to have read-only span object in my tinyMCE editor. Does the same go for Chrome? 'Cause it works there too. And, apparently, Firefox and Safari already use HTML 5, which makes every text (within a span or a div) editable. Right? And thus, I'm lucky it works even for IE and Chrome AND it probably won't work in newer versions?

2) Javascript... last night I was seriously considering it. Ideally, it would be a hacking, but still... first, I'll need to be able to detect where in the editor I clicked to edit and where my cursor is. If it's on the span object, it immediately moves the cursor to the end of the span object. And, of course, delete function needs to be altered: when I attempt to delete a span object, it somehow wouldn't allow me to do so one character at a time, only the whole thing. Same goes for backspace. Thought that might do the trick, preventing the user from altering the actual text id the span object and make it look like we're dealing with a read-only component. Sounds rather complicated, I'm afraid, but more or less doable, do you think? Unless you can see some pitfalls I've missed.

Other than that, as always, I appreciate the time you took to help me.
10 years ago
JSF

Greg Charles wrote:Well, I may have an answer. As Tim points out, the rich:editor does seems to maintain a hidden textarea for the contents of the edit window in the same way something like OpenOffice is maintaining an XML version of the document being edited. The user doesn't directly work with it though. The actual display of the document is done with an iframe, with its body tag set to contenteditable="true". I believe that is an HTML 5 tag, but it is pretty widely supported in today's browsers.

I tried it out in Firefox, and it seem to work OK for me. There is a known bug in IE8 that forces you to set contenteditable to true if you want the span to be uneditable (that is, exactly the opposite of what it should be), but I couldn't find any reported issues with Firefox. Boris maybe you could post a small example of your rich:editor?



Apparently, setting iframe's "contenteditable" attribute to anything doesn't fix the problem. You can still edit the content of a span object by simply placing the cursor anywhere (basically, just like any text). The idea was to treat those span objects as components, which the user can only add or delete, but not actually change.
10 years ago
JSF
Here's what my rich:editor looks like (someBean.someHTMLData is, of course, the HTML content that contains span objects I want to make read-only):



Is there something I need to set there? I thought about it, but I was afraid it's going to affect the whole content, not just the span objects (and only span objects that I need).
10 years ago
JSF