Re: [ovirt-devel] Build failure on F19

2014-08-08 Thread Sandro Bonazzola
Il 08/08/2014 01:35, Colin Coe ha scritto:
 Hi all
 
 I'm attempting to build oVirt Engine from git.  I've been following 
 http://www.ovirt.org/OVirt_Engine_Development_Environment
 
 The errors I'm seeing are:
 ---
 Results :
 
 Tests in error:
   
 initializationError(org.ovirt.engine.api.restapi.resource.BackendResourceInfoDetailTest):
  Bad init method call from inside of a branch
 Exception Details:
   Location:
 
 org/ovirt/engine/api/restapi/resource/AbstractBackendResourceLoggingTest.init(Lorg/powermock/core/IndicateReloadClass;)V
  @40: invokespecial
   Reason:
 Error exists in the bytecode
   Bytecode:
 000: 2a2b 4e4d 1210 b800 1604 bd00 0d59 032d
 010: 5312 a6b8 001b b800 213a 0519 05b2 0025
 020: a500 0e2a 01c0 0027 b700 2aa7 000a 2c2d
 030: b700 2a01 57b1
   Stackmap Table:
 
 full_frame(@46,{UninitializedThis,Object[#39],UninitializedThis,Object[#39],Top,Object[#13]},{})
 
 full_frame(@53,{Object[#2],Object[#39],Object[#2],Object[#39],Top,Object[#13]},{})
 
   
 initializationError(org.ovirt.engine.api.restapi.resource.BackendResourceDebugDetailTest):
  Bad init method call from inside of a branch
 Exception Details:
   Location:
 
 org/ovirt/engine/api/restapi/resource/AbstractBackendResourceLoggingTest.init(Lorg/powermock/core/IndicateReloadClass;)V
  @40: invokespecial
   Reason:
 Error exists in the bytecode
   Bytecode:
 000: 2a2b 4e4d 1210 b800 1604 bd00 0d59 032d
 010: 5312 a6b8 001b b800 213a 0519 05b2 0025
 020: a500 0e2a 01c0 0027 b700 2aa7 000a 2c2d
 030: b700 2a01 57b1
   Stackmap Table:
 
 full_frame(@46,{UninitializedThis,Object[#39],UninitializedThis,Object[#39],Top,Object[#13]},{})
 
 full_frame(@53,{Object[#2],Object[#39],Object[#2],Object[#39],Top,Object[#13]},{})
 

latest java release on F19 is broken, just yum downgrade it and it will build.



 
 Tests run: 1427, Failures: 0, Errors: 2, Skipped: 71
 
 [INFO] 
 
 [INFO] Reactor Summary:
 [INFO]
 [INFO] ovirt-root  SUCCESS [0.759s]
 [INFO] oVirt Build Tools root  SUCCESS [0.026s]
 [INFO] oVirt checkstyle .. SUCCESS [2.449s]
 [INFO] oVirt JBoss Modules Maven Plugin .. SUCCESS [7.475s]
 [INFO] oVirt Checkstyle Checks ... SUCCESS [0.442s]
 [INFO] Extensions API root ... SUCCESS [0.469s]
 [INFO] ovirt-engine-extensions-api ... SUCCESS [9.139s]
 [INFO] oVirt Modules - backend ... SUCCESS [0.009s]
 [INFO] oVirt Manager . SUCCESS [0.027s]
 [INFO] oVirt Engine dependencies . SUCCESS [5.124s]
 [INFO] oVirt Modules - manager ... SUCCESS [1.820s]
 [INFO] Universal utilities ... SUCCESS [1.977s]
 [INFO] Extensions manager  SUCCESS [1.645s]
 [INFO] CSharp Compatibility .. SUCCESS [3.162s]
 [INFO] Common Code ... SUCCESS [13.578s]
 [INFO] Common utilities .. SUCCESS [26.240s]
 [INFO] Data Access Layer . SUCCESS [4.415s]
 [INFO] engine scheduler bean . SUCCESS [1.519s]
 [INFO] Vds broker  SUCCESS [6.338s]
 [INFO] Backend Authentication, Authorization and Accounting  SUCCESS [1.271s]
 [INFO] builtin-extensions  SUCCESS [1.574s]
 [INFO] Search Backend  SUCCESS [2.958s]
 [INFO] Backend Logic @Service bean ... SUCCESS [44.189s]
 [INFO] oVirt RESTful API Backend Integration . SUCCESS [0.305s]
 [INFO] oVirt RESTful API interface ... SUCCESS [0.138s]
 [INFO] oVirt Engine API Definition ... SUCCESS [9.658s]
 [INFO] oVirt Engine API Commom Parent POM  SUCCESS [0.137s]
 [INFO] oVirt Engine API Common JAX-RS  SUCCESS [2.500s]
 [INFO] oVirt RESTful API Backend Integration Type Mappers  SUCCESS [2:14.079s]
 [INFO] Branding package .. SUCCESS [6.994s]
 [INFO] oVirt RESTful API Backend Integration JAX-RS Resources  FAILURE 
 [47.614s]
 [INFO] oVirt RESTful API Backend Integration Webapp .. SKIPPED
 [INFO] Custom Logger Using Extensions  SKIPPED
 [INFO] oVirt Engine Web Root . SKIPPED
 [INFO] ovirt-engine services . SKIPPED
 [INFO] oVirt Engine Web Docs . SKIPPED
 [INFO] ovirt-engine welcome .. SKIPPED
 [INFO] oVirt Engine Tools  

[ovirt-devel] add a ***Command for a button

2014-08-08 Thread 力波 王
Hi, everyone:
I added a button on the Template Tab, in the client side, It’s OK,

Added the button’s callback like this:
===
 private void backup()
{
BackupInfoParameters param = new BackupInfoParameters();
Frontend.RunAction(VdcActionType.Unknown, param, new
IFrontendActionAsyncCallback() {
@Override
public void executed(FrontendActionAsyncResult result) {

}
});
}
===

The BackupInfoCommand.java is :
===
package org.ovirt.engine.core.bll;

import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.action.BackupInfoParameters;


import java.io.IOException;
import java.util.Collections;
import java.util.List;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoCommand T extends BackupInfoParameters extends
CommandBaseT{
public BackupInfoCommand(T parameters){
super(parameters);
}

@Override
public ListPermissionSubject getPermissionCheckSubjects() {
return Collections.emptyList();
}

@Override
protected boolean canDoAction() {
return true;
}


@Override
protected void executeCommand() {
int a;
a = 1;
try{
Runtime.getRuntime().exec(touch /tmp/tmp.txt);
}catch (IOException e){
e.printStackTrace();
}

}
}
===

And the BackupInfoParameters.java is:
===
package org.ovirt.engine.core.common.action;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoParameters extends VdcActionParametersBase implements
java.io.Serializable{
private static final long serialVersionUID = -1363077467684414051L;
private VdcActionType _actionType;

//public BackupInfoParameters(){}

public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}

public VdcActionType getActionType() {
return _actionType;
}
}
===

Built the code success, but when I clicked the button, got a dialog with the
error info:

Error while executing action: A Request to the Server failed with the
following Status Code: 500

I debug it , find the error is raised at :

protected VdcReturnValueBase evaluateCorrelationId(CommandBase?
commandBase) {
VdcReturnValueBase returnValue = null;

// Evaluate and set the correlationId on the parameters, fails on
invalid correlation id
returnValue =
ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());
if (returnValue != null) {
log.warnFormat(CanDoAction of action {0} failed. Reasons: {1},
commandBase.getActionType(),
StringUtils.join(returnValue.getCanDoActionMessages(),
','));

}
// Set the correlation-id on the command

commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId())
;
return returnValue;
}


___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

[ovirt-devel] FW: add a ***Command for a button

2014-08-08 Thread 力波 王


发件人:  力波 王 wlblea...@126.com
日期:  Fri, 08 Aug 2014 16:10:48 +0800
至:  devel@ovirt.org
主题:  [ovirt-devel] add a ***Command for a button

Hi, everyone:
I added a button on the Template Tab, in the client side, It’s OK,

Added the button’s callback like this:
===
 private void backup()
{
BackupInfoParameters param = new BackupInfoParameters();
Frontend.RunAction(VdcActionType.Unknown, param, new
IFrontendActionAsyncCallback() {
@Override
public void executed(FrontendActionAsyncResult result) {

}
});
}
===

The BackupInfoCommand.java is :
===
package org.ovirt.engine.core.bll;

import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.action.BackupInfoParameters;


import java.io.IOException;
import java.util.Collections;
import java.util.List;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoCommand T extends BackupInfoParameters extends
CommandBaseT{
public BackupInfoCommand(T parameters){
super(parameters);
}

@Override
public ListPermissionSubject getPermissionCheckSubjects() {
return Collections.emptyList();
}

@Override
protected boolean canDoAction() {
return true;
}


@Override
protected void executeCommand() {
int a;
a = 1;
try{
Runtime.getRuntime().exec(touch /tmp/tmp.txt);
}catch (IOException e){
e.printStackTrace();
}

}
}
===

And the BackupInfoParameters.java is:
===
package org.ovirt.engine.core.common.action;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoParameters extends VdcActionParametersBase implements
java.io.Serializable{
private static final long serialVersionUID = -1363077467684414051L;
private VdcActionType _actionType;

//public BackupInfoParameters(){}

public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}

public VdcActionType getActionType() {
return _actionType;
}
}
===

Built the code success, but when I clicked the button, got a dialog with the
error info:

Error while executing action: A Request to the Server failed with the
following Status Code: 500

I debug it , find the error is raised at :

protected VdcReturnValueBase evaluateCorrelationId(CommandBase?
commandBase) {
VdcReturnValueBase returnValue = null;

// Evaluate and set the correlationId on the parameters, fails on
invalid correlation id
returnValue =
ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());
if (returnValue != null) {
log.warnFormat(CanDoAction of action {0} failed. Reasons: {1},
commandBase.getActionType(),
StringUtils.join(returnValue.getCanDoActionMessages(),
','));

}
// Set the correlation-id on the command

commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId())
;
return returnValue;
}
___ Devel mailing list
Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Re: [ovirt-devel] add a ***Command for a button

2014-08-08 Thread Oved Ourfali
Hi Didn't do a too deep code review, but from a first glance 
 You need to add a new VdcActionType that is called BackupInfo, and use that 
when you call RunAction.  Hope it helps, 
 Oved On Aug 8, 2014 11:11 AM, =?UTF-8?B?5Yqb5rOiIOeOiw==?= wlblea...@126.com 
wrote:
Hi, everyone:
I added a button on the Template Tab, in the client side, It’s OK,

Added the button’s callback like this:
===
 private void backup()
{
BackupInfoParameters param = new BackupInfoParameters();
Frontend.RunAction(VdcActionType.Unknown, param, new
IFrontendActionAsyncCallback() {
@Override
public void executed(FrontendActionAsyncResult result) {

}
});
}
===

The BackupInfoCommand.java is :
===
package org.ovirt.engine.core.bll;

import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.action.BackupInfoParameters;


import java.io.IOException;
import java.util.Collections;
import java.util.List;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoCommand T extends BackupInfoParameters extends
CommandBaseT{
public BackupInfoCommand(T parameters){
super(parameters);
}

@Override
public ListPermissionSubject getPermissionCheckSubjects() {
return Collections.emptyList();
}

@Override
protected boolean canDoAction() {
return true;
}


@Override
protected void executeCommand() {
int a;
a = 1;
try{
Runtime.getRuntime().exec(touch /tmp/tmp.txt);
}catch (IOException e){
e.printStackTrace();
}

}
}
===

And the BackupInfoParameters.java is:
===
package org.ovirt.engine.core.common.action;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoParameters extends VdcActionParametersBase implements
java.io.Serializable{
private static final long serialVersionUID = -1363077467684414051L;
private VdcActionType _actionType;

//public BackupInfoParameters(){}

public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}

public VdcActionType getActionType() {
return _actionType;
}
}
===

Built the code success, but when I clicked the button, got a dialog with the
error info:

Error while executing action: A Request to the Server failed with the
following Status Code: 500

I debug it , find the error is raised at :

protected VdcReturnValueBase evaluateCorrelationId(CommandBase?
commandBase) {
VdcReturnValueBase returnValue = null;

// Evaluate and set the correlationId on the parameters, fails on
invalid correlation id
returnValue =
ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());
if (returnValue != null) {
log.warnFormat(CanDoAction of action {0} failed. Reasons: {1},
commandBase.getActionType(),
StringUtils.join(returnValue.getCanDoActionMessages(),
','));

}
// Set the correlation-id on the command

commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId())
;
return returnValue;
}


___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Re: [ovirt-devel] add a ***Command for a button

2014-08-08 Thread 力波 王
hi, Oved:
I don’t know how to add a VdcAction,

Is this could work:
public enum VdcActionType {
Unknown(0, QuotaDependency.NONE),
Backup(9000, QuotaDependency.NONE),

I don’t know whether is it need a ActionGroup.


发件人:  Oved Ourfali oourf...@redhat.com
日期:  Fri, 8 Aug 2014 04:20:58 -0400 (EDT)
至:  力波 王 wlblea...@126.com
抄送:  devel@ovirt.org
主题:  Re: [ovirt-devel] add a ***Command for a button

Hi

Didn't do a too deep code review, but from a first glance
You need to add a new VdcActionType that is called BackupInfo, and use that
when you call RunAction.

Hope it helps, 
Oved

On Aug 8, 2014 11:11 AM, =?UTF-8?B?5Yqb5rOiIOeOiw==?= wlblea...@126.com
wrote:

Hi, everyone:
I added a button on the Template Tab, in the client side, It’s OK,

Added the button’s callback like this:
===
 private void backup()
{
BackupInfoParameters param = new BackupInfoParameters();
Frontend.RunAction(VdcActionType.Unknown, param, new
IFrontendActionAsyncCallback() {
@Override
public void executed(FrontendActionAsyncResult result) {

}
});
}
===

The BackupInfoCommand.java is :
===
package org.ovirt.engine.core.bll;

import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.action.BackupInfoParameters;


import java.io.IOException;
import java.util.Collections;
import java.util.List;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoCommand T extends BackupInfoParameters extends
CommandBaseT{
public BackupInfoCommand(T parameters){
super(parameters);
}

@Override
public ListPermissionSubject getPermissionCheckSubjects() {
return Collections.emptyList();
}

@Override
protected boolean canDoAction() {
return true;
}


@Override
protected void executeCommand() {
int a;
a = 1;
try{
Runtime.getRuntime().exec(touch /tmp/tmp.txt);
}catch (IOException e){
e.printStackTrace();
}

}
}
===

And the BackupInfoParameters.java is:
===
package org.ovirt.engine.core.common.action;

/**
 * Created by leaboy on 8/7/14.
 */
public class BackupInfoParameters extends VdcActionParametersBase implements
java.io.Serializable{
private static final long serialVersionUID = -1363077467684414051L;
private VdcActionType _actionType;

//public BackupInfoParameters(){}

public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}

public VdcActionType getActionType() {
return _actionType;
}
}
===

Built the code success, but when I clicked the button, got a dialog with the
error info:

Error while executing action: A Request to the Server failed with the
following Status Code: 500

I debug it , find the error is raised at :

protected VdcReturnValueBase evaluateCorrelationId(CommandBase?
commandBase) {
VdcReturnValueBase returnValue = null;

// Evaluate and set the correlationId on the parameters, fails on
invalid correlation id
returnValue =
ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());
if (returnValue != null) {
log.warnFormat(CanDoAction of action {0} failed. Reasons: {1},
commandBase.getActionType(),
StringUtils.join(returnValue.getCanDoActionMessages(),
','));

}
// Set the correlation-id on the command

commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId())
;
return returnValue;
}
___ Devel mailing list
Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel


___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Re: [ovirt-devel] add a ***Command for a button

2014-08-08 Thread 力波 王
Hi, Oved:
Get the new error :
Error while executing action: A Request to the Server failed: This
application is out of date, please click the refresh button on your
browser. ( The client cannot accept BackupInfo )

In the public VdcReturnValueBase executeAction()
actionAllowed is false

在 8/8/14, 16:52, Martin Perina mper...@redhat.com 写入:

Hi

- Original Message -
 From: 力波 王 wlblea...@126.com
 To: Oved Ourfali oourf...@redhat.com
 Cc: devel@ovirt.org
 Sent: Friday, August 8, 2014 10:34:38 AM
 Subject: Re: [ovirt-devel] add a ***Command for a button
 
 hi, Oved:
 I don’t know how to add a VdcAction,
 
 Is this could work:
 public enum VdcActionType {
 Unknown(0, QuotaDependency.NONE),
 Backup(9000, QuotaDependency.NONE),

Yes

 
 I don’t know whether is it need a ActionGroup.

You may not need to set ActionGroup for this

More info about oVirt Command architecture you can found at [1].

Martin Perina

[1] http://www.ovirt.org/Backend_modules_bll

 
 
 发件人: Oved Ourfali  oourf...@redhat.com 
 日期: Fri, 8 Aug 2014 04:20:58 -0400 (EDT)
 至: 力波 王  wlblea...@126.com 
 抄送:  devel@ovirt.org 
 主题: Re: [ovirt-devel] add a ***Command for a button
 
 
 
 Hi
 
 Didn't do a too deep code review, but from a first glance
 You need to add a new VdcActionType that is called BackupInfo, and use
that
 when you call RunAction.
 
 Hope it helps,
 Oved
 On Aug 8, 2014 11:11 AM, =?UTF-8?B?5Yqb5rOiIOeOiw==?= 
wlblea...@126.com 
 wrote:
 
 Hi, everyone:
 I added a button on the Template Tab, in the client side, It’s OK,
 
 Added the button’s callback like this:
 ===
 private void backup()
 {
 BackupInfoParameters param = new BackupInfoParameters();
 Frontend.RunAction(VdcActionType.Unknown, param, new
 IFrontendActionAsyncCallback() {
 @Override
 public void executed(FrontendActionAsyncResult result) {
 
 }
 });
 }
 ===
 
 The BackupInfoCommand.java is :
 ===
 package org.ovirt.engine.core.bll;
 
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.common.action.BackupInfoParameters;
 
 
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
 
 /**
 * Created by leaboy on 8/7/14.
 */
 public class BackupInfoCommand T extends BackupInfoParameters extends
 CommandBaseT{
 public BackupInfoCommand(T parameters){
 super(parameters);
 }
 
 @Override
 public ListPermissionSubject getPermissionCheckSubjects() {
 return Collections.emptyList();
 }
 
 @Override
 protected boolean canDoAction() {
 return true;
 }
 
 
 @Override
 protected void executeCommand() {
 int a;
 a = 1;
 try{
 Runtime.getRuntime().exec(touch /tmp/tmp.txt);
 }catch (IOException e){
 e.printStackTrace();
 }
 
 }
 }
 ===
 
 And the BackupInfoParameters.java is:
 ===
 package org.ovirt.engine.core.common.action;
 
 /**
 * Created by leaboy on 8/7/14.
 */
 public class BackupInfoParameters extends VdcActionParametersBase
implements
 java.io.Serializable{
 private static final long serialVersionUID = -1363077467684414051L;
 private VdcActionType _actionType;
 
 //public BackupInfoParameters(){}
 
 public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}
 
 public VdcActionType getActionType() {
 return _actionType;
 }
 }
 ===
 
 Built the code success, but when I clicked the button, got a dialog
with the
 error info:
 
 Error while executing action: A Request to the Server failed with the
 following Status Code: 500
 
 I debug it , find the error is raised at :
 
 protected VdcReturnValueBase evaluateCorrelationId(CommandBase?
 commandBase) {
 VdcReturnValueBase returnValue = null;
 
 // Evaluate and set the correlationId on the parameters, fails on
invalid
 correlation id
 returnValue =
 ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());
 if (returnValue != null) {
 log.warnFormat(CanDoAction of action {0} failed. Reasons: {1},
 commandBase.getActionType(),
 StringUtils.join(returnValue.getCanDoActionMessages(), ','));
 
 }
 // Set the correlation-id on the command
 
commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId
());
 return returnValue;
 }
 ___ Devel mailing list
 Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
 
 ___
 Devel mailing list
 Devel@ovirt.org
 http://lists.ovirt.org/mailman/listinfo/devel



