<commit_before>/**********************************************************************************
 * $URL$
 * $Id$
 ***********************************************************************************
 *
 * Copyright (c) 2006 The Sakai Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at
 * 
 *      http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 *
 **********************************************************************************/

package org.sakaiproject.citation.api;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.List;
import java.util.Map;

import org.sakaiproject.entity.api.Entity;
import org.sakaiproject.exception.IdUnusedException;


/**
 * 
 *
 */
public interface Citation 	// extends Entity
{
	/**
     * @param label
     * @param url
     * @return A unique identifier for the URL and its label.
     */
    public void addCustomUrl(String label, String url);
    
    /**
     * @param name
     * @param value
     */
    public void addPropertyValue(String name, Object value);
    
    /**
     * Write this citation in RIS format to an output stream
     * @param buffer
     * @throws IOException 
     */
    public void exportRis(StringBuffer buffer) throws IOException;
    
    /**
	 * Access a mapping of name-value pairs for various bibliographic information about the resource.
	 * Ideally, the names will be expressed as URIs for standard tags representing nuggets of bibliographic metadata.
	 * Values will be strings in formats specified by the standards defining the property names.  For example if the 
	 * name is a URI referencing a standard format for a "publication_date" and the standard indicates that the value
	 * should be expressed as in xs:date format, the value should be expressed as a string representation of xs:date.
	 * @return The mapping of name-value pairs.  The mapping may be empty, but it should never be null.
	 */
	public Map getCitationProperties();

	/**
	 * Access a representation of the value(s) of a named property.  If the property is multivalued, 
	 * the object returned will be a (possibly empty) java.util.List.  Otherwise it will be an Object 
	 * of a type appropriate for the named property (usually a String or a Date). The value(s)
	 * must be of a type for which toString() is defined and returns a reasonable representation 
	 * for use in a textual display of the citation.
	 * @param name The name of the property for which a value is to be returned.
	 * @return A representation of the value(s) of the named property.  May be an empty String ("") 
	 * if the property is not defined. 
	 */
	public Object getCitationProperty(String name);
	
	/**
	 * @return
	 */
	public String getCreator();
	
	/**
     * @param id
     * @return
     */
    public String getCustomUrl(String id) throws IdUnusedException;
    
	/**
     * @return
     */
    public List getCustomUrlIds();
	
	/**
     * @param id
     * @return
	 * @throws IdUnusedException 
     */
    public String getCustomUrlLabel(String id) throws IdUnusedException;
    
    public String getYear();
	
	/**
	 * Access the brief "title" of the resource, which can be used to display the item in a list of items.
	 * @return The display name.  
	 */
	public String getDisplayName();

	/**
     * @return
     */
    public String getFirstAuthor();
	
	/**
     * @return
     */
    public String getId();
	
	/**
	 * @return
	 */
	public String getOpenurl();

	/**
	 * @return
	 */
	public String getOpenurlParameters();
	
	public String getSaveUrl(String collectionId);

	/**
	 * Access the schema for the Citation
	 * @return th
	 */
	public Schema getSchema();
    
    /**
	 * @return
	 */
	public String getSource();
	
	/**
     * @return
     */
    public boolean hasCustomUrls();

	/**
	 * @return
	 */
	public boolean hasPropertyValue(String fieldId);

	/**
     * Read this citation from an input stream in RIS format
     * @param istream
	 * @throws IOException 
     */
    public void importFromRis(InputStream istream) throws IOException;
    
    /**
	 * @return
	 */
	public boolean isAdded();
    
    /**
     * @param fieldId
     * @return
     */
    public boolean isMultivalued(String fieldId);

	/**
	 * Access a list of names of citation properties defined for this resource.
	 * @return The list of property names.  The list may be empty, but it should never be null.
	 */
	public List listCitationProperties();
    
    /**
     * @param added
     */
    public void setAdded(boolean added);
    
    /**
	 * @param name
	 * @param value
	 */
	public void setCitationProperty(String name, Object value);
    
