Posts

Showing posts from August, 2017

Java 8 Lambda Expressions | Code Factory

Image
Lambda expression is a new and important feature of Java which was included in Java SE 8. Lambda expression facilitates functional programming, and simplifies the development a lot. Syntax ( Arguments / parameters) -> {Body} Java lambda expression is consisted of three components. 1) Argument / Parameters:  It can be empty or non-empty as well. 2) Arrow-token:  It is used to link arguments-list and body of expression. 3) Body:  It contains expressions and statements for lambda expression. Java Example without Lambda Expression interface Drawable { public void draw(); } public class Main { public static void main(String[] args) { int width = 10; // without lambda, Drawable implementation using anonymous class Drawable d = new Drawable() { public void draw() { System.out.println("Drawing " + width); } }; d.draw(); } } Output :  Drawing 10 Java Example with Lambda Expression @FunctionalInterface // It i

Alfresco Books | Code Factory

1. Alfresco Content Services 5.2 On Premises Reference Architecture :  Link. 2. Alfresco Content Services 5.2 Administrator Guide :  Link. 3. Alfresco Content Services 5.2 Developer Guide :  Link. 4. Alfresco Content Services 5.2 Getting Started Guide :  Link. 5. Alfresco One 5x Developer's Guide - 2nd Edition :  Link. Tags : Alfresco Content Services 5.2 On Premises Reference Architecture Alfresco Content Services 5.2 Administrator Guide Alfresco Content Services 5.2 Developer Guide Alfresco Content Services 5.2 Getting Started Guide Alfresco One 5x Developer's Guide - 2nd Edition

Customizing the Share Header Style (Aikau) and Introducing SurfBug in Alfresco | Code Factory

Image
Customizing the Share Header Style (Aikau) : Go to Url :  http://127.0.0.1:8080/share/page/modules/deploy and add " Debug Enable Extension ". Introducing Surfbug : Go to Url :  http://127.0.0.1:8080/share/page/surfBugStatus and click button " Enable Surfbug ". Tags : Alfresco Tutorials Customizing the Share Header Style (Aikau) and Introducing SurfBug Customizing the Share Header Style Introducing SurfBug How to enable surfbug in alfresco

Customizing the Share Header in Alfresco | Code Factory

Image
File : share-header.get.js ( <Alfresco> -> tomcat -> webapps -> share -> WEB-INF -> classes -> alfresco -> site-webscripts -> org -> alfresco -> share -> header ) Removing Menu Items : if (user.isAdmin) { widgetUtils.deleteObjectFromArray(model.jsonModel, 'id', 'HEADER_MY_FILES'); } This code remove 'My Files' from the header if user is Admin . Other widgets for removing menus from the header... widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER ADMIN CONSOLE"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_TASKS"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU"); widgetUtils.deleteObjectF

Cannot find Alfresco Repository on this server | Code Factory

Cannot find Alfresco Repository on this server. (Does this application have access to alfresco-global.properties? Does this application have cross-context permissions?) If you try to configuring the MySQL database with alfresco and this error come then follow this steps... First of all follw this :  Link. Then check you completed these steps or not : Copy mysql-connector-java-5.x.x jar into <Alfresco>  ->  tomcat  ->  lib folder. max_connections = 275  in C -> Program Files(x86) -> MySQL  ->  MySQL Server 5.0  ->  my.ini Create user alfresco and assign all privilages. Create schema alfresco in DB.

Add a new page to Alfresco Share with link in Share Header | Code Factory

Image
The following steps are needed to add a Surf Page: Add a Surf Page definition file (XML) Add a Template Instance file (XML) Add a physical Template file (FTL) Add a properties file (.properties) - Optional but good practice Add Web Script(s) that fetches content to display (if you have page scoped regions and use an existing template) File :  helloworldhome.xml ( <Alfresco> -> tomcat -> shared -> classes -> alfresco -> web-extension -> site-data -> pages ) <?xml version='1.0' encoding='UTF-8'?> <page> <title>Hello World Home</title> <title-id>page.helloworldhome.title</title-id> <description>Hello World Home Description</description> <description-id>page.helloworldhome.description</description-id> <template-instance>helloworldhome-three-column</template-instance> <authentication>none</authentication> </page>

Creating a new theme in Alfresco | Code Factory

Image
Step1  : Go to <Alfresco> -> tomcat -> webapps -> share -> themes . Step2  : Copy the contents of an existing theme directory to the new theme directory.              Example : greenTheme to codeFactoryTheme Step3  : Open following files :              - presentation.css              - yui/assets/skin.css Step4  : Search for .yui-skin-greenTheme and replace with .yui-skin-codeFactoryTheme (In both files). Step5  : Save the files. Step6  : Create a new XML file in the <Alfresco> -> tomcat -> webapps -> share -> web-inf -> classes -> alfresco -> site-data -> themes then copy greenTheme.xml and rename codeFactoryTheme.xml Step7  : Open the codeFactoryTheme.xml file, change all instances of greenTheme to codeFactoryTheme, and then save the files. Step8  : Restart server. Step9  : Done. Tags : Alfresco tutorials Creating a new theme in Alfresco Creating a Custom Theme for Alfresco Share Alfresco Share the

Upload a file in Alfresco using java | Code Factory

Image
Download code and jars :  Link. Release 1.1.0 -> Commodity Packages -> Package -> OpenCMIS Client with dependencies File : AlfrescoFileUpload.java package com.alfresco; package com.alfresco; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.math.BigInteger; import java.util.HashMap; import java.util.Map; import org.apache.chemistry.opencmis.client.api.Document; import org.apache.chemistry.opencmis.client.api.Folder; import org.apache.chemistry.opencmis.client.api.Session; import org.apache.chemistry.opencmis.client.api.SessionFactory; import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl; import org.apache.chemistry.opencmis.commons.PropertyIds; import org.apache.chemistry.opencmis.commons.SessionParameter; import org.apache.chemistry.opencmis.commons.data.ContentStream; import org.apache.chemistry.opencmis.commons.enums.BindingType; import org.apache.chemistry.opencmis.commons.enums.VersioningState; import org.apach

Change Default Language In Alfresco | Code Factory

Image
Step1 : Download jars :  Link. Step2 : Copy these jar files into  C:\alfresco-community\tomcat\shared\lib  Folder. Step3 : Restart alfresco. Step4 : Now change browser language. Step5  : Done. Tags : Change default language in alfresco How to change languages in Alfresco 5.0.x Language support in alfresco How to change language of alfresco share