Achieving early binding
There have been some messages here about the problem of getting early binding for packaged beans.
I have found a way to achieve that for an individual bean. The solution is to include an explicit BeanInfo class, and not to rely on automatic bean info being obtained by reflection.
I included a BeanInfo class with the following method:
public MethodDescriptor[] getMethodDescriptors()
Method[] classMethods = beanClass.getMethods();
Vector publicMethods = new Vector();
for (int i = 0; i < classMethods.length; i++)
int modifiers = classMethods.getModifiers();
if (Modifier.isPublic(modifiers))
publicMethods.add(new MethodDescriptor(classMethods[i]));
int count = publicMethods.size();
MethodDescriptor[] methods = new MethodDescriptor[count];
publicMethods.copyInto(methods);
return methods;
Package the bean, making sure the BeanInfo class is in the jar file with the bean.
Install and register the dll.
In VB, add the dll to the project references.
Now you can instantiate the bean with the standard
Set beaninstance = New BeanLib.BeanClassand have early binding for the beans methods.
Regards,
Maarten
I would love to help you get it to work properly, however while trying to build a more complete example today, it seems that it stopped working on my machine.
Even my previous project, which has early binding working, now refuses to run.
I must say that finding this method was more of a side-effect of creating a larger-scale Java-com integration.
My final solution does not rely on the bridge to provide early binding. Instead it automatically generates VB classes that wrap all exported java classes. These classes are compiled into a DLL which then provides early binding to VB projects, including strongly typed object return types. Internally the wrapper classes use late binding.
Unfortunately I am unable to provide the wrapper generator, as it is owned by my current employer. If anybody is interested in writing one, I suggest using a javadoc Doclet as the base technology. That will take care of all the parsing and referencing of the java classes, and unlike reflection, it lets you use the actual parameter names in your wrappers.
If I ever find a consistenly working way to achieve early binding with just the sun bridge, I'll be sure to let you guys know.
Kind regards,
Maarten
Similar Messages
-
How to solve the "type mismatch" error in jCOM early binding program?
I got a "type mismatch" error jCOM early binding program.
I use the VB as the jCOM client to access the EJB deployed on WLS7. While using the
object parameter like "java.lang.Integer" in EJB method call, I got that error message
and my VB client had to be stopped?
The same situation, the VB program work perfect when using the "int" as the parameter.
And I try to instance the "myTLB.JavaLangInteger" in my VB program, but how ? The
"New", "CreateObject" and "GetObject" all failure, I don't know what to do next ???Hi,
This problem Could happen when you referesh quality or test system.
Your delta setup for the related master and transaction data needs to be reinit.
What happens is when you init. the delta and subsequent delta is all maintained in your source system
please check Notes 852443,424848,834229
Hope this helps
Thanks
Teja
Message was edited by:
Teja badugu -
I need to find two kinds of method calls that use early binding in Java.
I would like to know if my ideas are correct:
I think overloaded functions uses early binding, because the compiler looks at the types of the parameter variables.
I think static functions uses early binding because they are outside of a class.
I think functions define as final uses early binding because they do not change.
Does that make sense? Are those correct method calls that uses early binding please?
Thank you for your help.a. What is the difference between design patterens and frameworkA design pattern is what you see in a lace curtain and a framework is usally made of wood and used as a support structure (as for a house).
b. What is the difference bewteen composition and generalizationcomposition is a part of decomposition (like with the trash heap in the backyard) and generalization is streotyping
c. Hash map and Hash tableEating hashbrowns at the table or (for whatever odd reason) sitting on a map
d. What are virtual functionsThese are what supervisor's and manager's have (as they have no real function)
e. How do we do late binding and early binding in javaDepends on when you do your coding, morning or evening
P.S.
Sorry for the joke on your behalf, but after dizzy's post I just had to do the same in a sarcastic manner. ;-) -
Revision: 11535
Author: [email protected]
Date: 2009-11-06 13:50:52 -0800 (Fri, 06 Nov 2009)
Log Message:
Don't early bind lexical references in a with block. It causes
outer locals to shadow properties on the with object.
(bug ASC-2257; r=peted)
Ticket Links:
http://bugs.adobe.com/jira/browse/ASC-2257
Modified Paths:
flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/FlowAnalyzer.javaThis line:
Jul 30 18:34:00 sleepy dhclient: wmaster0: unknown hardware address type 801
According to your kernel log, your wireless card is wlan0. I'm not sure what wmaster0 is, but I'm pretty sure that's the network device causing the issue here; NetworkManager can be pretty finicky when your network configuration is not correct. -
Wat is early binding and late binding
1)Class A {
Public void amethod(){
System.out.println(�amethod�);
class B extends A{
public static void main(String args[]){
B b = new B();
b.amethod();
if I run amethod will be printed on the console;
in the class A if i replace public class with private modifier;then I don�t compile class B and I run directly what will happen?
What is late binding and early binding?What is late binding and early binding?Suppose you have two objects iA and sB, where iA is an Integer object and sB is a String object. If you were to assign them to one another, this would result in a compile time error. This is because the compiler checks if the objects 'bind' with each other. This is early binding.
Take another case where you have two custom objects (A & B) implementing the same interface. you pass an one of the objects (say A) to a method which accepts the implemented interface as a parameter and try to work with it as if it were to be the other (ie B) the compiler passes this since syntactically this is correct. But when it comes to runtime, the runtime env will get to know that this is illegal and throws an exception. This is a typical case of late binding. -
Com2java. early binding and JCOM WLS7
All,
I have been looking at the use of JCOM with WLS 7. Based around supplied examples,
the com-to-java using zero client or late binding appears simple and worked reliably
using entity and session beans, however I have been unable to produce an early bound
com-to-java example or a java-to-com example. In the former case the VB client produces
a GPF (General Protection Fault) when attempting retrieve the home interface of
the targeted EJB and in the latter case com2java produced code which would not compile
(even after following the note 076584 regarding the jintegra code). I am beginning
to doubt the current release. Has anybody succeeded in building an early bound example
or used com2java succesfully.
Regards
Chris -
Hi All,
1 class parent
2 {
3 int a=10;
4 public void getme1()
5 {
6 System.out.println ("parent");
7 }
8 }
9
10 class child extends parent
11 {
12 int a=10;
13
14 public void getme1()
15 {
16 System.out.println ("child");
17 //System.out.println (a);
18 }
19
20 public static void main(String args[])
21 {
22 parent p = (parent)new child();
23 parent p1 = new child();
24 p.getme1();
25 System.out.println (p.a);
26 }
27 }In the above code snippet,
1. what is the difference between lines 22 and 23 ?
2. why the statement on line 25 prints class parent's instance variable 'a' instead of class child's instance variable 'a' ?
Thanks & Regars,
Kumar.for 1) I think there is compile time optimizations
done and for I doubt it, but you could always use javap to look at the bytecode and see.
2) A's instance variable for which I dont
know what is the reasonYes, the parent class' variable will get printed. However, you've set both child and parent to 10, so how can you personally even tell which "10" it is?
The reason it's the parent's is the member variables can't be overridden--they're bound at compile time by the reference type. They're not polymorphic the way non-private instance methods are. Because p is declared as parent, the compiler determines that p's member variable will be accessed (because the reference is a refrence to parent). Contrast this with getMe1()--a non-private instance method. Here, the VM determines at runtime which one to call based on the class of the instance. -
Late Binding Word Automation creates a document with an unresponsive Ribbon
I have a .NET ActiveX COM object that is calling Word and adding a template for processing. This template will get some data and then add in a layout template which will create the final document with the data and layout.
When it is all said and done, the Word document has all the data, however, when the user tries to access the ribbon (click on one of the tabs or an item in the visible ribbon), nothing happens (like it is disabled). You can click into the document
itself and if the document has bolded text or something like that the ribbon changes to reflect the changes in font.
The only way for the ribbon to become responsive is to either minimize and reshow Word or select another application and then back to Word. This "unlocks" the ribbon and you can interact with it.
I accidently left in a reference to Word 2010 when I was testing something and then the code I have worked. I went back to late binding and removed the reference to Office 2010 and it does not work even though none of my code has changed. The
Word constants/enums I am using were already locally created and the methods I am using have the either no parameters or the appropriate parameters provided as far as I know.
In the code snippet below, the line "officeApp.ActiveWindow.Activate()" is what worked with early binding to
cause the ribbon to be responsive immediately and allow the use to interact with the ribbon with no additional steps. With late binding nothing seems to work.
Code snippet :
Dim reportDocument As Object = Nothing
Try
officeApp = GetObject(, "Word.Application")
usingExistingWord = True
Catch exp As Exception
'Not Ideal - would prefer not to rely on Exception handle to catch this
If officeApp Is Nothing Then
officeApp = CreateObject("Word.Application")
End If
End Try
Try
'Open process template
templateDocument = officeApp.Documents.Add(Template:=ProcessTemplate)
Catch exp As Exception
Success = False
If Not usingExistingWord Then
officeApp = Nothing
templateDocument = Nothing
End If
Throw exp
End Try
If templateDocument Is Nothing Then
'The process template was not loaded/added properly, abort code
If Not usingExistingWord Then
officeApp.Quit()
officeApp = Nothing
End If
Success = False
Exit Sub
End If
'hide Word while the process template runs its code.
officeApp.Visible = False
Try
officeApp.Run("RunReport", _parameters, reportDocument)
Catch exp As Exception
Success = False
If officeApp IsNot Nothing Then
If templateDocument IsNot Nothing Then
templateDocument.Close(SaveChanges:=False)
templateDocument = Nothing
End If
If Not usingExistingWord Then
officeApp.Quit()
End If
officeApp = Nothing
End If
Throw exp
End Try
If Success Then
Try
If reportDocument IsNot Nothing Then
reportDocument.Activate()
End If
officeApp.ActiveWindow.Activate()
officeApp.Activate()
officeApp.ActiveWindow.ToggleRibbon()
officeApp.ActiveWindow.ToggleRibbon()
Catch ex As Exception
End Try
End If
'Done - close the process template
templateDocument.Close(SaveChanges:=c_wdDoNotSaveChanges)
End If
Thanks in advance for any help you are able to provide!Hi gardmica,
Thanks for the detail explaintation. However I still failed to reproduce the issue. Here is the code I tested:
Public Class Class1
Sub Main()
Dim reportDocument As Object = Nothing
Dim usingExistingWord As Boolean
Dim officeApp As Object
Dim templateDocument As Object
Dim ProcessTemplate As String
Dim Success As Boolean
Dim c_wdDoNotSaveChanges As Boolean
Success = True
ProcessTemplate = "C:\Users\UserName\Desktop\ProcessAndLayoutTemplates\MailMerge Process XML.dot"
Try
officeApp = GetObject(, "Word.Application")
usingExistingWord = True
Catch exp As Exception
'Not Ideal - would prefer not to rely on Exception handle to catch this
If officeApp Is Nothing Then
officeApp = CreateObject("Word.Application")
End If
End Try
Try
'Open process template
templateDocument = officeApp.Documents.Add(Template:=ProcessTemplate)
Catch exp As Exception
Success = False
If Not usingExistingWord Then
officeApp = Nothing
templateDocument = Nothing
End If
Throw exp
End Try
If templateDocument Is Nothing Then
'The process template was not loaded/added properly, abort code
If Not usingExistingWord Then
officeApp.Quit()
officeApp = Nothing
End If
Success = False
Exit Sub
End If
'hide Word while the process template runs its code.
officeApp.Visible = True
Try
'officeApp.Run("RunReport", _parameters, reportDocument)
Catch exp As Exception
Success = False
If officeApp IsNot Nothing Then
If templateDocument IsNot Nothing Then
templateDocument.Close(SaveChanges:=False)
templateDocument = Nothing
End If
If Not usingExistingWord Then
officeApp.Quit()
End If
officeApp = Nothing
End If
Throw exp
End Try
If Success Then
Try
If reportDocument IsNot Nothing Then
reportDocument.Activate()
End If
officeApp.ActiveWindow.Activate()
officeApp.Activate()
officeApp.ActiveWindow.ToggleRibbon()
officeApp.ActiveWindow.ToggleRibbon()
Catch ex As Exception
End Try
End If
'Done - close the process template
templateDocument.Close(SaveChanges:=c_wdDoNotSaveChanges)
End Sub
End Class
Did I miss any step? Does the issue exist when you didn't run the "RunReport" macro?
Also I notich that the template is working in a compatibilty mode, is it helpful that convert it via File->Info->Convert?
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Problem while binding variable progmatically shared variable in RT
Hi All,
I have a problem while programaticaly binding the shared variable from RT controller.
The application scenario is as follows
I have three cFP controllers and two
server PCs in my application. Servers are implemented with Redundancy. If server
1 fails, server 2 will take care and vice versa. The cFP controller program is
intelligent enough to detect this switching and identify the active server.
I am using shared variable
communication for transferring the data between cFP and Active Server. This I am
achieving by binding the cFP variable to Server variables. I can bind server
variables to cFP variables also. But I have some advantage with first one rather
than second one.
Now, cFP Variable to Server Variable
binding I can do in two ways.
Right click the variable in Project
Explorer and select the network URL.
Other method is by programmatic
binding.
Now Programatic binding should be
done in cFP controller since cFP controller should bind to second server
whenever it detects switching.
For this, I tried with
SharedVariableIO property node like in the below attached diagram 1.
But I was getting a deployment error
shown in attached diagram 2.
The second method I tried is by
transferring a shared variable library cFP Library.lvlib to cFP through FTP and
opening the Library variable reference and by using the variable property node.
This way of binding was successful when I run from windows PC. But in RT
controller, it was giving me Error 1 while opening a
library.
I am attaching the code with this post
Summary of the problem is I am not able to progmatically bind variables from
RT Controllers
Kindly help me in solving this
problem.
Regards,
Blackperl
Message Edited by blackperl on 08-18-2008 08:29 AM
Message Edited by blackperl on 08-18-2008 08:31 AM
Attachments:
Code and Library.zip 27 KB
Diagram 1.jpg 15 KB
Diagram 2.jpg 25 KBHi All,
I have a problem while programaticaly binding the shared variable from RT controller.
The application scenario is as follows
I have three cFP controllers and two
server PCs in my application. Servers are implemented with Redundancy. If server
1 fails, server 2 will take care and vice versa. The cFP controller program is
intelligent enough to detect this switching and identify the active server.
I am using shared variable
communication for transferring the data between cFP and Active Server. This I am
achieving by binding the cFP variable to Server variables. I can bind server
variables to cFP variables also. But I have some advantage with first one rather
than second one.
Now, cFP Variable to Server Variable
binding I can do in two ways.
Right click the variable in Project
Explorer and select the network URL.
Other method is by programmatic
binding.
Now Programatic binding should be
done in cFP controller since cFP controller should bind to second server
whenever it detects switching.
For this, I tried with
SharedVariableIO property node like in the below attached diagram 1.
But I was getting a deployment error
shown in attached diagram 2.
The second method I tried is by
transferring a shared variable library cFP Library.lvlib to cFP through FTP and
opening the Library variable reference and by using the variable property node.
This way of binding was successful when I run from windows PC. But in RT
controller, it was giving me Error 1 while opening a
library.
I am attaching the code with this post
Summary of the problem is I am not able to progmatically bind variables from
RT Controllers
Kindly help me in solving this
problem.
Regards,
Blackperl
Message Edited by blackperl on 08-18-2008 08:29 AM
Message Edited by blackperl on 08-18-2008 08:31 AM
Attachments:
Code and Library.zip 27 KB
Diagram 1.jpg 15 KB
Diagram 2.jpg 25 KB -
Binary Message in Orchestration - Binding vs Direct
Hi,
I've seen a number of questions/answers on here and blogs/posts all over the web suggesting that I can handle binary messages (such as ZIP files or PDFs) through BizTalk Orchestration by declaring the orchestration receive port as message type System.Xml.XmlDocument.
I have built myself a simple orchestration, that receives a message of type System.Xml.Document, logs the receipt of the message and then forwards to a send point (the logging part is key for us, otherwise I would just do a messaging only solution).
I have defined a receive port with a passthru pipeline, and BizTalk picks the message up fine.
My problem comes with binding the orchestration port. If I bind the orchestration port to the receive port, everything works fine; however, I was actually hoping to achieve direct binding with the messagebox (I may have multiple subscribers for these binary
messages). When I change the orchestration to direct binding, with or without a filter expression, the incoming message always suspends saying there are no subscribers available.
My question is, is it possible to achieve this kind of routing using with binary messages, or am I'm going to have to use a receive pipeline to wrap the message in an envelope, or convert to multi-part, or similar?? Articles I've read suggest that a direct
binding using System.Xml.XmlDocument is possible, but try as I might, it won't work!?
I'm using BizTalk 2006 (unfortunately) ... anyone got any ideas?
Regards
ChrisHi Chris,
Problem is here “I have defined a receive port with a passthru pipeline, and BizTalk picks the message
up fine.” -
User XML-Receive not passthru.
When you bound your Receive port (Receive location with pass-thru) to orchestration (which has
System.Xml.XmlDocument message type at the Receive shape) , though the Receive-shape’s message type is of type System.Xml.XmlDocument, you have NOT converted
your PDF file content to XML since you had pass-thru pipeline in Receive location. Because
message travelled through an orchestration isn't automatically loaded up into the DOM but rather remains a stream. So in your case, the Orchestration Receive
shape with System.Xml.XmlDocument message type is just acted as message receiver. And since in your orchestration you just did logging, you have not loaded
the content of the PDF from its stream to XMLDoM. So it worked.
But when you used direct, your Orchestration’s subscription is for the System.Xml.XmlDocument but the received PDF was in steam so it won’t work in direct bound
unless you create XML-Receive or custom-pipeline to load the PDF content to some XML base type schema.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
What type of binding is done in PLSQL? Is it late,early or deferred binding
ID 1008453.6:
PL/SQL uses static or early binding. This means that binding is done at compile time which increases efficiency because the definitions of database objects are looked up at compile time, rather than at run time. -
Hi,
I created a simple plugin and since i wanted to use Early Binding i added Xrm.cs file to my solution.After i tried registering the plugin (using the Plugin Registration Tool) the plugin does not gets registered and i get the below mentioned Exception.
Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this
operation may have been a portion of a longer timeout.
Server stack trace:
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)
at Microsoft.Crm.Tools.PluginRegistration.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)
Inner Exception: System.TimeoutException: The HTTP request to 'https://demoorg172.api.crm.dynamics.com/XRMServices/2011/Organization.svc' has exceeded the allotted timeout of 00:01:59.9430000. The time allotted to this operation may have been a portion of a
longer timeout.
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
Inner Exception: System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
And to my Surprise after i remove the Xrm.cs file from my solution the Plugin got registered!
Not understanding what exactly is the issue.
Any Suggestions are highly appreciated.
Thanks,
Shradha
Hello Shardha,
I really appreciate that you have faced this issue.This is really very strange issue and basically it occurs because of big size of your early bound class and slow internet
connection.
I would strictly recommend you to reduce the file size of your early bound class and then register.By default early bound class is created for all the entities which are
present in CRM(System entities as well custom entities).Such kind of early bound classes takes lots of time to register on server and hence timeout exception comes.
There is some standard define to reduce the size of early bound class.Please follow the link to get rid from big size of early bound class.
Create a new C# class library project in Visual Studio called SvcUtilFilter.
In the project, add references to the following:
CrmSvcUtil.exe(from sdk) This exe has the interface we will implement.
Microsoft.Xrm.Sdk.dll (found in the CRM SDK).
System.Runtime.Serialization.
Add the following class to the project:
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Microsoft.Crm.Services.Utility;
using Microsoft.Xrm.Sdk.Metadata;
namespace SvcUtilFilter
/// <summary>
/// CodeWriterFilter for CrmSvcUtil that reads list of entities from an xml file to
/// determine whether or not the entity class should be generated.
/// </summary>
public class CodeWriterFilter : ICodeWriterFilterService
//list of entity names to generate classes for.
private HashSet<string> _validEntities = new HashSet<string>();
//reference to the default service.
private ICodeWriterFilterService _defaultService = null;
/// <summary>
/// constructor
/// </summary>
/// <param name="defaultService">default
implementation</param>
public CodeWriterFilter( ICodeWriterFilterService defaultService )
this._defaultService = defaultService;
LoadFilterData();
/// <summary>
/// loads the entity filter data from the filter.xml file
/// </summary>
private void LoadFilterData()
XElement xml = XElement.Load("filter.xml");
XElement entitiesElement = xml.Element("entities");
foreach (XElement entityElement in entitiesElement.Elements("entity"))
_validEntities.Add(entityElement.Value.ToLowerInvariant());
/// <summary>
/// /Use filter entity list to determine if the entity class should be generated.
/// </summary>
public bool GenerateEntity(EntityMetadata entityMetadata, IServiceProvider services)
return (_validEntities.Contains(entityMetadata.LogicalName.ToLowerInvariant()));
//All other methods just use default implementation:
public bool GenerateAttribute(AttributeMetadata attributeMetadata, IServiceProvider services)
return _defaultService.GenerateAttribute(attributeMetadata, services);
public bool GenerateOption(OptionMetadata optionMetadata, IServiceProvider services)
return _defaultService.GenerateOption(optionMetadata, services);
public bool GenerateOptionSet(OptionSetMetadataBase optionSetMetadata, IServiceProvider services)
return _defaultService.GenerateOptionSet(optionSetMetadata, services);
public bool GenerateRelationship(RelationshipMetadataBase relationshipMetadata, EntityMetadata otherEntityMetadata, IServiceProviderservices)
return _defaultService.GenerateRelationship(relationshipMetadata, otherEntityMetadata, services);
public bool GenerateServiceContext(IServiceProvider services)
return _defaultService.GenerateServiceContext(services);
This class implements the ICodeWriterFilterService interface. This interface is used by the class generation
utility to determine which entities, attrributes, etc. should actually be generated. The interface is very simple and just has seven methods that are passed metadata info and return a boolean indicating whether or not the metadata should be included
in the generated code file.
For now I just want to be able to determine which entities are generated, so in the constructor I read from an XML
file (filter.xml) that holds the list of entities to generate and put the list in a Hashset. The format of the xml is this:
<filter>
<entities>
<entity>systemuser</entity>
<entity>team</entity>
<entity>role</entity>
<entity>businessunit</entity>
</entities>
</filter>
Take a look at the methods in the class. In the GenerateEntity method, we can simply check the EntityMetadata parameter
against our list of valid entities and return true if it's an entity that we want to generate.
For all of the other methods we want to just do whatever the default implementation of the utility is. Notice
how the constructor of the class accepts a defaultService parameter. We can just save a reference to this default service and use it whenever we want to stick with the default behavior. All of the other methods in the class just call the default
service.
To use our extension when running the utility, we just have to make sure the compiled DLL and the filter.xml file
are in the same folder as CrmSvcUtil.exe, and set the /codewriterfilter command-line argument when running the utility (as described in the SDK):
crmsvcutil.exe /url:http://<server>/<org>/XrmServices/2011/Organization.svc /out:sdk.cs /namespace:<namespace> /codewriterfilter:SvcUtilFilter.CodeWriterFilter,SvcUtilFilter
/username:[email protected] /password:xxxx
That's it! You now have a generated sdk.cs file that is only a few hundred kilobytes instead of 5MB.
One final note: There is actually a lot more you can do with extensions to the code generation utility.
For example: if you return true in the GenerateOptionSet method, it will actually generated Enums for each CRM picklist (which it doesn't normally do by default).
Also, the source code for this SvcUtilFilter example can be found here.
Use at your own risk, no warranties, etc. etc.
Please mark as a answer if this post is useful to you. -
One reason why commandLink doesn't work in dataTable
Ok, so I think I've got an explanation why commandLink doesn't work in dataTable when the model bean is request scoped. Maybe somebody can tell me if I'm wrong.
I have a model bean that generates table rows based on some input criteria (request parameters).
So, we validate the inputs, apply them to the bean and render the page. Once the inputs have been applied to the bean, a request for table rows returns rows, no problem.
However, we put a commandLink in each row, so we can expand the details. Maybe we even get smart and repeat the input row-generating criteria as a hidden field in the page.
Unfortunately, when the user hits the commandLink, the list page simply refreshes, maybe even w/out table rows. The user doesn't get the details page as expected.
Why not?
Because: in the DECODE phase (even before validation and before "immediate" values have had their valueChangeListeners called), we ask the model bean for the table rows, so we can decode the commandLinks. Unfortunately, in "decode" phase, the request-scoped model bean has not had its row-generating criteria updated (that happens in the "update model" normally, or at the END of the decode phase if we got cute by (1) setting the "immediate" attribute on the row-generating criteria to "true" AND (2) set a valueChangeListener to allow us to update the model bean early. The END of the decode phase isn't good enough -- in the middle of that phase, when we're attempting to deocde commandLinks, the model bean has no citeria, so there's no row data. No row data means no iteration over commandLinks to decode them and queue ActionEvents. So, we march through the rest of the phases, process no events, and return to the screen of origin (the list screen) with no errors.
So, what's the solution?
One solution is to make the model bean session-scoped. Fine, maybe we can store a tiny bit of data in it (the search criteria), so it's not such a memory drag to have it live in the session forever. How do we get that data in? A managed property in faces-config.xml with value #{param.PARENT_KEY} won't work because it's assigning request-scoped data to a session-scoped holder. JBoss balks, and rightly so. Do we write code in the model bean that pulls the request parameter out of thin air? (FacesContext.getExternalContext()....) I don't really like to code the name of a specific http request parameter into the bean, I think it's the job of the JSP or faces-config.xml to achieve that binding (request parameter to model propery). Plus, I'd be sad to introduce a dependency on Faces in what was previously just a bean.
Is there a better way?
In my particular situation, we're grafting some Faces pages onto an already-existing non-Faces application. I don't get the luxury of presenting the user an input field and binding it to a bean. All I've got to work with is a request parameter.
Hmm, I guess I just answered my own question. if all I've got to work with is a request parameter, some ugliness is inevitable, I guess.
I guess the best fix is to cheat and have the bean constructor look for a request parameter. If it finds it, it initializes the criteria field (which, in my case, is the key of an object that has a bunch of associated objects (the rows data), but could be more-general d/b search criteria).
(I looked at the "repeater" example code in the RI, but it basically statically-generates its data and then uses 100% Faces (of course) to manage the paging (where "page number" is essentially the "criteria").
Comments? Did I miss something obvious?
John....or I could just break down and do the thing I was hoping to avoid (outputLink instead of commandLink):
<h:outputLink value="/faces/Detail.jsp">
<f:param name="PARENT_KEY" value="#{bean.parentKey}"/>
<h:outputText value="#{bean.label}"/>
</h:outputLink>It's still a "hardcoded" parameter name, but at least the binding is in the JSP and faces-config.xml, not the bean Java code. -
Matching Raster and Vector RGB color in InDesign CS3.
We print on a Durst Lambda RGB imaging device to photographic paper. All color management is done as an early bind (raster files are converted to the printer's color space and vector colors are chosen from a palette database). So basically the files must go through InDesign without any color change in raster or vector information. We have clients that require specific RGB builds for logo colors the are present in both their raster and vector files.
Color Management is set to "North American General Purpose 2" with "RGB: Preserve Embedded Profiles" selected.
1) The file is exported as a PDF 1.4, High Quality, PDF/X_None.
2) The PDF was ripped on a Cheetah RIP (Jaws level 3) with no color management on.
3) Solid raster colors such as 0-255-0 will reproduce as 0-255-1.
4) The color differences between the raster and vector are usually 1-4 points.
5) The vector is consistent as was input in the programit's only the raster that changes. When you are trying to match raster and vectors logo colors it is a killer.
However, I can go into the InDesign (or Illustrator) color settings and turn color management off (This is our current workflow). In doing this the RGB working space uses the monitor profile and "color management policies" are set to OFF. With these settings the RGB raster and vector match. The problem with this work flow is two fold:
1) We have other devices than our RGB Durst Lambda that can use the InDesign color managementVutek flat bed 3200 and grand format 3360.
2) We have had many occurrences where the custom "color management off" settings have reverted back to the default "North American General Purpose 2"without any intervention.
I have tried this with different RIP's with the same results.
Does anyone have an idea to create a simple PDF workflow and keep the color information consistent?
Program: InDesign CS3 5.0.2
Platform: Mac OS 10.5.2
Computer: G5 tower with 4 gigs of RAMI believe that setting is an old Illustrator setting that has been saved to effectively turn the color management off. The monitor profile effects the image displayedit doesn't effect the color transform.
Anyway, the color management I want to use is the "North American General Purpose 2".
To reiterate:
The procedure:
1) The file is exported as a PDF 1.4, High Quality, PDF/X_None.
2) The PDF was ripped on a Cheetah RIP (Jaws level 3) with no color management on.
The Problem:
3) Solid raster colors such as 0-255-0 will reproduce as 0-255-1It changes from the original raster color placed in InDesign.
4) The color differences between the raster and vector are usually 1-4 points.
5) The vector is consistent as was input in the programit's only the raster that changes. When you are trying to match raster and vectors logo colors it is a killer.
To summarize, the color of the raster file will change from the original that was place into the documenteven though nothing was selected in InDesign that would change the color (i.e. profile conversion to an output profile or a transparency effect used). The change is slightbut there. -
2 or more cascading selectonechoice in Oracle ADF 11g Rel 2
Hi,
I want to have 2 (later more) cascading (depending) selectonechoice component.
The first combobox (partners) will be filled with the result of a SQL view object (PartnerLovView) execution, this query has NO (bind) parameter and only has one primary key as id and a name column (SELECT partnerId, partnerName FROM Partner ORDER BY partnerName).
The second combobox (partner sites) has empty default value. This combobox will be filled with the result of a SQL view object (PartnerSiteLovView) execution, this query HAS a parameter (p_partnerId) and has one primary key as id, one foreign key for partner (partnerId) and a name column (SELECT partnerSiteId, partnerId, partnerSiteName FROM PartnerSite WHERE partnerId = :p_partnerId ORDER BY partnerSiteName).
I can't achieve to bind the two comboboxes. I've dropped from the AppModuleDataControl the PartnerLovView1 to the JSF page as "Single Selection --> ADF Select One Choice... and also dropped the PartnerSiteLovView1 as same (this combo depends on the first combo selected value).
In this case I get error something like: IN, OUT parameter missing, what is true because select need the parameter value. But how to bind it?
I've set the autoSubmit to true for the first combo and partialTrigger property to the first combo id of the second combo.
If a modify the (depending) second SQL and removed the paramter from base query and added a view criteria, this combo will filled but no reaction if I submit the first combo.
How and where to bind the first combo selected value to the second combo?Hi Shay,
thank You for your answer.
The first solution doesn't meet my use case: I have two (later more for addinitonal) separate queries. No join.
Second solution: can You give me some concrete source code? In the valuechangeListener I always got the label of the selected value not the real value (id). I've followed Your code with [getting value|https://blogs.oracle.com/shay/entry/getting_the_value_from_a_selec].
Later I will be use more dependent comboboxes, this combos will prefilter a tree, and the tree will prefilter a table. Please send me (throw email) your contact too, because I need somebody who can help me, and maybe I send you my project use cases.
Thanks
Bye
Maybe you are looking for
-
Absolute FASTEST way to transfer files btw 2 computers?
I've set up a network btw 2 airport-enabled laptops--one w/AirPort Extreme, the other w/old-school AirPort. It's taking about 2 hours to transfer 1.5 gb from 1 to the other, using the network... Is there a faster method than this? Thanks! David
-
How to restrict the user(Schema) from deleting the data from a table
Hi All, I have scenario here. I want to know how to restrict a user(Schema) from deleting the values from a table created in the same schema. Below is the example. I have created a table employee in abc schema which has two values. EMPLOYEE ABC XYZ I
-
Does anybody know whether it works in 10.6, either through Canon's ScanGear tool or through Apple's Image Capture?
-
I am having trouble importing photos onto my Mac book Pro from my Iphone...in the middle of the import I get a message stating that they are having trouble with one of my photos and then stops importing...want to save photos and clear the phone stora
-
Send data complext to Net Webservice
Hello, I need to send array of array to Net webservice (rest) but the webservide respond the error: {"Exception":"Object reference not set to an instance of an object.","StackTrace":" I have an sample how can I send the with PHP and works but I try t