Hi! I have two different types of services and I want to access a property from the Form Space. I tried to do it like this :
String value = new PropertyQuery() .setName("Service property") .setSpaceName(txn.spaceName) .getValue()
The problem is that what happen in the groovy services that I don't have a transaction?, and what happen when I call a service that I don't send any transaction?
Is there a way to access the property "Service property" for all kind of services in the same way?
What types of service are you implementing?
Hi Fabiola, An alternative approach whereby you access the space then pull the resources for instance:def space = DaoFactory.portalDao.getPortalByName(portalNameHere)
Then you can access say resources of this space thus:
def resource = DaoFactory.portalResourceDao.getPortalResourceByPath(space.getId(), pathAsString)
Hope this helps you move forward or generate some ideas for you.
Hi Petros! Thanks for your answer.
Is there a way that I don't have to hard code the portal name? Because I need this property in different environments and they have different form spaces name, so It make it more difficult.
I was thinking something like get current form space but I couldn't find how.
Hi, there should be a way to return these as a list and iterate through.