Can NPAPI plugins execute on every page? - plugins

I wanted to build an extension but realized a plugin would give me more control to do the things I want. Can you build NPAPI plugins that are called on every page the user loads like an extension is, or are they limit to the MIME type to you specify in the plugins manifest file?

Plugins are only instantiated to handle their defined MIME types. If you wanted a plugin to run on every page, you'd have to make an extension that injected an instance of your plugin into the DOM of every page.

Related

Liferay 7.2 Customize Documents And Media Porlet

I have Liferay 7.2
I want to customize the html of the layout of the widget Documents AND Media
I tried to create a hook to document and media but it seems that is not the right way.
How can i do that?
First, the fact that you're talking about a hook tells me that you're coming from Liferay 6 or earlier. Forget the old module types ("war-style modules"), embrace the new "jar-style modules" or "OSGi modules", which leverage the OSGi methods and mechanisms in the foundation. The new module type that comes closest to the functionality of hooks would be a "module fragment".
Alternatively, if you want to create one module that overrides the JSPs of more than one other module (or overrides JSPs as a side effect to its main purpose), you may want to look into "JSP Bags".
Still, both methods are discouraged and should be taken as a last resort, according to Liferay's "Introduction to Customizing JSPs".
The preferred method would be to use Dynamic Includes (albeit they only work if the target portlet has been written to include inclusion points) or Portlet Filters (which basically allow you to programmatically edit the request to and response from the standard Portlet classes and JSPs).
Still, if you're aiming to replace most of the JSPs of the standard document and media widget (keep in mind: Widgets are still Portlets, they just have been renamed in the frontend), a module fragment still seems to the best way forward.
To identify the correct module, here are the necessary steps. I'll show it using the DLAdmin portlet from the control panel as an example:
Identify the portlet you want to edit: Look into the HTML using the DOM inspector of your browser. Look for section tags with IDs like <section class="portlet" id="portlet_com_liferay_document_library_web_portlet_DLAdminPortlet"> around the area of interest.
Now translate that ID into a package path with portlet class: com.liferay.document.library.web.portlet.DLAdminPortlet. Search for that class in the Liferay github repository. (Go there, press T, enter the class name, find its Java class source file. In case of multiple hits, you need to check the package path, too.)
Once you opened the source file, go back up in the file tree to the parent folder of the src folder. There's a bnd.bnd file. Take a look into it, it will tell you the Bundle-SymbolicName.
Use the Liferay IDE or Blade CLI (depending on your development environment) to create a module fragment for the module identified by the Bundle-SymbolicName.

How to add Typo3 Extensions to a page?

I googled for quite some time now and i cannot find a solution for such an easy beginner-problem.
I used the Typo3 Extension Builder to build a test-extension in Extbase. Now i want to use this and include it into one of my pages in the page tree structure to actually see if it works. When browsing the folder structure i can clearly see that the Domain model, the Controllers and all the views have properly been generated. But... How can i tell my page to include it and execute it?
I tried things like including the auto generated typescript into the templates of the pages but nothing works.
Thanks!
In Extension Builder make sure that you added "Frontend plugin" on the left pane. If you'll do it properly you will be able to add this plugin via CE "General Plugin" and then via field "Select plugin"
Sounds like you struggle on a more general level here.
In order to get the output of your Extension in the Frontend you have to assure the following steps:
Set up general Configuration, so that you can see the output of standard content elements in the frontend.
Install your extension and include its TypoScript.
Make sure you have a Plugin configured in your ext_localconf.php and registered in your ext_tables.php.
In the backend, create a new content element and choose "plugin" as its type.
Choose your registered plugin and save.
You should now see output of your extension in the frontend.

How to put multiple forms in the same page using joomla?

I'm using CKForms to create 3 forms, so far, they are independent components, I would like to put them in the same page.
This manual could help :
http://joomlacode.org/gf/download/frsrelease/12021/48586/manual_ckforms-EN-1.3.4.pdf
In order to use multiple instances of the same component in a joomla page, you have to check if there is a module or a plugin available.
If there is an option for a module you could publish each instance in a module position.
If there is a plugin, you could create an article (or a module in some cases) and add plugin code to load plugin instance.
Checking CKForms site I could see that there are both options.
Hope this helps

How to use a joomla plugin

I have a plugin that i have installed & I am able to view it on the plugin manager , however i have no idea how to use it on the template i.e is it possible to assign plugins to positions? I am new to joomla assistance would be appreciated.
Plugins respond to (are triggered by) events. They are not meant to be attached to an specific position (like modules are). What you should do is to enable it, then it'll start listening for some event(s). Did you build this plugin yourself? If it's someone else's it's commonplace to use {myplugin} parameters {/myplugin} syntaxis, so that you can call it from any editor field. In that case you could have a module with an editor field, place it in any position you want and then call your plugin from it.
For more information about plugins, see http://docs.joomla.org/Plugin

Load firebreath plugin in Firefox extension without injecting anything in DOM

Is there any way to load firebreath plugin in firefox extension.I've seen one way by injecting html related to plugin into DOM as explain here(see "http://stackoverflow.com/questions/5688904/scriptable-npapi-plugin-doesnt-work-with-firefox")
I think its better that extension will load plugin in background to avoid any security issues.
my plugin has nothing to do with drawing, its just send data to a specific port by calling a simple function.I'm new to extension development so any example will be helpful...
Sounds like you figured it out, but for the sake of any who find this question with the same issue: a NPAPI-based plugin (FireBreath or otherwise) can only be loaded inside of a DOM; however, in the case of a firefox extension (or Chrome extension for that matter) it doesn't have to neccesarily be the DOM of the web page, it could also be the DOM of the extension.
In this case, you can load the plugin in the XUL file.
It's also worth checking out this thread:
Using a plugin generated with Firebreath in a Firefox Extension?