Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [bpel-dev] getPrefix()

Right.

The problem with prefixes and completion processing that I recall stumbling over (and the below may not be the best compromise) was rather a big PINTA ....

I can only defend this ... because at the time the I could not come up with a better approach. The idea was to take the prefix mappings from the function registries ... so that bpws: prefix could be mapped to the bpel functions for example. But it was the template completion code to sets the prefix mappings in the model [when the user accepts the proposal as opposed to when the proposal is shown ]... so this code just checks to sees if the prefix is good. Otherwise it rejects it and does not populate the proposals .... its a silent ignore rather then an exception.

The problem is that expressions (in XPath or otherwise) in the _expression_ editor plugin mechanism do not have a way to communicate any other type information about the _expression_ other then it's textual final form. So if an _expression_ "uses" namespaces for example (as in functions with namespaces) then there is no way to let the main editor code know it. The _expression_ editors do not create parse trees for the expressions ....

So the only way to somehow magically do these mappings is to push them on proposal acceptance by the user. It is not the ideal situation clearly.

-m



Danilov, Oleg V wrote:

Hi,

 

I just found a strange piece of code in the org.eclipse.bpel.ui.contentassist.FunctionTemplatesContentAssistProcessor:

 

      . . .

      String getPrefix ( String ns , String preferredPrefix ) {

           

            /**

             * Namespaces must be mapped to a prefix as the template proposal is going

             * to generate a proposal where the prefix is used.

             */

           

            String pfx = BPELUtils.getNamespacePrefix (fModel, ns);               

           

            /** Valid, already mapped prefix */

            if (BPELUtils.isEmptyOrWhitespace(pfx) == false) {

                  return pfx;

            }

     

            /** Not yet mapped */             

            pfx = preferredPrefix;      

            if (BPELUtils.isValidPrefixName(pfx) ) {

                  // problem

                  return null;

            }

           

            return pfx;

 

      }

      . . .

 

I guess if pfx is a valid prefix name then it’s actually not a problem and getPrefix() should not return null, right? J

 

Thanks,

  Oleg.

 

--------------------------------------------------------------------
Closed Joint Stock Company Intel A/O
Registered legal address: 125252, Moscow, Russian Federation, 
Chapayevsky Per, 14.

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
  

_______________________________________________ bpel-dev mailing list bpel-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/bpel-dev


-- 
Michal Chmielewski, CMTS, Oracle Corp, 
W:650-506-5952 / M:408-209-9321 

"Manuals ?! What manuals ? Son, it's Unix, you just gotta know." 

Back to the top