Be able to view old version (revision) of Word, Excel, Visio Online document on O365

When you want to view a document Online, for example Word Document, the Url of the document is :

The GUID is the UniqueID of the document in SharePoint.

It would be very interesting to select an older version of the document to view using a syntax like underneath (for the revision 1 of a document) as when you want to download a specific revision of a document?

For Downloading the revision 1 of MyDocument.docx the syntax is :

For viewing this underneath URL could be great:

I will design business card in 3 hr revision unlimited for $3

About Myself: Hi There! I’m a professional graphic designer. My work is my passion. I do what I love & I love what I do. I love to create a design with a different view of my mind. My Services That You Will Get In This Gig: All type of BUSINESS CARD High-quality print ready file for the business cardRevision until your 100% satisfaction100% Money Back GUARANTEE.All type of files.UNIQUE designThe BEST QUALITY JPEG file and PDF For PrintingThe NICELY oriented Source file for the business card.If need LOGO Design, please check Gig extra.You can check Gig extra for extra service. If you have any questions, Please Inbox me before placing the order. Looking Forward to working with you! Best Regards, Marii

by: lanamarii7
Created: —
Category: Business Card Design
Viewed: 459

I will Design poster in 8 hour unlimited revision for $5

Flyer Design And Posters Within 8 Hours My service : ★ Flyers in any custom size ★ Posters in any custom size ★ Postcards in any custom size ★ Brochures in any custom size ★ Facebook Cover Page ★ Cover Page for any social media ★ Header in any custom size ★ Banner in any custom size Why Choose CHICAGO GRAPHIC ? ■ 8 Hours Fast Delivery. NEVER DELAYED ■ 8 years of Experience ■ High Resolution (300 DPI) ■ JPEG,PNG,PDF,PSD file formats FREE ■ 100% Guaranteed ■ 24×7 Customer Support ■ Money Back Guarantee ■ Unlimited Revisions for FREE ■ Customer Friendly GUARANTEED ★★★Order Now★★★

by: lanamarii7
Created: —
Category: Art & Design
Viewed: 282

How to disable cration of node revision on programaticall node update ($node->save())?

I added a field of type computed field to existing nodes. It’s required to re-save the nodes to set/update computed field values. As I do not want to update the changed timestamp I decided to not use the views bulk update to resave content. The easiest way would be a drush script, that way I can re-save content whenever it is necessary.

My first problem was that I was not able to leave the changed time unchanged on update ($ node->save()). But I found that it could be re-set on a second node save.

My problem is that on each node save a new revision gets created. The node type is revision-able and beside the core module content moderation is enabled. I would appreciate any help on how to prevent the creation of revisions.

This is my current drush script in

