MobileTogether Support Forum
»
Designer
»
MobileTogether Designer
»
Relative path specification not properly resolved on server
Rank: Member
Groups: Registered
Joined: 8/11/2014(UTC) Posts: 29 Thanks: 4 times
|
On the design client a global resource "MTBase" has been defined pointing to a folder on the local disk. Below there is a sub-folder with a xml file inside. This file is defined as default file for an application by specifying file as relativ to global resource, i.e. <MTBase>/<sub-folder>/<filename>. This works when simulating on design client. After deployment to server, message "Server: Cannot read file from <full design client path>. The only allowed location for reading is <server solution file path base [as specified in server settings]" Relative sub folder and file being present on the server as documented in server settings: "It is also used as the base for resolving solution's relative paths."
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
MobileTogether Server has a "Server side solution's working directory" setting. Local files can only be saved in this folder or one of its subfolders. This is basically a security feature in order to avoid overwriting of some critical files. So you must make sure to only write local files in one of these subfolders. There is no restriction when accessing files via HTTP
You can even avoid using a global resource - if you intend to use a relative file, then during design it must be located in the same folder with the MTD file or one of its subfolders and must be also addressed relatively. When deployed, MT server will use the Working Directory folder (or its subfolders) to search for corresponding files.
You can open one of the sample files delivered with MobileTogether Designer how it was done. For example, the BizBudget.mtd accesses data from SampleData/BizBudget.xml - this file is located in SampleData subfolder below the MTD file for Designer and in C:\ProgramData\Altova\MobileTogetherServer\SolutionFiles\SampleData for Server.
Let me know if something is unclear
Altova MobileTogether Experts
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/11/2014(UTC) Posts: 29 Thanks: 4 times
|
What you explain is exactly how I expect things to behave and what I want to achieve. The problem is that either designer or server do not work this way. See my first post: Server is looking for the xml file at the full designer client path, even the specification for the file has been made relatively. I had a look at the sample you mentioned: The used xml file has the "Embed xml in design" flag set. I doubt that the file is really read from the SampleData sub-directory of the solution's working directory. This doesn't matter for the sample, as the file content is constant. This, by the way, is also the only way I get my solution working from the server: I used the "Deploy file with design" flag. But for productive purpose this is not feasible, as the file content changes on a regular base. So someone whould have to manually re-deploy the solution each time the file content changes in order to make changed content visible. My original intent is to have the xml file in a sub-directory of the Solution's working directory replaced by an "external" source so the next call to my solution will pick up fresh data.
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
You are right, that BizBudget.xml is marked as embedded - I've overseen this flag. But you can uncheck the Embedded flag, and it will still work. Or you can look at the WidgetsSalesData.mtd - it uses a sample file which is not embedded and also works.
I should have been more precise in my first answer: by using a Global Resource you have made your file location absolute. It doesn't matter that you use a relative path after - MobileTogether MUST resolve Global Resources fully for them to work. In contrary, if you simply use a relative path as we do in our samples, then MobileTogether uses this special functionality to look in the folder configured on server.
If you prefer to use Global Resources - fine, but then you must provide a second configuration in your Global Resource, which you also must use when deploying MTD to the server. This second configuration must result in a folder which is located somewhere within the folder you configured on server for data access.
I perfectly understand your requirement about updating the file whenever you need, and I believe the trick with relative folders is by far the easiest way to achieve it.
Feel free to ask if you still have any questions
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/11/2014(UTC) Posts: 29 Thanks: 4 times
|
I followed your recommendation to use a path relative to the .mtd file on the design client. Now it works as desired after deployment. Additional comment: One has to type the relative path manually w/o using the file dialog(...). Otherwise again an absolute path is recorded.
Thanks for your explanation.
|
|
|
|
MobileTogether Support Forum
»
Designer
»
MobileTogether Designer
»
Relative path specification not properly resolved on server
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.