How to plugin custom WidgetsService in Orchard CMS - orchardcms

I need to create a custom WidgetsService implementation and use that instead of the default Orchard implementation. I assume I need to work with autofac to register my own implementation but not sure on the details. Could you help with step-by-step instructions?

No, you just need to use the OrchardSuppressDependency attribute.

Related

How to override UserFinderImpl in liferay 7?

I need to override UserFinderImpl to execute custom sql queries. I developed this project using dynamic query. But I need to make it via custom sql.So please tell me how to do that? Thanx in advance..
UserFinderImpl is considered internal class and it's not meant to be extended / overridden / replaced. Before Liferay 7, doing such thing was only discouraged and considered bad practice. Due to monolith approach and EXT plugins, it was not possible to enforce such isolation.
The modular architecture or Liferay 7 (based on OSGi) allowed to encapsulate and isolate internal classes and only allow extensions via well defined public APIs. There is no extension point in Liferay 7 that allows you to override / modify UserFinderImpl. If you absolutely need to do that you would have to compile from source with your modifications in place (which is basically what EXT plugins were doing in a bit more sophisticated way before Liferay 7).

Extracting a Module from Orchard

I am having a little problem in my workplace where we have a IIS 6 server where Orchard (1.7) will not run. We are planning an upgrade but that's going to take some time.
Since we are using this site on IIS6 only to run one particular custom module we wrote for Orchard (basically a MVC module with its own Controllers/Actions etc.) I was thinking that a temporary solution could be to rip that module out of Orchard and run it independently.
Of course this extraction needs to take into account how many ties I have with the framework. I was wondering if there is some kind of guide to perform this and if there is something I need to take specially into account.
I am using the Users in Orchard so I would probably have to rewrite some users code. I am also using the Authorizer, which again may mean I need to re-wire something else.
It seems like a daunting job so I am looking for some quick tips on how to proceed if you know any.
Thanks a lot!
It all depends on what components you actually use within your module.
Hard to write any tutorial on this, really.
Regarding Orchard.Users - you could drop all related code usages and rely on the default ASP.NET roles-based authentication/authorization model.
If dependency injection is what you want to keep, then you need to integrate it yourself (for Autofac, but other DI containers will also work). Feel free to copy and change any Orchard components that you use, stripping the unneeded code.
In my opinion the hardest thing to strip out and replace would be any code that relies on content items - hope you don't have it. Rewriting this pieces sounds like an overkill. But if you just use IRepository, going for plain NHibernate or EF instead should be quite easy.

extend liferay plugin functionality with hooks

Fairly new to Liferay. I learned it is possible to create plugins UI with different frameworks including JSF. Also I learned I can extend functionality of an existing plugin with hooks. Now I am curious if it is possible to add new JSF pages to an existing plugin which interface is build with JSP using hooks?
Suppose I want to extend dynamic data list portlet, add some new functionality and for this I need to add new pages.
Is it possible to add new pages in general?
Can I create a new plugin with JSF as a front end framework, implement the logic I want to add within JSF pages, would it be possible to redirect a user from an original JSP to those JSF pages, let user do something there and then return the user back to original dynamic_data_list JPSs?
If it is possible, how can I do this with Liferay 6.2?
Thanks
The mechanics are documented in the developer guide or the Wiki. It's not exactly a hook that you deploy to the running system, rather a development option to inject custom changes into existing plugins, and you deploy the modified version instead of the original one.
With this, you can do everything that you can add as extra feature this way (see the build process). Technically the answer to the first two bulletpoints is "yes". If the linked documentation doesn't help answering your third bulletpoint, please ask more specifically what actually doesn't work. But keep in mind that only core liferay is customizable with hooks, plugins are customizable at compile time - and not with hooks.

How Can OSGI and JSF work together?

I'm new in OSGI and I'm having many problems to try to create WABs. I'm using BndTools with Eclipse to help me with OSGi. My problem now is how can I integrate JSF with OSGi. I want to make one main web server, and add bundles with jsf pages runtime. How can I do this? What are the needs?
Thanks in Advance!
JSF is quite complex due to it's classloading mechanism. If you use Pax-Web you are able to use JSF, though it requires some special handling. For more details get in contact with the OPS4j community.
Another hint, since you seem to try to build your own "web-container", I don't recommend that, try to use an existing one, makes life easier :)

Security Plugin from Grails?

I try find some simple security plugin from Grails.
And first of all, i want ask you: what plugin you can recommend?
I not need super powerful plugin. Its must be simply and for small application.
Thanks.
I recommend Spring Security. It is easy to configure, and very flexible. It can handle everything from simple login, to annotated access controls on methods, to various complicated login schemes.
It does have a fairly complicated API, but there is plenty of documentation, and you can be sure others are using it.
If you just want simple login, it is really easy to set up.
More info here.
Per #robbbert suggestion, here is an alternative -- the Shiro plugin. I cannot speak to its reliability/community/expandibility.
We use Apache Shiro which is very simple to use and set up. It works by convention and supports both authentication and authorization.

Resources