hi i'm working in a spring mvc project and i need to add a survey option, the requeriment is sending a link inside a email to a survey or i dont know if you can send the questions inside the email, i will probably lean for the firts option, i'm thinking of using limesurvey or any other open source survey tool who can be integrated with my spring mvc web application.
since i have not worked with a survey tool before, how acctually limesurvey works i asume that this is how it works:
1) you install limesurvey in your server
2) you create the survey with limesurvey UI after it was succesfully installed in your server
3) that survey that i just create give me somekind of URL
if this assumptions are correct,
QUESTIONS:
1) how can i get that url in my spring mvc application so i could send it in a email, since they are to different applications, does lime survey save that url in data base where i could connect with my spring mvc application and get it?
2) the same thing goes with the results can i get access with my spring mvc application to the results since i need that info to create reports,
3) can i create limesurvey surveys from my spring mvc application, if limesurveys create the surveys in a data base can i crete them from and UI in spring and save them in the limesurvey database
4) is there a way to configure the valid period time of a survey, since i dont want that a user can access the survey for long periods of times like 1 hour doing the survey, or being able to access the survey from the link for a entire week, since this can be a problem to my server capacity
Url : if unique link for each user is needed : https://manual.limesurvey.org/RemoteControl_2_API#get_participant_properties . Else a survey link it's allways the same example.org/surveyid.html for example.
https://manual.limesurvey.org/RemoteControl_2_API#export_statistics
https://manual.limesurvey.org/RemoteControl_2_API#add_survey and/or https://manual.limesurvey.org/RemoteControl_2_API#import_survey etc ...
Start and expiry date-time : https://manual.limesurvey.org/Survey_settings#Publication_.26_access_control
Then : I think LS are able to be integrated in your MVC. ANd remind : you can too use Extra plugin use LS core system with newDirectRequest event : https://manual.limesurvey.org/NewDirectRequest Return some json for your MVC if it's easiest for you.
Denis
Related
I'm building a profile page with update form. After submitting the form with new data and several page refreshes I see sometime new and sometimes old data. It depends on thread handling current request. One thread contains new data and another one old. NHibernate is configured using ThreadStaticSessionContext and NoCacheProvider. In Autofac UserStore, OwinContext.Authentication and UserManager are configured as InstancePerRequest.
I tried to change ThreadStaticSessionContext to CallSessionContext and it started working normally. So the question is: why it works(ThreadStaticSessionContext is preferable for multithread apps) and what negative effects can it bring?
Thanks!
ThreadStaticSessionContext is for long running processes such as windows services or windows apps. For web applications you want to be implementing Session Per Request. This is what the WebSessionContext is for.
I actually don't use any of the contexts and just wire it up myself. See my answer here for an example.
the tracker collects data on the web page it's included in and sends it to Piwik by calling the HTTP tracking API. I got this information,but i am unable to find the piece of code for this. can anybody please help me with this?
If you have integrated the Henhed-Piwik extension to magento 2 and configured your piwik credentials in the following section Stores > Configuration > Sales > Piwik API with piwik-host URL, user id tracking, etc.
Since you have integrated the Henhed-Piwik to your magento 2 (Hope you have compiled your magento 2 and upgraded). This extension automatically places the java script tracking code to your magento site. Whenever you visit the site it automatically tracks your actions, clicks, impressions, referrals etc., asynchronously.
The role of piwik.js and piwik.php are as follows:
Your tracking site consists of a global variable var _paq = _paq || []; and _paq.push(['trackPageView']); this actually mentions the what are all the features in piwik you would like to track.
This code defines the script execution mode, i.e asynchronous and you are sending all the data to piwik.js file. g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js';.
The same piwik.js file also calls the API methods in the piwik.php file of Piwik Analytics Tool and tracks all your web site data and stores into the MySQL database, where you have configured while installing and setting up of your piwik.
Hope, I have answered your question.
In a SPA app using breeze, how would I go about combining metadata from multiple sources for related data so that I can use them in 1 manager on the client. For example, I might have the following
Entity Framework Metadata from WebAPI controller (e.g. Account)
Custom Metadata from DTOs (e.g. Invoices)
Data from a third party service with metadata provided from client side metadata (e.g. Invoice transmission result)
In each case the data has related properties so I might want to be able to use Account.Transactions.TransmissionResults
UPDATE
I have tried several ways of getting this to work but to no avail. From Jay's answer, it is not possible at present to update the metadata from the server once it has been retrieved, so if and until that changes (see breeze user voice issue) I am left with one of the following approaches
1 Retrieve metadata from the server from Entity Framework and add metadata on the client to add extra entities. This worked to a degree but I could not add navigation properties from entity types added on the client to entity types retrieved from the server because I cannot add the foreign key association to the entity retrieved from the server, again back to the need to modifying metadata after it has been retrieved.
2 Write the complete metadata by hand, which will work but makes maintainability that much harder and seems wrong to be manually writing mostly the same code that the designer would write.
3 Generate most of the code from Entity Framework as described in the docs and then update it afterwards to add in the custom entities. Again similar issues than with option 2, it seems hacky.
Anyone else tried something similar? Is there something I am missing, which I could be, I've only started with breeze and js.
Thanks
A breeze EntityManager can have metadata from any number of DataService endpoints, and you can manually add metadata (new EntityTypes) on the client at any point. The only current restriction is that once you have metadata from a specific service, you can't change it. ( We are considering reviewing the last restriction).
So the question is, what are you trying to do that you can't right now?
Is there a built in function which will test if an email address is valid?
I want to test the email address structure is valid before sending a confirmation email to the end user.
I understand i could create my own function easy enough with the use of a regular expression but if there is a built in function i would much rather use this.
You can do this with Data Annotations extensions I believe. Check out Scott Guthrie's blog post on it here: http://weblogs.asp.net/srkirkland/archive/2011/02/23/introducing-data-annotations-extensions.aspx.
There is a good point in Scott's post as to why you would use this rather than the MVC 3 Futures validators which might be relevant to your choice:
ASP.NET MVC 3 futures defines four new data annotations attributes which this project has as well: CreditCard, Email, Url and EqualTo. Unfortunately referencing MVC 3 futures necessitates taking an dependency on MVC 3 in your model layer, which may be unadvisable in a multi-tiered project. Data Annotations Extensions keeps the server and client side libraries separate so using the project’s validation attributes don’t require you to take any additional dependencies in your model layer which still allowing for the rich client validation experience if you are using MVC 3.
Yes, you can use
public class CustomerMetaData
{
// Add type information.
[DataType(DataType.EmailAddress)]
public object EmailAddress;
}
on your model. See more about it here.
however, last time I checked it does not work client sided.
I googled it, and from imran baloch's blog post it seems it does work now.
Im pretty new to struts2 and Ajax ,Actually i have a drop down menu in JSP lets say first.jsp, When user select a choice from dropdown menu,I am calling a function of Action class lets say Method1.In this method i am fetching some value from DB(lets say:a,b,c) and one value from java memory lets say d.Then I am forwarding to second.jsp and display all the parameters(a,b,c and d) in tabular format.
Now problem is that the parameter d is dynamic ,this is updating by some other application and if its change then I have to show it on JSP wihout any action.
One solution is I use in second.jsp , so after interval of 10 second again Mehod1 will call and it will fetch value(a,b,c) from db and updated value of d from java memory. and disply it to second.jsp.But in this case i am unnecessary retrieving value from db while my purpose is just to get value d from memory.This is working but this is causing my application to slower.
Can any body suggetst some other solution? or can i do it using ajax and how?
Any other advice? any help is appreciated.try to be more clear, i'm in lack of ideas in this problem, even it sounds like a classic :I have spend hours trying to play around with this but have got nowhere
Okay... What you're asking is a little fuzzy so let me rephrase:
You have a user (USER1) who opens a web page and sees some data.
You have a second user (USER2) (who may be an application) who is able set a value from time to time.
When USER2 updates that value you want USER1 to see it change in their open browser window?
If this is the case you need to understand basic ajax. For that get these demo applications working:
This example uses dojo and perhaps the S2 ajax tag lib I don't remember I prefer not to use ajax tags (as they are deprecated and prefer jquery for ajax):
http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html
This example here shows a very similar application but using jquery, no tag library, upgraded to Spring 3, it still needs polish:
http://www.kenmcwilliams.com/Downloads/
Now that you know how to get data via ajax, look at the request with firebug. You'll see that the request is just like a typical function call, the browser keeps waiting for the data to come back.
What you do is simply not return from the action until new data is provided. This is called long polling see: http://en.wikipedia.org/wiki/Comet_%28programming%29#Ajax_with_long_polling
If you have not written a simple chat program, using just terminal windows I recommend you do so. Two windows per client (client-send, client-receive windows) and you'll need a server program. I remember hacking one together in a few hours using _Thinking In Java 2nd Edition (Later books took out the networking section if I remember correctly). Anyways between understanding client server interaction and long polling will let you get things working. It would be fun to extend the simple terminal based chat application to a S2 ajax chat application. Would make an awesome tutorial! PS: This is just an application of the producer/consumer problem (If you understand that then I guess you don't need to do the fun exercise).
The interfaces would look very pretty if the server was managed by spring. I know there must be nice servers already written but I am not familiar with any, but would love to hear of one.