Navigation, menu and look and feel disappears on Liferay 7 CE - liferay-7

I am trying to deploy and test a portlet on Liferay 7.0 CE version. All of a sudden I realized that the menu icon on top that displays the left navigation, the Add and the configure option on the top right and the menu on the top rightof each portlet that allows you to configure has all disappeared. I had seen and used it in the past, but am not aware at what point I lost all these options. Now I am unable to clear cache, add a new portlet or remove existing ones.
Can someone give me some ideas as to what could have happened? Could it be some javascript in my portlet that's conflicting with the bundle that holds these options? Or could something else be wrong?

Looks like I had got signed out which caused all the menu icons and navigation to disappear. I could only see the Sign-in link, but when I tried to Sign-in, sign-in did not work. The Sign-in pop-up stayed as it is. I could not see errors in any logs either. I had to undeploy the portlet after which the sign-in worked. Then I redeployed the portlet and its all good until I Sign-out and the icons disappear again and Sign-in does not work again.
Has anyone faced this issue? Why does the Sign-in not work with the portlet running? Do I need to change anything with the role?
My portlet.xml has :
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
My liferay-portlet.xml has :
<role-mapper>
<role-name>administrator</role-name>
<role-link>Administrator</role-link>
</role-mapper>
<role-mapper>
<role-name>guest</role-name>
<role-link>Guest</role-link>
</role-mapper>
<role-mapper>
<role-name>power-user</role-name>
<role-link>Power User</role-link>
</role-mapper>
<role-mapper>
<role-name>user</role-name>
<role-link>User</role-link>
</role-mapper>

Related

Laravel Backpack devtools add-on not working?

I'm having an issue with devtools.
I just did a clean install of Laravel followed by new backpack install. During the install when I was prompted to install paid add-ons, I went to the backpack site and purchased "backpack pro" and "devtools". Went back to installer and installed both add-ons. Everything worked as expected with no errors.
Then went to http://project.test/admin. Registered an admin account. Logged in. Then went to http://project.test/admin/devtools. App/Models/User is shown on the models screen so I clicked the generate CRUD button. It seemed like it was doing something, but I didn't see anything change.
Now on the Models screen, the "Generate button" under actions is disabled and the disabled class is present on the button in the inspector. The CRUDs link in the top navbar links to nothing (a href="#").
So now I click the "Generate All CRUDs button". It pops up the green notification which displays "CRUD generated for: " nothing, it doesn't show a CRUD name.
When I click the "See files" button on the model, it shows a list of all the files it created except the Route link and the Menu link are disabled.
I'm not sure if missing something - what do I do now?
NEW INFO
I finally found an error. Creating a new model with migration works. However, when trying to generate a CRUD for any model, I get this error:
str_repeat(): Argument #2 ($times) must be greater than or equal to 0
It's happening in the middleware:
App\Http\Middleware\CheckIfAdmin
in the handle function on line 66. Line 66 is: return $next($request);
I've just create a new Laravel app and followed the steps to add the PRO and Devtools repo.
I did the same as you did, opened the "Models" and saw only User. I made sure I deleted the user migration before as you said that Models without migration wouldn't work.
I clicked Generate CRUD, and got the green notifications.
This is what I get when I click on See Files
https://prnt.sc/t7kbQme68yVM
Route and Menu are disabled because it's a feature we are still working on, nothing that impacts the application.
If your issue persist please open a issue report on https://github.com/Laravel-Backpack/devtools-issues
UPDATE: We found a situation where that str_repeat could trigger, we are working on it and will patch it ASAP. I will let you know here when we do it
UPDATE 2: It was fixed. Thanks for the report!
Cheers

Disabling SPA at porlet level

