Examples of storeResource()


Examples of org.xmldb.api.base.Collection.storeResource()

                                    key = collection.createId();
                                }
                                // Support of binary objects can be added. Content can be obtained using Source.
                                Resource resource = collection.createResource(key, "XMLResource");
                                resource.setContent(document);
                                collection.storeResource(resource);
                                result = "success";
                                key = resource.getId();
                            } catch (XMLDBException e) {
                                message = "Failed to create resource " + key + ": " + e.errorCode;
                                getLogger().debug(message, e);
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

            // Create the BinaryResource and store the resource
            Resource resource = col.createResource((String) table.get(XMLTools.NAME_OF),
                                                   "BinaryResource");
            resource.setContent(data);
            col.storeResource(resource);

            System.out.println("Added resource " + table.get(XMLTools.COLLECTION) + "/" +
                               resource.getId());
            resource = null;
        } finally {
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

            // Create the XMLResource and store the document
            Resource resource = col.createResource((String) table.get(XMLTools.NAME_OF),
                                                   "XMLResource");
            resource.setContent(ser.toString());
            col.storeResource(resource);

            System.out.println("Added document " + table.get(XMLTools.COLLECTION) + "/" +
                               resource.getId());
            resource = null;
        } finally {
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

           
            String data = readFileFromDisk(args[0]);

            XMLResource document = (XMLResource) collection.createResource(null, "XMLResource");
            document.setContent(data);
            collection.storeResource(document);
            System.out.println("Document " + args[0] + " inserted as " + document.getId());
        }
        catch (XMLDBException e) {
            System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
        }
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

                           homeaddress,workaddress);
  
         // Create the XMLResource and store the document
         XMLResource resource = (XMLResource) col.createResource( "", "XMLResource" );
         resource.setContent(ourdoc);
         col.storeResource(resource);
        
      } catch ( Exception e) {
          e.printStackTrace();

    // there's not much else we can do if the response is committed
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

                           homeaddress,workaddress);
     
         // Get the XMLResource and replace the content
         XMLResource resource = (XMLResource) col.getResource(dockey);
         resource.setContent(ourdoc);
         col.storeResource(resource);
        
      } catch ( Exception e) {
         e.printStackTrace();

    // there's not much else we can do if the response is committed
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

      if(in == null)
        {LOG.warn("Could not find policy collection configuration file '" + confName + "'");}
     
      final String content = XACMLUtil.toString(in);
      res.setContent(content);
      confCol.storeResource(res);
    }
    catch(final IOException ioe)
    {
      ClientFrame.showErrorMessage("Error setting up XACML editor", ioe);
    }
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

               
                if (resource != null){
                  if (mime != null){
                    ((EXistResource)resource).setMimeType(mime.getName());
                  }
                  target.storeResource(resource);
                }
                 
                }
               
            } else {
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

        { // binary resource:
            Resource resource = collection.createResource("testresource", "BinaryResource");
          assertNotNull(resource);
          assertEquals(collection, resource.getParentCollection());
          resource.setContent("some random binary data here :-)");
          collection.storeResource(resource);
        }
        } catch (Exception e) {           
            fail(e.getMessage());
        }
  }
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

            final Collection collection = client.current;
           
            final Resource resource = collection.createResource(resName, resType);
            resource.setContent(resourceContent.toString());
            ((EXistResource)resource).setMimeType(resourceType.getMimeType());
            collection.storeResource(resource);
            collection.close();
            client.reloadCollection();
        } catch(final XMLDBException xmldbe) {
            ClientFrame.showErrorMessage(xmldbe.getMessage(), xmldbe);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.