1 /*
2 * Copyright (C) 2003-2008 eXo Platform SAS.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Affero General Public License
6 * as published by the Free Software Foundation; either version 3
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see<http://www.gnu.org/licenses/>.
16 */
17 package org.exoplatform.services.wcm.link;
18
19 import java.util.List;
20
21 import javax.jcr.Node;
22
23 /**
24 * Created by The eXo Platform SAS
25 * Author : Phan Le Thanh Chuong
26 * chuong_phan@exoplatform.com
27 * Aug 6, 2008
28 */
29 public interface LiveLinkManagerService {
30
31 /**
32 * Get all link existed in all portal and update status for them (live or broken)
33 *
34 * @throws Exception the exception
35 */
36 public void updateLinks() throws Exception;
37
38 /**
39 * Get all link existed in specified portal and update status for them (live or broken)
40 *
41 * @param portalName the portal name
42 *
43 * @throws Exception the exception
44 */
45 public void updateLinks(String portalName) throws Exception;
46
47 /**
48 * Gets the broken links by portal.
49 *
50 * @param portalName the portal name
51 *
52 * @return the broken links
53 *
54 * @throws Exception the exception
55 */
56 public List<LinkBean> getBrokenLinks(String portalName) throws Exception;
57
58 /**
59 * Gets the broken links by web content.
60 *
61 * @param webContent the web content
62 *
63 * @return the broken links
64 *
65 * @throws Exception the exception
66 */
67 public List<String> getBrokenLinks(Node webContent) throws Exception ;
68
69 /**
70 * Extract all link (<code>a</code>, <code>iframe</code>, <code>frame</code>, <code>href</code>)
71 * and all image (<code>img</code>) from html document
72 *
73 * @param htmlFile the node html file
74 *
75 * @return the list of link's URL
76 *
77 * @throws Exception the exception
78 */
79 public List<String> extractLinks(Node htmlFile) throws Exception ;
80
81 /**
82 * Add exo:links (multi value) property of exo:linkable node type to web content node, with pattern
83 *
84 * @param webContent the current web content node
85 * @param newLinks the list of new links will be updated
86 *
87 * @throws Exception the exception
88 */
89 public void updateLinkDataForNode(Node webContent, List<String> newLinks) throws Exception ;
90
91 }