Powered By Blogger

Tuesday, September 27, 2011

Grails

Spring Source tools eclipse is used foe Grails Development.


Now will tell some steps

1. By default in the controller index method will be called
2. In the views folder name of the controller (login) folder will be created if you create loginController

3. In the controller we can instantiate Java classes and call them

4. In the contoller we will have the enclosures.

if you have the enclosure by name search inside LoginController
then it will look for
views --> login-->search.gsp

def search= {
render "abccc.gsp";
}


5. to define variables use def, semicolons are not mandatory

6. USes Gstrings similar to Velocity.


Sample

package com.hersheys.groovy.quickr

import com.hersheys.quickr.migration.TestClass

class LoginController {

/* def index = {

//can be double or string
def i = 4;

System.out.print("Inside the LoginController");

if(i < 0.5){
render "Hellvsgvdso World";
}else{
// brackets are not mandtory
render ("asfasgfasg");
}


//grroovy typeless, no return type , No semicolons , Gstring we have extrac com pared to Java


// Now calling Java

TestClass testClass = new TestClass();
def name = testClass.getNickName("john");

render name;
}
*/

def index = {

//We can configure the gsp to be used as below
//render "abccc.gsp";

// if you leave this method emptry then the index.gsp will be take n from the login folder of views
}


// url --- We can access closure similar to Dispatch Action
//http://localhost:8080/QuickrAlfresco/login/index
//login -- Controller
//index-- closure


def update = {
//render "updatehit"
System.out.print("Inside the update Closure. If we dont return anything then it will look for update.gsp inside song folder in views");
}


def search ={

def x = params.item;
//render x;
request.message = x;
}

}


We can explictly specify the name of the file where to go also

Link to get the Remote object

https://forums.alfresco.com/en/viewtopic.php?t=17587

Sunday, September 25, 2011

Saturday, September 24, 2011

Policy and Behaviour

We can trigger same policy for 2 contents in 2 different classes

EX:
public class UsageQuotaProtector implements NodeServicePolicies.OnUpdatePropertiesPolicy


public void init()
{
if (contentUsageService.getEnabled())
{
// Register interest in the onUpdateProperties policy
policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"),
ContentModel.TYPE_PERSON,
new JavaBehaviour(this, "onUpdateProperties"));
}
}


Similarly we can have
public class RepositoryAuthenticationDao implements MutableAuthenticationDao, InitializingBean, OnUpdatePropertiesPolicy, BeforeDeleteNodePolicy



*/
public void afterPropertiesSet() throws Exception
{
this.policyComponent.bindClassBehaviour(
OnUpdatePropertiesPolicy.QNAME,
ContentModel.TYPE_PERSON,
new JavaBehaviour(this, "onUpdateProperties"));

Friday, September 23, 2011

Alfresco Liferay doclib

http://pypeline.net

In this site you have the demo for alfreso and liferay doclib integration

Commands to copy file

sudo su -liferay



cp /home/hbasa/share-config-custom.xml /opt/liferay-portal-6.0-ee/tomcat-6.0.29/shared/classes/alfresco/web-extension/


file operations
vim filename
to open the file

press i to write the content

once you are done with file operation do this to save and quit
esc:q! --- To Quit the file

escape+:+w+q
To write and quit the file

Wednesday, September 21, 2011

We can generate the classes from the below command

http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html

We can generate the classes from the below command
wsimport -keep -verbose wsdl_URL


This is how we generate files

wsimport -p com.patil.jax -keep file.wsdl