Posts

Showing posts from 2017

At Least One Checkbox Is Checked From All CheckBox Group | #CodeFactory

Image
File : checkBox.jsp <!DOCTYPE html > <html> <head> <title>checkbox</title> <!-- for bootstrap css and js --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <center> <h2> checkbox</h2> </center> <form action="#" class="form-horizontal" method="post" onsubmit="return checkFormData()"> <!-- Check Box 1 --> <div class="form-group"> <label class="control-label col-sm-4">Check Box 1</label> <div class="col-sm-5"> <

Web Page Editor In Eclipse | Code Factory

Image
You use the Web Page Editor Palette to edit and create a variety of tags, such as HTML, JSP, JSF, and so on. In addition to standard HTML and JSP tags, the Palette displays an item for each tag in the JSP tag libraries that are on the application's classpath. You drag and drop tags on to the Design or Source view to design Web pages. You can pin the Palette to be open, or set to automatically expand when the cursor is placed over it while it is in its collapsed state. To access the Palette, from your Web project open in the Project Explorer, right-click a page on which you are planning to drop or edit tags, and then select Open With > Web Page Editor from the drop-down menu. Tags : Web Application Development - Using the Web Page Editor Web Page Editor - Eclipse Web Tools Platform (WTP) - Eclipse HTML Editor (WTP) - Eclipse How To Edit JSP Page In Eclipse

FTP Connection In Installed Alfresco | Code Factory

Image
Note  :  First check that PC is able to create FTP connection... Step 1 : Stop alfresco. Step 2 : Add these properties in < alfresco> -> tomcat -> shared -> classes -> alfresco-global.properties ftp.enabled=true ftp.port=2121 Step 3 : Start alfresco. Step 4 : Check FTP connection is successfully created or not using URL. ftp://<ip address>:2121/alfresco Tags : Alfresco Tutorial Configuring the FTP file server How To Enable FTP On Alfresco? Transfer and Get File Using FTP

FTP Connection In Alfresco | Code Factory

Image
Note : First check that PC is able to create FTP connection... Step 1 : Add these properties in alfresco-global.properties ftp.enabled=true ftp.port=2121 Step 2 : Start Repo and Share. Step 3 : Check FTP connection is successfully created or not using URL. ftp://<ip address>:2121/alfresco Tags : Alfresco Tutorial Configuring the FTP file server How To Enable FTP On Alfresco? Transfer and Get File Using FTP

Java DOM Parser - Parse XML Document | Code Factory

