0

Alfresco Community4.0.e、chemistry-opencmis-client 0.7.0、primefaces 3.4.1 を使用しています。これを行うために、Web アプリケーションの添付ファイルに「オフラインで編集」機能を追加したいのですが、Web スクリプトを使用しようとしています」チェックアウト」しましたが、この Web スクリプトを呼び出す適切な方法が見つかりませんでした 「CMIS WorkBench」を介してこの Web スクリプトを実行し、ログを読み込もうとしました Alfresco がこの Web スクリプトを次のように呼び出すことがわかりました

DEBUG ent.bindings.spi.http.DefaultHttpInvoker: POST http://fateh:8080/alfresco/service/cmis/checkedout

TRACE ent.bindings.spi.http.DefaultHttpInvoker: POST http://fateh:8080/alfresco/service/cmis/checkedout > Headers: {null=[HTTP/1.1 201 Created], Date=[Tue, 16 Jul 2013 10:38:53 GMT],Transfer-Encoding=[chunked], Location=[http://fateh:8080/alfresco/service/cmis/pwc/s/workspace:SpacesStore/..., Content-Type=[application/atom+xml;type=entry;charset=UTF-8], Server=[Apache-Coyote/1.1],Pragma=[no-cache], Cache-Control=[no-cache]}

ログから理解したことに一致するようにコードを記述しようとしましたが、機能しません-_-

 public String cancelCheckOut(String objID) throws JSONException{
     try{
         HttpPost httpPost = new HttpPost("http://"+Constant.getAlfrescoIpConcatPort()+"/alfresco/service/cmis/checkedout");
         //StringEntity requestEntity  =new StringEntity(json);
         //httpPost.setEntity(requestEntity);
         httpPost.setHeader("Transfer-Encoding", "chunked");
         httpPost.setHeader("Content-type", "application/atom+xml");
         httpPost.setHeader("Location", "http://50.17.228.246:80/alfresco/service/cmis/pwc/s/workspace:SpacesStore/i/5b4772c9-8d8d-4fab-a7b9-5fe5d25b45f1");
         httpPost.setHeader("Content-Type", "application/atom+xml;type=entry;charset=UTF-8");
         httpPost.setHeader("Pragma", "no-cache");
         httpPost.setHeader("Cache-Control", "no-cache");

         System.out.println("Http post "+ httpPost.toString());

         HttpResponse response = client.execute(httpPost);
         System.out.println("response "+ response.toString());

         HttpEntity entity = response.getEntity();
         if (entity != null) {
                 return "done";
         }
    }catch (Exception ex) {         
        System.out.println(ex.getLocalizedMessage());
    } finally {
        client.getConnectionManager().shutdown();
    }
    return "failed";    
} 

何か助けはありますか?

4

3 に答える 3

0

アルフレシアンの答えを明確にするために、client.executeの前に書く必要があるのは次のとおりです。

String data = "what alfrescian wrote";
httpPost.setEntity(new StringEntity(data));
于 2013-07-18T02:11:57.287 に答える
0

curl クエリの前に使用しなかったため、プライベート作業コピーを作成するより簡単な方法を見つけました

Session session = CMISUtils.getSession();
Document doc = (Document) session.getObject(session.createObjectId(attachment.getIdAttachment()));
Document pwc = (Document) session.getObject(doc.checkOut());
于 2013-07-29T12:15:16.807 に答える