Prepopulating Fields to jhipster form via URL Parameters - forms

Hello Jhipster community
i would like to know if there is a way to populate form in jhipster through url parameter
for instance jhispter has generated for myentity a form callable by
http://localhost:8080/#/shipment(popup:shipment-new)
is there a way to prefilled it?
http://localhost:8080/#/myentity(popup:myentity-new)?name=new
Thanks

I'm guessing looking at the url that you're using the Angular frontend.
You can retrieve that kind of data from via the ActivatedRoute service. Properties params and queryParams should provide you the data you're looking and let you populate your template.

Related

Bambora Payment Service + React Application integration

I'm trying to set up a third party payment service with my React application.
https://developer.bambora.com/europe/sdk/web-sdk/checkout-integration
I'm trying to figure out how to send form data onSubmit as an object to pre-populate form fields on the Bambora redirect URL page.
I'm thinking that I have to create a state object, populate it onSubmit of the fields, if valid pass it to the RedirectCheckout() somehow. I'm not sure how to do that last part.
import { RedirectCheckout } from "#bambora/checkout-sdk-web";
....
new RedirectCheckout("<<YOUR-SESSION-TOKEN-HERE>>")
This was solved by using the checkout link generator from Bambora and creating a hash function using the params they used in their hash function for validation for the link.

Infusionsoft Form Submission API

I have been using Infusionsoft form embedded in html page but now I want to send data to Infusionsoft form using their API. I checked their APIs but could not figure out which one should be used to submit data to the Infusionsoft form. Can someone please help me with this?
https://developer.infusionsoft.com/docs/xml-rpc/
Thanks for looking into this.
Thank you, Naresh
Try to use REST API instead of XML RPC. Developer center already marked XML RPC to "legacy" module, and I guess they will replace "XML RPC" sooner or later.
Regarding to your question, you will need to define what data set you want to update.
For example, if your form is going to insert a new contact, you will need 2 things from your code.
First, prepare the parameters such like "email_addresses", "phone_numbers" and "given_name".
Second, POST request with parameters to this URL "https://api.infusionsoft.com/crm/rest/v1/contact?access_token=123abc" after authentication.
Ways to test:
Try REST API calls on page https://developer.infusionsoft.com/docs/rest/
Good luck.
To pull Webformvia API you will have to use following method, this will pull the HTML form:
Retrieve a Form's HTML
to submit a data to Infusionsoft via API
You will have to use Create contact and update contact API:
Create Contact
Update COntact
XML RPC is still in use but Infusionsoft suggests to use REST API methods
Create a Contact
Update a Contact
Single API call for two methods: Create or Update a Contact

How to construct client context in AEM by passing values from an external system?

Is there a way to construct the client context in AEM by using values passed by an external website? The external website sends the user information such as IP address, page data, geolocation, etc. I want to construct the ClientContext JSON without using CQ_Analytics.ClientContextMgr.init, as the information is from an external system.
For eg: We know the location of a visitor to our website. We want to pass this value to AEM and set the client context so that we can get the targeted content for this location.
Our end goal is to get something like this (but we are trying to achieve this without constructing the JSON by ourselves):
CQ_Analytics.ClientContextMgr.clientcontext = JSON.parse('{"profile":{"country":"US"}}');
Is there any Javascript APIs provided by AEM to construct the JSON?
You need to extend the client context using AEM documentation provided at:
Creating a Custom Context Store Component
Follow the instructions till the Initialization part where you will need to populate the data in the jsp file for your extension.
So in your case it would be something this:
if(!locstore){
locstore = CQ_Analytics.JSONPStore.registerNewInstance("<%= store %>",
"<%= jsonpurl %>",{});
}
Where jsonpurl will be the location of your service that provides the external data in json(p) format. This will initialise your store with the values you want and you won't need to worry about the manual json handcrafting.
Client context is constructed on client side using the JS library in AEM. You will need some binding parameters to connect your external data source to the current client context.
The detailed tutorial can be found here.

Laravel HTML form on multiple pages

How to make a form across multiple pages in Laravel like here
http://www.html-form-guide.com/php-form/php-order-form.html
I have a lot of input fields and i can't find any info on Laravel multiple pages forms. If someone has any good website where to read about it and to see how it is done?
Any help is appreciated.
You can achieve through session of laravel, you can set your values with key and value:
public function step1(Request $request)
{
$request->session()->put('key', 'value');
}
for further information see this link
Other way is make in your client side, with localStorage is cleaner for me, you can use Single Page Aplication and send the data when you're at the final step.
localStorage works seemed to PHP session, check out this link :
you can set the item thought steps, like this:
localStorage.setItem("key", "value");
and retrieve the information like this:
localStorage.getItem("key");
The Single Page application lets you render diferent pages in a route and it's not neccesary to reload the page, you can check out Angular or Ember.js Framework.
If you are looking to do this on server side and not with javascript framework here is what you can approach.
You can make use of Laravel session to store intermediate data between the pages and then pull data out of session to insert into database at the final step.
Detailed Tutorial
https://www.5balloons.info/multi-page-step-form-in-laravel-with-validation/

Create servlet in Wicket to pass input as a parameter on submit to the web page

I'm new to Wicket and have made an application using some tutorials.
How do I create a servlet and pass on the input from that to a web page without database transactions?
I'm assuming you are trying redirect to a Wicket page (parameterized) from outside the Wicket application.
You can do this by using one of the URL encoding strategies (BookmarkablePageRequestTargetUrlCodingStrategy, QueryStringUrlCodingStrategy, ...) which will give that page a clean URL which can be referenced easily. Or you can put a BookmarkablePageLink in your web application somewhere, copy the link that it generates and use it to redirect to.
You can reference that link anywhere you wish passing parameters to it using the normal ?par1=val&par2=val system.
To read these parameters in your page you will need to define your page constructor like so:
...
public MyPage(final PageParameters parameters) {
final String par1 = parameters.getString("par1");
final String par2 = parameters.getString("par2");
}
...