I have an WAR style application that has been converted from Liferay 6.2 to 7.1. it needs to have SPA turned off and has been tested successfully when turning off SPA at the portal level but would like to turn off at the portlet level.
have tried adding the false property to the object in liferay-portlet.xml but the app doesn't load into Liferay correctly after that and complains.
this appears to be the recommended approach from https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/automatic-single-page-applications. there may be some "order" necessary to these properties? I can't determine exactly what that might be from this DTD https://docs.liferay.com/ce/portal/7.1-latest/definitions/liferay-portlet-app_7_1_0.dtd.html#single-page-application.
a further inspection of the error message that occurs when the portlet is loading provides help that indicates the properties order that should appear in the liferay-portlet.xml. I'm able to deploy the portlet without error now.
unfortunately, the portlet still does not act properly. its an EXTJs front end and there are consistent "The schema can only be reconfigured once" and "duplicate object" errors reported in the browser console. reloading the entire page works fine.
how might one start to debug this issue?
I disabled SPA in a WAR application by setting <single-page-application> to false in liferay-portlet.xml
See: https://github.com/jorgediaz-lr/index-checker/blob/master/docroot/WEB-INF/liferay-portlet.xml#L18
<portlet>
<portlet-name>index_checker</portlet-name>
<icon>/icon.png</icon>
<configuration-action-class>com.liferay.portal.kernel.portlet.DefaultConfigurationAction</configuration-action-class>
<control-panel-entry-category>
apps
</control-panel-entry-category>
<control-panel-entry-weight>1.5</control-panel-entry-weight>
<control-panel-entry-class>
jorgediazest.indexchecker.portlet.IndexCheckerControlPanelEntry
</control-panel-entry-class>
<preferences-company-wide>true</preferences-company-wide>
<preferences-unique-per-layout>false</preferences-unique-per-layout>
<single-page-application>false</single-page-application>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>
/js/main.js
</footer-portlet-javascript>
<css-class-wrapper>index_checker-portlet</css-class-wrapper>
</portlet>
If that setting is not working to you and causes errors, please copy your log traces with the problems.

Polymer unexpected routing result home page

I cloned polymer starter kit 1.0 and its working perfectly fine only if the url is : localhost:8080. When I tried with Eclipse and Apache Tomcat 8.0 to build a Java MVC application then URL would be as : localhost:8080/project-name.
Now the behaviour of the page navigation changed dramatically. When I start the project the URL comes as: localhost:8080/project-name/#!/project-name
But it should come like: localhost:8080/project-name and should show home page and on clicking on users or contact tab the url should be :
localhost:8080/project-name/#!/users
localhost:8080/project-name/#!/contact
but it is showing like:
localhost:8080/project-name/#!/project-name/users
localhost:8080/project-name/#!/project-name/contact
I tried to make app.baseUrl =" ";. Changed the routing.html routing for home to empty or '*'but nothing worked.
Any help would be highly appreciated.
Thanks.
You must deploy your app as "ROOT.war" to hide the projects context. The name of your project is deployed as the "context" in the URL.
Naming your app ROOT simply tells Tomcat it is the main app to run and you will indeed get below as your projects context.
localhost:8080
Don't worry about the Tomcat homepage, I simply rename it to "ROOT-1" when I really want to keep it. Also don't worry about the context while running in eclipse because it would awkward to test your app as ROOT. Just rename the .war to ROOT before launch.
When you see the "#" it usually means your are navigating to some point in an html file, i.e. looks like your app is SPA.
"#!/appComponent"
The line below simply looks like you have a SPA style page with the same name as your project with all the other pages inside of it.
localhost:8080/project-name/#!/project-name/users

Overriding liferay login jsp using a hook

I'm trying to override a JSP in Liferay 6.1, namely html/portlet/login/login.jsp.
I have
created a hook (using Eclipse)
added <custom-jsp-dir>/custom_jsps</custom-jsp-dir> to liferay-hook.xml
created the abovementioned directory structure
copied login.jsp there and modified it
deployed the hook
(restarted the server, you never know...)
But i am not able to see the modified login page.Where i am doing wrong.I am very new to this liferay.I am getting very much confuse with this.Can any one tell me where i am doing wrong.
Implementing Hooks in Liferay-portal-6.0.5
The above links targets on creation of a hook for custom login page. Hope this helps..!!!

How to check if parallel portlet rendering is working or not

I have enabled parallel portlet rendering in Webspere portal server 6.1.5. by following the below steps
legacy.useParallelRendering.html = true
std.useParallelRendering.html = true
And at individual portlet level as well.
Could somebody please suggest how can I check if this is working at runtime or not.
Regrads,
Snehan Solomon
You can verify this by checking the logs. You will see text like WorkManager in the log file.
Create a portlet that prints out a log at its start and at its end. Do a Thred.sleep in between. Add it several times to your portlet page and open that page. Check if the logs overlap or not.