___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Re: [ovirt-devel] add a ***Command for a button

2014-08-08 Thread Martin Perina


- Original Message -
 From: 力波 王 wlblea...@126.com
 To: Martin Perina mper...@redhat.com
 Cc: Oved Ourfali oourf...@redhat.com, devel@ovirt.org
 Sent: Friday, August 8, 2014 11:40:35 AM
 Subject: Re: [ovirt-devel] add a ***Command for a button
 
 Hi, Oved:
 Get the new error :
 Error while executing action: A Request to the Server failed: This
 application is out of date, please click the refresh button on your
 browser. ( The client cannot accept BackupInfo )
 

Can you please post stacktrace of the execption?

 In the public VdcReturnValueBase executeAction()
 actionAllowed is false
 
 在 8/8/14, 16:52, Martin Perina mper...@redhat.com 写入:
 
 Hi
 
 - Original Message -
  From: 力波 王 wlblea...@126.com
  To: Oved Ourfali oourf...@redhat.com
  Cc: devel@ovirt.org
  Sent: Friday, August 8, 2014 10:34:38 AM
  Subject: Re: [ovirt-devel] add a ***Command for a button
  
  hi, Oved:
  I don’t know how to add a VdcAction,
  
  Is this could work:
  public enum VdcActionType {
  Unknown(0, QuotaDependency.NONE),
  Backup(9000, QuotaDependency.NONE),
 
 Yes
 
  
  I don’t know whether is it need a ActionGroup.
 
 You may not need to set ActionGroup for this
 
 More info about oVirt Command architecture you can found at [1].
 
 Martin Perina
 
 [1] http://www.ovirt.org/Backend_modules_bll
 
  
  
  发件人: Oved Ourfali  oourf...@redhat.com 
  日期: Fri, 8 Aug 2014 04:20:58 -0400 (EDT)
  至: 力波 王  wlblea...@126.com 
  抄送:  devel@ovirt.org 
  主题: Re: [ovirt-devel] add a ***Command for a button
  
  
  
  Hi
  
  Didn't do a too deep code review, but from a first glance
  You need to add a new VdcActionType that is called BackupInfo, and use
 that
  when you call RunAction.
  
  Hope it helps,
  Oved
  On Aug 8, 2014 11:11 AM, =?UTF-8?B?5Yqb5rOiIOeOiw==?= 
 wlblea...@126.com 
  wrote:
  
  Hi, everyone:
  I added a button on the Template Tab, in the client side, It’s OK,
  
  Added the button’s callback like this:
  ===
  private void backup()
  {
  BackupInfoParameters param = new BackupInfoParameters();
  Frontend.RunAction(VdcActionType.Unknown, param, new
  IFrontendActionAsyncCallback() {
  @Override
  public void executed(FrontendActionAsyncResult result) {
  
  }
  });
  }
  ===
  
  The BackupInfoCommand.java is :
  ===
  package org.ovirt.engine.core.bll;
  
  import org.ovirt.engine.core.bll.utils.PermissionSubject;
  import org.ovirt.engine.core.common.action.BackupInfoParameters;
  
  
  import java.io.IOException;
  import java.util.Collections;
  import java.util.List;
  
  /**
  * Created by leaboy on 8/7/14.
  */
  public class BackupInfoCommand T extends BackupInfoParameters extends
  CommandBaseT{
  public BackupInfoCommand(T parameters){
  super(parameters);
  }
  
  @Override
  public ListPermissionSubject getPermissionCheckSubjects() {
  return Collections.emptyList();
  }
  
  @Override
  protected boolean canDoAction() {
  return true;
  }
  
  
  @Override
  protected void executeCommand() {
  int a;
  a = 1;
  try{
  Runtime.getRuntime().exec(touch /tmp/tmp.txt);
  }catch (IOException e){
  e.printStackTrace();
  }
  
  }
  }
  ===
  
  And the BackupInfoParameters.java is:
  ===
  package org.ovirt.engine.core.common.action;
  
  /**
  * Created by leaboy on 8/7/14.
  */
  public class BackupInfoParameters extends VdcActionParametersBase
 implements
  java.io.Serializable{
  private static final long serialVersionUID = -1363077467684414051L;
  private VdcActionType _actionType;
  
  //public BackupInfoParameters(){}
  
  public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}
  
  public VdcActionType getActionType() {
  return _actionType;
  }
  }
  ===
  
  Built the code success, but when I clicked the button, got a dialog
 with the
  error info:
  
  Error while executing action: A Request to the Server failed with the
  following Status Code: 500
  
  I debug it , find the error is raised at :
  
  protected VdcReturnValueBase evaluateCorrelationId(CommandBase?
  commandBase) {
  VdcReturnValueBase returnValue = null;
  
  // Evaluate and set the correlationId on the parameters, fails on
 invalid
  correlation id
  returnValue =
  ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());
  if (returnValue != null) {
  log.warnFormat(CanDoAction of action {0} failed. Reasons: {1},
  commandBase.getActionType(),
  StringUtils.join(returnValue.getCanDoActionMessages(), ','));
  
  }
  // Set the correlation-id on the command
  
 commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId
 ());
  return returnValue;
  }
  

