mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-16 17:55:15 +00:00
Fix main entry point for the interpreters
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6816 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
1747086061
commit
0d7da3e6e6
@ -65,24 +65,25 @@ public abstract class BaseInterpreter extends AbstractLifecycleBean
|
|||||||
*/
|
*/
|
||||||
protected String lastCommand = null;
|
protected String lastCommand = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
public static void runMain(String beanName)
|
||||||
* Main entry point.
|
|
||||||
*/
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
{
|
||||||
ApplicationContext context = ApplicationContextHelper.getApplicationContext();
|
ApplicationContext context = ApplicationContextHelper.getApplicationContext();
|
||||||
|
runMain(context, beanName);
|
||||||
BaseInterpreter console = getConsoleBean(context);
|
}
|
||||||
|
|
||||||
|
public static void runMain(ApplicationContext context, String beanName)
|
||||||
|
{
|
||||||
|
BaseInterpreter console = getConsoleBean(context, beanName);
|
||||||
|
|
||||||
console.username = DEFAULT_ADMIN;
|
console.username = DEFAULT_ADMIN;
|
||||||
console.rep();
|
console.rep();
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BaseInterpreter getConsoleBean(ApplicationContext context)
|
public static BaseInterpreter getConsoleBean(ApplicationContext context, String beanName)
|
||||||
{
|
{
|
||||||
return null;
|
return (BaseInterpreter)context.getBean(beanName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,6 @@ import java.util.List;
|
|||||||
import org.alfresco.i18n.I18NUtil;
|
import org.alfresco.i18n.I18NUtil;
|
||||||
import org.alfresco.service.cmr.admin.RepoAdminService;
|
import org.alfresco.service.cmr.admin.RepoAdminService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
@ -54,13 +53,12 @@ public class RepoAdminInterpreter extends BaseInterpreter
|
|||||||
this.repoAdminService = repoAdminService;
|
this.repoAdminService = repoAdminService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Main entry point.
|
||||||
*/
|
*/
|
||||||
public static BaseInterpreter getConsoleBean(ApplicationContext context)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
return (RepoAdminInterpreter)context.getBean("repoAdminInterpreter");
|
runMain("repoAdminInterpreter");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasAuthority(String username)
|
protected boolean hasAuthority(String username)
|
||||||
|
@ -61,9 +61,12 @@ public class TenantInterpreter extends BaseInterpreter
|
|||||||
this.authenticationService = authenticationService;
|
this.authenticationService = authenticationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BaseInterpreter getConsoleBean(ApplicationContext context)
|
/**
|
||||||
|
* Main entry point.
|
||||||
|
*/
|
||||||
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
return (TenantInterpreter)context.getBean("tenantInterpreter");
|
runMain("tenantInterpreter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +67,6 @@ import org.alfresco.service.namespace.NamespaceService;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.alfresco.util.GUID;
|
import org.alfresco.util.GUID;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.ApplicationEvent;
|
import org.springframework.context.ApplicationEvent;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
@ -219,11 +218,11 @@ public class WorkflowInterpreter extends BaseInterpreter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Main entry point.
|
||||||
*/
|
*/
|
||||||
public static BaseInterpreter getConsoleBean(ApplicationContext context)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
return (WorkflowInterpreter)context.getBean("workflowInterpreter");
|
runMain("workflowInterpreter");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasAuthority(String username)
|
protected boolean hasAuthority(String username)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user