Image
File : ReadXMLFile.java package com.codeFactory; import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class ReadXMLFile { public static void main(String[] args) { // TODO Auto-generated method stub try { File folder = new File("./src/com/codeFactory"); File[] listOfFiles = folder.listFiles(); // get all files details for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile() && listOfFiles[i].toString().contains(".xml")) { // check file is xml or not System.out.println("\n*** File " + listOfFiles[i].getName() + " ***\n"); File fXmlFile = new File("./src/com/codeFactory/" + listOfFiles[i].getName()); DocumentBuilderFactory dbFactory = DocumentBuilderFactory .n

Add and Delete User Using REST API In Alfresco | Code Factory

Image
Alfresco One 5.x Developer's Guide :  Download. Log in : GET  /alfresco/s/api/login?u={username}&pw={password?} Log in and establish a ticket.  Input u cleartext user name (must be URL encoded) pw cleartext password (must be URL encoded) Returns the new authentication ticket.  The user name and password are provided as URL arguments which may be logged by proxies or the Alfresco server. Add Person : POST  /alfresco/s/api/people Adds a new person based on the details provided.  userName mandatory - the user name for the new user firstName mandatory - the given Name lastName mandatory - the family name email mandatory - the email address password optional - the new user's password. If not specified then a value of "password" is used which should be changed as soon as possible. disableAccount optional - If present and set to "true" the user is created but their account will be disabled. quota optional - Sets the q

Upload Metadata And Files Using Batch Import Or Bulk Import In Alfresco | Code Factory

Image
Alfresco One 5.x Developer's Guide :  Download. Streaming bulk import is exposed in two web scripts: A simple UI web script that can be used to set up the parameters for an import. This is an HTTP GET web script with a path of: http://localhost:8080/alfresco/service/bulkfsimport An initiate web script that kicks off an import using parameters that are passed to it (for the source directory, target space, and so on). If you want to script or invoke the tool programmatically, this is the web script that you call. This is an HTTP POST web script with a path of:  http://localhost:8080/alfresco/service/bulkfsimport/initiate The UI web script presents the following simplified HTML form: The  Import directory  field is required and indicates the absolute file system directory to load the content and spaces from, in an OS-specific format. Note that this directory must be locally accessible to the server on which the Alfresco instance is running. It must either be a

SMTP Server Configuration In DSpace | Code Factory

Image
Download DSpace  :   Download. - Stop tomcat - Open dspace.conf (D: -> dspace -> config)   -  Edit properties or uncomment it mail.server = smtp.gmail.com mail.server.username = username@gmail.com mail.server.password = PASSWORD mail.server.port = 465 mail.allowed.referrers = localhost mail.extraproperties = mail.smtp.socketFactory.port=465, \ mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory, \ mail.smtp.socketFactory.fallback=false -  Start tomcat ( NOTE : If you change <dspace-x.x-src-release> -> dspace -> config -> dspace.conf then you must Build and Configure the dspace and then start tomcat ) Tags : DSpace tutorial DSpace SMTP server setup for enabling Emails Dspace Gmail SMTP Configuration Configure Gmail on Dspace How to configure smtp email settings in DSpace Configure SMTP mail server On Dspace

WYSIWYG Editor In DSpace | Code Factory

Image
Download DSpace :  Download. In order to allow HTML in item metadata, we propose the inclusion of a WYSIWYG editor during Describe Step. This addition would allow a user to enter rich text as metadata value. Here are some case scenarios: Allow abstracts with some visual styles like bold, italic Allow free HTML Also, it would allow the use of additional plugins like Latex formulas. To add WYSIWYG editor in DSpace, an easy and good option is adding online .js to any page because DSpace doesn't have any plugin. Add online .js in header-submission.jsp (<tomcat> -> webapps -> jspui -> layout), it adds WYSIWYG editor in all pages. If you want to add WYSIWYG editor to only for particular page then add .js to page where you want this editor like add .js to edit-community.jsp  (<tomcat> -> webapps -> jspui -> tools)  Add this code to your JSP page. <script src="https://cloud.tinymce.com/stable/tinymce.min.js">&

Create Community, Sub Community and Versioning in DSpace | Code Factory

Image
Download DSpace :  Download. Start and Create Versioning in DSpace : Step 1 : Stop tomcat. Step 2 : Go to <dspace-x.x-src-release> -> dspace -> config -> modules -> versioning.cfg and then make all false to true. Step 3 : Build and configure DSpace and Start tomcat Step 4 : Go to URL : http://localhost:8080/jspui             Click on any submitted collection from the below on HOME.             Select "Create version of this item" or "Show version history". Tags : DSpace tutorial Create Community, Sub Community and Versioning in DSpace Create versioning in dspace  Item level versioning Item Versioning Support

How to Install DSpace on Windows | Code Factory

Download DSpace :  Download. How to Configure DSpace in Windows Using CMD : Step 1 : Download DSpace from the above link. Step 2 : First download these softwares and install on your machine.      1) apache-ant-x.x.x-bin      2) apache-maven-x.x.x      3) Java and Tomcat      4) PostgreSQL Step 3 : Login in PGadmin and create user : dspace and password : dspace with full role. Step 4 : Create database with name dspace with dspace user role. Step 5 : Go to location <dspace> -> dspace -> config and then copy file local.cfg.EXAMPLE and paste at same location and rename it with local.cfg Step 6 : Now remove all blank lines from the local.cfg and dspace.cfg Step 7 : Create a extension in postgre in dspace database. CREATE EXTENSION pgcrypto; commit; Step 8 : CMD : <dspace> -> dspace -> mvn package Step 9 : CMD : <dspace> -> dspace -> target -> dspace-installer -> ant fresh_install Step 10 : Pr

How To Add Language To DSpace? | Gujarati Language in DSpace | Code Factory

Image
Download DSpace :  Download. Steps for add another language in DSpace : Step 1 : Stop tomcat. Step 2 : Go to <dspace-x.x-src-release> -> dspace -> config -> local.cfg and add / change default.language = gu_IN default.locale = gu webui.supported.locales = gu, en Step 3 : Go to <dspace-x.x-src-release> -> dspace -> config -> dspace.cfg and add / change default.locale = gu webui.supported.locales = gu, en Step 4 : Go to <dspace-x.x-src-release> -> dspace-api -> src -> main -> resouces and copy Messages.properties and rename it to Messages_gu.properties and change values according to requirements ( Convert english text into gujarati text and then convert gujarati text into uni code ).       English to Gujarati convert :  Link.       Gujarati to uni code convert :  Link.  (Note :  Select text from the  JavaScript textbox ) Step 5 : Eclipse -> dspace -> right click -> run as -> runconfiguration ->

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