Re: [ovirt-devel] Intro

2014-08-08 Thread Michal Skrivanek

On 8 Aug 2014, at 02:43, Colin Coe wrote:

 Hi all
 
 I'm a long time RHEV admin (since 2.1/2.2 days).  I'm in the process of 
 getting a dev workstation built to do some hacking to resolve some small 
 issues that are explained below.
 
 1)
 The business is moving to thin clients for specific users.  We're using IGEL 
 thin clients in appliance mode.  We have a problem where if the user (in the 
 User Portal) clicks on the Client Resources hyperlink, a new browse window 
 comes up that the user cannot move or dismiss.  
 
 I figure the  easiest way to resolve this is to put a Close button on the 
 Client Resources page.  Would this be acceptable to the project?

What is the browser on the IGEL client? Are you talking about RHEV or oVirt? 
Either way it's a branding item..you can as well disable/remove the link 
completely as I suppose it's not really relevant on a thin client

 
 2)
 In the power User Portal, VM descriptions are shown in parentheses.  In the 
 normal User Portal the description is not shown.  I'd like to have the 
 description shown in the normal User Portal also, maybe in parentheses on a 
 new line between the VM name and the VM's icon.  Is this acceptable to the 
 project?

should be easy enough. care to file a bug for it?

 
 3)
 Lastly, the normal user portal shows the VM image and to get a console, a 
 double click is required.  This is pretty much universally hated by our users 
  :(  The Power User Portal single click is loved by our users but I don't 
 want to to give them the added capabilities in the Power User Portal.  Would 
 it be acceptable to the project to change the double click to the same single 
 click as in the Power User Portal?

there's a new button now in 3.5

Thanks,
michal

 
 
 Thanks
 
 CC
 
 -- 
 RHCE#805007969328369
 ___
 Devel mailing list
 Devel@ovirt.org
 http://lists.ovirt.org/mailman/listinfo/devel

___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel


Re: [ovirt-devel] [ATTN] GWT Debug mode is now 2x faster!

2014-08-08 Thread Vojtech Szocs


- Original Message -
 From: Greg Sheremeta gsher...@redhat.com
 To: devel@ovirt.org
 Cc: aw...@redhat.com, eco...@redhat.com, Vojtech Szocs vsz...@redhat.com
 Sent: Wednesday, August 6, 2014 2:09:03 PM
 Subject: [ATTN] GWT Debug mode is now 2x faster!
 
 [changing the subject to be more noticeable]
 
 All,
 
 Alexander did some great work making GWT debug mode at least 2x faster.
 It is now *very* usable.

Indeed, well done Alex!

 
 I have previously avoided it, but now it's pretty awesome. If you have
 avoided
 it like me, give it a try!
 
 Tip:
 make gwt-debug DEBUG_MODULE=webadmin
 DEV_EXTRA_BUILD_FLAGS_GWT_DEFAULTS=-Dgwt.cssResourceStyle=pretty
 will un-obfuscate CSS classes for you. Very helpful with debugging UI stuff.
 
 Greg
 
 - Original Message -
  From: Vojtech Szocs vsz...@redhat.com
  To: devel@ovirt.org
  Cc: aw...@redhat.com, eco...@redhat.com, gsher...@redhat.com
  Sent: Wednesday, July 30, 2014 11:19:46 AM
  Subject: Re: GWT debug slowness.
  
  Hi Alex,
  
  (adding devel list to share it with others)
  
  I really appreciate that you took the time to analyze GWT EventBus
  activity!
  
  As we discussed on IRC, @ProxyEvent in AbstractSubTabPresenter is the most
  likely cause of overall UI slowness after successful user authentication.
  Fix for this should be rather easy and harmless, please add me as reviewer
  once you come up with the relevant patch.
  
  Another thing is refresh on logout for all (both) GWT applications. This
  is mainly due to planned SSO changes (there will be a dedicated interactive
  login page for entire Engine); for us it means that login section of all
  GWT applications will be unnecessary. Before that, however, we can already
  implement refresh on logout. As a nice side effect, we can remove some of
  our infra (UiCommonInitEvent  friends) to make it more simple.
  
  Please find some more comments below (inline).
  
  Thanks,
  Vojtech
  
  
  - Original Message -
   From: Alexander Wels aw...@redhat.com
   To: vsz...@redhat.com
   Cc: eco...@redhat.com, gsher...@redhat.com
   Sent: Friday, July 25, 2014 7:59:56 PM
   Subject: Re: GWT debug slowness.
   
   On Friday, July 25, 2014 09:28:33 AM Alexander Wels wrote:
Vojtech,

I know you suggested that maybe the event bus was getting overloaded
with
events might be the cause of the slowness in the GWT debug mode. So I
modified the event bus implementation to record the number of events,
their
handlers, and the occurrences of those events.

This is right after the login page is loaded.
+---+---+---
+
|Type   |handlers   |fired
||
+---+---+---
+
|event: ApplicationFocusChangeEvent:|0  |2
|| event: LockInteractionEvent:   |2  |2
|  | event: NavigationEvent:|0  |1
|| event: PlaceRequestInternalEvent:  |111
|| |1
|  | event: ResetPresentersEvent:   |1
|  | |1
|| event: RevealRootLayoutContentEvent:   |1
||1  |
+---+---+---
+
  
  Just for clarification:
  
  * ApplicationFocusChangeEvent - fired by our infra whenever browser/window
gains or looses focus (we use this to throttle UiCommon model refresh
timers, i.e. when out of focus, lower the refresh rate)
  
  * LockInteractionEvent - fired by GWTP infra, indicates that UI interaction
should be avoided because the application is currently in transition from
one place to another (in practice, invisible glass div element covers
the entire viewport during transition, see RootPresenter.RootView)
  
Note: we had plans to provide some In progress... label (just like you
see in Gmail) to make this obvious to end users, there's also RFE on this
  
  * NavigationEvent - fired by GWTP infra, it's a hook we don't use
  
  * PlaceRequestInternalEvent - fired by GWTP infra, PlaceManagerImpl fires
this event to ask all proxies: which one of you can reveal a presenter
with name token xxx (i.e. dataCenters-clusters)
  
Note: handler count is high because EACH presenter proxy adds handler
for this event.
  
  * ResetPresentersEvent - fired by GWTP infra, after transition to new place
is complete, trigger onReset lifecycle method on all presenters present
on reveal path (from leaf to root)
  
  * RevealRootLayoutContentEvent - fired by GWTP infra, this makes GWTP root
presenter/view reveal within the browser/window viewport
  

This is right after you login, and the VM main tab is displayed
+---+---+---
+
|Type   

Re: [ovirt-devel] [GUI] Generic Event/IEventListener

2014-08-08 Thread Vojtech Szocs


- Original Message -
 From: Lior Vernia lver...@redhat.com
 To: devel@ovirt.org
 Cc: Vojtech Szocs vsz...@redhat.com, Alexander Wels aw...@redhat.com, 
 Einav Cohen eco...@redhat.com
 Sent: Thursday, August 7, 2014 2:15:50 PM
 Subject: [GUI] Generic Event/IEventListener
 
 Hello developers,
 
 I've just pushed a patch which renders the Event and IEventListener
 generic, parameterized by the type of event arguments they receive,
 reviews are welcome (note some preceding and succeeding patches):
 http://gerrit.ovirt.org/#/c/31194/

Looks good, this should have been done long time ago.

 
 If merged, this should enable us to slowly remove unsafe casts, e.g. as
 is often done with PropertyChangedEventArgs. I have used this (in
 succeeding patches) to eliminate a couple of such coverity scan defects.
 
 It will also add a lot of IDE warnings until most events and listeners
 are properly parameterized, as was the case with the parameterization of
 EntityModel and ListModel...

In general, the parametrization makes sense; we should just not forget
about updating existing code (as you wrote, there will be tons of new
warnings after the patch gets merged, so we need to fix them too).

 
 Yours, Lior.
 
___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel