Friday 14 November 2014

Get and Put properties on Document(CE API)

//Put Multiple Properties on multiple Documents

                ObjectStore objectstore =//Get Object Store
                logger.info("Object Store Name :: "+objectstore.get_DisplayName());
                SearchScope search=new SearchScope(objectstore);
                String value = "abcd"
                String sql1= "Select * from DocumentClass where DocumentTitle = "+value;
                SearchSQL searchSQL=new SearchSQL(sql1);
                DocumentSet documents=(DocumentSet)search.fetchObjects(searchSQL, Integer.getInteger("50"), null, Boolean.valueOf(true));
                Document doc;
                Iterator it=documents.iterator();
                while(it.hasNext())
                {
                    doc=(Document)it.next();
                    doc.getProperties().putValue("Name", abc);
                    doc.getProperties().putValue("number", 123);
                    doc.getProperties().putValue("Salary", 200);
                    doc.save(RefreshMode.REFRESH);

                }


//

No comments:

Post a Comment