How To Pass Data From Database Apps To Theme App Extensions Without Metafield? - node.js

I am trying to figure out how to pass data between database apps to theme app extensions. In backend, Merchant can create, edit and delete data and it will update database. I also try using Metafield in Product, but when I want to assign metafield to multiple products, it take too much time to save metafield in every product.
How can I pass data from Database to Theme App Extension to update latest data to display on Online Store?
My theme app extension as below:
(https://i.stack.imgur.com/aQ4CD.png)
https://i.stack.imgur.com/UJ8De.png

You have two choices. One, the obvious one, is using Liquid, and rendering your custom data using Liquid, which implies, Metafields. You say that takes too much time, but the reality is, that is by far the best way.
Your second option is to use an App Proxy. It is slower, and prone to network problems obviously, but it does allow your extension to access data from the App's database.
Hope that helps.

Related

Rewriting a NodeJS Website using Oracle APEX

My company is upgrading our database hardware to facilitate a data process that potentially may not work (... long story) and in order to somewhat justify the purchase in case the data process does not work, the idea has been floated around of rewriting the site using Oracle APEX. I am wondering about the limitations of APEX and have been unable to find a solution to a few questions.
I currently have a fairly complex, dynamic ecommerce website written in NodeJS and ExpressJS using EJS for templating. There is a lot of logic done inside the .ejs files and the partial templates themselves are re-used in various places throughout the site. We are using ORDS calls from the Node server to retreive data from the database.
I am mainly curious about how one would go about implementing something similar to EJS partial views in APEX. I am pretty new to APEX (2-3 months working on another application) so I haven't gotten too in depth into the way templates are used, past the normal #REGION_01# substitution of simple elements.
I am assuming that most of the logic (deciding whether to show element A or element B based on a value from the database record of the product) would be done in PL/SQL or in a separate JS file.
Is something like the following possible?
A template containing a "Add To Cart" Button, MSRP, Sale Price, and a (HTML) table displaying possible discounts based on the quantity purchased
A template containing product information, like the product ID, name, manufacturer, and a small description of the product
A template combining the previous 2 options and a picture of the product into a row that can be re-used across the site
If someone has experience with this sort of thing, or could point me towards some good reference material on a similar topic, I would appreciate it.
I've been working with Oracle APEX for a while, specially in the front-end department because it does lack a bit in regards templates.
To answer your question. It depends on what you mean by template
If templates are the apex template objects
You can create and customize templates on Shared Components -> Templates. I'm almost sure you need to create new stuff or duplicate because the vanilla ones are locked.
Another option is to create plugins for you app which will function similarly and can be exported/shared with other projects and people.
If Template is just a page that you will keep changing the record displayed
Sure, you can create many things using the a blank page and adding the components. I've on teams developing ERPs, Mobile Apps, Stock Integration with Marketplaces (needed some Java, though) and several custom made Application that are not available out-of-the-box.

How to build vue views from within electron apps to mount as plugins

I am writing a reporting app that runs in electron. Reporting means I have a data source and users write views that arrange the data in whichever ways they like so it can be printed out or archived as PDF.
Let's say there is a list of student data along with grades for courses. The reporing app allows you to create a report that has a data table with names and grades for each course. So you end up with grade reports. Someone else wants just names and addresses another one wants to create a library card for each student. HTML and CSS combined with Vue make a great foundation to write this stuff.
The easy part is to fetch data from the database and offer json as a data source to views. The difficult part is how to let users add their reports to the app. In dev mode I can just add views to directories, import them and render the data as part of the app. But I have my views available at build time. Once I have built and shipped the production app it's out of my hands and the user can't add their views to the app anymore because they don't rebuild the app. They just want to point to a directory, add their views and use them.
I have decided to use single file components because they allow users to simply add calculations and maybe use pug etc to keep it simple. Besides I can store data about the component in a straight forward way (like name of report, department etc)
To my knowledge I need to build those views programmatically and load them dynamically.
So my questions are:
How can I build and mount single file components (.vue) dynamically
from within a production app that has no prior knowledge of user
produced files?
Do I need to build these components or is there a way to utilize on board tools to just read and render these components?
Is there a better way to serve these files?
More information:
Security is not a concern. So loading user created views is ok. It needs to be working in electron. I do have a server based app written in Ruby that does the same thing but the server is going away anytime soon so it has to be client based and executable. I cannot install node on client PCs so they could just build their own app and include their own views via hot reloading.
If you're interested in reporting apps there is one in JS but server based: https://jsreport.net/ or mine, ruby based: https://github.com/hmt/sahib
You could watch the directory and respond to new files being add. That's for the dynamic part of your question. A nice way is node-fs.
Using the same lib you can serialize and deserialize object to or from file, letting you load the file from your user.
At this point, you only need to be able to change back and forth from an object to a Vue component. As far As I know, this is no problem as you can
new Vue (object)

SharePoint and DataBase Design

I don't know about SharePoint that much, so hope that someone can give me some good explanations for me.
For SharePoint application, we don't need to consider SharePoint DB design? Everything is done through List and SharePoint will take care of the Database? Don't need to consider it at all unless we are connecting to the external Database?
For Parent Child relationship, I have to use lookup field?
If we are developing using Web parts, we need to deploy it using Features. So eventually, there can be so many features in the production? Is it recommended in this way?
1)
For SharePoint application, we don't need to consider SharePoint DB
design ? Everything is done through List and SharePoint will take care
of the Database ? Don't need to consider it at all unless we are
connecting to the external Database ?
You do need to consider the database... In term of administration. back ups, restore, size and so on.
however you never directly read or write to it. You don't need to pay attention to the schema because you won't ever be directly using it. If you want to update something in SharePoint you do it pragmatically with c# / vb.net using the SharePoint API's. You have 2 API's one that works on the server called the SharePoint object model and one that works on a remote machine called the client side object model.
From a users perspective, you are correct lists contain data in SharePoint and are somewhat smiler to DB tables in some ways.
2)
For Parent Child relationship, I have to use lookup field ?
Yip
3)
If we are developing using Web parts, we need to deploy it using
Features. So eventually, there can be so many features in the
production ? Is it recommended in this way?
This can happen if you create a new solution for every web part but you can bundle multiple web parts in the same solution in the same project in the same feature
Right click on your project --> add new item. select a web part. By default the web parts will all be part of the same feature but you can separate them out and have multiple features in the same solution if you want to

