Embedable Widgets in ASP.Net application - javascript

We have a existing ASP.Net webforms application which is used by a lot of external clients.
eg: property.onesite.realpage.com\ol2\?s=1008641. Select a apartment type and click search.
I have been tasked with creating html, css, javascript widgets of certain core functionality(eg: Search apartments and show apartment results in the example above) so
a. external clients can host it in their applications like this on thier html page.
<DIV id="searchwidget">
<script src="http://property.onesite.realpage.com/widgets/search.js"/>
</DIV>
b. We can embed the same widgets into our new internal applications. We are planning to build a new ASP.Net MVC application for this.
c. Embed the same widgets into our old ASP.Net webforms applications.
How do we take care of communication(passing request data) between
a. different widgets,
b. widgets and the container application
How do we store the state of the widgets? I am sure I have other questions but I am not sure if I am asking the questions that I need to ask.

You can have a look at how other Shared scripts work. For e.g Google Maps, there is always a unique key appended in the query string. this key can be used to identify the client.
I created one which involved showing customized weather conditions. I implemented token based request using Jquery and rest based WCF services.

Related

How can I manage the customization of a basic company product using angular?

I need to simulate something similar to what I did for NestJS to customize a basic product for a specific customer.
For the backend, written in NestJS, I developed a feature that gets all modules inside a folder called "Plugin" and loads them inside the whole application at startup.
This is because my company sells basic software to N customers, but some of these customers may need more functionalities/customizations.
So at the moment I can provide more controllers/services by adding a folder inside the Plugin folder of my backend server.
By doing so I can have a unique repository of the backend where I can continue providing basic modules updates (the ones that every customer have).
The plugins are in a separate repositories.
Now I need to do the same thing for the frontends, so provide custom pages/components/navigation.
For the navigation it's not a problem, at frontend first load I can ask a JSON that tells me how to build/which elements are present inside the navigation sidebar.
But how can I provide the custom page (so HTML, TS, SCSS) connected to a menu item of the sidebar?

How to tell if a website is static or dynamic?

My prof said that dynamic pages get created by the computer, while static pages are created by the user.
Thank you so much!
The difference between static pages and dynamic pages.
a static page has a generic URL suffix, such as .htm, .html, .shtml, and does not contain "?";
Websites using dynamic page skills can perform more functions such as user registration, login, online survey, user management, order management, etc.;
Application and web languages:
Static web pages: HTML, JavaScript, CSS, etc.
Dynamic Web Pages: PHP, CGI, AJAX, ASP, ASP.NET, etc.
Dynamic web pages are used where information changes frequently, such as stock prices, weather information, news and sports news.
Static web pages have fixed content, while dynamic web pages can have changing content.
Static web pages must be modified manually, while changes to a dynamic page can be loaded through an application whose resources are stored in a database.
Static web pages only use a web server, while dynamic web pages use a web server, an application server, and a database.
Regarding: "How to tell if a website is static or dynamic?"
Static websites are simple web pages (typically written in languages like JavaScript, HTML, CSS, etc.) and stored in a web server. In the case of static web pages, as soon as a server receives a request for a page, it immediately sends a response to the client with no additional processing. Users will always view the same content regardless of their location, device type, and web browser.
In static websites, the displayed content remains the same unless someone manually edits the HTML source code on every page that’s part of the website. These pages contain no alterations based on any user input. Hence the name- static web pages. You don't necessarily need any prior experience with database design and web programming to create and maintain a static website. As long as they don't change when we update them, the code for static web pages stays the same.
On the other hand, Dynamic web pages have greater complexity than static ones because they display different content for each user while retaining the same layout and design. A dynamic website generates web pages in real-time. The flexible nature of the content allows for customization based on the requests from the user or the browser used by them. Such pages are usually written in languages like CGI, AJAX, ASP or ASP.NET, and they usually take more time to load than static web pages. They are frequently implemented to show information that changes frequently, e.g., weather updates, stock prices, etc.
Server-side code used to construct a dynamic web page can generate real-time HTML pages for each request from an individual user. While static websites are mostly informational, dynamic websites contain interactive, continually changing elements. In order to provide an interactive website experience for visitors, web developers usually combine both client-side and server-side programming techniques.
Dynamic web pages usually contain application programs for various services and require server-side resources like databases. A dynamic website accesses content from a CMS (Content Management System), which means that the website reflects any changes made in the database content. These sites use client-side scripting, server-side scripting, or both for generating content. Separating the site’s design from its content makes it easier for web designers to create pages without having to worry about formatting issues. After uploading content into the database, websites retrieve their content from there when responding to user requests.
Now, regarding "Would www.tagpro.gg (the homepage) be static or dynamic?"
I have visited the homepage and it is a dynamic webpage actually as you mentioned.
My prof said that dynamic pages get created by the computer, while static pages are created by the user.
Well, actually also static pages can be generated by the computer, since there are a lot of static sites generators out there. Take for example https://astro.build or https://gohugo.io
Would www.tagpro.gg be static or dynamic?
You are right, it is dynamic, since you can see a login/sign-up feature on the page. That's nothing you can achieve with a 100% static site.
Its very simple... Only major two factors matter -
A static website does not have artificial intelligence means it cannot add something automatically the user has to type the code for that is he wants to do so but a dynamic website can do it on its own.
A static website cannot store a information means it only includes frontend no backend no php, node.js or something like that. In simpler words if user signin to your website you would not able to store his username and password.

