How to dynamically load localization resource data without rebilding the application? - dynamic

I'm using localization in my Blazor Server app. I need to add key, value pairs to localization resource file programmatically. I have inputs in my UI. User will able to add key, value pairs through the application UI. But after that I need that inserted data to be available with localization(After refreshing the browser) without re-building the application. Is there a way to dynamically load .resx resource file data without rebuilding the application in Blazor Server app after it get changed while running?

If I understand your request:
You can store the resource strings to database and create a Cache to store the last updated data of resources.
It's work fine if your resource less than 4MB.

Related

How to send a content to specific users in ASP.NET Core 5

I have an ASP.NET Core 5 MVC project that I want the admin to be able to send a file to a specific person and the information in this file is formed through a form.
Suppose an academic advisor has to send a separate syllabus to each of their students, which is a photo file. I have problems for every student in all areas such as database, downloading, uploading and displaying that image. I hope I could have explained it well
Please anyone who can help me
you can use a table in your database and save address of each file for each user you want. also use GUID file name for files and if It Has secure thing you can use Webapi interface Download (disable directly download) that check permission every time api called

Adding licence field to WSO2 API in API manager

I have the need to add a licence field to the APIs published by the API manager.
It does not seems to be any extension point beyond the api.rxt file in the resource folder.
If I modify the file and run the application the carbon app correctly show the added field, but nor the publishe nor the store are able to get the field and there is no way to get it also with REST APIs since it calls a method of a class that (in later versions) outputted fields positionally.
Is it possible to add the field, without running the risk of crashing the API Manager?
Which is the correct way?
Thanks
This change cannot be done without modifying the code. When an API is created from the Publisher app, it gets stored in the registry. The api.txt you modified, only defines the structure of this stored artifact. It may add a new field to the artifact, but to correctly populate that field, you need to modify several methods in APIProviderHostObject and APIProviderImpl + several Jaggery scripts.

Sencha Touch LOcal Storage on Mobile Apps

I am planning to use Sencha Touch for an application of my company. I read that local storage stores data on client's browser. MY problem is when I build the code to native app using Sencha CMD how does the local storage work? What is the alternative of local storage to keep some data suppose user details (so that user doesn't need to login always).
Advance Thanks
localStorage
Is a very easy to use interface that works synchronous. It stores strings (you can JSON.stringify other Javascript objects) as key-value pairs and you just set the value with a key in this way:
localStorage.setItem('key', 'value');
To read:
var value = localStorage.getItem('key');
which returns value or null if key wasn't found in the storage.
You can use it as an object:
localStorage['key'] = 'value';
var value = localStorage['key'];
however, this is not the recommended approach. In this case undefined will be returned for non-existing items.
More details:
http://www.w3.org/TR/2013/PR-webstorage-20130409/
http://diveintohtml5.info/storage.html
IndexedDB
Database that sort of replaces the now deprecated Web SQL. It works asynchronous and is a bit harder to understand as it uses stores, requests and transactions to deal with the data.
You can store any kind of objects in IndexedDB (Javascript objects, Blobs (files)).
You can also request storage space. User will be alerted if you need more than 5 mb (5 mb is not defined, but seem to be the limit most browsers set before asking user for permission).
See here for details on how you can use it:
http://www.w3.org/TR/IndexedDB/
http://www.html5rocks.com/en/tutorials/indexeddb/todo/
Web SQL
Although, as mentioned, deprecated it is still supported in browsers such as Safari. Is a database that works with SQL-queries and request, and works asynchronous.
Here are more details:
http://www.w3.org/TR/webdatabase/
http://html5doctor.com/introducing-web-sql-databases/
File API
Currently only supported in Chrome. Is a virtual file-system that works asynchronous as IndexedDB but is intended for large files (video and audio files etc.) but can just as easily be used for storing other data.
You can store any kind of objects in File API as Blobs (files). As it is a virtual file system you can navigate using folders.
You can also request storage space here as well (quota).
For details:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://www.w3.org/TR/FileAPI/
And of course there is cookies and for IE UserData, but these are very limited.
This example demonstrates how to use local storage with Sencha Touch model objects:
http://www.mysamplecode.com/2012/06/sencha-touch-local-storage-example.html
If you're wanting to switch & sync data from online to offline you might also be interested in this example:
https://www.robertkehoe.com/2012/11/sencha-touch-2-localstorage-example/

Where to store data in Sencha Touch?

I have following case to handle:
My mobile application ( Sencha Touch App wrapped in native container ) has around 5000 book titles. Now, I don't want application to ping server to get these books on his mobile. Application will need to access this data during run time. So should I
a) dump the data into sqlite at the time of installation of the application ? (First time run)
b) Fetch data from files only. ( I will be making sorting and querying operations over this data - may not be a good solution if I store the entire file in an array at once and process it further )
Kindly advice.
Create a JSON API to fetch your data from a database on the server.
You can store this data in JSON file and then use JSON proxy to load/sort/query it.
BUT its better to expose a web service, just like what Diodeus said.

How to save app instance specific state

I'd like to save the user selection of a Rally artifact so that when the page is reloaded details about that artifact are displayed. There may be several instances of the app on the smae dashboard; whats the best way to uniquely identify a specific instance. I plan to use the preferences api to save the state.
If we're talking about SDK 2.0p3: Each copy of the app has a unique ID that you can use "getAppID()" to find. However, if you use the updateSettingsValues, it will save it uniquely by AppID automatically. Sadly, the updateSettingsValues is app specific only, not user or project specific.