Drupal, a custom searchable user profile should be based on Node or Custom db?

I have to work on a Drupal project to create user profile for some specific users on the website with some special fields. They can be a different role. Main idea is to search. User profile must be searchable with provided criteria.
I have two options,
1- Using node with (content_profile)
2. Create my own form and tables.
One my question is, is it possible to create a separate search machanism for custom created database? and is there a way to cache search result? or should I use node based? please advice some one with idea on this..
Thanks.
Yes it is possible to create a search mechanism using views and exposing the custom table to views via the api (there is a blog post here: http://blog.menhir.be/2008/10/22/expose-database-fields-to-views-in-a-custom-drupal-module/ and there is more info using the advanced help module (http://drupal.org/project/advanced_help) (install and look through the views documetation), then you could also use the Views caching.
A custom table and fields would be my preferred method if you have a lot of users as the profile tables can get pretty big (this may not be an issue for you), or you could use the content profile module http://drupal.org/project/content_profile and possibly save yourself some work!
If you wanted to perform a complete custom search not using views you'd probably need to implement that and the caching yourself if you went the custom field/table route, but you'd gain a lot of flexibility.

comparing sharepoint list and sqlserver table

I have a list in sharepoint which maintains particular month OnCall list,and we are maintaining employee directory in sql server. My requirement is to get complete data from sql server and show it in sharepoint and compare with sharepoint list and show small icon for the employees who are On Call for that particular Month. Can anyone please suggest me the waus of implementing this.
Thanks in advance.
Update: I have finished the part where I have to connect to the sqlserver database and get the employees information. For this we are using 3rd party web part to connect to the sql server and pull the data from the table. Now I have to show some kind of image on the employee name to show that he is on-call for that week. We are going to cretae custom list for maintaing the list of people who are on-Call. Can anyone please advise me on how to accomplish this.
Write a custom webpart which will pull the data from the list using sharepoint object model and SQL server using ADO.NET and do the said comparison.
If you were looking for out of the box, I am afraid there i too little information given here to analyze if its feasible out of the box or not.
If you have the SharePoint Enterprise version, you can look at using the Business Data Catalog. This will let you bind columns to external data sources. This might provide you with the functionality you're looking for.
If you do not have the Enterprise features, do you have access to deploy WSP packages and custom code?
You will have to write your own data access to your external data source. Your options would be to have a job that pulls data from the external data source and populates SharePoint list(s) or create a custom view that pulls the external data on-demand.
You'll have to come up with synchronization strategies. Meaning, is the data in the external SQL data source static, reference information that does not need to be updated depending on what a user does in SharePoint? This seems to be the case based on your question. If you do need to update the external data source, you'll have to hook into the on save event (so probably a custom event handler that listens for ItemAdding) to update the data, validate, and optionally cancel the operation with an error message.
If you can't deploy WSP packages / DLLs, you could take a look at the jQuery SharePoint library. This will let you interact with lists using jQuery. If you also write a WCF or Web Service wrapper around the data you need access to from your external data source that is accessible from the SharePoint environment, you can use hack together a solution.
To accomplish this you'd need to place a Content Editor Web Part on the page you need custom data access. In there you will write the code to reference the jQuery javascript library and jQuery SharePoint library. The code will have to make the calls to your external data service and make any updates you need.
This is the least reliable method to accomplish what you want since it's entirely page-based and can be broken by simply disabling script or someone editing the CEWP or removing it altogether.
If you don't have access to place a CEWP or any of the other solutions, then you have no options at all.
it relatively easy now to pull all the data using the third party webpart and saving it into a custom list. I would recommend you not only creating custom list but also creating the content types for this list. take a look at SharPoint MVP's post about creating a Custom List with Content Types

Resources