<?php /**  * @file  * Provides drush command to update all articles.  */  use Drupal\node\Entity\Node;  /**  * Implements hook_drush_command().  */ function custom_helper_drush_command() {   $  items = array();   $  items['custom-resave-content'] = array(     'description' => dt('Resaves all article entities.'),     'options' => [       'types' => dt('Coma separated list of content type to be resaved.'),       'nids' => dt('Coma separated list if node ids.'),       'field' => dt('Machine name of computed field to be updated.')     ],     'aliases' => array('custom-rc'),   );   return $  items; }  /**  * Moves paragraphs into one paragraph reference field.  */ function drush_custom_helper_custom_resave_content() {   $  nids = _convert_csv_to_array(drush_get_option('nids', []));   $  types = _convert_csv_to_array(drush_get_option('types', []));    if (!$  nids || $  types) {     // Get an array of node IDs.     $  query = \Drupal::entityQuery('node');     if ($  types) {       $  query->condition('type', $  types, 'IN');     }     if ($  nids) {       $  query->condition('nid', $  nids, 'IN');     }     $  nids = $  query->execute();   }    // Load all the nodes.   if ($  nids) {     $  field_name = drush_get_option('field', '');      $  nodes = Node::loadMultiple($  nids);     foreach ($  nodes as $  node) {       $  entity_type = $  node->getEntityType();       $  original_changed = $  node->getChangedTime();       if ($  entity_type->isRevisionable()) {         $  node->setNewRevision(FALSE);       }       if ($  field_name) {         /** @var \Drupal\Core\Field\FieldItemListInterface $  items */         $  items = $  node->get($  field_name);         if (empty($  items[0])) {           $  items->appendItem();         }         $  items->preSave();       }        $  node->setChangedTime($  original_changed);       if ($  entity_type->isRevisionable()) {         $  node->setNewRevision(FALSE);       }       $  node->save();        $  node->setChangedTime($  original_changed);       if ($  entity_type->isRevisionable()) {         $  node->setNewRevision(FALSE);       }       $  node->save();        $  changed_after = $  node->getChangedTime();       drush_print('node:' . $  node->id() . ':' . $  original_changed . ':' . $  changed_after);     }   }    drush_log(dt('Resave finished.'), 'ok'); } 

Retrieving value of paragraph type with entity reference revision through preprocessor

I have created a paragraph type which has field of type entity reference, link, plain text.

Now I want to fetch the values present in these through the and display it in the custom template(twig).

Can anyone please let me know how do i do this?

I have written a hook function in the preprocessor, but unable to fetch values of paragraph types.

Eg of my paragraphs type:

  1. Section
  2. Box

In the section contains 2 fields, first is the title which is a plain text and second is the box, which is an entity reference revision

The box, is a paragraph type which has many fields like

  1. Link
  2. Image
  3. text field
  4. Wysiwig

Now how do i access values present in these through the hook function and display the same in twig template.

Delete entity revision does not delete from field_data table

I created a custom entity, I can edit, save, delete, create revisions and revert. I adapted the code from node module to achieve all this and everything works just fine except the revision deletion.

This code will delete entries from my_entity_revision table but not from my_entity_revision_field_data table:

$  this->myEntityStorage->deleteRevision($  revision_id) 

Any ideas why this might happen? Thanks.

Here is my entity annotation:

@ContentEntityType(    id = "my_entity",    label = @Translation("My entity"),    bundle_label = @Translation("My Entity type"),    handlers = {      "list_builder" = "Drupal\my_entity\Controller\MyEntityListBuilder",      "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",      "access" = "Drupal\website_settings\MyEntityAccessControlHandler",      "form" = {        "default" = "Drupal\my_entity\Form\MyEntityForm",        "add" = "Drupal\my_entity\Form\MyEntityForm",        "edit" = "Drupal\my_entity\Form\MyEntityForm",        "delete" = "Drupal\my_entity\Form\MyEntityDeleteForm"      },      "views_data" = "Drupal\my_entity\MyEntityViewsData",    },    base_table = "my_entity",    data_table = "my_entity_field_data",    revision_table = "my_entity_revision",    revision_data_table = "my_entity_revision_field_data",    translatable = TRUE,    entity_revision_parent_id_field = "parent_id",    entity_keys = {      "id" = "id",      "uuid" = "uuid",      "bundle" = "type",      "langcode" = "langcode",      "revision" = "revision_id"    },    bundle_entity_type = "my_entity_type",    field_ui_base_route = "entity.my_entity_type.edit_form",    links = {      "canonical" = "/admin/structure/my_entity/{my_entity}",      "edit-form" = "/admin/structure/my_entity/{my_entity}/edit",      "delete-form" = "/admin/structure/my_entity/{my_entity}/delete",      "revision" = "/admin/structure/my_entity/{my_entity}/revision/{my_entity_revision}/view",      "version-history" = "/admin/structure/my_entity/{my_entity}/revisions"    } ) 

And my baseFieldDefinition:

public static function baseFieldDefinitions(EntityTypeInterface $  entity_type) {      // Standard field, used as unique if primary index.     $  fields['id'] = BaseFieldDefinition::create('integer')       ->setLabel(t('ID'))       ->setDescription(t('The ID of the Website settings entity.'))       ->setReadOnly(TRUE);      // Standard field, unique outside of the scope of the current project.     $  fields['uuid'] = BaseFieldDefinition::create('uuid')       ->setLabel(t('UUID'))       ->setDescription(t('The UUID of the Website settings entity.'))       ->setReadOnly(TRUE);      $  fields['revision_id'] = BaseFieldDefinition::create('integer')       ->setLabel(t('Revision ID'))       ->setDescription(t('The paragraphs entity revision ID.'))       ->setReadOnly(TRUE)       ->setSetting('unsigned', TRUE);      $  fields['type'] = BaseFieldDefinition::create('entity_reference')       ->setLabel(t('Type'))       ->setDescription(t('The website settings bundle type.'))       ->setSetting('target_type', 'website_settings_type')       ->setReadOnly(TRUE);      $  fields['langcode'] = BaseFieldDefinition::create('language')       ->setLabel(t('Language code'))       ->setDescription(t('The paragraphs entity language code.'))       ->setRevisionable(TRUE);      $  fields['uid'] = BaseFieldDefinition::create('entity_reference')       ->setLabel(t('Authored by'))       ->setDescription(t('The user ID of the website settings author.'))       ->setRevisionable(TRUE)       ->setSetting('target_type', 'user')       ->setSetting('handler', 'default')       ->setDefaultValueCallback('Drupal\website_settings\Entity\WebsiteSettings::getCurrentUserId')       ->setTranslatable(TRUE)       ->setDisplayOptions('view', array(         'label' => 'hidden',         'type' => 'hidden',         'weight' => 0,       ))       ->setDisplayOptions('form', array(         'type' => 'hidden',         'weight' => 0,       ))       ->setDisplayConfigurable('view', TRUE)       ->setDisplayConfigurable('form', TRUE);      // We set display options for the view as well as the form.     // Users with correct privileges can change the view and edit configuration.     $  fields['title'] = BaseFieldDefinition::create('string')       ->setLabel(t('Title'))       ->setSettings(array(         'default_value' => '',         'max_length' => 255,         'text_processing' => 0,       ))       ->setDisplayOptions('view', array(         'label' => 'above',         'type' => 'string',         'weight' => -6,       ))       ->setDisplayOptions('form', array(         'type' => 'string_textfield',         'weight' => -6,       ))       ->setRevisionable(TRUE)       ->setTranslatable(TRUE)       ->setDisplayConfigurable('form', TRUE)       ->setDisplayConfigurable('view', TRUE);      $  fields['status'] = BaseFieldDefinition::create('boolean')       ->setLabel(t('Published'))       ->setRevisionable(TRUE)       ->setTranslatable(TRUE)       ->setDefaultValue(TRUE)       ->setDisplayConfigurable('form', TRUE)       ->setDisplayConfigurable('view', TRUE);      $  fields['created'] = BaseFieldDefinition::create('created')       ->setLabel(t('Authored on'))       ->setDescription(t('The time that the website settings was created.'))       ->setRevisionable(TRUE)       ->setTranslatable(TRUE)       ->setDisplayOptions('view', array(         'type' => 'hidden',         'weight' => 0,       ))       ->setDisplayOptions('form', array(         'type' => 'hidden',         'weight' => 0,       ))       ->setDisplayConfigurable('view', TRUE)       ->setDisplayConfigurable('form', TRUE);      $  fields['changed'] = BaseFieldDefinition::create('changed')       ->setLabel(t('Changed on'))       ->setDescription(t('The time that the website settings was last updated.'))       ->setRevisionable(TRUE)       ->setTranslatable(TRUE)       ->setDisplayOptions('view', array(         'type' => 'hidden',         'weight' => 0,       ))       ->setDisplayOptions('form', array(         'type' => 'hidden',         'weight' => 0,       ))       ->setDisplayConfigurable('view', TRUE)       ->setDisplayConfigurable('form', TRUE);      $  fields['revision_uid'] = BaseFieldDefinition::create('entity_reference')       ->setLabel(t('Revision user ID'))       ->setDescription(t('The user ID of the author of the current revision.'))       ->setSetting('target_type', 'user')       ->setQueryable(FALSE)       ->setRevisionable(TRUE);      $  fields['parent_id'] = BaseFieldDefinition::create('entity_reference')       ->setLabel(t('Parent ID'))       ->setDescription(t('The ID of the parent entity of which this entity is referenced.'))       ->setSetting('target_type', 'my_entity')       ->setSetting('handler', 'default')       ->setRevisionable(TRUE);      $  fields['langcode'] = BaseFieldDefinition::create('language')       ->setLabel(t('Language code'))       ->setDescription(t('The language code of ContentEntityExample entity.'));      return $  fields;   } 

Layout builder “edit layout” form missing revision log message field

When I edit the layout for a given node it is missing a log message field in the revision area. Is anybody else seeing this or am I alone? In trying to diagnose:

  • Where that particular revision log field would be defined to check if it’s defined at all. If it’s not then this is probably a core bug that should be addressed.
  • If it does exist, where this particular form is defined to make sure that the revision log field is actually being included in the form definition.

Any insights on the above? I’m using the lightning distribution, so it’s possible that there’s some sort of override going on there, but I figured I should be checking in core first just in case.

enter image description here

In code, only create a revision if a field is changed

I have a custom revisionable entity with a few dozen fields. I’m importing data about the entity on a periodic basis. If the entity has changed, I’d like to save it and create a new revision.

$  dogs = \Drupal::entityTypeManager()   ->getStorage('my_entity')   ->loadByProperties(['my_entity_id' => $  my_entity_id]);  $  dog = reset($  dogs);  $  dog->set('name', $  record['TheName']); $  dog->set('birth_date', $  record['Dog Birth Date']); // Lots more ->set happening here. $  dog->set('notes', $  record['Notes']); if ($  dog->someMagicComparisonFunction()) {   $  dog->setNewRevision(TRUE);   $  dog->save(); } 

I searched for the someMagicComparisonFunction but didn’t find it. Does it exist?

Revisión de metodos en java

Eh realizado un programa que trata satisfacer un problema que mostrare a continuación, la cual sin enbargo me causa conflictos en su ultima parte(la dejo marcada). Soy principiante, y quiero saber si mi codigo realmente satisface a la problematica planteada.

Haz una clase llamada Persona que siga las siguientes condiciones:

Sus atributos son: nombre, edad, DNI, sexo (H hombre, M mujer), peso y altura. No queremos que se accedan directamente a ellos. Piensa que modificador de acceso es el más adecuado, también su tipo. Si quieres añadir algún atributo puedes hacerlo. Por defecto, todos los atributos menos el DNI serán valores por defecto según su tipo (0 números, cadena vacía para String, etc.). Sexo sera hombre por defecto, usa una constante para ello. Se implantaran varios constructores: Un constructor por defecto. Un constructor con el nombre, edad y sexo, el resto por defecto. Un constructor con todos los atributos como parámetro. Los métodos que se implementaran son: calcularIMC(): calculara si la persona esta en su peso ideal (peso en kg/(altura^2 en m)), si esta fórmula devuelve un valor menor que 20, la función devuelve un -1, si devuelve un número entre 20 y 25 (incluidos), significa que esta por debajo de su peso ideal la función devuelve un 0 y si devuelve un valor mayor que 25 significa que tiene sobrepeso, la función devuelve un 1. Te recomiendo que uses constantes para devolver estos valores. esMayorDeEdad(): indica si es mayor de edad, devuelve un booleano. comprobarSexo(char sexo): comprueba que el sexo introducido es correcto. Si no es correcto, sera H. No sera visible al exterior. toString(): devuelve toda la información del objeto. Adicionalmente se necesita realizar un metodo contador que permita verificar si el numero de diguitos que se ingresen en el Campo de DNI sea correcto.Si el DNI no es 10 diguitos, Mostrar un mensaje que diga, los diguitos son incorrectos, y no mostrar nada, de lo contrario si el numero es correcto, Verificar si dicha DNI es de Nacionalidad Ecuatoriana, y mostrar los demas datos.
Aplicar Métodos set de cada parámetro, excepto de DNI.

Ahora, crea una clase ejecutable que haga lo siguiente: Ultima parte:

Pide por teclado el nombre, la edad, sexo, peso y altura. Crea 3 objetos de la clase anterior, el primer objeto obtendrá las anteriores variables pedidas por teclado, el segundo objeto obtendrá todos los anteriores menos el peso y la altura y el último por defecto, para este último utiliza los métodos set para darle a los atributos un valor. Para cada objeto, deberá comprobar si esta en su peso ideal, tiene sobrepeso o por debajo de su peso ideal con un mensaje. Indicar para cada objeto si es mayor de edad. Por último, mostrar la información de cada objeto. Puedes usar métodos en la clase ejecutable, para que os sea mas fácil.


Clase persona:

public class Persona { protected String nombre=""; protected int edad=0; private String DNI =" "; protected char Sexo='H'; protected int peso=0; protected double altura=0;   public Persona() { }  public Persona(String nombre, int edad, char Sexo) {     this.nombre = nombre;     this.edad = edad;     this.Sexo = Sexo; }  public Persona(String nombre, int edad, String DNI,  char Sexo, int peso, double altura) {     this.nombre = nombre;     this.edad = edad;     this.Sexo = Sexo;     this.DNI = DNI;     this.peso = peso;     this.altura = altura; }  public void setNombre(String nombre) {     this.nombre = nombre; }  public void setEdad(int edad) {     this.edad = edad; }  public void setSexo(char Sexo) {     this.Sexo = Sexo; }  public void setPeso(int peso) {     this.peso = peso; }  public void setAltura(double altura) {     this.altura = altura; }  public String getNombre() {     return nombre; }  public int getEdad() {     return edad; }  public char getSexo() {     return Sexo; }  public int getPeso() {     return peso; }  public double getAltura() {     return altura;   } 

Clase Calculo:

public class Calculos extends Persona{ private double r; private String dni; public int CalculoINC(){     r= peso/Math.pow(altura, 2);     if(r<20){         return -1;     }else if(r>25){         return 1;     }else{         return 0;     } } public boolean edad(){     if(edad >=18)         return true;     else         return false; } public char ComprobarSexo(char Sexo){  if(Sexo=='H'|| Sexo=='M'|| Sexo=='h'|| Sexo=='m')     {         this.Sexo=Character.toUpperCase(Sexo);;     }else if(Sexo!='H'|| Sexo!='M'|| Sexo!='h'|| Sexo!='m'){         this.Sexo='H';      }     return Sexo; }  public String contador (String num) {     String resp="";     if(num.length()!=10)          resp="La cantidad de diguitos de su DNI es incorrecto, vuelva a intentar";       return resp; }  public int validador(String num) {     String numeros[]= num.split("");     int val=Integer.parseInt(numeros[9]);     int suma=0;     int mul=1;     int decima;     int resta;     int respuesta;      for(int i=0; i<numeros.length-1;i++)     {        if(i%2==0)        {            mul=Integer.parseInt(numeros[i])*2;            if(mul>9)            {                mul=mul-9;            }            suma=suma+mul;        }        else        {            suma=suma +Integer.parseInt(numeros[i]);                               }     }     decima=((suma/10)+1)*10;     resta= decima-suma;      if(resta==val)         {         respuesta=1;     }     else     {         respuesta=0;     }            return respuesta;  }  public String ToString(){                     return  "INDICE DE MASA CORPORAL (IMC) :" + "\n"+ CalculoINC()+"\n"+"SEXO:"+ ComprobarSexo(Sexo)+"\n"+"MAYOR DE EDAD: "+ edad()+"\n";  } 

Mi frame, que está en otro paquete, donde ingreso los datos y imprimo en un text area:

    private void btnMostrarActionPerformed(java.awt.event.ActionEvent evt) {                                                // TODO add your handling code here:       String nombre= txtNombre.getText();     int Edad=Integer.parseInt(txtEdad.getText());     String dni = " ";     String temp= txtSexo.getText();     char Sexo= temp.charAt(0);     String DNI= txtDNI.getText();      int peso=Integer.parseInt(txtPeso.getText());     double altura=Double.parseDouble(txtAltura.getText());      Persona p;      p= new Persona(nombre,Edad,DNI, Sexo,peso,altura);      Calculos c = new  Calculos();      txtcadena.setText( String.valueOf(c.ComprobarSexo(Sexo)));      if(c.contador(DNI).equals(""))     {         if(c.validador(DNI)==1)             txtcadena.setText("Su nombre es :"+ nombre+"\n"+ "Tiene " + Edad+ " años de edad\n"+ "Su DNI es: "+ DNI+"\n"+"Pesa:" + peso+ "\n"+"Su altura es:" +altura+ "\n"+String.valueOf(c.ToString())+"SU DNI ES: REAL");         else        txtcadena.setText("Su nombre es :"+ nombre+"\n"+ "Tiene " + Edad+ " años de edad\n"+ "Su DNI es: "+ DNI+"\n"+"Pesa:" + peso+ "\n"+"Su altura es:" +altura+ "\n"+String.valueOf(c.ToString())+"SU DNI ES: FALSA");     }     else     {        txtcadena.setText(" ");         JOptionPane.showMessageDialog(null,c.contador(DNI));     }   }