06-24-2008 09:50 AM
package org.atosorigin.repo.action.executer;
import org.alfresco.error.AlfrescoRuntimeException;
public class testException extends AlfrescoRuntimeException {
/**
*
*/
private String cannotPaste;
public testException(String cannotPaste){
super(cannotPaste);
this.cannotPaste=cannotPaste;
}
/*public String getCannotPaste(){
return cannotPaste;
}*/
public String getMessage(){
return (" Attention " + cannotPaste + ", cette valeur est encorre utilisé."); //getCannotPaste();
}
}
protected void executeImpl(final Action ruleAction,
final NodeRef actionedUponNodeRef)
{
/*
* recuperation du name de l'espace et celui de l'espace parent
*/
String namevaleur = nodeService.getProperty(actionedUponNodeRef,
valeurMetadata(actionedUponNodeRef, "name")).toString();
NodeRef nodeparent = nodeService.getPrimaryParent(actionedUponNodeRef)
.getParentRef();
String nameParent = nodeService.getProperty(nodeparent,
valeurMetadata(actionedUponNodeRef, "name")).toString();
nameParent = nameParent.replaceAll("\\s", "");
if (nameParent.contains("toto")) {
List<NodeRef> result = requeteLucene("ASPECT", "propertytoto");
if (!verifieValeur(result, "titi", namevaleur)) {
System.out.println("je v supprimer la valeur");
deleteValeur(namevaleur, nameParent);
} else {
System.out.println("afficher message d'erreur");
throw new testException(namevaleur);
}
}
08-01-2008 08:12 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.