当前位置: 首页>>代码示例>>Java>>正文


Java Note.getId方法代码示例

本文整理汇总了Java中net.sf.memoranda.Note.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Note.getId方法的具体用法?Java Note.getId怎么用?Java Note.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.memoranda.Note的用法示例。


在下文中一共展示了Note.getId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: noteToDocument

import net.sf.memoranda.Note; //导入方法依赖的package包/类
private Document noteToDocument(Note note, String noteHtmlContents) {
	Document d = new Document ();
	
	String id = note.getId ();
	
	Project project = note.getProject();
	
	String projectId = project.getID();
	String projectName = project.getTitle();
	String title = note.getTitle ();		
	String date = note.getDate() != null ? new SimpleDateFormat ("yyyy-MM-dd").format(note.getDate().getDate()) : null;
	
	d.add (new StringField ("id", id, Field.Store.YES));
	d.add (new StringField ("project_id", projectId, Field.Store.YES));
	d.add (new StoredField ("project_name", projectName));
	d.add (new TextField ("title", title, Field.Store.YES));
	d.add (new TextField ("title_cs", title, Field.Store.YES));
	d.add (new TextField ("date", date != null ? date : "", Field.Store.YES));
	d.add (new TextField ("body", noteHtmlContents, Field.Store.YES));
			
	return d;
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:23,代码来源:NoteIndexer.java

示例2: storeNote

import net.sf.memoranda.Note; //导入方法依赖的package包/类
/**
 * @see net.sf.memoranda.util.Storage#storeNote(net.sf.memoranda.Note)
 */
public void storeNote(Note note, javax.swing.text.Document doc) {
    String filename =
        JN_DOCPATH + note.getProject().getID() + File.separator;
    doc.putProperty(
        javax.swing.text.Document.TitleProperty,
        note.getTitle());        
    CalendarDate d = note.getDate();

    filename += note.getId();//d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
    /*DEBUG*/System.out.println("[DEBUG] Save note: "+ filename);

    try {
        OutputStreamWriter fw =
            new OutputStreamWriter(new FileOutputStream(filename), "UTF-8");
        AltHTMLWriter writer = new AltHTMLWriter(fw, (HTMLDocument) doc);
        writer.write();
        fw.flush();
        fw.close();
        //editorKit.write(new FileOutputStream(filename), doc, 0, doc.getLength());
        //editorKit.write(fw, doc, 0, doc.getLength());
    }
    catch (Exception ex) {
        new ExceptionDialog(
            ex,
            "Failed to write a document to " + filename,
            "");
    }
    /*String filename = JN_DOCPATH + note.getProject().getID() + "/";
    doc.putProperty(javax.swing.text.Document.TitleProperty, note.getTitle());
    CalendarDate d = note.getDate();
    filename += d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
    try {
        long t1 = new java.util.Date().getTime();
        FileOutputStream ostream = new FileOutputStream(filename);
        ObjectOutputStream oos = new ObjectOutputStream(ostream);
    
        oos.writeObject((HTMLDocument)doc);
    
        oos.flush();
        oos.close();
        ostream.close();
        long t2 = new java.util.Date().getTime();
        System.out.println(filename+" save:"+ (t2-t1) );
    }
        catch (Exception ex) {
            ex.printStackTrace();
        }*/

}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:53,代码来源:FileStorage.java

示例3: getNoteURL

import net.sf.memoranda.Note; //导入方法依赖的package包/类
public String getNoteURL(Note note) {        
    return "file:" + JN_DOCPATH + note.getProject().getID() + "/" + note.getId();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:4,代码来源:FileStorage.java

示例4: getNotePath

import net.sf.memoranda.Note; //导入方法依赖的package包/类
public String getNotePath(Note note) {
        String filename = JN_DOCPATH + note.getProject().getID() + File.separator;
//        CalendarDate d = note.getDate();
        filename += note.getId();//d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
	return filename;
   }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:7,代码来源:FileStorage.java

示例5: storeNote

import net.sf.memoranda.Note; //导入方法依赖的package包/类
/**
 * @see net.sf.memoranda.util.Storage#storeNote(net.sf.memoranda.Note)
 */
public void storeNote(Note note, javax.swing.text.Document doc) {
    String filename =
        JN_DOCPATH + note.getProject().getID() + File.separator;
    doc.putProperty(
        javax.swing.text.Document.TitleProperty,
        note.getTitle());        
    CalendarDate d = note.getDate();
    String time = note.getTime();
    filename += note.getId();//d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
    /*DEBUG*/System.out.println("[DEBUG] Save note: "+ filename);

    try {
        OutputStreamWriter fw =
            new OutputStreamWriter(new FileOutputStream(filename), "UTF-8");
        AltHTMLWriter writer = new AltHTMLWriter(fw, (HTMLDocument) doc);
        writer.write();
        fw.flush();
        fw.close();
        //editorKit.write(new FileOutputStream(filename), doc, 0, doc.getLength());
        //editorKit.write(fw, doc, 0, doc.getLength());
    }
    catch (Exception ex) {
        new ExceptionDialog(
            ex,
            "Failed to write a document to " + filename,
            "");
    }
    /*String filename = JN_DOCPATH + note.getProject().getID() + "/";
    doc.putProperty(javax.swing.text.Document.TitleProperty, note.getTitle());
    CalendarDate d = note.getDate();
    filename += d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
    try {
        long t1 = new java.util.Date().getTime();
        FileOutputStream ostream = new FileOutputStream(filename);
        ObjectOutputStream oos = new ObjectOutputStream(ostream);
    
        oos.writeObject((HTMLDocument)doc);
    
        oos.flush();
        oos.close();
        ostream.close();
        long t2 = new java.util.Date().getTime();
        System.out.println(filename+" save:"+ (t2-t1) );
    }
        catch (Exception ex) {
            ex.printStackTrace();
        }*/

}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:53,代码来源:FileStorage.java

示例6: storeNote

import net.sf.memoranda.Note; //导入方法依赖的package包/类
/**
   * @see net.sf.memoranda.util.Storage#storeNote(net.sf.memoranda.Note)
   */
  public void storeNote(Note note, javax.swing.text.Document doc) {
      String filename =
          JN_DOCPATH + note.getProject().getID() + File.separator;
      doc.putProperty(
          javax.swing.text.Document.TitleProperty,
          note.getTitle());        
      CalendarDate d = note.getDate();

      filename += note.getId();//d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
      /*DEBUG*/System.out.println("[DEBUG] Save note: "+ filename);

      try {
          OutputStreamWriter fw =
              new OutputStreamWriter(new FileOutputStream(filename), "UTF-8");
          AltHTMLWriter writer = new AltHTMLWriter(fw, (HTMLDocument) doc);
          writer.write();
          fw.flush();
          fw.close();
          //editorKit.write(new FileOutputStream(filename), doc, 0, doc.getLength());
          //editorKit.write(fw, doc, 0, doc.getLength());
      }
      catch (Exception ex) {
          new ExceptionDialog(
              ex,
              "Failed to write a document to " + filename,
              "");
      }
      
      try {
	NoteIndexer.addOrUpdateNote(note, doc.getText(0, doc.getLength()));
} catch (Exception e) {
	throw new RuntimeException ("could not add note to index", e);
}        
      /*String filename = JN_DOCPATH + note.getProject().getID() + "/";
      doc.putProperty(javax.swing.text.Document.TitleProperty, note.getTitle());
      CalendarDate d = note.getDate();
      filename += d.getDay() + "-" + d.getMonth() + "-" + d.getYear();
      try {
          long t1 = new java.util.Date().getTime();
          FileOutputStream ostream = new FileOutputStream(filename);
          ObjectOutputStream oos = new ObjectOutputStream(ostream);
      
          oos.writeObject((HTMLDocument)doc);
      
          oos.flush();
          oos.close();
          ostream.close();
          long t2 = new java.util.Date().getTime();
          System.out.println(filename+" save:"+ (t2-t1) );
      }
          catch (Exception ex) {
              ex.printStackTrace();
          }*/

  }
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:59,代码来源:FileStorage.java


注:本文中的net.sf.memoranda.Note.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。