Yes, you can. But I am not sure if you could access them through MS WebFolders. I created a web interface to upload and store the document, but couldn't open it with MS WebFolder. Anyone knows what I have missed? Thanks! My code to store the document: String documentUri = documentsPath + "/" + document.getDocname(); String contentUri = documentUri + "/" + document.getContentName(); SubjectNode documentNode = new SubjectNode(); SubjectNode contentNode = new SubjectNode(); Structure structure = nat.getStructureHelper(); Content content = nat.getContentHelper(); NodeRevisionDescriptor documentRevision = createRevisionForDocument(document); NodeRevisionContent revisionContent = null; NodeRevisionDescriptor contentRevision = createRevisionForContent(document, contentUri, revisionContent); try { nat.begin(); structure.create(st, documentNode, documentUri); content.create(st, documentUri, documentRevision, null); structure.create(st, contentNode, contentUri); content.create(st, contentUri, contentRevision, revisionContent); nat.commit(); } catch (Exception e) { try { nat.rollback(); } catch (SystemException se) { // ignore } throw e; }
private NodeRevisionDescriptor createRevisionForDocument(Document document) { NodeRevisionDescriptor revision = new NodeRevisionDescriptor(0); revision.setProperty(new NodeProperty("resourcetype", "<collection/>",true)); revision.setCreationDate(new Date()); revision.setLastModified(new Date()); revision.setProperty(new NodeProperty("getcontentlength", "0", true)); revision.setProperty(new NodeProperty("source", "", true)); revision.setProperty(new NodeProperty(SUBJECT, document.getDocsubject())); revision.setProperty(new NodeProperty(AUTHOR, document.getDocauthor())); // Owner String owner = st.getCredentialsToken().getPublicCredentials(); revision.setProperty(new NodeProperty(OWNER, owner, true)); return revision; } private NodeRevisionDescriptor createRevisionForContent(Document document, String contentPath, NodeRevisionContent revisionContent) { NodeRevisionDescriptor revision = new NodeRevisionDescriptor(document.getContentSize()); revision.setCreationDate(new Date()); revision.setLastModified(new Date()); // Resource type revision.setProperty(new NodeProperty("resourcetype", "", true)); // Source revision.setProperty(new NodeProperty("source", "", true)); // Get content language revision.setProperty(new NodeProperty("getcontentlanguage", "en", true)); // Get content length revision.setProperty(new NodeProperty("getcontentlength", new Long(document.getContentSize()), true)); // Get content type String contentType = document.getContentType(); revision.setProperty(new NodeProperty("getcontenttype", contentType, true)); // Etag generation String etag = contentPath.hashCode() + "_" + (new NodeRevisionNumber()).hashCode() + "_" + document.getContentSize(); revision.setProperty(new NodeProperty("getetag", etag, true)); // Owner String owner = st.getCredentialsToken().getPublicCredentials(); revision.setProperty(new NodeProperty(OWNER, owner, true)); //MS properties // Is hidden revision.setProperty(new NodeProperty("ishidden", "0", "MICROSOFT")); // Is collection revision.setProperty(new NodeProperty("iscollection", "0", "MICROSOFT")); // Is read only revision.setProperty(new NodeProperty("isreadonly", "0", "MICROSOFT")); // Last accessed revision.setProperty(new NodeProperty("lastaccessed", (new Date()).toString(), "MICROSOFT")); revisionContent = new NodeRevisionContent(); revisionContent.setContent(document.getContentInputStream()); return revision; } ----- Original Message ----- From: "Dips Agni" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 23, 2002 1:00 PM Subject: Adding custom properties... > Hi, > > I am planning to use Slide Client API to build a > browser based Content Management Tool. I would like to > know if it is possible to add custom metadata > (properties) for the resource like Title, keyword for > the documents. > > Secondly, is it possible to view/set these custom > properties with MS WebFolders? > > Thanks in advance > > > __________________________________________________ > Do you Yahoo!? > Y! Web Hosting - Let the expert host your web site > http://webhosting.yahoo.com/ > > -- > To unsubscribe, e-mail: <mailto:slide-user-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: <mailto:slide-user-help@;jakarta.apache.org> > -- To unsubscribe, e-mail: <mailto:slide-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:slide-user-help@;jakarta.apache.org>