AnsweredAssumed Answered

Metadata as file properties, search with TEXT='' a

Question asked by nimind on Apr 23, 2007
one method to add metadata can be this? add metadata to file properties?:


prop = new NamedValue[3];
            prop[0] = new NamedValue();
            prop[0].setName(Constants.PROP_NAME);
            prop[0].setValue(lIncidentId.toString());
            prop[0].setIsMultiValue(false);
            prop[1] = new NamedValue();
            prop[1].setName(Constants.PROP_TITLE);
            prop[1].setValue("3");
            prop[1].setIsMultiValue(false);
            prop[2] = new NamedValue();
            prop[2].setName(Constants.PROP_DESCRIPTION);
            prop[2].setValue("Content");
            prop[2].setIsMultiValue(false);
            //prop[3] = new NamedValue();
            //prop[3].setName("{http://www.alfresco.org/model/content/1.0}metadata2");
            //prop[3].setValue("meta");
            //prop[3].setIsMultiValue(false);
         
          logger.info("createIncident: create");
           create = new CMLCreate("1", parentReference, null, null, null, Constants.TYPE_FOLDER, prop);
           cml = new CML();
           cml.setCreate(new CMLCreate[]{create});
           results = WebServiceFactory.getRepositoryService().update(cml);

Another question:
with this code:

buildQuery = "-TYPE:\"{http://www.alfresco.org/model/content/1.0}folder\"";
buildQuery = buildQuery + " TEXT:\""+sSolutionText+"\" ";
query = new Query(Constants.QUERY_LANG_LUCENE, buildQuery);
queryResult = repositoryService.query(store, query, false);

If sSolutionText is equals to " " or "", it launches an exception.


Also, i want to do a connector to Alfresco web services APi that would have functions with search, create content, create link, get content, set properties, url direct download, url webdav….. in order to approach the prommatic way easier in java. is there some problem with this?

Outcomes