--- /dev/null
+/**
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.pentila.entSavoie.cartable.service.impl;
+
+import com.liferay.portal.kernel.exception.PortalException;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.pentila.entSavoie.cartable.model.FileTag;
+import com.pentila.entSavoie.cartable.service.base.FileTagLocalServiceBaseImpl;
+
+/**
+ * The implementation of the file tag local service.
+ *
+ * <p>
+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.pentila.entSavoie.cartable.service.FileTagLocalService} interface.
+ *
+ * <p>
+ * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
+ * </p>
+ *
+ * @author Barma Igor - Amblard Mathieu
+ * @see com.pentila.entSavoie.cartable.service.base.FileTagLocalServiceBaseImpl
+ * @see com.pentila.entSavoie.cartable.service.FileTagLocalServiceUtil
+ */
+public class FileTagLocalServiceImpl extends FileTagLocalServiceBaseImpl {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never reference this interface directly. Always use {@link com.pentila.entSavoie.cartable.service.FileTagLocalServiceUtil} to access the file tag local service.
+ */
+
+ public FileTag addFileTag() throws PortalException, SystemException {
+ final long fileTagId = counterLocalService.increment();
+ final FileTag fileTag = fileTagPersistence.create(fileTagId);
+ return fileTag;
+ }
+
+ public FileTag addFileTag(long dlFileEntryId, String tagList, String linkList, String keywordList) throws SystemException, PortalException {
+
+ FileTag fileTag = this.addFileTag();
+
+ fileTag.setDlFileEntryId(dlFileEntryId);
+ fileTag.setTagList(tagList);
+ fileTag.setLinkList(linkList);
+ fileTag.setKeywordList(keywordList);
+
+ fileTagPersistence.update(fileTag, false);
+
+ return fileTag;
+ }
+
+ public FileTag update(long dlFileEntryId, String tagList, String linkList, String keywordList) throws SystemException, PortalException {
+
+ FileTag ft = null;
+ try {
+ ft = fileTagPersistence.findBydlFileEntryId_tag(dlFileEntryId);
+ } catch(Exception e){
+
+ ft = addFileTag(dlFileEntryId, tagList, linkList, keywordList);
+
+ return ft;
+ }
+
+ ft.setTagList(tagList);
+ ft.setLinkList(linkList);
+ ft.setKeywordList(keywordList);
+ fileTagPersistence.update(ft, false);
+
+ return ft;
+ }
+
+ public FileTag getFileTagByFileEntryId(long dlFileEntryId) throws SystemException, PortalException {
+ return fileTagPersistence.fetchBydlFileEntryId_tag(dlFileEntryId);
+ }
+
+ public void removeFileTagByFileEntryId(long dlFileEntryId) throws SystemException, PortalException {
+ fileTagPersistence.removeBydlFileEntryId_tag(dlFileEntryId);
+ }
+
+ public FileTag addFileVersion(long arg0, String arg1, String arg2,
+ String arg3) throws PortalException, SystemException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
\ No newline at end of file