× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



a follow up.... I think I have realised what is causing my problems.

I was trapping the editor being closed by adding a part listener. during
the PartClose event I issued a delete() against the
QSYSEditableRemoteSourceFileMember instance. After taking out this delete I
no longer seem to have any issues.

Well, no issues apart from why I put in that delete() method call in there
in the first place :-(

The reason it was there is because I do not want the user to use the
navigation history backwards and forwards buttons once the editor is
closed. Ideally I want to remove all entries from the history for the
element that was just browsed, but to date I have not found a way in the
Eclipse APIs to do so.

In WDSC and RDi v7 it seemed an option to use the delete() method against
the QSYSEditableRemoteSourceFileMember instance to remove the local version
of the source member. Whilst this would not remove any entries from the
navigation history, it would throw up an error and therefore effectively
stopping the user from opening up the source member again via this route (I
know, not the nicest way to do this, but I could not find any other way)


Met vriendelijke groet / Kind regards,

FRANK KNUBBEN
Senior Consultant
CSC

Financial Services | t: +31 (0)30 657 4088 | f: +31 (0)30 657 4570 |
fknubben@xxxxxxx | www.csc.nl

CSC â This is a PRIVATE message. If you are not the intended recipient,
please delete without copying and kindly advise us by e-mail of the mistake
in delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose â CSC Computer Sciences BV â Registered Office:
Kosterijland 20, 3981 AJ Bunnik, The Netherlands â Registered in The
Netherlands No: 33239071




Frank
Knubben/NLD/CSC
Sent by: To
wdsc-plugin-dev-b RDi / WDSC Plugin Developers
ounces@xxxxxxxxxx <wdsc-plugin-dev@xxxxxxxxxxxx>
om cc

Subject
13-08-2009 10:54 Re: [RDi/WDSC-Plugin-Dev]
QSYSEditableRemoteSourceFileMember
and read-only
Please respond to
RDi / WDSC Plugin
Developers
<wdsc-plugin-dev@
midrange.com>






Thanks David,

I get my editable remote object by simply instantiating a new
QSYSEditableRemoteSourceFileMember object. passing an IQSYSMember instance
I just created on the fly .

Initial testing was looking promising, but then I encountered another
oddity. I was suddenly confronted with a dialog titled "Member Locked",
which told me the following:

"Member X/Y(Z) can not be saved on ABC. The member is locked by job
QRWTSRVR/QUSER/123456. Click Display job properties button to view the job
properties.. To save the member, remove all read and write exclusive locks
on the member. You can end the job that is locking the member. Ending the
job will free the member."

I find this mighty strange...I know for sure that I am the only one
accessing this particular source member so something in the IBM APIs is
trying to doing something with the member on the host. Further
investigation shows me that at times the actual change timestamp on the
source member on the host is being updated! Very odd...

I guess I have to do a little more digging to figure out what is going on!


Met vriendelijke groet / Kind regards,

FRANK KNUBBEN
Senior Consultant
CSC

Financial Services | t: +31 (0)30 657 4088 | f: +31 (0)30 657 4570 |
fknubben@xxxxxxx | www.csc.nl

CSC â This is a PRIVATE message. If you are not the intended recipient,
please delete without copying and kindly advise us by e-mail of the mistake
in delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose â CSC Computer Sciences BV â Registered Office:
Kosterijland 20, 3981 AJ Bunnik, The Netherlands â Registered in The
Netherlands No: 33239071




David Gibbs
<david@xxxxxxxxxx
om> To
Sent by: RDi / WDSC Plugin Developers
wdsc-plugin-dev-b <wdsc-plugin-dev@xxxxxxxxxxxx>
ounces@xxxxxxxxxx cc
om
Subject
Re: [RDi/WDSC-Plugin-Dev]
12-08-2009 15:50 QSYSEditableRemoteSourceFileMember
and read-only

Please respond to
RDi / WDSC Plugin
Developers
<wdsc-plugin-dev@
midrange.com>






Frank Knubben wrote:
In RDi 7.5 this class seems to have been replaced with the

QSYSEditableRemoteSourceFileMember

class so that is what I am using, with the same method, passing in the
read-only is true value.

But I am getting some strange results...most of the time the editor is
opened in browse mode as expected, but sometimes as soon as the source is
visible in the editor it is already marked as dirty and the asterisk is
visible to the left of the source file member name. And very
occasionally
the asterisk is not visible at all, but when I close the editor the "Save
Resource" dialog pops up, indicating that the member has been change.

I've encountered this exact situation! And I resolved it.

How are you getting your editable remote object?

Here's (roughly) what I'm doing ...

IBMiConnection connection = getConnection();

IQSYSMember mbr = connection.getMember(sourceLibrary, sourceFile,
sourceMember, new NullProgressMonitor());

IAdaptable item = (IAdaptable)mbr;

ISystemRemoteElementAdapter adapter =
(ISystemRemoteElementAdapter) item .getAdapter
(ISystemRemoteElementAdapter.class);

ISystemEditableRemoteObject remoteObject = adapter.getEditableRemoteObject
(item);

QSYSEditableRemoteSourceFileMember editableMember =
(QSYSEditableRemoteSourceFileMember)remoteObject;


(appologies if this code doesn't work, it's being copied & pasted from a
bunch of different routines).

IIRC, I found that trying to open the member for edit when it was already
open for browse could cause problems. To that end, the following routines
came in handy so I would just activate an existing editor (edit or browse)
if it was already open.


protected final boolean isOpenInEditor(ISystemEditableRemoteObject
editable)
throws CoreException {
int openStatus = editable.checkOpenInEditor();

boolean open = (openStatus !=
ISystemEditableRemoteObject.NOT_OPEN);

return open;
}

/**
* Activates the editor for a specific remote editable object.
*
* @param editable remote editable object to activate
*/
protected final void activateEditor(ISystemEditableRemoteObject editable) {
IEditorPart editor = editable.getEditorPart();
IWorkbenchPartSite site = editor.getSite();
IWorkbenchPage page = site.getPage();
page.activate(editor);
}

david

--
IBM i on Power - For when you can't afford to be out of business
--
This is the RDi / WDSC Plugin Developers (WDSC-Plugin-Dev) mailing list
To post a message email: WDSC-Plugin-Dev@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsc-plugin-dev
or email: WDSC-Plugin-Dev-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/wdsc-plugin-dev..
--
This is the RDi / WDSC Plugin Developers (WDSC-Plugin-Dev) mailing list
To post a message email: WDSC-Plugin-Dev@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsc-plugin-dev
or email: WDSC-Plugin-Dev-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/wdsc-plugin-dev..

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.