Examples of Publication


Examples of com.Publication

    return true;
  }

  @Override
  public boolean commenter(Publication publication, Commentaire commentaire, String nom) throws RemoteException {
    Publication pb = null;
   
    HashMap<String, Profil> profils;
    ProfilSocial profil;
   
    try {
      // Récupération de la liste des profils
      profils = Serialiser.deserialiser(Constantes.PROFIL);

      try {
        // Récupération du profil correspondant
        profil = (ProfilSocial)profils.get(nom);
       
        // Récupération de la publication à commenter
        for (Publication pub : profil.getPublications()) {
          if (pub.getDate().compareTo(publication.getDate()) == 0 || pub.getPseudo().equals(publication.getPseudo())) {
            pb = pub;
            break;
          }
        }
 
        // Ajout du commentaire à la liste des commentaires liés à cette publication
        pb.comment(commentaire);
       
        // Mise à jour de la liste des profils
        profils.put(nom, profil);
       
        // Enregistrement de la nouvelle liste
        Serialiser.serialiser(profils, Constantes.PROFIL);
      } catch (NullPointerException e1) { // Aucun pseudonyme profil ne correspond au nom entré en paramètre, ou la publication n'a pas été trouvée pour ce profil
       
        HashMap<String, Groupe> groupes;
        Groupe groupe;
       
        // Récupération de la liste des groupes
        groupes = Serialiser.deserialiser(Constantes.GROUPES);
       
        try {
          // Récupération du groupe correspondant
          groupe = groupes.get(nom);
         
          // Récupération de la publication à commenter
          for (Publication pub : groupe.getPublications()) {
            if (pub.getDate().compareTo(publication.getDate()) == 0 || pub.getPseudo().equals(publication.getPseudo())) {
              pb = pub;
              break;
            }
          }
 
          // Ajout du commentaire à la liste des commentaires liés à cette publication
          pb.comment(commentaire);
         
          // Mise à jour de la liste des groupes
          groupes.put(nom, groupe);
         
          // Enregistrement de la nouvelle liste
View Full Code Here

Examples of com.adobe.dp.epub.opf.Publication

public class EPUBFilter {

  public static void main(String[] args) {
    try {
      File file = new File(args[0]);
      Publication epub = new Publication(file);
      epub.parseAll();
      epub.cascadeStyles();
      System.out.println("Loaded \"" + epub.getDCMetadata("title") + "\"");
      long start = System.currentTimeMillis();
      epub.refactorStyles();
      long end = System.currentTimeMillis();
      System.out.println( "Refactored styles in " + (end - start) + "ms");
      //epub.addFonts();
      FileOutputStream out = new FileOutputStream(args[1]);
      epub.serialize(new OCFContainerWriter(out));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of eu.pursuit.core.Publication

      case START_PUBLISH:
        // Is the event the catalog? Problem here!...
        if (Arrays.equals(id, cat)){
          // Get the catalog data
          String catData = publisher.getVideoPublisher().getCatalogNames();
          Publication pub = new Publication(publisher.getVideoPublisher().getCatName(), catData.getBytes());
          // publish catalog data
          publisher.getClient().publishData(pub, strategy);
        }else{
          // start the video event handler
          // Check to see if the video is already started.
View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

   * Copy the resources files belongs to the documents corresponding to this node
   * 
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();
    DocumentBuilder builder = publication.getDocumentBuilder();

    String srcDocumentid = node.getAbsoluteId();
    String destDocumentid =
      srcDocumentid.replaceFirst(
        getFirstdocumentid(),
View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

  /** (non-Javadoc)
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();
    DocumentBuilder builder = publication.getDocumentBuilder();

    String destDocumentid = node.getAbsoluteId();
    String srcDocumentid =
      destDocumentid.replaceFirst(
        getSecdocumentid(),
View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

      log("document-id for the source :" + this.getFirstdocumentid());
      log("area for the source :" + this.getFirstarea());
      log("document-id for the destination :" + this.getSecdocumentid());
      log("area for the destination :" + this.getSecarea());

      Publication publication = getPublication();
      SiteTree tree = publication.getTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
    }
View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

  public void execute() throws BuildException {
    try {
      log("document-id for the source" + this.getFirstdocumentid());
      log("area for the source" + this.getFirstarea());

      Publication publication= getPublication();
      SiteTree tree = publication.getTree(getFirstarea());
      SiteTreeNode node = tree.getNode(getFirstdocumentid());

      node.acceptSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

        Parameters parameters)
        throws PageEnvelopeException, DocumentDoesNotExistException, DocumentException, SiteTreeException, DocumentBuildException {

        PageEnvelope pageEnvelope =
            PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
        Publication publication = pageEnvelope.getPublication();
        String area = pageEnvelope.getDocument().getArea();
        String language = pageEnvelope.getDocument().getLanguage();
        String id = pageEnvelope.getDocument().getId();

        SiteTree siteTree = publication.getTree(area);
        SiteTreeNode node = siteTree.getNode(id);

        if (node == null) {
            throw new DocumentDoesNotExistException("The document " + pageEnvelope.getDocument().getId() + " does not exist. Check sitetree, it might need to be reloaded.");
        }
       
        SiteTreeNode[] children = node.getChildren(language);
        if (children.length > 0) {

            String childNodeId = children[0].getId();
            String childId = id + "/" + childNodeId;
            DocumentBuilder builder = publication.getDocumentBuilder();
            String url = builder.buildCanonicalUrl(publication, area, childId, language);
            Document childDocument = builder.buildDocument(publication, url);

            if (!childDocument.existsInAnyLanguage()) {
                throw new NoChildDocumentExistException("The document " + childId + " does not exist. Check sitetree, it might need to be reloaded.");
View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

     * @param contextPath The servlet context path.
     */
    public void rewriteLinks(Document originalTargetDocument, Document newTargetDocument,
            String contextPath) {

        Publication publication = originalTargetDocument.getPublication();
        String area = originalTargetDocument.getArea();
        File[] files = getDocumentFiles(publication, area);

        DocumentBuilder builder = publication.getDocumentBuilder();

        try {
            for (int fileIndex = 0; fileIndex < files.length; fileIndex++) {
                org.w3c.dom.Document xmlDocument = DocumentHelper.readDocument(files[fileIndex]);
                boolean linksRewritten = false;

                String[] xPaths = publication.getRewriteAttributeXPaths();
                for (int xPathIndex = 0; xPathIndex < xPaths.length; xPathIndex++) {
                    NodeList nodes = XPathAPI.selectNodeList(xmlDocument, xPaths[xPathIndex]);
                    for (int nodeIndex = 0; nodeIndex < nodes.getLength(); nodeIndex++) {
                        Node node = nodes.item(nodeIndex);
                        if (node.getNodeType() != Node.ATTRIBUTE_NODE) {
                            throw new RuntimeException("The XPath [" + xPaths[xPathIndex]
                                    + "] may only match attribute nodes!");
                        }
                        Attr attribute = (Attr) node;
                        final String url = attribute.getValue();

                        if (url.startsWith(contextPath + "/" + publication.getId())) {
                            final String webappUrl = url.substring(contextPath.length());
                           
                            if (builder.isDocument(publication, webappUrl)) {
                                Document targetDocument = builder.buildDocument(publication, webappUrl);

View Full Code Here

Examples of org.apache.lenya.cms.publication.Publication

  /** (non-Javadoc)
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();
    DocumentBuilder builder = publication.getDocumentBuilder();

    Label[] labels = node.getLabels();
    for (int i = 0 ; i < labels.length; i++){
      String language = labels[i].getLanguage();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.