Where does GateIn store its content and how can I retrieve it?
albertoalmagrosotelo Nov 25, 2011 10:45 AMHello,
first of all, as I am new here, I will present myself. I am Alberto Almagro, I come from Spain and I have started with GateIn two months before.
Now comes the doubt, I want to be able to retrieve the content that already exists in GateIn with a Porlet, so I can after edit it or simply add new content. In order to achieve that behaviour I have created a Sample page in the eXo Platform´s sample Site (acme), and then I add a porlet in this page that prints recursively the content of the JCR repository.
I will try to explain the process, first I retrieve eXo´s repositoryService:
private static RepositoryService repositoryService = (RepositoryService) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(RepositoryService.class);
Then I get the number of repositories, in my case, there is only one, which name is "repository"
List<RepositoryEntry> entrylist = repositoryService.getConfig().getRepositoryConfigurations();
Then I get all the worspaces that exist in the JCR repository:
String[] accessibleWorkspaceNames; accessibleWorkspaceNames = session.getWorkspace().getAccessibleWorkspaceNames();
That are the following:
Workspace: system
Workspace: portal-system
Workspace: portal-work
Workspace: wsrp-system
Workspace: pc-system
And I search inside all the workspace for my new page, or even for the complete acme site but without results. This is an example of what I get when I retrieve the structure of the JCR repository in the workspace "portal-system".
-production --app:gadgets ---app:Todo ----app:data -----app:resources ------Todo.xml -------jcr:content ---app:Calendar ----app:data -----app:resources ------Calendar.xml -------jcr:content ---app:Calculator ----app:data -----app:resources ------Calculator.xml -------jcr:content ---app:rssAggregator ----app:data -----app:resources ------style.css -------jcr:content ------script.js -------jcr:content ------rssAggregator.xml -------jcr:content ---app:Currency ----app:data --app:applications ---app:Gadgets etc......
And the following is an example of the same workspace but now also showing the properties (the properties start with a *** chain, wich length depends on the node depth in the structure) For each property it is showed the NAME and its VALUE):
-production **NAME:jcr:primaryType 7 VALUE 0:nt:unstructured **NAME:jcr:mixinTypes 7 VALUE 0:exo:privilegeable **NAME:exo:permissions 100 VALUE 0:org.exoplatform.services.jcr.impl.core.value.PermissionValue@69d80eeb VALUE 1:org.exoplatform.services.jcr.impl.core.value.PermissionValue@67bb9c96 VALUE 2:org.exoplatform.services.jcr.impl.core.value.PermissionValue@4e25710e VALUE 3:org.exoplatform.services.jcr.impl.core.value.PermissionValue@7c217636 --app:gadgets ***NAME:jcr:primaryType 7 VALUE 0:app:gadgetregistry ***NAME:jcr:mixinTypes 7 VALUE 0:exo:privilegeable ***NAME:jcr:uuid 1 VALUE 0:cc144ba69eeae8d7648419f31cb7746e ***NAME:exo:permissions 100 VALUE 0:org.exoplatform.services.jcr.impl.core.value.PermissionValue@2d43d059 VALUE 1:org.exoplatform.services.jcr.impl.core.value.PermissionValue@3f239a46 VALUE 2:org.exoplatform.services.jcr.impl.core.value.PermissionValue@3a658a0c VALUE 3:org.exoplatform.services.jcr.impl.core.value.PermissionValue@604a37c7 VALUE 4:org.exoplatform.services.jcr.impl.core.value.PermissionValue@28941b34 ---app:Todo ****NAME:jcr:primaryType 7 VALUE 0:app:gadgetdefinition ****NAME:jcr:uuid 1 VALUE 0:cc14a8279eeae8d726f96a651fe01bfa ****NAME:app:referenceurl 1 VALUE 0:http://www.exoplatform.org ****NAME:app:thumbnail 1 VALUE 0:http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Todo.png ****NAME:gtn:description 1 VALUE 0:ToDo Gadget, easily manage and track your daily to-do list. ****NAME:gtn:name 1 VALUE 0:Todo ----app:data *****NAME:jcr:primaryType 7 VALUE 0:app:localgadgetdata *****NAME:jcr:uuid 1 VALUE 0:cc14a8279eeae8d707697150ec6113de *****NAME:app:filename 1 VALUE 0:Todo.xml -----app:resources ******NAME:jcr:primaryType 7 VALUE 0:nt:folder ******NAME:jcr:mixinTypes 7 VALUE 0:mix:referenceable ******NAME:jcr:uuid 1 VALUE 0:cc14a8279eeae8d7405f44fbcd52512d ******NAME:jcr:created 5 VALUE 0:java.util.GregorianCalendar[time=1321978865703,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2011,MONTH=10,WEEK_OF_YEAR=47,WEEK_OF_MONTH=4,DAY_OF_MONTH=22,DAY_OF_YEAR=326,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=5,HOUR_OF_DAY=17,MINUTE=21,SECOND=5,MILLISECOND=703,ZONE_OFFSET=3600000,DST_OFFSET=0] ------Todo.xml *******NAME:jcr:primaryType 7 VALUE 0:nt:file *******NAME:jcr:mixinTypes 7 VALUE 0:mix:referenceable *******NAME:jcr:uuid 1 VALUE 0:cc14a83b9eeae8d7439740e348f19bc3 *******NAME:jcr:created 5 VALUE 0:java.util.GregorianCalendar[time=1321978865723,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2011,MONTH=10,WEEK_OF_YEAR=47,WEEK_OF_MONTH=4,DAY_OF_MONTH=22,DAY_OF_YEAR=326,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=5,HOUR_OF_DAY=17,MINUTE=21,SECOND=5,MILLISECOND=723,ZONE_OFFSET=3600000,DST_OFFSET=0]
Any idea about where can GateIn save this content?
Thank you in advance.
Alberto