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..
As an Amazon Associate we earn from qualifying purchases.