Package org.jasig.portal.io.xml

Examples of org.jasig.portal.io.xml.PortalDataKey


                            + "'" + tenant.getFname() + "':  "
                            + rsc.getFilename());
                }
                final Document doc = reader.read(rsc.getInputStream());
                final QName qname = doc.getRootElement().getQName();
                PortalDataKey atLeastOneMatchingDataKey = null;
                for (PortalDataKey pdk : dataKeyImportOrder) {
                    // Matching is tougher because it's dom4j <> w3c...
                    boolean matches = qname.getName().equals(pdk.getName().getLocalPart())
                            && qname.getNamespaceURI().equals(pdk.getName().getNamespaceURI());
                    if (matches) {
View Full Code Here


    public void importEntity(@RequestParam("file") MultipartFile entityFile,
        HttpServletRequest request, HttpServletResponse response) throws IOException, XMLStreamException {
       
        //Get a StAX reader for the source to determine info about the data to import
        final BufferedXMLEventReader bufferedXmlEventReader = createSourceXmlEventReader(entityFile);
        final PortalDataKey portalDataKey = getPortalDataKey(bufferedXmlEventReader);

        final IPerson person = personManager.getPerson(request);
    final EntityIdentifier ei = person.getEntityIdentifier();
      final IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
      if (!ap.hasPermission("UP_SYSTEM", "IMPORT_ENTITY", portalDataKey.getName().getLocalPart())) {
        response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        return;
      }

      portalDataHandlerService.importData(new StAXSource(bufferedXmlEventReader));
View Full Code Here

        return new BufferedXMLEventReader(xmlEventReader, -1);
    }

    protected PortalDataKey getPortalDataKey(final BufferedXMLEventReader bufferedXmlEventReader) {
        final StartElement rootElement = StaxUtils.getRootElement(bufferedXmlEventReader);
        final PortalDataKey portalDataKey = new PortalDataKey(rootElement);
        bufferedXmlEventReader.reset();
        return portalDataKey;
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.io.xml.PortalDataKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.