Hyperlinking the eclipse console - delayed writes causing BadLocationException? - eclipse

I'm writing an eclipse plugin with a hyperlinked console, but I see BadLocationExceptions when creating the hyperlinks.
To create the hyperlink, I followed the instructions on the related question How to write a hyperlink to an eclipse console from a plugin.
Background: The issue appears to be that the underlying document is updated asynchronously to requests that write to the console (e.g. via a MessageOutputStream), so attempting to create a hyperlink immediately after a write won't work because the offset and length indices provided in the request are invalid.
To try to fix this, I created a DocumentListener on the underlying document, so I could detect when the console is updated and create the HyperLink at that point. But the listener is provided with events that correspond to bulk updates to the console - so I can't easily detect if the console has been updated yet. The only choice seems to be to search the console document for the string I want to hyperlink, which seems quite inefficient.
So the question is: when is the correct time to create a HyperLink, after writing to the console? Are there any proven mechanisms that guarantee the underlying document will have been updated when I issue my hyperlink creation request? An example of code that writes to the console then creates a HyperLink would be great.
Not sure of the exact version of eclipse (I'm writing this from home before heading into work) - but I do know that I'm using MessageConsole.addHyperlink() to issue the request.

I am in exactly the same situation, and came to the same conclusion: I add the hyperlink in a document listener, then remove the document listener. Note that you have no other option than searching for the string, because the console can be cleared by the user! In my case, it is not a severe performance penalty, so I'm happy with this solution.

Related

Typo3 Workspace elements not shown in preview

First foremost: I am aware that this is not a general Typo3 bug/error per se, as I have working installations. I am hoping for hints/help in finding the error in this installation, as it's way too big to just set it up as a new installation.
I have an erronous Typo3 10.4.17 installation (updated to 10.4.x, no fresh install)
Problem: Edited elements in workspace are not shown in the Frontend preview (opened via "Show webpage" or other basic means in BE) nor in the BE View-module.
Additional info #1: They are however shown when preview links are generated via "Generate page preview links" and those are viewed.
Additional info #2: Changed elements only become visible after publishing them & clearing Cache
Additional info #3: Clearing any Cache does not make them visible in the preview
After comparing all settings I could think of to another working installation I decided to delve into the core in search for a hint/solution and got stuck there at following point:
TYPO3\CMS\Workspaces\Controller\PreviewController
Line 130 $workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace()
As well as:
TYPO3\CMS\Workspaces\Service\WorkspaceService
Line 220 public function selectVersionsInWorkspace()
At this point my edited workspace version of the element does get retrieved. selectVersionsInWorkspace() does get called when viewing the preview.
While the PreviewController does not further filter the staged elements, they are not displayed in the Preview.
I am looking for any hint as to where selectVersionsInWorkspace() might still be filtered or other hints as to possible reasons/solutions for this problem that I may have overlooked.
Just when I decided to post to SO a co-worker found the reason...
As it's a big installation we use a dev-domain as admins and each website (over 100) have their own domains which are also set as base in the Site-config.
Only when the preview is opened as either the base or a baseVariant the workspace-elements are displayed at all. In older version the elements would still be displayed when opened via other associated domains, just sometimes not 100% accurately.
Letting this stay in case anyone ever has a similar problem and is hopefully able to find this.

Kentico Import Tool inconsistent/buggy when updating documents

I've had a number of problems using the provided Kentico Import Toolkit, namely when using the "Import new and overwrite existing pages" option to update my existing/already imported pages. I'm using a custom SQL query to import and have had a profile saved for each import I've needed (client has article based site so a few tables of similar information) to try and keep each as consistent as possible between imports.
Here's the problems I've encountered thus far (in no particular order):
the tool tries to guess which fields from the query correlates to the fields of the page type in Kentico for you, which is a nice idea, but seems poorly implemented. If I'm not very careful and reload the profiles every time I import I've had instances where fields changed inexplicably when testing imports because the tool thought it knew which field I wanted
this is more the problem when importing/reimporting multiple times in a session and choosing to go back and load the same profile (without reloading)
the NodeAlias field is only seemingly required on update/reimport rather than on initial import. I'm sure there's an internal cleaning of the document's title to generate a NodeAlias and this is generated fine when importing documents while NOT providing the NodeAlias. After importing the items initially and wishing to update however the NodeAlias is seemingly required as you'll get errors with text asking it be included. This implies to me that there's matching of the NodeAlias along with the given ID field, which should be fine in theory but isn't specifically mentioned anywhere in the tool as best I can tell.
I've had instances where reimporting items will change/strip their NodeAliasPath. I've gotten around this by specifically setting the NodeAliasPath (which only shows after selecting "Show Advanced Columns") but like NodeAlias path before it, I'd think the tool should be smart enough to know to keep the path if not specifically given for updated items.
it seems very odd that in order to match on ID for previous items you have to provide the name of the new column instead of the old one. My example: client was using just a field named 'id' and the new one is 'OriginalID' to clearly differentiate it from the Kentico derived ID fields. To match the items I have to use 'OriginalID' rather than 'id'
A couple of notes/niceties or potential updates along with the above:
it would be nice if there were some way to select if the page should
be published or not through a single query. Currently having the
"Automatically publish pages under workflow" toggle checked seems to always publish
the items. I have an instance where the client has old documents in
the provided DB dump that they don't want visible on the site but
want preserved in the DB if they change their mind later. Currently I
have to perform 2 imports, 1 for the unpublished and a second for the
published items, to accommodate this, which is quite cumbersome
I'll likely edit/add to this as I get responses. This isn't really a specific problem (as I managed a workaround to the NodeAliasPath stripping problem, which inspired this post initially) but more just me asking if these are bugs,if I'm not using the software as intended, etc.
You've stated all the problems you're having/experiencing and possibilities why they are happening but didn't ask a particular question. If you suspect they are bugs, then I'd go to directly to Kentico Support and report the issues there since these are things that have been part of the KIT for as long as I have worked with it.

Trigger a plugin step on "entityimage" change

I created a plugin that should upload the contact entity "entityimage" to an external storage.
The code itself should works (it works as a console app), but I am unable to add a step that trigger on "entityimage" change as I can't find it in the filtering attribute list in the Plugin Registration Tool.
Is there a way to trigger this plugin only when "entityimage" change?
Regards,
Dremor
Reviewing the Contact's entityimage field in the Metadata Browser indicates that it is a "Virtual" field, which may be why it is unavailable as a filtering attribute.
Also, according to the SDK there does not appear to be any other message available besides "Update" on the Contact that could be used to indicate that the entityimage has changed.
And, changing the image through the UI does create an Audit History entry, however, it is a generic "Update" entry, with the old value and new value blank.
It appears that triggering a plugin on change of only the entityimage field is not possible, nor do there appear to be any OOB hooks to see if that field has changed.
The only other think I can think to research is Change Tracking. Otherwise it looks like you may have to upload the image on any Update of a Contact.
Or, you could sync the image URL's from CRM to an external system and compare the one in CRM to the external system before uploading.
Strangely enough, if you don't set any filtering attributes the plugin does get triggerd when changing the image, but i guess this also means that all field changes will trigger it.

Rest Console for Chrome won't let me input any info

I installed the Rest Console extension onto Chrome. I can't use this Rest Console for anything, because the only fields that accept text are 'Request URL' and 'Request Method'.
I ask here as there is no resources or community accessible for even simple instructions on how this extension works, and there are likely members of this community who have used this extension.
Use the Postman - REST Client it works perfectly!
your_url_to_post: Fill the URL
your_json_param: The name of the param that you'll pass you json
your_json_data: The json content
Don't forget to select x-www-form-urlencoded if you'll do a post
http://i.stack.imgur.com/TISW1.png
You should be able to enter text in the other field if you tick the checkbox associated to the field first.
I started having a similar issue myself (Forms wouldnt let me input data I could click them but thats as far as it went) across a lot of web pages to include my own php game and I know the form code hasnt changed at all before this issue started. I came across a article of someone else having a similar issue themselves that I was having and someone said that they needed position: relative on their forms that are not given specific instructions on positioning when dealing with google chrome. I have since made this change myself at www.immoralattack.com and the issue has stopped on that site but still continues on many others so its pretty safe to say that is the issue.
Its only happening on the dev build of chrome for me atleast and I hope this isnt something they plan on implementing on live or this will mess up alot of websites.
Also try turning off auto fill from chrome if its on, while I was looking for this bug I found alot of similar bugs but they delt with auto fill being on.

SmartGWT DataSource binding to ListGrid and DynamicForm

First let me warn readers not to pass me off to any links in isomorphic because it is highly probable I have read it and I have scoured the smartgwt showcase running locally here as I ask this question. What I ask is not documented and if it is, I am unable to decipher and need actual explanation here. No, do not tell me about SmartGWT EE. This case is purely Smartclient interacting with my JSP (or perl, php) on the server side, which I use to interact with a SAS backend.
This question has nothing to do with how to operate SAS. I am mentioning SAS to illustrate the point that smartclient has to interact with SAS web service directly and not through SmartGWT server. I asked a similar but different question at smartclient forum which is still unanswered, so this must be a very difficult subject that probably even people at isomorphic does not have an answer.
I have
JSON xjsondatasource url produced from a SAS web service, sasxjsondsrc. I am mocking it with a JSP on Jetty.
sasxjsondsrc = id(primaryKey), name, description.
ListGrid whose datasrc is set to sasxjsondsrc.
SearchForm/DynamicForm editForm whose datasrc is set to sasxjsondsrc.
I need to
user would visually select a row on listGrid and then click del button, which my code would trigger listGrid.removeSelectedData(), which would then remove only that row locally and as well as send to sasxjsondsrc url the parameters id=id to be deleted, operation=DEL.
user would visually select a row on listGrid and then click modify button, which my code would editForm.editSelectedData(). When user presses save edit button, my code would trigger editForm.saveData(), which would then modify that row locally and as well as send to sasxjsondsrc url the parameters id=id, name=modified-value, description=modified-description, operation=MOD.
user would click add button and my code would trigger editForm.saveData(), which would then append that row locally and as well as send to sasxjsondsrc url the parameters name=new-name, description=new-description, operation=ADD.
This local-server management is what smartclient advertises itself as an advantage. The problems are
my JSP is not registering smartclient sending any parameter to indicate what operation should be performed. It is only receiving the datasource fields=values as parameters for the affected records.
the records are not appended or modified locally for add or edit operations.
to overcome problem (1), I tried providing an extra non-displayed datasource field called operation. But when a dynamic form is bound to that datasource, the dynamicform field would not allow me to programmatically modify the operation field successfully.
I tried appending operation as a DSRequest but my JSP is not receiving it either.
HOW does my JSP know what operation (ADD/REMOVE/EDIT) is being performed?
OK, to cut a long story short - datasource in SmartGWT is a horribly tricky business. I have been advised to use SmartGWT only for its UI but I should avoid using SmartGWT datasource because it is too tricky to deal with. Could some post or link me to examples of how you did your SmartGWT client programming in a configuration similar to mine.
Should I revert to using GWT 2.1M3 cell/page architecture and write my own rpc-table cells-form linking?
I think that you do actually need to be looking at the SmartGWT data sources, specifically the RestDataSource and quite possibly, the DataSource.setOperation() method.