Eric,

First, thanks for contributing back to the STAF project.

Yes, the patch file procedure for submitting changes is current (at 
http://staf.sourceforge.net/contributions.php).  Once you have approval 
for the Statement of Origin, you can follow that procedure to submit a 
patch for the Namespace service.  When submitting a patch, you can set the 
Category field to "Service::Namespace" (which I just added) and  leave the 
Group field at its default value of "None".  Note that you can always just 
leave these fields set to "None" when submitting a patch. 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




"Eric Kadison" <ekadi...@istor.com> 
08/17/2009 08:17 PM

To
Sharon Lucas/Austin/i...@ibmus
cc
<staf-users@lists.sourceforge.net>
Subject
RE: [staf-users] Namespace error display






Sharon,
Thank you for the fast response.  Your solution worked great.  I already 
had code to test the result but I never looked at result.result.
 
We did plan to develop a GUI and Namespace file writer to allow a user to 
set up a test and ensure reliability of the Namespace files.  But 
priorities have not yet permitted its development.  So I have a number of 
users who must manually edit XML files.  Guess what: they sometimes make 
mistakes.
 
We have made a change to the Namespace Service source code that I would 
like to give back.  The change adds the passing of optional arguments.  If 
the PARMS keyword is present, then the first argument after PARMS is the 
absolute path to the location of the xml file and the second argument is 
the file name with extension.  If the PARMS keyword is not present, then 
the Namespace service operates as it does now.  This allows us to use n 
Namespace services that utilize n files of different names in a single 
directory, which simplifies our configuration management.  I'm currently 
getting approval from someone who will have to sign the Statement of 
Origin.  The change affected 2 Java files.  A quick look at the 
SourceForge site (referenced on the STAF web site) makes me wonder how I 
would fill out the Category and Group fields.
 
Is the patch file procedure for submitting changes still current?  If not, 
then tell me how.
 
Eric

From: Sharon Lucas [mailto:luc...@us.ibm.com] 
Sent: Monday, August 17, 2009 4:17 PM
To: Eric Kadison
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] Namespace error display


Eric, 

When registering the Namespace service dynamically via a STAF SERVICE ADD 
request, if an error occurs you should get a non-zero return code and the 
result string contains any additional information provided.  So, check 
these when you get an error.  For example, if you are registering the 
Namespace service via a request submitted via a Java program, you could 
print out result.rc and result.result if an error occurred as follows: 

  STAFHandle handle = new STAFHandle("MyApplication"); 
  String machine = "local"; 
  String service = "SERVICE"; 
  String namespaceServiceName = "Namespace"; 
  String request = "ADD SERVICE " + namespaceServiceName + 
      " LIBRARY JSTAF EXECUTE 
{STAF/Config/STAFRoot}/services/namespace/Namespace.jar"; 

  STAFResult result = handle.submit2(machine, service, request); 

  if (result.rc != STAFResult.Ok) 
  { 
      System.out.println( 
          "ERROR: STAF " + machine + " " + service + " " + request + 
           " failed.  RC: " + result.rc + ", Result: " + result.result); 
  } 

Note that you shouldn't have any errors in the Namespaces.xml file though 
if you're using the NAMESPACE service's SET VAR request to set variables 
in a namespace. 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313



"Eric Kadison" <ekadi...@istor.com> 
08/17/2009 05:07 PM 


To
<staf-users@lists.sourceforge.net> 
cc

Subject
[staf-users] Namespace error display








When a Namespace service is created as part of STAF startup (i.e. the 
Namespace service is created within the STAF.cfg file), and there is an 
error in the Namespaces.xml file, then error information is printed in the 
"terminal" window showing the line where the error was detected, which is 
quite helpful.  The application we've written makes heavy use of the 
Namespace service and we commonly use 5 Namespace services in a test run. 
  
I recently changed our code to create the Namespace services dynamically 
rather than in the STAF.cfg file, and this is working fine.  Is there a 
way to get the error information, if any, when creating the service in 
this way?  We are using Windows (XP and Server 2Kx) and STAF 3.3.3 without 
STAX. 
  
Thanks, 
Eric 
 
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 
30-Day 
trial. Simplify your report design, integration and deployment - and focus 
on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  
http://p.sf.net/sfu/bobj-july_______________________________________________

staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to