Client-side transient model for storing temporary data
We've been using the ODataModel in our UI5 application for retrieving data from Gateway and now we have a requirement to store temporary (session based) client-side data. Ideally it would be stored in such a way that it can be shared across views and controllers and can be bound from UI components via property bindings. The data in most cases will be OData entities. As an example a user would view a list of PO's (from the ODataModel) in the first view, then select a subset of POs and move onto the next view to "work" on those POs. We'd want to store this subset of POs in a client model so the second view can bind to the model and display them.
My first thought is to create another model separate from our ODataModel in which we could add transient client-side data (OData entities and custom data) and make it available to all views and controllers in the app. I realize we could probably also just store such data in global JS variables, however a client-side model seems like a cleaner approach to me.
I'd appreciate any suggestions on how this can be achieved.
Hi Derek,
why don't you just use sap.ui.core.Core.setModel? You can store multiple models and access them in your entire SAPUI5 app.
Except for SAPUI5-apps, these requirements are often realized with HTML5 Web Storage JavaScript API. As you can see in the following blog post, you can easily store even complex entities and access your items in the entire web-application: Client-side Session Management.
I can't recommend the approach with global variables. A lot of developers had negative experiences with this design pattern. At least, use namespacing techniques to store your functions and variables in one central scope. I've written a simple example on jsFiddle to show you this. As you can see, you could also handle your transient model as an additional variable of your own namespace.
Regards Michael
Similar Messages
-
What is Sharepoint client side object model ?
What is Sharepoint client side object model ?
The client-side object model (CSOM) provides client-side applications with access to a subset of the SharePoint Foundation server object model, including core objects such as site collections, sites, lists, and list items. As described in Data Access for
Client Applications, the CSOM actually consists of three distinct APIs—the ECMAScript object model, the Silverlight client object model, and the .NET managed client object model—that target distinct client platforms. The ECMAScript object model and the Silverlight
client object model provide a smaller subset of functionality. This is designed to enhance the user experience, because it minimize the time it takes Silverlight applications or JavaScript functions running in a Web page to load the files required for operation.
The .NET managed client object model provides a larger subset of functionality for standalone client applications. However, these APIs provide a broadly similar developer experience and work in a similar way.
You can write both managed client object model code and JavaScript Client Object model code in Visual Studio. As an example, you can create a console application having managed client object model code. Similarly, you may create a Visual Web Part and have
JavaScript client object model code in it. The JavaScript client object model code can also be directly written inside the SharePoint Designer as well.
Blog | SharePoint Learnings CodePlex Tools |
Export Version History To Excel |
Autocomplete Lookup Field -
Full mask permission in SharePoint using Client Side Object Model
Full mask permission in SharePoint using Client Side Object Model does not include all the base permission while it does have all base permission in server side . Is this a bug ?
Or do we have any workaround for this.
BasePermissions.Set(PermissionKind.FullMask); is not updating all the permissions.
It seems that there is some limitation with Microsoft.SharePoint.Client.dll as mentioend at below link . Do we have any workaround here.
http://break962.rssing.com/browser.php?indx=7116806&last=1&item=9
Ashish Baranwal || To know what you know and what you do not know, that is true knowledgeYou can write your own loop to upload multiple files via an individual call.
http://sharepoint.stackexchange.com/questions/108525/multiple-file-upload-with-metadata-using-rest/108532#108532
More reference: http://sharepointfieldnotes.blogspot.com/2014/04/uploading-documents-and-setting.html
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Import TermSet CSV using client side object model
Hello,
I want to import CSV in TermStore using client side object model. Unfortunately there is no ImportManager here.
Is there any other way (Other than reading from CSV and adding term one by one to term store)?
Regards, Nanddeep NachanHi,
Here is a tool(server-side) from codeplex for your reference:
SharePoint 2010 CSV Bulk Taxonomy TermSet Importer/Exporter
If you want to import termsets from CSV in Client-Side, we can refer the tool above.
You can develop a windows form application and use .Net Client Object Model to achieve it. The following articles is about how to operate the termset using Client Object Model for you reference:
http://sundarnarasiman.net/?p=87 (Download)
http://code.msdn.microsoft.com/office/SharePoint-2013-Synchronize-d40638d1/sourcecode?fileId=72317&pathId=166025385
http://www.c-sharpcorner.com/Blogs/10853/how-to-create-a-term-set-for-the-specified-group-using-clien.aspx
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
Cross Site Collection lookup using client side object model
I have to do Cross Site Collection lookup using client side object model or Odata ,
no servier side.. any ideas experts?Did you read about cross site publishing feature in SP 2013?
Check this out
http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=1038
http://blogs.technet.com/b/sharepoint_quick_reads/archive/2012/09/18/sharepoint-2013-cross-site-publishing.aspx
http://blog.helloitsliam.com/Lists/Posts/Post.aspx?ID=89
http://blogs.msdn.com/b/ritazh/archive/2012/09/26/sharepoint-2013-how-to-setup-cross-site-publishing-enable-catalog-use-managed-navigation.aspx
http://stackoverflow.com/questions/1151036/sharepoint-lookup-column-across-site-collection-boundary
You will need custom code for this, but since the amount is minimal and this is Stack Overflow I assume that won't be a problem. You will want to make your own listview web part that queries the list using ListViewByQuery. An example can be found here:
http://blogs.msdn.com/b/ramg/archive/2009/04/21/implementing-a-simple-cross-site-collection-list-view-webpart.aspx -
Copy one list items new list using client side object model
Hi,
I have a requirement like i need to copy one list information to new list with createdby and modified by fields.I need to use client side object model code.Can u please send me the code sample.
Regards,
PraveenHi,
According to your post, my understanding is that you want to copy one list items new list using client side object model.
You can use console application.
Here is a similar thread for your reference:
https://social.technet.microsoft.com/Forums/sharepoint/en-US/28a43891-7505-4d34-b513-fdd66773c2a3/copy-list-item-to-another-list-using-client-object-model-in-console-application?forum=sharepointdevelopmentprevious
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Hi,
The requirement is to create ""Document Sets in Bulk" using JSOM. I am using the following posts:-
http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1904cddb-850c-4425-8205-998bfaad07d7/create-document-set-using-ecma-script
But, when I am executing the code, I am getting error "Cannot read property 'DocumentSet' of undefined "..Please find
below my code. I am using Content editor web part and attached my JS file with that :-
<div>
<label>Enter the DocumentSet Name <input type="text" id="txtGetDocumentSetName" name="DocumentSetname"/> </label> </br>
<input type="button" id="btncreate" name="bcreateDocumentSet" value="Create Document Set" onclick="javascript:CreateDocumentSet()"/>
</div>
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"> </script>
<script type="text/javascript">
SP.SOD.executeFunc('sp.js','SP.ClientContext','SP.DocumentSet','SP.DocumentManagement.js',CreateDocumentSet);
// This function is called on click of the “Create Document Set” button.
var ctx;
var parentFolder;
var newDocSetName;
var docsetContentType;
function CreateDocumentSet() {
alert("In ClientContext");
var ctx = SP.ClientContext.get_current();
newDocSetName = $('#txtGetDocumentSetName').val();
var docSetContentTypeID = "0x0120D520";
alert("docSetContentTypeID:=" + docSetContentTypeID);
var web = ctx.get_web();
var list = web.get_lists().getByTitle('Current Documents');
ctx.load(list);
alert("List Loaded !!");
parentFolder = list.get_rootFolder();
ctx.load(parentFolder);
docsetContentType = web.get_contentTypes().getById(docSetContentTypeID);
ctx.load(docsetContentType);
alert("docsetContentType Loaded !!");
ctx.executeQueryAsync(onRequestSuccess, onRequestFail);
function onRequestSuccess() {
alert("In Success");
SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
alert('Document Set creation successful');
// This function runs if the executeQueryAsync call fails.
function onRequestFail(sender, args) {
alert("Document Set creation failed" + + args.get_message());
Please help !!
Vipul JainHello,
I have already tried your solution, however in that case I get the error - "UncaughtSys.ArgumentNullException: Sys.ArgumentNullException:
Value cannot be null.Parameter name: context"...
Also, I tried removing SP.SOD.executeFunc
from my code, but no success :(
Kindly suggest !!!
Vipul Jain -
Client side object model examples in sharepoint 2010
Hi,
I wanted to learn client side object model in share point 2010.Please provide some urls with examples.
Regards,
PraveenHi Praveen,
here is your links to start with ....explained with examples. :)
http://www.codeproject.com/Articles/399156/SharePoint-Client-Object-Model-Introduction
http://zimmergren.net/technical/sp-2010-getting-started-with-the-client-object-model-in-sharepoint-2010
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Implementation Options: Server Side Object Model & Client Side Object Model
Hi All, I'm design a custom web application and it will be deploy on SharePoint 2010/2013 (to be confirmed) server, and I found some aritical as follows:
http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspx
May I ask ask your advice for following items?
1) Is the above URL still valid? e.g. Vice Versa for SharePoint 2013?
2) Microsoft has a phase out plan for server side object model or not? (e.g. MOSS 202X)
3) For programmatcally update of SharePoint permission: should I call client-side OM instead of server-side OM even I will deploy the web application to SharePoint server?
Thank you very much.
.NET Beginner 3.5In sharepoint 2013 I don't think this link is
http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspxis reliable at all.
what is your say?
====================================================
Hi All, I'm design a custom web application and it will be deploy on SharePoint 2010/2013 (to be confirmed) server, and I found some aritical as follows:
http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspx
May I ask ask your advice for following items?
1) Is the above URL still valid? e.g. Vice Versa for SharePoint 2013?
2) Microsoft has a phase out plan for server side object model or not? (e.g. MOSS 202X)
3) For programmatcally update of SharePoint permission: should I call client-side OM instead of server-side OM even I will deploy the web application to SharePoint server?
Thank you very much.
.NET Beginner 3.5 -
Custom Client-Side Video Codec for Standard Linux Flash Player
I'm new to Flash development, so please excuse my naivete. I'd like to have the standard Linux Adobe Flash player use an experimental client-side H.264 codec I am working on when playing FLV media (even if embedded within an SWF file) instead of the standard one bundled with the player. Is there any way to accomplish that?
Thanks,
Brian McGannThe problem, at least in my case, was QtCurve's opacity. If I have opacity set to less than 100%, flash would not display for sites like Youtube and Vimeo, but worked elsewhere.
The solution for me was to go into qtcurve's settings, and put npviewer.bin in the application exceptions section for window and menu opacity. Doing that, I was able to keep my transparent menus, and also use flash everywhere.
You can find out what the application name is by launching your browser of choice in a terminal with qtcurve debug turned on, like so:
QTCURVE_DEBUG=1 firefox
If you watch through the lines that start with "QtCurve" you'll see "Application name". Look for the one that shows up when you try to load a video. In my case it was npviewer.bin. In yours, it might be nspluginviewer or something else. If you add an exception for that specific application, you'll fix your problem without having to compromise on your theme. -
Common Practice For Storing Application Data Files
During my application development targeting for XP and Linux time, I will store my application data files (Files where user may create, modify, rename, delete...) same path as my application directory. For instance, if my application is installed in :-
C:\Program Files\MyApp\MyApp.jar
All my application data files will be located in
C:\Program Files\MyApp\Config\ directory.
This works quite well until Vista introduce UAC. Vista will not allow write opration to C:\Program Files\MyApp\Config\ folder (Config folder is being created during installer execution). However, to support legacy application, Vista use a workaround (Virtualization) for application to write. For example, MyApp.jar want to perform write on
Real path :-
C:\Program Files\MyApp\Config
Vista will redirect it to :-
Virtual path
C:\Users\<account>\AppData\Local\VirtualStore\Program Files\MyApp\Config
Please refer to the links for more detail
[http://www.codeproject.com/KB/security/acl_common_data.aspx?display=Print]
[http://www.codeproject.com/KB/vista-security/MakingAppsUACAware.aspx]
However, this introduce several additional problems [http://support.microsoft.com/kb/927387]
May I know what is the common practice for storing an application data files? The below are my several thoughts
(1) Writing to
* Windows XP - %systemdrive%\Documents and Settings\All Users\Application Data
* Windows Vista - %systemdrive%\ProgramData
* Windows 2000 - %systemdrive%\Documents and Settings\All Users\Application Data
* Windows Server 2003 - %systemdrive%\Documents and Settings\All Users\Application Data
* Windows 98 - %systemdrive%\Windows\All Users\ Application Data
which we may retrieve through "CommonApplicationData", using the API function SHGetFolderPath. However, how can we do that in Java? How to make compatible with Linux?
(2) Writing to user home directory through "user.home" properties. Create a folder .MyApp and write the application data on it.
Any input and suggestion are welcomed.
Thanks!
cheok>
...I will store my application data files (Files where user may create, modify, rename, delete...) same path as my application directory. >See [Store Application Settings and Components|http://sdnshare.sun.com/view.jsp?id=2305] for code that will put the required parts in a suitable sub-dir of user.home. -
Client side system requierments for using enterprise portal??
Hi
Does anybody know if there are some official client side system requirements published for using the enterprise portal?
Also, is there any experience on client side requirements for having all features operating at a decent usability?
Regards,
NanaHi,
SUS is mostly untouched in SRM7.0 and it is still using BSP application.
Regards,
Ranjan -
Configure client side security polise for RMI
Hi all!
How to configure client side security if I want to use applet and RMI on the single
computer.
I was editing . java.policy file:
grant {
// added to allow RMI/JMS
permission java.io.SerializablePermission "enableSubstitution";
permission java.lang.RuntimePermission "setContextClassLoader";
But I have MarshalException if I want to make a call from one
Java VM to another.
Regards,
Pavel.Which version WLS are you using? In the latest versions of WLS 6.0 you need
not give these extra permissions for the applets.This is taken care in the
server itself. You can contact support for the patch.
..maruthi
"Pavel" <[email protected]> wrote in message
news:3bc7d744$[email protected]..
>
Hi all!
How to configure client side security if I want to use applet and RMI onthe single
computer.
I was editing . java.policy file:
grant {
// added to allow RMI/JMS
permission java.io.SerializablePermission "enableSubstitution";
permission java.lang.RuntimePermission "setContextClassLoader";
But I have MarshalException if I want to make a call from one
Java VM to another.
Regards,
Pavel. -
Using XSU for Storing XML data
Please how can I use the XSU API for storing XML documents in Oracle8i? I know part of the code to store a document but how do I import the XSU API?
Do I have to download it or use it via Oracle?
example:
String xmlDoc = "my_xml_document";
Connection conn = >>DriverManager.getConnection(...);
OracleXMLSave sav = new OracleXMLSave
(conn,"purchaseOrderTab");
sav.insertXML(xmlDoc);But how do I use OracleXMLSave? How do I import the XSU API?
thanks for your help
nullWhat is XSU? I think you question should be posted at the XML or XDK forum.
-
URL data type in CAML Query with Client side object model
hi,
How do I write a CAML query to filter list items based on the URL field using it's Description?
Same with REST API. How do I construct a REST query so that filter list items based on the URL data type using it's Description.Hi Cooltechie,
Thanks for posting your query, Below are the example that you can use in your CAML query
<Where><Eq><FieldRef Name="FileRef"/><Value Type="Url">sites/SiteCollection/SubSite/Site Documents/Excel Report.xls</Value></Eq></Where>
Note: Do not include the server name or beginning /.
The following examples assuming you have a list or library setup with a URL column named "My Document".
The link is to a document that is hosted on the sharepoint server (do not need server name):
<Where><Eq><FieldRef Name="My_x0020_Document"/><Value Type="URL">/sites/subsite/Site%20Documents/Excel%20Report.xls</Value></Eq></Where>
The link is an absolute URL to something not on the server... for example http://www.google.com:
<Where><Eq><FieldRef Name="My_x0020_Document"/><Value Type="URL">http://www.google.com</Value></Eq></Where>
I hope this is helpful to you, mark it as Helpful.
If this works, Please mark it as Answered.
Regards,
Dharmendra Singh (MCPD-EA | MCTS)
Blog : http://sharepoint-community.net/profile/DharmendraSingh
Maybe you are looking for
-
How can i add text in dreamweaver?
I want to add text ot my page so i can edit my page in dreamweaver. I made my layout in Photoshop no wi want to add a "text box" or anything i can add text in, On top of the layout cell. Is it possible for me to do? -Bryan
-
Hi, I am new to Java. What's the most efficient way to count the number of characters in a string. I have a string of text called MyText. I was thinking of a for loop but maybe there is better solution? Regards, Rob.
-
I try to go to itunes to see how much I m spent on itunes and app store and I can not and tries several times! I was told that they charged me wrong and I will return the money as they will do in what way? I need to know how much I have spent urgent
-
Hi, I was modifying the header of the View Responses part (In fact I deleted the header) when suddenly I saw that all my questions in the design part had disappeared. Only my questions, not the horizontal lines or whatever, just my questions. How can
-
Can I change the symbol presented for an app tab?
when you pin a "tab" to the bar, there's a symbol represented, I assume from some where on the website in question. Can I change that symbol? two of them are generic and non-informative.