Changeset 36512 for lang/csharp

Show
Ignore:
Timestamp:
01/22/10 17:34:09 (3 years ago)
Author:
hoge1e3
Message:
 
Location:
lang/csharp/soyText/soyText
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/soyText/soyText/DocumentSet.cs

    r36503 r36512  
    6868        public DocumentList getRecents() 
    6969        { 
     70            if (cache != null) return cache.getRecents(); 
    7071            Debug.syslog("Getrecent called " + (++count) + "times"); 
    71             if (cache != null) return cache.getRecents(); 
    7272            Debug.print("文書一覧取得中..."); 
    7373            //var res = new DocumentList(); 
  • lang/csharp/soyText/soyText/DocumentWebServer.cs

    r36503 r36512  
    3030                Debug.syslog(str); 
    3131                var s=Regex.Split(str, @"/"); 
    32                  
    33                  
     32                if (req.RemoteEndPoint.Address.ToString()!="127.0.0.1") 
     33                { 
     34                    res.StatusCode = 403; 
     35                    Httpd.respondByString(res, "isLocal "+req.IsLocal+" / "+req.RemoteEndPoint.Address); 
     36                    return; 
     37                } 
    3438                if (s[1].ToLower()=="byid" && s.Length>=2) 
    3539                { 
     
    4953                else 
    5054                { 
    51                     var c = new AndCondition(); 
     55                    //var c = new AndCondition(); 
     56                    var cstr = ""; 
    5257                    for (var i = 1; i < s.Length - 1; i++) 
    5358                    { 
    54                         c.add(new AttributeCondition("tag",s[i])); 
     59                        if (i>1) cstr += " "; 
     60                        cstr += "tag:" + s[i]; 
     61                        // c.add(new AttributeCondition("tag",s[i])); 
    5562                    } 
    56                     c.add(new AttributeCondition("name",s[s.Length-1])); 
    57                     var src=documentSet.createDocumentSearcher(c); 
    58                     Document found=null; 
    59                     foreach (var d in src.search()) { 
    60                         found=d; 
    61                         break; 
     63                    var name=s[s.Length - 1]; 
     64                    if (name == "") 
     65                    { 
     66                        search(cstr, res); 
    6267                    } 
    63                     if (found!=null) { 
    64                         feedDocument(found, res); 
    65                     } else { 
    66                         res.StatusCode = 404; 
    67                         Httpd.respondByString(res, "Not found : "+str); 
     68                    else 
     69                    { 
     70                        var nc = new AttributeCondition("name", name); 
     71                        //c.add(); 
     72                        //var src=documentSet.createDocumentSearcher(c); 
     73                        Document found = null; 
     74                        foreach (var d in documentSet.search(cstr, true)) 
     75                        { 
     76                            if (nc.matches(d)) 
     77                            { 
     78                                found = d; 
     79                                break; 
     80                            } 
     81                        } 
     82                        if (found != null) 
     83                        { 
     84                            feedDocument(found, res); 
     85                        } 
     86                        else 
     87                        { 
     88                            res.StatusCode = 404; 
     89                            Httpd.respondByString(res, "Not found : " + str); 
     90                        } 
    6891                    } 
    6992                } 
    7093            }); 
    7194        } 
     95 
     96        private void search(string cstr, HttpListenerResponse res) 
     97        { 
     98            var buf = ""; 
     99            foreach (var d in documentSet.search(cstr, true)) 
     100            { 
     101                buf += "<a href=\"/byid/" + d.id + "\">" + d.ToString() + "</a><br/>\n"; 
     102 
     103            } 
     104            res.ContentType = "text/html; charset=utf-8"; 
     105            Httpd.respondByString(res, buf); 
     106        } 
    72107    } 
    73108} 
  • lang/csharp/soyText/soyText/SearchLogSet.cs

    r36101 r36512  
    5353                d.save(); 
    5454                add(d); 
     55                Debug.syslog("searchLogSet.addOrGet: new " + searchExpr); 
    5556                return d; 
    5657            } 
     58            Debug.syslog("searchLogSet.addOrGet: using "+expr2doc[c].id +" for "+ searchExpr); 
    5759            return expr2doc[c]; 
    5860        } 
  • lang/csharp/soyText/soyText/bin/Debug/soyText.application

    r36503 r36512  
    1212        </dsig:Transforms> 
    1313        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
    14         <dsig:DigestValue>/HIo/Q3Fs9gZgg2VhJ/f0NTzC0c=</dsig:DigestValue> 
     14        <dsig:DigestValue>MNlBnwvOKvpJMUxLlXER2Q3vpQM=</dsig:DigestValue> 
    1515      </hash> 
    1616    </dependentAssembly> 
  • lang/csharp/soyText/soyText/bin/Debug/soyText.exe.manifest

    r36503 r36512  
    113113  </dependency> 
    114114  <dependency> 
    115     <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="119296"> 
     115    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="120320"> 
    116116      <assemblyIdentity name="soyText" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> 
    117117      <hash> 
     
    120120        </dsig:Transforms> 
    121121        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
    122         <dsig:DigestValue>YMToFiphbNRH3JvmM9mUijtDw30=</dsig:DigestValue> 
     122        <dsig:DigestValue>Jd6quLTYL9ZUU3sUYExy+6fDENM=</dsig:DigestValue> 
    123123      </hash> 
    124124    </dependentAssembly> 
  • lang/csharp/soyText/soyText/bin/Debug/soyText.vshost.application

    r36503 r36512  
    1212        </dsig:Transforms> 
    1313        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
    14         <dsig:DigestValue>/HIo/Q3Fs9gZgg2VhJ/f0NTzC0c=</dsig:DigestValue> 
     14        <dsig:DigestValue>MNlBnwvOKvpJMUxLlXER2Q3vpQM=</dsig:DigestValue> 
    1515      </hash> 
    1616    </dependentAssembly>