Exporting plugin functions to javascript
Hi,
Does anyone know how to call a plugin menu command function when app.execMenuItem is
ignored form within an XFA click event ?
Kind regards,
EmergentTime.
All SDK calls have to be made from the same thread, the Acrobat SDK does not
support mutli-threading. If you need to trigger a call to an SDK function
from anything but the main thread, you need to create a messaging mechanism,
so that tread "x" can send a message to the main thread and have it execute
that function. Anything else will fail - as you've noticed.
Karl Heinz Kremer
PDF Acrobatics Without a Net
[email protected]
http://www.khkonsulting.com
Similar Messages
-
Call Plugin-Function with parameters via JavaScript
Hi!
I have following problem: I wrote a plugin for Illustrator CS2 in C++ and now I would like to call a function of the plugin from outside of illustrator (from a JavaScript).
This can be done with the Actionsuite. But how could I then give some parameters to my function?
For example:
In the plugin, I have a function "void myFun(char * test)" and I want to call this function in JavaScript with test="Hello World" for example.
The only possible way right now seems to write parameters into a file and open that file in the plugin to "receive" them.Hi,
Could you send your plugin coding.
Regards,
Maria -
How to get the destination path in an photoshop sdk export plugin when using a batch action?
Hello,
I've written an exporter plugin (not save-as) that exports a given file to a custom format.
I was able to open a file selector dialog and choose a path that is then transported to the saving location.
Now my problem is: Another intended use is batch exporting many files. The user records an action with the export step and then applies a batch on it.
The PS batch window allows you to select the destination to be a directory where the exporter should write the data. Fine.
Now how do I get this path? When running in batch mode the silent flag is set for my plugin so I do not spawn a file selector dialog to annoy the user.
But I am also unable to obtain the path which was selected by the user in the batch window.
The SDK automation plugin Getter has some code to retrieve the path of the file and even that fails as it cannot obtain anything.
PropertyUtils.h has some PIGetWorkPathIndex and PIGetPathName functions but I always get 0 when asking PIGetNumberPaths, and get -1 with PIGetWorkPathIndex.
I would be thankful if somebody could hint me how I can retrieve directories.
It even seems impossible for me to get the path where the file is actually saved. The filter plugin called Propertizer utilizes a function called PIGetDocumentName but this only outputs the file name, not the full path.
(Just to be sure: The file on which the tests run is already saved to disk, if that matters)
Another fun part is: When I record an export step, what is the directory I am exporting into?Ok, after lots of reading the sdk sample outbound I've realized that or plugin is broken.
When recording an action the outbound plugin stores the current path to gAliasHandle which is then recorded as a scripting parameter. Now when I execute the action I get the alias handle.
However how is this supposed to work with an export plugin and batch processing with a "destination" set to a target? Is this even possible or do I need to double click the export step in the action and "reset" the location even if that causes the entire exporter to run again? -
Play from an Export plugin?
Hi,
From a complete novice at Photoshop plugins...
I am wondering if there is any underlying reason why I can't call sPSActionControl->Play() from an Import or Export plugin.
I have a very simple import and export plugin pair to port from Windows to Mac, and both call a third Listener plugin to keep track of open images. The Windows code creates a hidden window (HWND) in the Listener and messages that from Import and Export. I was thinking that I could replace this by calling Play to send a custom event to the Listener, but can't get it to work.
In fact any call to sPSActionControl fails. [The actual failure is sSPBasic->AcquireSuite in PIUSuites.h returns error 'Parm' when called for the sPSActionControl suite. sSPBasic has been set up, looks ok and sSPBasic->AcquireSuite works when called for sPSActionDescriptor suite].
As a test (to remove other sources of error), I pasted the following lines into the PluginMain function of the History plugin in the SDK sample code and this fails in the same way:
// TEMP code to test use of SPActionControl.
SPErr error = kSPNoError;
DescriptorTypeID typeID;
error = sPSActionControl->StringIDToTypeID("Save Prestige Image dictionary", &typeID);
So I'm wondering (a) is there some underlying reason why this doesn't work, or (b) is there some extra bit of initialisation or setup I need to do before calling sPSActionControl functions?
Tearing out what little hair I have left!! Any help or suggestions most welcome.
Thanks
Terry Smyth
PS Is there another way (apart from Play) to communicate from one plugin to another?Yes, there are many reasons.
But the biggest reason is that it's an export plugin, and not an automation plugin. -
CS6 Exporter Plugin doesn't open in Premiere Elements 11 (Windows)
I want to make my (Windows) exporter-plugin compatible with Premeire Elements 11.
So far, I have been gotten my exporter-plugin to appear in Adobe Premiere Pro CS6 and Media Encoder CS6, and the plugin runs there correctly.
I then followed the directions for running Premeire CS6 to create an export a preset file (*.epr). I copied copied that exported *.epr file to "OTHERS/MyCompany/MyPreset.epr" in my Premere 11 [App installation folder]. (As well as copying the plugin-binary *.prm to Plug-ins/common
In the <Publish:Share> tab, when I use the mouse to highlight 'OTHERS', I receive an error-dialog-box :
"Premiere Elements has encountered an error.
[..\..\Src\Exporter_Accessors.cpp-213]" [Continue]
After I click continue, I don't get the dialog-box for my exporter-plugin. In the <Publish:Share> tab, I now see the warning-triangle and some text next to it: "Export Settings Invalid"Hmm, I forgot about using Visual Studio's debugger. After some debugging, the error was triggered the first time the SDK_Exporter plugin called anything involving the <exportParamSuite>.
After a little more digging, I found that Adobe Premiere Elements 11 doesn't support the latest version of the exportParamSuite (kPrSDKExportParamSuiteVersion4).
In the CS6 SDK sample project SDK_Exporter, the function exSDKBeginInstance() grabs all of the suiteAPIs. The following call fails:
spError = spBasic->AcquireSuite(
kPrSDKExportParamSuite,
kPrSDKExportParamSuiteVersion, // CS6 supports v4, but crashes in Premiere Elements 11
const_cast<const void**>(reinterpret_cast<void**>(&(mySettings->exportParamSuite))));
The original-call returns an spError code of <kSPSuiteNotFoundError>, which is actually misleading. I changed the version-argument to v3, and the error-call went away.
spError = spBasic->AcquireSuite(
kPrSDKExportParamSuite,
kPrSDKMemoryManagerSuiteVersion3, // compatible with Premiere Elements 11
const_cast<const void**>(reinterpret_cast<void**>(&(mySettings->exportParamSuite))));
so it looks like Premiere Pro CS6 SDK's sample SDK_Exporter project requires a few tweaks to run with Premiere elements 11. -
Export plugin on Macintosh not honoring LrTasks.startAsyncTask ?
Hi -- I need some help again!
I'm writing an export plugin for my own application.
On Windows, everything works as expected -- I can start the export and then go back to doing other tasks in Lightroom while my application does its own thing.
But on Macintosh, Lightroom hangs with the rotating "busy" icon until my application quits.
I am baffled by this behavior because I think I've wrapped everything I'm doing in calls to LrTasks.startAsyncTask.
Apparently I'm missing something about how asynchronous tasks work in Lightroom, or at least in Lightroom on Macintosh.
Do you have any suggestions about how I can get the Mac version to keep Lightroom responsive while my exported-to application does its thing?
Thanks!
--Rik
For further information...
Mac OS X 10.9, Lightroom 4.2
Here is the current structure of my ExportToMA.lua file
local myLogger = LrLogger("myLogger")
myLogger:enable("logfile")
ExportToMA = {}
ExportToMA.outputToLog = function(param)
myLogger:trace(param)
end
LrTasks.startAsyncTask( function()
myLogger:trace("Entering outer LrTasks.startAsyncTask function")
LrTasks.startAsyncTask( function()
myLogger:trace("Entering inner LrTasks.startAsyncTask function")
local activeCatalog = LrApplication.activeCatalog()
local frameSet = activeCatalog.targetPhotos
local exportSession = LrExportSession( {
exportSettings = {
LR_exportServiceProvider = "net.mydomain.MAloader",
LR_exportServiceProviderTitle = "My Application",
LR_format = "TIFF",
LR_tiff_compressionMethod = "compressionMethod_None",
LR_export_bitDepth = 16,
LR_export_colorSpace = "sRGB",
LR_minimizeEmbeddedMetadata = false
photosToExport = frameSet,
myLogger:trace("Before doExportOnCurrentTask()")
exportSession:doExportOnCurrentTask()
myLogger:trace("After doExportOnCurrentTask()")
myLogger:trace("Exiting inner LrTasks.startAsyncTask function")
end )
myLogger:trace("Exiting outer LrTasks.startAsyncTask function")
end )
When run on Windows, the log file contains a sequence of messages like this:
12/30/2013 10:36:48 TRACE Entering outer LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE Exiting outer LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE Entering inner LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE Before doExportOnCurrentTask()
12/30/2013 10:36:49 TRACE After doExportOnCurrentTask()
12/30/2013 10:36:49 TRACE Exiting inner LrTasks.startAsyncTask function
<meanwhile my application continues to run while Lightroom stays responsive>
But when run on Macintosh, this is what happens:
2013-12-30 19:01:50 +0000, TRACE Entering outer LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE Exiting outer LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE Entering inner LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE Before doExportOnCurrentTask()
<indefinitely long pause while my application runs>
2013-12-30 19:02:44 +0000, TRACE After doExportOnCurrentTask()
2013-12-30 19:02:44 +0000, TRACE Exiting inner LrTasks.startAsyncTask function
Ideas?> I'm confused by your application: if you already have a renditions loop, then why are you starting another export
I apologize for the confusion.
In each case I've exercised, there is only one export and one renditions loop.
The code I've been showing you is what gets executed to service a menu entry in File > Plug-In Extras. I'm focusing attention on that case because it seems more transparent. Notably, I get to specify which task the export happens on.
The renditions loop in my processRenderedPhotos function is in another script. The renditions loop gets called in two places: 1) from File > Plug-In Extras via the explicit doExportOnCurrentTask (now doExportOnNewTask), and 2) from Lightroom's internal processing of File > Export... and File > Export with Preset.
> did you try doExportOnNewTask?
I tried it just now. It did not change the behavior.
I also added some more diagnostics. Here is what happens on the Mac:
2013-12-31 01:09:31 +0000, TRACE Entering outer LrTasks.startAsyncTask function
2013-12-31 01:09:31 +0000, TRACE Exiting outer LrTasks.startAsyncTask function
2013-12-31 01:09:31 +0000, TRACE Entering inner LrTasks.startAsyncTask function
2013-12-31 01:09:31 +0000, TRACE Before doExportOnNewTask()
2013-12-31 01:09:31 +0000, TRACE After doExportOnNewTask()
2013-12-31 01:09:31 +0000, TRACE Exiting inner LrTasks.startAsyncTask function
2013-12-31 01:09:31 +0000, TRACE MyApplicationUploadTask.processRenderedPhotos prefs.maPath: /Users/myaccount/Desktop/MyApplication.app/Contents/MacOS/JavaApplicationStub
2013-12-31 01:09:31 +0000, TRACE tempPath: /var/folders/4n/2lxf6v593x5_c3lmx_jghgnw0000gn/T/temp_lre_ma_1230170931
2013-12-31 01:09:31 +0000, TRACE nPhotos = 2
2013-12-31 01:09:32 +0000, TRACE source path/Users/myaccount/Desktop/jpeg-8d/testorig.jpg
2013-12-31 01:09:32 +0000, TRACE destination path: /var/folders/4n/2lxf6v593x5_c3lmx_jghgnw0000gn/T/6F05FC8E-126C-47E0-AD51-C545CE0DA66D/tes torig.tif
2013-12-31 01:09:32 +0000, TRACE source path/Users/myaccount/Desktop/jpeg-8d/testprog.jpg
2013-12-31 01:09:32 +0000, TRACE destination path: /var/folders/4n/2lxf6v593x5_c3lmx_jghgnw0000gn/T/6F05FC8E-126C-47E0-AD51-C545CE0DA66D/tes tprog.tif
2013-12-31 01:09:32 +0000, TRACE just before LrShell.openFilesInApp
<long pause here, while I let my application run for a while>
2013-12-31 01:10:00 +0000, TRACE just after LrShell.openFilesInApp
The LrShell.openFilesInApp call happens after my renditions loop, at the very bottom of my processRenderedPhotos function, which is now separated by 3 levels of asynchronous tasks from whatever task initially serviced the menu entry.
Nonetheless, on Macintosh only, as soon as LrShell.openFilesInApp is called, Lightroom comes to a grinding halt heralded by a spinning beach ball.
It's as if, deep under the covers, LrShell.openFilesInApp (on Macintosh only!) is telling the rest of Lightroom to wait until the spawned application terminates.
I know, it sounds crazy to me too, and I've been programming for close to 45 years.
At the moment, the only way I see to work around this problem is to provide a separate "application" that is actually a spawn-and-terminate, so that LrShell.openFilesInApp will see a rapid termination of the thing that it launches. That seems like a lot of trouble for what I've been hoping is a simple misunderstanding on my part.
The one thing I can see different between my app and anybody else's is that mine is written in Java, so the thing that gets launched by LrShell.openFilesInApp is the JavaApplicationStub.
Any other ideas?
--Rik
PS.
> Do you have this problem with hard drive export too?
I doubt it, but I don't know for sure. On my test Mac, at the moment, there are not enough files to keep hard drive export running long enough to notice. -
Premiere Export Plugin Migration
A few years back my current company created an export plugin on Premiere Elements 7 that brings up its own complex UI for creating video content for our Simulation Product. We have a need to move forward to the latest version of Premiere Element which is now 11. And it seems that somewhere around 9 the export went away and has been replaced with the Share window. From what I can gather you can create export plugins for the share window, but you provide a set of parameters to Premiere which it then uses to build a UI. This is not going to work for our particular application, is there a way to migrate our existing plugin to the new SDK that we can still launch our own UI?
Zac,
Thanks for the quick response. In looking at the new SDK it looks like the exportcontroller example is closer to what we need, at least in that it provides access to the ecStdParms struct which has a pointer to the piSuitesPtr. We use many of the functions on this object to get infromation about the video. Is it possible to get this piSuitesPtr from the "ex" interface? I haven't been able to find access to that. Are ExportController plugins also accessible thru the Publish+Share menu? -
Getting Error while calling Flex function from JavaScript
Hi,
I have an aspx page, which shows charts as per dropdown selection,
I am using flex charts for flex.In aspx page, i am calling an mxml function using javascript.below is the code for javascript in aspx.
Javascript code in aspx page:
<script type="text/javascript">
function callApp(formid) {
try {
var objectChart = document.getElementById("statisticsChart");
alert(objectChart.id);
objectChart.myFlexFunction(formid,get('<%=HiddenDashboardWS.ClientID %>').value);
catch (e) {
alert(e.message);
function getDropDownListvalue() {
var IndexValue = $get('<%=FormDropDownList.ClientID %>').selectedIndex;
var SelectedVal = $get('<%=FormDropDownList.ClientID %>').options[IndexValue].value;
// alert(SelectedVal);
callApp(SelectedVal);
</script>
Html code where dropdown control is placed
<asp:DropDownList CssClass="combo" ID="FormDropDownList" runat="server" AutoPostBack="false"></asp:DropDownList>
<object id="statisticsChart" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
height="220" width="680">
<param name="src" value="../swf/DashboardStatisticChart.swf" />
<param name="flashVars" value="" />
<embed name="statisticsChart" src="../swf/DashboardStatisticChart.swf" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="220" width="680" flashvars=""></embed>
</object>
Mxml code:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="white" creationComplete="initApp();" >
<mx:script>
public function initApp():void {
ExternalInterface.addCallback("myFlexFunction",myFunc);
public function myFunc(s:String,wsurl:String):void {
Formid.text = s;
webService.wsdl = wsurl;
Alert.show("webservice");
//Getdata calls webservice and gets xml data
GetData();
//showchart() will draw chart
ShowChart();
</mx:script>
</mx:Application>
Above code works perfect in ie, but in firefox, it gives An error saying “chartObject.MyFlexFunction is not a function”.
I am getting the object in javascript in all the browsers, but not the functions!
Does anyone has worked with this?
Any help will be highly appreciated.
Regards,
Nirav PatelFound the solution from here... http://74.125.153.132/search?q=cache:4BC9BY04B5EJ:livedocs.adobe.com/flash/8/main/00002201 .html+externalinterface.addcallback+not+working&cd=1&hl=en&ct=clnk&gl=in
Hope it will help others...
Regards, -
Error in import/export of functions - for the apex team
After exporting functions, the import gives an error.
Reason :
the export generates a script with
function \
function
importing this script gives an error because only the first function is imported. or the functions seems to be togheter one function
the export should generate
function
function
LeoLeo - I logged into your workspace and exported the functions. The generated script looks perfectly good. I then uploaded that file into my own workspace and ran the script. The functions were all created as separate functions.
There must be something happening at your end causing newline characters in the file to be lost or something. Or maybe I didn't follow exactly the steps you did.
BTW, when you mentioned the "\" character in your original post, I assumed you meant the "/" character.
Scott -
How to use Search plugin functions in your plugin?
Hi,
I am developing a plugin which need to add an action for bookmarks. For this I need to search a particular word in the document and the corresponding page number.
On going through the SDK documentation I came across the Search plugin. There are ways in which your plugin can communicate with the Search plugin. For doing so you need to do the following:
1. Add HFT of the Search plugin by registering PluginImportReplaceAndRegister.
2. Add "SrchClls.h" header file.
I did the following steps and my plugin compiled successfully. But I am not able to understand how will I use the Serach plugin functions to find a word in the document from my plugin?
Please help.
ThanksThe HTML help is spectacularly unhelpful, sometimes giving dozens of unrelated methods when you try to read the section for Search. But try Search... http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/API_References/Acrobat_API_Ref erence/AV_Layer/Search.html
It's worth making sure that you understand the difference between "Search" and "Find" functionality in Acrobat, something rather masked in the UI in recent releases.
Find - looking for a string in the current document. The Search API has no connection to this.
Search - managing indexes of multiple documents. API provides limited functionality (create/delete/query/search). Search results are not available to the API, they can only be displayed in the UI as a results window. -
Any Flickr Export plugin available for Aperture 3?
I was happy to see Flickr included in Aperture 3, but to say the least, it really *****.
The worst thing is that it applies my own keywords to all the uploaded images. I don't want the (full) names of peoples in my pictures to display at Flickr and having my local-language keywords on my images probably doesn't help Flickr where most users are speaking english (compared to my local language).
Basically I wish the Flickr export feature would allow me to either "not sync keywords" or modify my keywords to determine if I want them exported or not - like Lightroom does.Thanks for the warning Martin. I already know from iPhoto's flickr export that you gotta be careful. I guess the iPhoto/Aperture flickr export is great for those wanting REAL simplicity, but if you want to adjust just one or two settings, it's a no-go and it kinda *****
I hope there's an AP3 flickr export plugin out there? I would be willing to spend $10 on it. -
Cannot call AS3 Function from JavaScript
Hi,
I am trying to call an ActionScript 3 function with JavaScript. The problem I cannot seem to get any of the browsers to trigger this AS3 function. The debuggers say that the function is undefined when I call it on the flash object.
What is supposed to happen is - the javascript function calls the AS3 function, and passes it an integer value. That integer is then used to pull one of 20 swfs, and load that into the flash movie.
Please let me know if you guys can think of anything that I can do to make this work! I've been stuck for hours, and can't seem to make it happen.
Here is my actionScript:
import flash.net.URLRequest;
import flash.display.Loader;
import flash.external.ExternalInterface;
var movies:Array = ["idle-ok.swf", "idle-good.swf"];
// It first loads this "hello swf".
var helloLoader:Loader = new Loader();
var helloURL:URLRequest = new URLRequest("idleAvatar.swf");
helloLoader.load(helloURL);
addChild(helloLoader);
var setAvatar:Function = loadAvatar;
ExternalInterface.addCallback("callSetAvatar", setAvatar);
// Then, this function should be called by JavaScript to load one of the other swfs.
function loadAvatar(indx:Number){
var url:URLRequest = new URLRequest(movies[0]);
var ldr:Loader = new Loader();
ldr.load(url);
addChild(ldr);
Here is my JavaScript:
<script type="text/javascript">
function callExternalInterface(val) {
document.getElementById("loader").callSetValue(val);
</script>
Here is my embed code:
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="350" id="loader" name="loader">
<param name="movie" value="loader.swf" />
<param name="allowscriptaccess" value="always" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="loader.swf" width="250" height="350">
<param name="allowscriptaccess" value="always" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<a href="#" onClick="callExternalInterface(1)">CLICK</a>You don't appear to be calling any function in your actionscript. The names between and within do not agree.
document.getElementById("loader").callSetValue(val);
should be calling a function identified with the string "callSetValue" in your actionscript, but you only have a function identified with "callSetAvatar" and the function associated with that on your AS3 side is specified to be setAvatar...
ExternalInterface.addCallback("callSetAvatar", setAvatar);
but you do not have a function named setAvatar, you have one named loadAvatar
Here's a link to a tutorial that might help you to see how the functions are specified between javascript and actionscript using the ExternalInterface class. It gets confusing so I suggest you copy the code to a word processing file so you can clearly highlight where they have the same language between them.
http://viget.com/inspire/bi-directional-actionscript-javascript-communication -
Problem with confirm() function in javascript
Hi All,
When we use confirm() function in javascript, it displays message with two options Ok or Cancel.
Is it possible to change the Ok, Cancel buttons as Yes,No or Accept,Reject.
Is there any other way to implement it.
Thanks in advance,
MahaHi,
We don't have any provision to have Yes,No or Accept,reject button in javascript confirm() function. You can preprare your own popup window and acheive the same thing.
Regards,
Sudheer -
Hi,
because of some security reasons, there is a need to disable export connections functionality in SQL developer.
Is it possible to do this somehow?
Many thanks,
DejanNot that I know of.
Even if we did, they are still stored in a file that most of your users would be able to access.
You can however disable the ability to save passwords.
And exporting connections now do not include passwords by default, although you can include them if you supply an additional password. -
How to call java function in javascript
Hello Everyone,
Can anyone tell me solution that:
How to call java function in javascript?
Thanks,
VIDsYou can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want.
Maybe you are looking for
-
Stupid slow lag with iTunes 11 on Windows7
Before I mention anything else: - Running on Windows 7 64-bit with a 1.3GHz processor. My baby's getting old, but my only problems besides iTunes 11 in the past year was some lag playing Skyrim. - My iTunes library is tiny. We're talking less than 25
-
PSC 1510 always prints test page on startup; settings menu no help
Hi, My HP PSC 1510 All-in-one printer always prints a test page when I start it up, wasting ink and paper. I tried two things, neither of which solved the problem: - Checking the settings, services, and every other menu I could find for any related o
-
I have an .mpg movie I made several years ago on a PC. However, I cannot get it to open on my mac or under Windows (on Fusion). I get an error n Quicktime that says it is not a file format that it understands. I cannot open it in FlipforMac or in iMo
-
Where do I find photoshop cs3 full program to download on a second computer?
Where do I find photoshop cs3 full program to download on a second computer?
-
How to read resource file under the WEB-INF through ClassPathResource
I have an xml file under the directory WEB-INF but WEB-INF/classes, I want to read it through ClassPathResource class from Spring, and where I read this xml file is not in a Servlet class, how can I do? Thank you.