1 package nl.hippo.cms.workflows.multiplesitessite; 2 3 import java.io.IOException ; 4 import java.util.HashMap ; 5 import java.util.Map ; 6 import nl.hippo.cms.Constants; 7 import nl.hippo.cms.repositorylocation.CommonRepositoryLocationRoles; 8 import nl.hippo.cms.repositorylocation.RepositoryInformation; 9 import nl.hippo.cms.repositorylocation.RepositoryLocation; 10 import nl.hippo.cms.workflows.shared.QueryDataRetrieverComponent; 11 import nl.hippo.cocoon.webdav.WebDAVHelper; 12 import org.apache.avalon.framework.service.ServiceException; 13 import org.apache.commons.httpclient.HttpState; 14 15 public class WaitingForDeletionReviewDataRetriever extends QueryDataRetrieverComponent 16 { 17 18 public WaitingForDeletionReviewDataRetriever() 19 { 20 super(); 21 } 22 23 public Map getDataImpl(String uri, String repositoryRootUri, HttpState httpState) throws IOException 24 { 25 Map result = new HashMap (); 26 27 try 28 { 29 RepositoryLocation editorRepoLocation = (RepositoryLocation) m_manager 30 .lookup(CommonRepositoryLocationRoles.EDITOR_REPOSITORY_LOCATION_ROLE); 31 try 32 { 33 RepositoryInformation editorRepoInfo = editorRepoLocation 34 .getRepositoryInformation(); 35 String absoluteUri = editorRepoInfo.getAbsoluteUri(uri); 36 String lastUserName = WebDAVHelper.propfindAsString(absoluteUri, 37 Constants.CMS_1_0_NAMESPACE, Constants.LAST_WORKFLOW_USER_PROPERTY_NAME, 38 httpState); 39 if (lastUserName != null && !lastUserName.equals("")) 40 { 41 String displayName = WebDAVHelper.propfindAsString(repositoryRootUri 42 + "/users/" + lastUserName, "DAV:", "displayname", httpState); 43 if (displayName != null && !displayName.equals("")) 44 { 45 lastUserName = displayName; 46 } 47 } 48 result.put("person", lastUserName); 49 } 50 finally 51 { 52 m_manager.release(editorRepoLocation); 53 } 54 } 55 catch (ServiceException e) 56 { 57 } 59 60 return result; 61 } 62 63 } 64 | Popular Tags |