Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
sleyzerzon
Post subject: Configuring XML support  PostPosted: Sep 22, 2005 - 03:29 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

Hi,

Could you please guide me on how to configure the context help in MyEclipse xml editor.
I'm working with drools project, and would like to enable the validation of their rules document in the MyEclipse editor. I've downloaded the java.xsd and rules.xsd files from the http://www.drools.org/Schema+Validation but am not sure how to integrate them with MyEclipse so that when I type the xml tags it presents me with the context sensitive available attributes list and the children subtags.

Thank you in advance.
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 22, 2005 - 04:11 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

Simeon,
You will need to add appropriate DOCTYPE headers to your XML files that reference the XSD files, the XML editor will parse those values and give you autocomplete.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 22, 2005 - 06:36 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

Could you please provide an example. Here is the xml file I'm using:

Code:
<?xml version="1.0"?>

<rule-set name="CalculatorWorker"
          xmlns="http://drools.org/rules"
          xmlns:java="http://drools.org/semantics/java"
          xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
          xs:schemaLocation="http://drools.org/rules rules.xsd
                             http://drools.org/semantics/java java.xsd">


<java:import>java.lang.String</java:import>
<java:import>com.csfb.fao.clr.calc.rules.Input</java:import>

<!--
<rule name="blank" salience="-10">

   <parameter identifier="input">
     <class>java.lang.String</class>
    </parameter>

   <java:condition>1==1</java:condition>
   
   <java:consequence>
      System.out.println("Blank");
   </java:consequence>

</rule>
-->

<rule name="Portfolio_Participation_SELL_Exists" salience="-1">

   <parameter identifier="input">
     <class>Input</class>
    </parameter>

   <java:condition>input.getFacilLenderIndic().equals("P") || input.getFacilLenderIndic().equals("M")</java:condition>
   <java:condition>input.getPortfolioPartSellExists().equals("undefined")</java:condition>
   
   <java:consequence>
      //System.out.println("Portfolio_Participation_SELL_Exists");
      input.setPortfolioPartSellExists("Y");
      //System.out.println("Sell indicator: " + input.getPortfolioPartSellExists() + " on " + input);
      drools.modifyObject(input);
   </java:consequence>

</rule>


<rule name="Portfolio_Participation_SELL_Does_NOT_Exists" salience="-1">

   <parameter identifier="input">
     <class>Input</class>
    </parameter>

   <java:condition>input.getFacilLenderIndic().equals("B")</java:condition>
   <java:condition>input.getPortfolioPartSellExists().equals("undefined")</java:condition>
   
   <java:consequence>
      //System.out.println("Portfolio_Participation_SELL_Exists");
      input.setPortfolioPartSellExists("N");
      //System.out.println("Sell indicator: " + input.getPortfolioPartSellExists() + " on " + input);
      drools.modifyObject(input);
   </java:consequence>

</rule>




<rule name="Risk_Ost_2">
     <parameter identifier="input">
     <class>com.csfb.fao.clr.calc.rules.Input</class>
    </parameter>

    <java:condition>input.getOstCount() &gt; 0 </java:condition>
   
    <java:condition>!input.getOtsdTypeCategoryCd().equals("LN") </java:condition>
   
    <java:condition>input.getOtsdTypeCategoryCd().equals("LC") </java:condition>
   
    <java:condition>input.getOpsCount() &gt; 0 </java:condition>
   
    <java:condition>input.getLocIssueFirmInd().equals("N") </java:condition>
   
    <java:condition>input.getPortfolioPartSellExists().equals("Y")</java:condition>

    <java:consequence>
      System.out.println("Calculate RISK_OST_2");
    </java:consequence>
</rule>


