JHipster: Create an entity and move it to admin - angularjs

I created an entity with yo jhipster:entity MyEntity and everything works fine. But this entity should be part of the admin section so I moved the whole folder and updated the paths etc.
But now the whole app can not load any more. It says:
"Invalid configuration of route '': Encountered undefined route.
The reason might be an extra comma."
I just copied myEntityRoute to ADMIN_ROUTES. How can I figure out the problem?

Please list out the configuration in your admin/index.ts. You need to export your new entity configuration before "export * from './admin.route';"

Related

How can I get views in a module to be found in MVC

I've created a module in abp.io and it's picking up the controllers fine, but can't find any of the files inside the Views folder. I'm using MVC, and I assume I'm just missing a configuration step, but can't seem to find anything in the documentation. I always get the error, "InvalidOperationException: The view was not found. The following locations were searched". Can someone point me in the right direction?

CakePHP: Can only load index.php, all pages 404 after Cake Bake

I'm trying to bake my first CakePHP application and am unable to get any page to particularly load for me right now. I've updated my config settings for salt,database, etc. and the index.php page tells me that I have configured everything.
So far I've used cake bake all on just one database table so far to make sure it loads properly. I created the Model, Controller, and View for the standard add/index/view/edit pages. When I try to access URL/organizations/index.php I'm hitting a 404 error however.
Is there any troubleshooting someone might have advice for how to solve this one? It is confusing to me that the index.php loads (so it redirects properly when loading the webroot) but trying to view any View pages yields no results. Is there any debug commands I can do to view what the valid pages would be? Or any additional information I can provide?
If you try URL/index.php/organisations or something similar to this and it works, then there is an issue with URL re-writing on the server which you'll need to correct.
I believe if you have things set up correctly you would want to visit /organizations in order to access the index() method of the organizations controller.
In general the ".php" is left off of the URL, as your index.php file initiates all the bootstrapping and routing. This also requires a correct .htaccess setup. Hard to say exactly what the problem is without seeing the app or an error message.
Try in url
URL/organizations/index.php
To
URL/organizations/index
or
URL/organizations/index.ctp
Cakephp using .ctp extension, that means cakephp Template. Please see this link. And also you can see your app\view\Organizations folder. Here all file is with .ctp extension. Isn't it ?

The newly added field's value not saved in db by magento

In Magento I created a new module as like the customer module.
Everything will be fine.
In my module there are some additional fields, but the values are not being saved into the db.
Only particular fields save into db.
I have not created a setup file as in the core part.
Do I require a setup file? And if yes how may I do it please?
How to set the default entities.
delete cache .
And if problem exists.Refer Link 1.Hope this helps you.

backbone.js + require.js + user authentication

Started learning backbone.js and require.js.
Not sure how to structure files for web app with user authentication.
Seems it should flow like this:
On app init, query server to check auth session state;
Q#1: where should I be writing this 'after init' session code - in /js/app.js?
Q#2: should I be using jQuery ajax for this, or is there better backbone.js methods (I've seen references to get(), fetch(), toJSON() in examples)?
If success, store auth data in a model (user_id, username, auth_token).
Q#3: how/where do I init this model so that I can access that data throughout modules? ie. I will have a view to display template for 'isLoggedIn.html' that will read "Hello %username%! Logout". I want to access 'username' field from this model. Currently, I see only how to create a new model by referencing it in the view's define[], so I don't know how to access the model that was created during init.
Will use jQuery $.cookies to save and get this auth data, so if user leaves page and returns, I can query server to check session instead of requiring user to login again.
Q#4: how do I include jquery.cookies.js plugin into this requirejs app, so that I can later use $.cookies as usual? Am I supposed to add this plugin to the define[] list? Do I have to add it to the /js/jquery/loader.js file?
Thank you for your assistance.
Edit: I used the files from modular-backbone example to create my web app. So when I am talking about /js/app.js and js/router.js, that's the files I refer to.
I'm in the same situation as well.
I found this post and it seems like the best option to do something before every request is to use this solution.
Before accessing and URL except /login, I'm going to authenticate by cookie or run the login view.
About the way to include other folders (jQuery cookie)- just use the require.js mechanism:
In your main file 'require.config' -> 'paths' add the plugin location (jqueryCokkie:)
In your view under 'define' add the path name ('jqueryCookie') and pass it to the finction
The .js file should be in the following structure (I tried to paste the code example here, but got problems...).

