Package org.silverpeas.components.kmelia
Class PublicationImport
- java.lang.Object
-
- org.silverpeas.components.kmelia.PublicationImport
-
public class PublicationImport extends Object
-
-
Constructor Summary
Constructors Constructor Description PublicationImport(KmeliaService kmeliaService, String componentId)
PublicationImport(KmeliaService kmeliaService, String componentId, String topicId, String spaceId, String userId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createTopic(String name, String description)
void
draftInPublication(String xmlFormName, String fieldName, String fieldValue)
String
getPublicationId(String xmlFormName, String fieldName, String fieldValue)
Collection<String>
getPublicationsSpecificValues(String componentId, String xmlFormName, String fieldName)
List<org.silverpeas.core.contribution.content.form.XMLField>
getPublicationXmlFields(String publicationId)
List<org.silverpeas.core.contribution.content.form.XMLField>
getPublicationXmlFields(String publicationId, String language)
boolean
importPublication(String publicationToUpdateId, Map<String,String> publiParams, Map<String,String> formParams, String language, String xmlFormName, String userProfile)
Creates or updates a publication.boolean
importPublication(Map<String,String> publiParams, Map<String,String> formParams, String language, String xmlFormName, String discrimatingParameterName, String userProfile)
Creates or updates a publication.void
importPublications(List<Map<String,String>> publiParamsList, List<Map<String,String>> formParamsList, String language, String xmlFormName, String discrimatingParameterName, String userProfile)
void
setIgnoreMissingFormFields(boolean ignore)
void
updatePublicationEndDate(String xmlFormName, String fieldName, String fieldValue, Date endDate)
-
-
-
Constructor Detail
-
PublicationImport
public PublicationImport(KmeliaService kmeliaService, String componentId, String topicId, String spaceId, String userId)
-
PublicationImport
public PublicationImport(KmeliaService kmeliaService, String componentId)
-
-
Method Detail
-
importPublications
public void importPublications(List<Map<String,String>> publiParamsList, List<Map<String,String>> formParamsList, String language, String xmlFormName, String discrimatingParameterName, String userProfile)
-
importPublication
public boolean importPublication(Map<String,String> publiParams, Map<String,String> formParams, String language, String xmlFormName, String discrimatingParameterName, String userProfile)
Creates or updates a publication.- Parameters:
publiParams
- The parameters of the publication.formParams
- The parameters of the publication's form.language
- The language of the publication.xmlFormName
- The name of the publication's form.discrimatingParameterName
- The name of the field included in the form which allows to retrieve the eventually existing publication to update.userProfile
- The user's profile used to draft out the publication.- Returns:
- True if the publication is created, false if it is updated.
-
importPublication
public boolean importPublication(String publicationToUpdateId, Map<String,String> publiParams, Map<String,String> formParams, String language, String xmlFormName, String userProfile)
Creates or updates a publication.- Parameters:
publicationToUpdateId
- The id of the publication to update.publiParams
- The parameters of the publication.formParams
- The parameters of the publication's form.language
- The language of the publication.xmlFormName
- The name of the publication's form.userProfile
- The user's profile used to draft out the publication.- Returns:
- True if the publication is created, false if it is updated.
-
getPublicationXmlFields
public List<org.silverpeas.core.contribution.content.form.XMLField> getPublicationXmlFields(String publicationId)
-
getPublicationXmlFields
public List<org.silverpeas.core.contribution.content.form.XMLField> getPublicationXmlFields(String publicationId, String language)
-
getPublicationId
public String getPublicationId(String xmlFormName, String fieldName, String fieldValue)
- Parameters:
xmlFormName
- The name of the XML form describing the publication.fieldName
- The name of the field searched into the form.fieldValue
- The value of the field searched into the form.- Returns:
- The id of the publication corresponding to the XML form name and containing a field named fieldName and valued to fieldValue. Returns null if no publication is found.
-
createTopic
public String createTopic(String name, String description)
- Parameters:
name
- The name of the topic.description
- The description of the topic.- Returns:
- The id of the newly created topic.
-
getPublicationsSpecificValues
public Collection<String> getPublicationsSpecificValues(String componentId, String xmlFormName, String fieldName)
-
draftInPublication
public void draftInPublication(String xmlFormName, String fieldName, String fieldValue)
-
updatePublicationEndDate
public void updatePublicationEndDate(String xmlFormName, String fieldName, String fieldValue, Date endDate)
-
setIgnoreMissingFormFields
public void setIgnoreMissingFormFields(boolean ignore)
-
-