How to make use of JSP File Creation Page in my own Wizard? - eclipse

I have a problem statement where in I need to add a page in my own wizard, the job of the page is to allow to create a JSP file with some additional tag-libs, imports.
Wizard page should ask for the valid JSP file name from user.
What I found is, eclipse already provide JSP file creation Wizard/page. Do you have any idea about what are those API ? are they extensible ? and how I can use same API in my wizard ? After loads of googling I din find any solution.
I found, same can be done for Servlets by extending "org.eclipse.jst.servlet.ui.internal.wizard.AddServletWizardPage" page API provided by eclipse
I also wanted to know what is IdataModel associated with JSP ?
I am very new in eclipse and have very little idea with eclipse APIs. Please help.
Thanks,
Rahul

I have found that it is very hard to take existing wizards like the jsp wizard, disect it, understand it and then modify it because most of these wizards are not designed to be extended and you will waste time trying to figure out detailed internals of the wizard. What I would suggest, is following the approach outlined here. Creating New File wizard
If your your new jsp file is a template and does not change based on wizard in put you can follow the same approach outlined in the link to create a text file in your bundle/plugin and load/copy it to the new resources. This wizard lets you define a constraint on file extension (in your case .jsp) and it provides pages for letting the user select the location of the file. If the initial jsp page creation is dynamic based on user input it will require some additional code on your part but going with a basic new file wizard in eclipse that is designed to be extended and then setting the file extension and setting initial file contents is the approach I would suggest instead of trying to disect and waste time in a complex wizard. In this case all you would need to do is customize the performFinish() method on the wizard to add the initial file contents. Then if you want this to show up as a wizard in file -> you use the org.eclipse.ui.wizards extension to contribute to that. If you want to have the wizard selection in its own folder you use the same extension point to create a category with an id and label and then assign the wizard to be the id of the category you created.
Hope that helps! - Duncan

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.

Jira plugin development - Is it possible to customize the 'Add project' page from a plugin?

I am developing a JIRA plugin and I'm trying to add a custom field to the Add project page. As far as I know, a custom field can be added only for an issue. Is it possible to add a custom field (a text field or a select list) at a project level?
I have found an plugin, which is able to add metadata on Project level.
Please take a glimpse at this link
Short answer: doable but not particularly easily
The way you do this is to write a WebWork plugin that changes the Java class that handles that webpage. The process is that the actions.xml file contains the AddProjects.jspa, e.g.
<action name="project.AddProject" alias="AddProject" roles-required="admin">
<view name="error">/secure/admin/views/addproject.jsp</view>
<view name="input">/secure/admin/views/addproject.jsp</view>
</action>
which tells you that the class name is AddProject, which you can extend to handle the user setting a value in this new field. Then you also need to decide how you're going to store values for each project (more info in the Practical JIRA Plugins or JIRA Development Cookbook books). The hardest part here is that the template files are .jsp files which you can't change directly with a plugin. What I usually do is write a ServletFilter to inject JavaScript to change the AddProjects page that way.
There is no elegant way, but you possibly can use Custom Project Properties for JIRA plugin.
This plugin allows to:
define list of custom fields for projects
define custom fields per project
fill custom fields on project administration page

How to extend Alfresco Share existing activity list dashlet with my own activity type?

In Community 4.0.a, I'm posting my custom activities in the repo following this: http://wiki.alfresco.com/wiki/3.0_Activities_Developer_Guide
I have defined my own activity type, with custom bundles and pagelink to display custom needs in the activity dashlet.
But I face an issue, I need to specialize the output based on the activity-type in a similar way of what is done already in activity-list.get.js in the specialize() function.
I can't hack the js cause I'm packaging things in my own amp for Share.
What is the best way to do it? Is there some kind of extension point or do I need to override completely the dashlet?
The old way (3.x) to change the behaviour of a webscript controller is to copy the code and overwrite the Javascript by placing it under web-extension: alfresco/web-extension/site-webscripts/org/alfresco/components/dashlets/activity-list.get.js. There you can modify the specialize() function or whatever you need to do.
All files you place in the alfresco/web-extension/site-webscripts folder will replace original files in the share.war WEB-INF/classes/alfresco/site-webscripts classpath. Best practice is to place your customizations in the tomcat/shared/classes/alfresco/web-extension folder so you don't need to modify the WAR file.
Alfresco 4.0 provides a new way to change the javascript controllers of a webscript. You can add additional Javascript code that will run after the original code. This is preferable because you don't need to change original code and you can upgrade more easily later. To use it you need to get familiar with the new Share extension modules concept. See David Draper's Blog for more info on that.

Dashcode: How to create a custom/new Project Template?

I'm trying to customize the javascript that Dashcode uses. So that I won't step on Apple's Project Templates, I want to make a custom project template that would appear as a choice after you click "New Project." I have been able to modify one of the existing templates (like, Custom, Browser, Utility, RSS, and Podcast).
I can not, however, seem to add a new template to the list, like adding "JJ's Awesome New Cross Platform Template" as a choice.
I have tried copying the directory Plugins/TemplateWebCustom.wdgtTemplate and changing in Custom's Info.plist file the com.apple.Dashcode.template.web.custom to, say com.apple.Dashcode.template.web.custom2 and in Resouces/project.plist updating the key value pair: TemplateIdentifier ==>com.apple.Dashcode.template.web.custom
Is it possible to add a new Project Template? What the minimum steps?
Thanks,
JJ
After a bunch of experimenting and searching, this doesn't appear possible. I could be wrong.