Cannot Call WordPress Plugin Files Under wp-content

I have a client who has many blog customers. Each of these WordPress blogs calls a plugin that provides a product link. The way that link is composed looks like this:
{website}/wp-content/plugins/prodx/product?id=432320
This works fine on all blogs except two. On those two, when you try to call the URL, you get a 404.
So, I disabled all plugins except prodx and reverted the theme to default (Kubrick), thinking perhaps a plugin intercept with add_action() API was doing this, such as intercepting URLs and redirecting them. However, this did not help.
So, I upgraded the WordPress to the latest version. Again, didn't fix.
So, I checked permissions, comparing with a blog that worked just fine. Again, didn't fix.
So I replaced the .htaccess, using one from a working blog. Again, didn't fix.
So I replaced all the files using some from a working blog that was identical to this one, and then restored the wp-config.php file back so that it talked to the right blog database. Again, didn't fix.
Again I checked permissions meticulously, comparing to a perfectly working blog. Again, didn't fix.
So, I created a test.php that looks like so:
<?php
print_r($_GET);
echo "hello world";
I then copied it into another plugin folder and used my browser to get to it -- again, 404. So I copied it into the root of wp-content/plugins and tried to call it there -- again, 404. So I copied it into wp-content -- again, 404. Last, I copied it into the root of the WordPress blog website, and this time, it worked!
Doesn't make sense.
I started to think that perhaps something was going on with /etc/httpd/conf/httpd.conf for this customer, but the only thing I saw different in their for this customer was the IP address was different than the customer's blog that worked. Each customer gets their own IP in this environment my client has built.
My client sysop is baffled too.
What do you think is going on? Is there something wrong in the WP database for this customer? Is there something wrong in httpd.conf?
You could check for bad URLs in plugins' options in the WP options table using phpmyadmin (and compare other aspects of each blogs' options) which might be already available at your host, or as a plugin: WordPress › Portable phpMyAdmin « WordPress Plugins. Or delete the plugins' options with Clean Options to completely "reset" the plugin (if the plugin uses options): Clean Options « WordPress Plugins
You should look into your server's error log, there should be an explanation. If not, turn up debugging levels etc. That said, the plugin really shouldn't link to the file in the plugin dir, it should use the wordpress rewrite class http://codex.wordpress.org/Function_Reference/WP_Rewrite
I think the problem was that the URL was too long. Here's some great info about that:
http://www.boutell.com/newfaq/misc/urllength.html
And for some reason the blog was getting a 404 instead of a 413.
The fix was that I used gzcompress to shorten my long product ID (which was a cloaked URL), then bin2hex. So I made the URL like so:
http://myblog.com/item/789ccb282929b0d2d72f2f2fd7cb4ac92fcc4faed44bcecfd54fcec94cced63536373334b730d7353430333334b530b60f0df2b1cd00ea503576543572032290befcb2d4a2e292fce46c904e90b0b15b1a50854b9aaa915980a3bb2b901910e4ef12ea1c0214f00f0ef60e058a181a199b5b18999b0100194725b4
From there, I had my plugin add an init handler to hijack the URL, inspect it, and redirect. That function looks like this:
add_action('init','hijackURL');
function hijack_URL() {
$sURL = $_SERVER['REDIRECT_URL'];
if (empty($sURL)) {
$sURL = $_SERVER['REQUEST_URI'];
}
if (strpos(' ' . $sURL, '/item/')>0) {
$sID = str_replace('/item/','',$sURL);
$sID = trim($sID);
if (empty($sID)) {
require('../../../wp-blog-header.php');
$sBlogURL = get_bloginfo('wpurl');
header('HTTP/1.1 302 Moved Temporarily');
header("Location: $sBlogURL");
exit(0);
}
$sID = pack('H*', $sID);
$sURL = gzuncompress($sID);
header('HTTP/1.1 302 Moved Temporarily');
header("Location: $sURL");
exit(0);
}
}

Resources