    /**
	 * @param name<commit_msg>SAK-11256 - Added method importFromRisList(List)<commit_after>/**********************************************************************************
 * $URL$
 * $Id$
 ***********************************************************************************
 *
 * Copyright (c) 2006 The Sakai Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at
 * 
 *      http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 *
 **********************************************************************************/

package org.sakaiproject.citation.api;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.List;
import java.util.Map;

import org.sakaiproject.entity.api.Entity;
import org.sakaiproject.exception.IdUnusedException;


/**
 * 
 *
 */
public interface Citation 	// extends Entity
{
	/**
     * @param label
     * @param url
     * @return A unique identifier for the URL and its label.
     */
    public void addCustomUrl(String label, String url);
    
    /**
     * @param name
     * @param value
     */
    public void addPropertyValue(String name, Object value);
    
    /**
     * Write this citation in RIS format to an output stream
     * @param buffer
     * @throws IOException 
     */
    public void exportRis(StringBuffer buffer) throws IOException;
    
    /**
	 * Access a mapping of name-value pairs for various bibliographic information about the resource.
	 * Ideally, the names will be expressed as URIs for standard tags representing nuggets of bibliographic metadata.
	 * Values will be strings in formats specified by the standards defining the property names.  For example if the 
	 * name is a URI referencing a standard format for a "publication_date" and the standard indicates that the value
	 * should be expressed as in xs:date format, the value should be expressed as a string representation of xs:date.
	 * @return The mapping of name-value pairs.  The mapping may be empty, but it should never be null.
	 */
	public Map getCitationProperties();

	/**
	 * Access a representation of the value(s) of a named property.  If the property is multivalued, 
	 * the object returned will be a (possibly empty) java.util.List.  Otherwise it will be an Object 
	 * of a type appropriate for the named property (usually a String or a Date). The value(s)
	 * must be of a type for which toString() is defined and returns a reasonable representation 
	 * for use in a textual display of the citation.
	 * @param name The name of the property for which a value is to be returned.
	 * @return A representation of the value(s) of the named property.  May be an empty String ("") 
	 * if the property is not defined. 
	 */
	public Object getCitationProperty(String name);
	
	/**
	 * @return
	 */
	public String getCreator();
	
	/**
     * @param id
     * @return
     */
    public String getCustomUrl(String id) throws IdUnusedException;
    
	/**
     * @return
     */
    public List getCustomUrlIds();
	
	/**
     * @param id
     * @return
	 * @throws IdUnusedException 
     */
    public String getCustomUrlLabel(String id) throws IdUnusedException;
    
    public String getYear();
	
	/**
	 * Access the brief "title" of the resource, which can be used to display the item in a list of items.
	 * @return The display name.  
	 */
	public String getDisplayName();

	/**
     * @return
     */
    public String getFirstAuthor();
	
	/**
     * @return
     */
    public String getId();
	
	/**
	 * @return
	 */
	public String getOpenurl();

	/**
	 * @return
	 */
	public String getOpenurlParameters();
	
	public String getSaveUrl(String collectionId);

	/**
	 * Access the schema for the Citation
	 * @return th
	 */
	public Schema getSchema();
    
    /**
	 * @return
	 */
	public String getSource();
	
	/**
     * @return
     */
    public boolean hasCustomUrls();

	/**
	 * @return
	 */
	public boolean hasPropertyValue(String fieldId);

	/**
     * Read this citation from an input stream in RIS format
     * @param istream
	 * @throws IOException 
     */
    public void importFromRis(InputStream ris) throws IOException;
    
    /**
	 * @return
	 */
	public boolean importFromRisList(List risList);

	/**
	 * @return
	 */
	public boolean isAdded();
    
    /**
     * @param fieldId
     * @return
     */
    public boolean isMultivalued(String fieldId);

	/**
	 * Access a list of names of citation properties defined for this resource.
	 * @return The list of property names.  The list may be empty, but it should never be null.
	 */
	public List listCitationProperties();
    
    /**
     * @param added
     */
    public void setAdded(boolean added);
    
    /**
	 * @param name
	 * @param value
	 */
	public void setCitationProperty(String name, Object value);
    
    /**
	 * @param name
{'fraction_non_alphanumeric': 0.13199426111908177, 'fraction_numerical': 0.0018173122907699664, 'mean_word_length': 2.9817212490479816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1119442', 'n_tokens_mistral': 2915, 'n_tokens_neox': 2664, 'n_words': 1121}