<rule name="Risk_Ost_3">
     <parameter identifier="input">
     <class>com.csfb.fao.clr.calc.rules.Input</class>
    </parameter>

   <!-- Facility has outstanding -->
    <java:condition>input.getOstCount() &gt; 0 </java:condition>

    <!-- Outstanding type is not Loan -->
    <java:condition>!input.getOtsdTypeCategoryCd().equals("LN") </java:condition>
   
    <!-- Outstanding type is Letter of Credit -->
    <java:condition>input.getOtsdTypeCategoryCd().equals("LC") </java:condition>

    <!-- Outstanding has OPSs -->
    <java:condition>input.getOpsCount() &gt; 0 </java:condition>
   
      <!-- LC is not CSFB Issue (Fronted) -->
    <java:condition>input.getLocIssueFirmInd().equals("N") </java:condition>
   
    <!-- Portfolio participation SELL does NOT exists -->
    <java:condition>input.getPortfolioPartSellExists().equals("N")</java:condition>

    <java:consequence>
      System.out.println("Calculate RISK_OST_3");
    </java:consequence>
</rule>


</rule-set>


Do I need to define anything under Preferences|MyEclipse|Editors|XML ?

Thank you,
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 22, 2005 - 07:02 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

You have it already here:
Quote:

<rule-set name="CalculatorWorker"
xmlns="http://drools.org/rules"
xmlns:java="http://drools.org/semantics/java"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/rules rules.xsd
http://drools.org/semantics/java java.xsd">


See the last 2 lines?
Quote:

xs:schemaLocation="http://drools.org/rules rules.xsd
http://drools.org/semantics/java java.xsd">


These are in the format of URI LOCATION, so since you just have "rules.xsd" and "java.xsd" that means your XSD should be in the same dir as your XML file, if it is already, then you are all set.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 22, 2005 - 09:29 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

I put the rules.xsd and java.xsd file in the same directory as my xml file is but it doesn't seem to react to that. Anything else I might be missing? Do I need to define anything under Preferences|MyEclipse|Editors|XML ?
Thanks,
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 22, 2005 - 09:51 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

Hmm, I had to change the header to this for it to work:
Quote:

<rule-set name="CalculatorWorker"
xmlns="http://drools.org/rules"
xmlns:java="http://drools.org/semantics/java"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/rules http://drools.org/rules
http://drools.org/semantics/java http://drools.org/semantics/java">

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 22, 2005 - 10:24 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

Sorry,
This didn't do it for me either.
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 22, 2005 - 10:49 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

Add these two entries to your XML Catalog (Window > Prefs > MyEclipse > Editors > XML > XML Catalog)
Code:

URI:         http://drools.org/semantics/java
Key Type:   Public ID
Key:      java.xsd


and

Code:

URI:         http://drools.org/rules
Key Type:   Public ID
Key:      rules.xsd


I'm already thinking this is related to another bug we had filed with the XML editor, but I just want to get you up and running and this point.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 23, 2005 - 04:03 AM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

No, this did not work either.
Maybe I'm missing something?
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 23, 2005 - 01:45 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

Simeon,
This may be a JAXP 1.2 parsing issue, I am looking into it now...

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 23, 2005 - 03:31 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

In fact, after adding the 2 suggested entries into the XML catalog, I'm now unable to delete any of them, it seemingly deletes them, but then when I reopen the preferences window, the entries are there again.

Thank you,
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 23, 2005 - 05:40 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

Simeon,
What is your MyEclipse Build ID (Window > Preferences > MyEclipse)? This was an old bug that should be fixed in 4.0 GA

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 23, 2005 - 06:16 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

You are right, I've tested it on my old install at home yesterday (possible 3.8) and here at work on 4.0 (20050829-4.0.0-GA) it doesn't behave this way.
Sorry for the confusion. But on any of them, the xml context help is not available.

Thank you,
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 23, 2005 - 07:44 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23855

Simeon,
We have assigned this problem to a developer for investigation, it maybe be a bug with our editor, stay tuned.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
sleyzerzon
Post subject:   PostPosted: Sep 23, 2005 - 09:44 PM
Registered Member
Registered Member


Joined: Nov 03, 2004
Posts: 36

Ok, please let me know if you need any additional details from my side.
Simeon
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits