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

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.

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.

Creating a folder from a space template via REST API

Well, I formuled this cuestion before but seems like I didnt do correctly, so I will try again explaining myself better.
Im working on a event handler in openbravo that creates a structure of folders via rest api, I have been able to make a single folder so I could make the structure via java but i need to add alot of stuff to all the folders idividually so my work will be x100 harder, so Im searching on internet a way of creating from a space template but cant find nothing, would be nice if u could lend me a hand, its my first time using Rest apis too so Im not that good on this, thx for ur time.
Something cool about Alfresco is that if you look at the Alfresco public REST API and you don't see what you are looking for you can simply write your own RESTful end point.
To do that, you use the Web Script Framework (tutorial). With the web script framework you can implement controllers using either server-side JavaScript or Java.
That gives you access to the entire foundational API of Alfresco, which includes the ability to create folders from space templates.
For example, when using Java to create a folder from a space template, you can use the fileFolderService to copy the template folder to a parent folder, like this:
fileFolderService.copy(template, parentFolder, folderName).getNodeRef();
That template variable is a nodeRef. How you get that nodeRef is up to you. One way would be to do a search for it.
So, to re-cap, write a web script. The web script can use the foundational API to create a folder from a template. Your web script can accept arguments for things like where to put the new folder, what space template to use, etc. That's up to you.

Where do I implement the settings html of my TYPO3 extension?

I am currently developing my own TYPO3 extension (in v 9.5.11) and I want to know where I have to reference the Html file that is supposed to open when you click on Admin Tools-->MyExtension in the TYPO3 sidebar.
This completely depends on how you integrated your extension; there are at least two (vanilla, Extbase) ways to make such modules. Where your template file (which is Fluid, not pure HTML) exists depends on the integration and your TypoScript configuration that defines template paths, but by default it would be in your extension, in the sub path Resources/Private/Templates/$controllerName where $controlerName is the name of the controller that renders your plugin.
Note that template paths for frontend and backend are configured separately.
If you use the vanilla way of making backend modules you most likely need to define this template manually, by setting it in the view, in which case it can be placed anywhere you like (but should of course be inside your extension).
Have a look at system extension extensionmanager, where the backend module has some registered controller classes, and methods in ext_tables.php. fx class ListController, with indexAction, unresolvedDependenciesAction, terAction, ... and more methods:
'List' => 'index,unresolvedDependencies,ter,showAllVersions,distributions',
ListController class like all other controller classes uses FLUID views, which is looking for HTML templates inside Resources/Private/Templates/<CONTROLLERNAME>/...
For ListController->indexAction it would be Resources/Private/Templates/List/Index.html where you can use TYPO3 FLUID functionality.
See also https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/BackendModules/TemplateClass/Index.html
Well, It is always recommended to write your question clearly and bit more detail so people can understand quickly.
Anyway as I understand the question, you're talking about view resource file. If you have created your extension with Extension builder, your action file will automatically be generated in the Resource folder.
BE module directory will be Resources/Private/Backend See the example here.
In the TypoScript, you will get the source path this will something look like this.
To check the backend default action, you can see the backend module configuration here. From here you will get better idea which action will be call by default (Probably List action)
In this directory, you will have all the HTML you need. Hope this will help you!

How to make pluggable architecture ASP.NET5/MVC 6?

I want to build an web application(ASP.NET MVC 6) that can add modules/plugins without having to rewrite my source code.
Already read about MEF and Areas but are not helping much.
Someone who has overcome this problem that can help me?
Depends on which part of the web application you are targeting.
1.If it's in the request pipeline you would make a Middleware package.
2.It's it's in HTML you would make a TAG Helper package.
3.If it's an intrinsic functionality you would extend appropriate classes and throw them into a package. An example of this would be helpful extension methods or methods to add claims given a claims principal.
4.If you want to go even further you could create your own Visual Studio templates that you can use to pre-fill your options upon creation.

How to create custom pages in dasBlog?

I know I've seen this in the past, but I can't seem to find it now.
Basically I want to create a page that I can host on a dasBlog instance that contains the layout from my theme, but the content of the page I control.
Ideally the content is a user control or ASPX that I write. Anybody know how I can accomplish this?
The easist way to do this is to "hijack" the FormatPage functionality.
First add the following to your web.config in the newtelligence.DasBlog.UrlMapper section:
<add matchExpression="(?<basedir>.*?)/Static\.aspx\?=(?<value>.+)" mapTo="{basedir}/FormatPage.aspx?path=content/static/{value}.format.html" />
Now you can create a directory in your content directory called static. From there, you can create html files and the file name will map to the url like this:
http://BASEURL/Static.aspx?=FILENAME
will map to a file called:
/content/static/FILENAME.format.html
You can place anything in that file that you would normally place in itemTemplate.blogtemplate, except it obviously won't have any post data. But you can essentially use this to put other macros, and still have it use the hometemplate.blogtemplate to keep the rest of your theme wrapped around the page.
I did something similar setting up a handler to stream video files from the blog on my home server. I ended up ditching it because it killed my bandwidth whenever someone would view a video, but I did have it up and working for a while.
To get it to work I had to check dasBlog out from source control and open it in visual studio. I had VS2008 and it was built using VS2005, so it took some work to get everything to build. Once I could get the unaltered solution to build I added a new class library project to hold my code. This is to make sure my code stays separate across dasBlog updates.
I don't have access to the code here at work so I can't tell you exact names right now, but if you want your pages to be able to use the themes then they need to inherit from a class in the newtelligence.dasBlog.Web namespace, and I believe also implement an interface. A good place to look is in FormatPage and FormatControl.