Wrap javascript API?

We are looking for your input regarding architectural design of a Javascript API and a .Net (Rest) API.
Background
We are building an enterprise solution with several different channels (Site, App etc) that are consuming data through a service layer, or API. The API is on one hand a .Net WebAPI that are communicating with the business layer but we are also thinking of wrapping external Javascript services (Communication with Google Maps, Google Analytics, Social Login etc) in some sort of API, or maybe SDK. The idea is to have the possibility to quick change components in the Javascript Library (Replace Social Login Provider with someone else).
What is your ideas regarding the Javascript? Should that just be a SDK that wraps other libraries?
Thank you,
Robert
I think it will depend on how much control you want to give to your client side development groups. If the UI development group is faster (and on different release schedules) than the group that manages this SDK, then the SDK will just get in the way (unless they are in lock step with the UI group). It would be better to just give them access to the server side APIs then let me compose the page as they see fit.

How to use SP2013 REST API on public-facing ASP.NET site using JavaScript/JQuery?

I have a public-facing ASP.NET site that does not have any authentication/authorization. It is strictly an external site that has information for anonymous users. I am trying to call list/library data in a secured SP2013 site and render the list/library items on the ASP.NET site. The SP2013 web app is on the same server and domain as the ASP.NET site, and both sites are running under the same IIS instance.
From what I understand, I have to use the cross-domain library to do this, since my desire is to use client-side code (i.e. JavaScript/JQuery) using an anonymous user. I recognize that using the server-side object model is another approach, and I am leveraging C# for certain functionality. Anyway, I'm having trouble where SP.RequestExecutor is saying I don't have an App Web URL defined. I'm struggling to find documentation on how to set that up. And the challenge also being that I really don't want to have appweburl and hosturl in the query string (if possible). If there is another way to do this, I'm def open to it. I just really want to leverage the REST API and execute the JS code using a service account (in theory).
You are taking the correct approach using client side code however there are some additional steps required because of SharePoint 2013's security model. What you are creating is viewed by SharePoint as an externally hosted SharePoint app. Your application cannot authenticate to SharePoint 2013 anonymously; it must have an identity that SharePoint can assign permissions to.
To access any list within the "secured SP2013 site" your code will have to provision an app (which will reside at an App URL) to with which SharePoint can exchange security tokens. You have the option of using Azure as an access control provider or creating a STS trust with your application. Once it is set up, the app will have to be granted permissions it requires (in this case read access to the list) by the person who installs it to SharePoint and it can only be installed by someone who possesses at least the permission level on that list that the app requires.
For a step-by-step walkthrough on the security model I recommend Scott Hillier's book on SharePoint 2013 app development Microsoft SharePoint 2013 App Development (Developer Reference).

Managing context in a JavaScript application

I am developing a mobile application with the Dojo Toolkit. To give you an understanding of my problem, consider the following application flow:
The start view of the mobile application is a list of entries that represent database instances that are monitored by the application. The user has to select a list entry to get to the views which show all monitored data related to the selected database instance. The application has many views, all of which show some monitoring data. My problem is that I do not know how to let all the views know, which database is selected to retrieve appropriate data from the server.
What would be a good solution for this problem that works well with the MVC pattern? Are there any design patterns that can applied?
If you're looking to manage a single db instance at a time and it effectively represents a resource within your application then you can add it to the URL (in the hash fragment) and then use a Dojo Router to configure the object in a place that can be retrieved by the views (using some form of registry or right from the URL depending on what you're doing). It sounds as though any design patterns to note would be in creating consistent interfaces to your database connections if needed (Adapter), but the actual connection tracking should be able to be handled simply by what you're viewing as your Controller.

Categories

Resources