1 16 17 package org.apache.jetspeed.services; 18 19 import org.apache.jetspeed.services.psmlmanager.PsmlManagerService; 20 import org.apache.jetspeed.om.profile.PSMLDocument; 21 import org.apache.turbine.services.TurbineServices; 22 import org.apache.jetspeed.om.profile.ProfileLocator; 23 import org.apache.jetspeed.om.profile.QueryLocator; 24 import org.apache.jetspeed.om.profile.Profile; 25 import org.apache.jetspeed.om.security.JetspeedUser; 26 import org.apache.jetspeed.om.security.Role; 27 import org.apache.jetspeed.om.security.Group; 28 29 import java.util.Iterator ; 30 import java.util.List ; 31 32 38 public class PsmlManager 39 { 40 41 45 public static PsmlManagerService getService() 46 { 47 return (PsmlManagerService)TurbineServices 48 .getInstance() 49 .getService(PsmlManagerService.SERVICE_NAME); 50 } 51 52 60 public static PSMLDocument getDocument( String name ) 61 { 62 return getService().getDocument(name); 63 } 64 65 70 public static PSMLDocument getDocument( ProfileLocator locator ) 71 { 72 return getService().getDocument(locator); 73 } 74 75 81 public static PSMLDocument getDocument( List locators ) 82 { 83 return getService().getDocument(locators); 84 } 85 86 91 public static boolean store(Profile profile) 92 { 93 return getService().store(profile); 94 } 95 96 100 public static boolean saveDocument(PSMLDocument doc) 101 { 102 return getService().saveDocument(doc); 103 } 104 105 111 public static boolean saveDocument(String fileOrUrl, PSMLDocument doc) 112 { 113 return getService().saveDocument(fileOrUrl, doc); 114 } 115 116 121 public static PSMLDocument createDocument( Profile profile ) 122 { 123 return getService().createDocument( profile ); 124 } 125 126 130 public static void removeDocument( ProfileLocator locator ) 131 { 132 getService().removeDocument( locator ); 133 } 134 135 139 public static void removeUserDocuments( JetspeedUser user ) 140 { 141 getService().removeUserDocuments( user ); 142 } 143 144 148 public static void removeGroupDocuments( Group group ) 149 { 150 getService().removeGroupDocuments( group ); 151 } 152 153 154 158 public static void removeRoleDocuments( Role role ) 159 { 160 getService().removeRoleDocuments( role ); 161 } 162 163 164 168 public static Iterator query( QueryLocator locator ) 169 { 170 return getService().query( locator ); 171 } 172 173 180 public int export(PsmlManagerService consumer, QueryLocator locator) 181 { 182 return getService().export(consumer, locator); 183 } 184 185 190 public static PSMLDocument refresh( ProfileLocator locator ) 191 { 192 return getService().refresh(locator); 193 } 194 195 } 196 197 | Popular Tags |