Messaging Setup


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I will need to export the XML, right?  Then, I will need to copy that XML into the solution, into the folder where I placed these XML files which are now embedded.  Is that the proper procedure?

You got it Wink

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Thanks Trent!  I do try to stay away from GACness. Blink  Nevertheless, it is working.  How nice it is, too! BigGrin

One thing I'd like to verify...if I open the Messaging Editor and add/change a message item, I will need to export the XML, right?  Then, I will need to copy that XML into the solution, into the folder where I placed these XML files which are now embedded.  Is that the proper procedure?

Bill

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Bill,

There are basically 3 ways to include message files.  You can pull the localization files from an XML file that is stored externally (this will require that you set the path on the MicroFour.StrataFrame.UI.Localization.MessageXMLPath), pull from a SQL Server (again more settings in the same namespace...you can find this in the docs), and then what you are trying to do here, embedded XML files.  Just for the record, the latter is the best way as this will be embedded in the EXE and be the fastest in retrieval of the localization messages.  SF will automatically try to load any embedded localization file when the assembly loads.  Just be sure to select the XML file and set it to embedded.  This is the most common mistake made.  Past that, compile and run and you should be good to go. 

If you are storing your assemblies in the GAC, then the VS sometimes requires that you run the project twice before it runs your new assembly (and sometimes when it is not in the GAC :heheSmile.  The reason for this is that when you are in your project working, the assemblies are loaded into the AppDomain for the VS environment so that the type editors and design environment can reference those assemblies.  So when you run, sometimes those initial assemblies are still loaded and get reset the first run and the are active on the second.  Confusing I know....bottom line...in a scenario like this, if it doesn't work the first time, get out and then run it again.  That will ensure that the assemblies are reloaded into the AppDomain.  If it doesn't work the second time, then you have a problem.  Hope that makes sense.

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Not sure how, but it is working.  I changed the init code to this:

MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML;
MicroFour.StrataFrame.UI.
Localization.MessageLocaleID = 1033;

I re-exported the XML files and copied them back into the solution (note: I did check the 'include common resposity' option).

F5...and it works! w00t w00t

I wish I had this one in my head, but perhaps it will sink in over time! Wink

Thanks,
Bill


Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
When a user clicks my delete button on the toolstrip, the code rips away the record and refreshes the listview.  All is well.

Then, I thought, what if the user picks the wrong item (not that users do that, of course)?  I should pop up a message window asking them if that is really what they want to do...typical delete confirmation stuff.  Here is where I thought would be a great place to implement SF messaging.  So, I went about reading the docs, setting up a project and creating my first message.  It was all very easy and straightforward.  The XML would be placed into the root of my comp and I told the application via the Solution Preferences to use the new localization project.  I called the key from the code that deletes my item, like this:

MessageFunctionType mt = MessageForm.ShowMessageByKey("DeleteConfirmation", mSalesOrderDetails.itemnum);
if (mt == MessageFunctionType.Yes)
{
    ...my delete code stuff

}

F5.

Crash!

The specified key [DeleteConfirmation] was not found within the messaging database.
The file [Message_Languages.xml] could not be found.  The localization languages table could not be loaded.

So, back to the drawing board.

I re-read the docs and ran into the concept of using embedded XML files.  So I walked through that simple procedure as outlined in the docs and hit F5, again.

Same error.

I re-re-read the docs and saw that I maybe missed a step...setting the locale ID.  I went through this and got confused, so I doubt that this is setup correctly, because I am getting the same error.  Here is the stuff from the InitApplication method that is pertinent:

MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML;
MicroFour.StrataFrame.UI.
Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage();

I left the GetActiveLanguage method with no parameters since the default is fine. 

What did I forget to do?  How do I get the messaging setup correctly to utilize these embedded XML files?

Thanks,
Bill


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search