Hi,
how can I get the version of the project, if I am using the server?
Sven
Hi Sven,
this is currentl not possible AFAIk. There is some way for offline copies but thats likely to be changed anyway (kind of annotation is stored in the project).
However, I understand the request, I guess a few more information are worth to be put into the report, right? Version, Repository (Server), maybe last modification or something like that? Could you list all potential stuff you would like to have in a report?
Happy Repoting
Jan
PS: Of course, as in the past, there is some way with scripting to get hands on the information so maybe a scripted m2doc service could be written as an intermediate step.
Hi I am using this m2doc wrapped around the m2doc template to get the last modification date ...
Active server Sessions (not getting anything){m:Axc::Session.allInstances()->sep('\n')} Seesion from eval (get session and modification date pf current project{m: projectmodel::MediniProject.allInstances()->first().getCollabInfo() }// template { m:template getCollabInfo(obj:ecore::EObject)}{ m: obj->filter(projectmodel::MediniProject).eval('//*$EXPERIMENTAL$*/ \n\nvar AMAUtil= bind(\"com.ansys.medini.collaboration\",\"com.ansys.medini.collaboration.util.AMAUtil\",false);\n var session = AMAUtil.getAllSessions().toArray().filter(s => s.mediniProject == self);\nsession = session.map(s=>s.project.api.getDetails().andWait().getLastModificationDate());java.util.Arrays.asList(session)')->first()}{ m:endtemplate getCollabInfo(obj:ecore::EObject)}
Marian
Interesting approach Marian! You basically used the fact that the "Repository browser" is EMF based too. I was myself not aware that you have access to it from m2doc, haha.
Hm, on the other hand you still need eval and nasty experimental stuff. Maybe we can improve that point? What is needed to directly talk to the current Session? Simply the current project, right?
Hi Jan,
yes indeed it is an EMF , I accidentally discovered that while in OCL console and with selection focused on Serer Browser
I agree that some improvements can be done for easier access. I was hoping to be able to navigate from the medini project to corresponding server Data but that is not possible
However the communication related thing is happening through api and that one is not EMF -> I did not succeed to use the api in the m2doc but no success.
That being said some JS part seems to be needed to get some info out of api.
// this one will not work because of no API methods in m2doc{ m: obj->filter(projectmodel::MediniProject).eval('//*$EXPERIMENTAL$*/ \n\nvar AMAUtil= bind(\"com.ansys.medini.collaboration\",\"com.ansys.medini.collaboration.util.AMAUtil\",false);\n var projectData= AMAUtil.getProjectData(self);\nprojectData;').api.getDetails().andWait().getLastModificationDate())}//Couldn't find the getDetails(com.ansys.medini.collaboration.genmymodel.client.api.ProjectAPIImpl)' serviceCouldn't find the 'andWait(org.eclipse.acceleo.query.runtime.impl.Nothing)' serviceCouldn't find the 'getLastModificationDate(org.eclipse.acceleo.query.runtime.impl.Nothing)' service
A believe that in fact ProjectData are only needed to communicate with server ( using project's api)
I Used Session because I wanted to get only loaded ones and could easily also identify matching mediniProject
Silly me I just found a shorter eval code to get to what I need: ( thanks for the poke Jan)
Active server Sessions (not getting anything){m:Axc::Session.allInstances()->sep('\n')} Active server ProjectData (not getting anything){m:Axc::CollaborativeProjectData.allInstances()->sep('\n')} ProjectData from eval (get modification date of current project from Collab project{m: projectmodel::MediniProject.allInstances()->first().getCollabInfo() }// template , can use also other mediniObjects as an input{ m:template getCollabInfo(obj:ecore::EObject)}{ m: obj->filter(projectmodel::MediniProject).eval('//*$EXPERIMENTAL$*/ \n\nvar AMAUtil= bind(\"com.ansys.medini.collaboration\",\"com.ansys.medini.collaboration.util.AMAUtil\",false);\n var projectData= AMAUtil.getProjectData(self);\nprojectData.api.getDetails().andWait().getLastModificationDate();')}{ m:endtemplate getCollabInfo(obj:ecore::EObject)}
I tried to use OCL query for collab classes inside of m2doc but nothing was return as a result .
So the snippet was the shortest way how to get to some Collab information.
PS: When I started to use some Collab objects in scripts :
> PS2: is the current Medini project in the m2doc Context accessible through some variable name or one always need to use projectmodel::MediniProject.allInstances()->first() to get the current medini project?
It is not available but we may make it available if you think its helpful. Maybe best as predefined variable as "now"?
Sorry for a bit delayed response, I played around the m2doc document properties especially with m:var:. to find a possible workaround on how to inject a selfTest variable into the reporttemplate document
but my trial failed as it does not seem to be supported by M2Doc report generator ( report wizard -> WARNING:Variable [selfTest] is not specified in the configuration.)
So I think that having a mediniProject variable inject in every report would be beneficial, especially if one has to use eval with correct initialized context ( finder + load + more as discussed in M2Doc FMEDA result table )