So, my extensioninfo.xml file looks like this:
<extension abstractclassprefix="Generated" classprefix="TrainingFacades" name="trainingfacades">
<!-- you should add all required extensions to this list, except platform
extensions which are automatically required -->
<requires-extension name="acceleratorfacades"/>
<requires-extension name="trainingcore"/>
<requires-extension name="trainingbackoffice"/>
<coremodule generated="true" manager="de.hybris.platform.jalo.extension.GenericManager" packageroot="com.training.facades"/>
<meta key="backoffice-module" value="true"/>
</extension>
The reason for why this is happening, is in my custom backoffice extension, services are located under backoffice/src, not under src.
But as I need loginInfoHandler from backoffice context, I need them placed exactly there. Or maybe I can add jar with loginInfoHandler to another extension (how can this be done)?
I'd appreciate your help, for sure.
I'm not sure I understand your scenario; it's not described clearly. But if my understanding is correct, you have a custom backoffice service which needs to pass loginInfoHandler data to a facade/service in another extension. Is it correct?
If my understanding is correct, you just need to make your custom backoffice extension depend on the facade (i.e. the custom backoffice extension has a requires-extension to the facade extension). Then, you can inject this facade to your backoffice service. You pass whatever data you need from loginInfoHandler to the facade. Does it make sense?
This approach is incorrect. Backoffice is the ultimate child extension and resides on the presentation layer. Backoffice should call facades, not the other way round. Same applies to other modules on the presentation layer eg. storefront, occ, etc.
Related
I'm trying to use "Users and Organizations" as a portlet.
I have tried as mentioned in this outdated (6.x) article but it doesn't work.
This can be done without any code at all, but you'll need quite a bit of configuration.
The portlet is an OSGi component. First, figure out the implementation class. The URL gives a hint, as it contains com_liferay_users_admin_web_portlet_UsersAdminPortlet. However, in this case, that's just the key. Grep the sourcode, or use any other means to find where it's used, and you'll get to com.liferay.users.admin.web.internal.portlet.UsersAdminPortlet. If you look at its properties configuration, you'll find the line
"com.liferay.portlet.display-category=category.hidden",
If you guess that this is the reason why the portlet is not available for just any page: you're right.
Now, any OSGi declarative service's properties can be altered by just creating a config file, which you can drop into Liferay's deploy folder (or directly into osgi/configs if you like).
So, create a file named com.liferay.users.admin.web.internal.portlet.UsersAdminPortlet.config with the single line content
com.liferay.portlet.display-category="category.sample"
and you're set.
However, regular permission checks likely are very restrictive and you should be very aware that opening up those permissions can easily open security holes (imagine someone creating a full Administrator account, or turning an existing account into an administrative one)
A better way to go ahead might be to selectively just provide the proper permissions to operate this portlet, and provide access to it in ControlPanel without opening everything else up as well. This is part of the regular roles&permissions configuration, and also doesn't require any line of code.
I need to obtain a property that is set in portal-ext.properties from my theme's portal_normal.ftl file. Using Liferay 7.
All my searches have come up short, but I can't believe I'm the first one to have this need.
For background, I need to display a web content that is stored in the global site. This needs to be displayed on every site, which is why it's going into the theme. It also needs to be updated by the content editors, so the content can't be included in the theme.
I can display the web content easily, using the journalArticleLocalService like this
journalArticleLocalService.fetchArticle(10197,"1260480")
but I obviously don't want to hard code the group ID and article ID like this; and they are already stored in portal-ext.properties for another reason.
Also, I know about theme configuration values, I use them for a lot of other configuration needs, but those require the values to be entered for each site and there are hundreds of sites in our implementation so this is not an option.
Thanks in advance for any solutions or advice you can provide.
Properties are (as far as I know) not available in Liferay's Freemarker Templates - and as everything in Liferay tries to phase them out in favor of OSGi based configuration) I'd not recommend keeping up the configuration there. Any change requires a restart of the portal - proper configuration would make them hot-changeable.
However, as you now have this situation and probably look for a quick solution: You can create a TemplateContextContributor and make the required values available for your template.
According to requirement of application, I have developed a custom web part in Kentico 9. This web part is using with same functionality at various places but we have to use with different layout structure.
As per my understanding, we can create custom layouts for a single web part from "Layout Tab" in web part configuration. As I used same things with various Kentio built in web part like Logon form, Logon-Mini form, etc.
But while trying to create new layout for my custom web part, I am getting web part loading error and when I checked into event log it is showing following error:
The file
'/CMSVirtualFiles/WebPartLayouts/=vg=87a868ce-926c-4cb3-a441-b4f1d4310afc/TDNForgottenPassword/ForgottenPassword.ascx.cs'
does not exist.
Here, internally system looking for ".CS" file under "CMSVirtualFiles" folder, which has actually under the "CMSWebParts" directory in which I have created my user control.
Is there any specific configuration required in custom web part to implement multiple layout of it? Please help me and guide me, what am I missing or doing wrong?
Check your webpart code file property in the ascx file. You need to specifically declare the full relative path to the .cs file and not just the filename. For example:
Correct
CodeFile="~/CMSWebParts/Community/GroupRegistration.ascx.cs"
Incorrect
CodeFile="GroupRegistration.ascx.cs"
Please make sure you don't have the store virtual files in the file system setting enabled.
I want to use Liferay's Organization select/search feature such as when adding a new user through the Control Panel (under Users and Organizations).
Does anyone know where that code lives? Trying to get a grasp on navigating their source code but can't find it.
Thanks
All the liferay OOTB portlets' JSPs lie in the folder portal-web/docroot/html/portlet.
And all the implementation classes (service implementation) reside in the portal-impl/src/com/liferay/portlet for respective portlets.
So keeping this convention in mind, the JSPs for the Users & Organization would reside in portal-web/docroot/html/portlet/users_admin since you can't see any folder with the name users or organizations or users_organization, so your best bet is to look inside the users_admin folder, also because this folder has user & organization folder which include specific JSPs for Users and Organizations.
In this folder you would find different *search.jsp & *search_results.jsp which would be what you might be looking for.
I would suggest always start looking from the view.jsp for a particular portlet since this is the first landing page when we add the portlet to the page or click on any Control Panel portlets the first time. Most probably this view.jsp would include all the other JSPs which you might want to customize or take an idea from.
Most of the time the JSPs lead you to the implementation classes, we can't use liferay's implementation classes (since they live in portal-impl.jar and using this jar in plugin-portlets is prohibited) but we can use the different *Util.java classes which are exposed for our use like the UserLocalServiceUtil, OrganizationLocalServiceUtil, OrganizationServiceUtil etc.
Hope this gives a clue to finding out Liferay implementations.
I'm exploring the possibility of deploying WCF services to a SharePoint Farm/WebApplication/Site/Web via a SharePoint feature without using the SPWebConfigModification class or manually editing web.config. The Gille virtual path fix has already been applied so it doesn't factor into this. The furthest I've been able to get thus far is creating a custom ServiceHostFactory class which I'm referencing inside the .svc file like so:
<%# ServiceHost Language="C#" Debug="true" Service="Company.Namespace.ServiceClass" Factory="Company.Namespace.CustomServiceHostFactory" %>
<%# Assembly Name="Company.WCFCustomLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0000000000000000" %>
I'm overriding ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) inside my custom service host factory and applying the various binding/endpoint configuration inside. But the problem I'm running into is that the method isn't even being called when I query the .svc file in my web browser. I was under the impression that IIS will try to create a ServiceHost using the ServiceHostFactory I specified as soon as I call the .svc in my web browser. Am I totally mistaken? Has anybody ever attempted to do something like this before? If so, is there something I'm missing? Is it possible to set up the ServiceHost completely programmatically or do I still have to mess around with <system.serviceModel> tags inside web.config?
You can do what you want, and get WCF to read configuration from where-ever you like. I built this once, to allow each WCF service to read from its own config file. Good for testing and independent deployment. The technique involves overriding the ServiceHost.ApplyConfiguration method.
This blog post has some additional details and full source code.
Another approach of general interest might be to let the WCF service read its config from a centralized store somewhere - a database, a remote file server, etc. You could use the same basic CustomServiceHost, and just modify one method to load from a database, or whatever.
ps: the reason IIS is disappearing is, I suspect, you have an exception occurring in the WCF ServiceHost.
Probably not the answer you are looking for, but I have gone into a bit of detail on how to have WCF-like capability in SharePoint on the SharePoint Depth wiki here. I go into the most detail on using a HttpHandler in lieu of WCF, but I also have some links for full-blown WCF in SharePoint.
In the HttpHandler approach you do not need to modify the root web.config file, but you do need to add a web.config file in your own folder.
I hope this provides some insight.