fidley / ABAPQuickFix

ABAP Quick Fix
https://abapblog.com
MIT License
42 stars 9 forks source link

Discussion: How to activate all Inactives #75

Closed pardonmycode closed 3 months ago

pardonmycode commented 3 months ago

Hi Fdiley, I really appreciate your work, which inspired me to develop an Eclipse Plugin. However, I've encountered an issue:

I need to activate all inactive objects without using the command com.sap.adt.activation.ui.command.multiActivation because it requires additional input.

Here's what I'm trying:

factory = AdtActivationPlugin.getDefault().getActivationServiceFactory();
activationService = factory.createActivationService(project.getName());
newInactiveCtsObjectList = activationService.getInactiveCtsObjects(new NullProgressMonitor());

Despite this, I'm unable to activate newInactiveCtsObjectList. Could you provide guidance on how to proceed?

fidley commented 3 months ago

Hi @pardonmycode ,

glad to hear that I was inspiration :)

The newInactiveCtsObjectList is an array of IInactiveCtsObject, which have the method getObject() which returns IWorkingObject.

From there you should get the reference to IAdtObjectReference image

Build a list from all then then use activationService.activate( your IAdtObjectReference list).

As long as it is possible to do so.

pardonmycode commented 3 months ago

Hi :) The Problem is: difference in IAdtObjectReference: com.sap.adt.tools.core.IAdtObjectReference com.sap.adt.tools.core.model.adtcore.IAdtObjectReference

activationService.activate(List<IAdtObjectReference> adtRefs); except IAdtObjectReference of com.sap.adt.tools.core.IAdtObjectReference but IInactiveCtsObjectis from com.sap.adt.tools.core.model.adtcore.IAdtObjectReference

and cast is also no possible: java.lang.ClassCastException: class com.sap.adt.tools.core.model.adtcore.impl.AdtObjectReferenceImpl cannot be cast to class com.sap.adt.tools.core.IAdtObjectReference

fidley commented 3 months ago

Maybe check the adapters? image

pardonmycode commented 3 months ago

couldn`t do it, but Thank you for your help.

pardonmycode commented 2 months ago

Do you have any documentation of "com.sap.adt.* " ? I manage to get the Ref from InactiveCts, but cannot activate this because the file is locked and I`m not the right user. Maybe there is some credential Information? So Documentation would be nice.

fidley commented 2 months ago

Only this what is found under https://tools.eu1.hana.ondemand.com/additional/com.sap.adt.core.apidoc-3.42.1.zip

https://tools.eu1.hana.ondemand.com/#abap image

The rest I always search using the project where I have all adt plugins added as dependency and then I read it using Enhanced Class Decompiler and I search using the names with standard Eclipse functions on plugin development perspective.