01-23-2008 08:55 AM
01-24-2008 01:36 AM
01-24-2008 07:34 AM
…….
try
{
String serverhost = "http://10.1.9.46:8080/alfresco/api";
WebServiceFactory.setEndpointAddress(serverhost);
AuthenticationUtils.startSession(user, pass);
try
{
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
String qString = "@bpm\\:workflowDefinitionId:\"jbpm$8\"";
ResultSetRow[] rows = listaProcessos(repositoryService,qString);
if (rows == null)
{
System.out.println("No query results found.");
}
else
{
for (int x = 0; x < rows.length; x++)
{
ResultSetRow row = rows[x];
NamedValue[] columns = row.getColumns();
for (int y = 0; y < columns.length; y++)
{
if(row.getColumns(y).getName().endsWith("workflowInstanceId"))
{
System.out.println("Process("+x+"): "
+ "WorkflowInstanceId = "
+ row.getColumns(y).getValue());
}
if(row.getColumns(y).getName().endsWith("name"))
{
System.out.println("Process("+x+"): "
+ "ProcessName = "
+ row.getColumns(y).getValue());
}
if(row.getColumns(y).getName().endsWith("creator"))
{
System.out.println("Process("+x+"): "
+ "ProcessCreator = "
+ row.getColumns(y).getValue());
}
if(row.getColumns(y).getName().endsWith("created"))
{
String[] time = row.getColumns(y).getValue().split("T");
System.out.println("Process("+x+"): "
+ "CreationDate = "
+ time[0]);
}
}
String ResultId = rows[x].getNode().getId();
Reference reference = new Reference(STORE, ResultId, null);
QueryResult childQueryResult = repositoryService.queryChildren(reference);
ResultSet childResultSet = childQueryResult.getResultSet();
ResultSetRow[] childRows = childResultSet.getRows();
if (childRows == null)
{
System.out.println("No child.");
}
else
{
System.out.println("Results from process ("+x+")");
for(int t=0;t<childRows.length;t++)
{
NamedValue[] colum = childRows[t].getColumns();
for (int y = 0; y < colum.length; y++)
{
System.out.println("Process content (" + x + "): "
+ childRows[t].getColumns(y).getName() + " = "
+ childRows[t].getColumns(y).getValue());
}
}
}
System.out.println("\n");
}
AuthenticationUtils.endSession();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
catch(Exception e)
{
System.out.println("Nao Logou!!");
}
}
…….
01-30-2008 07:35 AM
String hostname = null;
try {
hostname = "10.1.9.46";
String data = URLEncoder.encode("scriptPath", "UTF-8") + "=" + URLEncoder.encode("/Company%20Home/Teste/workflow.js", "UTF-8");
int port = 8080;
InetAddress addr = InetAddress.getByName(hostname);
Socket socket = new Socket(addr, port);
String path = "/alfresco/command/script/execute";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF8"));
wr.write("POST "+path+" HTTP/1.0\r\n");
wr.write("Content-Length: "+data.length()+"\r\n");
wr.write("Content-Type: application/x-www-form-urlencoded\r\n");
wr.write("\r\n");
// Send data
wr.write(data);
wr.flush();
// Get response
BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// Process line…
System.out.println(rd.readLine());
}
wr.close();
rd.close();
wf.fechaSessao();
}catch ( UnknownHostException eh )
{
System.err.println( " host inexistente: "+hostname) ;
System.exit( 1 ) ;
}
10:18:25,847 User:guest ERROR [[localhost].[/alfresco].[commandServlet]] Servlet.service() for servlet commandServlet threw exception
org.alfresco.error.AlfrescoRuntimeException: Error during command servlet processing: Acesso Negado. Você nao tem permissão para executar esta operação.
at org.alfresco.web.app.servlet.CommandServlet.service(CommandServlet.java:194)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Unknown Source)
Caused by: org.alfresco.repo.security.permissions.AccessDeniedException: Acesso Negado. Você nao tem permissão para executar esta operação.
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:241)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
at $Proxy40.resolveNamePath(Unknown Source)
at org.alfresco.web.app.servlet.BaseServlet.resolveWebDAVPath(BaseServlet.java:297)
at org.alfresco.web.app.servlet.BaseServlet.resolveWebDAVPath(BaseServlet.java:263)
at org.alfresco.web.app.servlet.BaseServlet.resolveNamePath(BaseServlet.java:343)
at org.alfresco.web.app.servlet.command.ScriptCommandProcessor.validateArguments(ScriptCommandProcessor.java:80)
at org.alfresco.web.app.servlet.CommandServlet.service(CommandServlet.java:139)
… 15 more
Caused by: net.sf.acegisecurity.AccessDeniedException: Access Denied
at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationProvider.decide(ACLEntryAfterInvocationProvider.java:299)
at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationProvider.decide(ACLEntryAfterInvocationProvider.java:316)
at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationProvider.decide(ACLEntryAfterInvocationProvider.java:200)
at net.sf.acegisecurity.afterinvocation.AfterInvocationProviderManager.decide(AfterInvocationProviderManager.java:107)
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.afterInvocation(AbstractSecurityInterceptor.java:329)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:82)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
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.