Wednesday, May 11, 2011

Merilyn Sakova Recent Piictures

Drupal uphp

In recent days, Internet browsing, I ran into the views of some Drupal developers.

Compared with other frameworks, such as MVC, CakePHP or similar, Drupal is rare. Brilliant, but odd. It is not MVC, and relies instead on an architecture that uses hooks to enable collaboration modules are installed.

Drupal has its particular way of doing things and takes some getting used. In his address forms to the issues, to intervene in the flow.

However, the fact is that Drupal is flourishing faster than other frameworks.

Many OOP purists criticize unused objects, but says Drupal implements OOP concepts differently.

Perhaps that
. Drupal offers a different way of doing things that, once learned, it helps to be more collaborative and productive.

But if you have a traditional OOP modeling system, you may encounter some difficulties to pass it to Drupal.

Although
helped me a lot, Drupal does not have a way to make me feel completely comfortable.

Drupal has a system tables that used to work. One of the tables is vital node. Or at least what I thought.

node turns out that was an optional table that became mandatory sometime in the transition from version 4 to 5.

Would it be possible without node Drupal? Would it be possible without Drupal database?

seems there initiatives. Although the base node is then put CCK and Views, two of its most important modules, some people think it was a mistake to do that node would become mandatory and that could be corrected (Make Node optional module).

Inspired by this possibility, I tried to see if I could make Drupal processed without needing to use HTML files as the database for it. I created a module called html with the idea that files processed placed in sites / default / html . I incorporated ideas from uphp and little by little, I realized that, in fact, was carrying uphp to Drupal.

uphp have the idea start page web development incorporating static and dynamic performance go outside, in the manner of unobstrusive javascript. In JavaScript, jQuery help in that. In PHP, is QueryPath .

Drupal
The way of doing things has been an inspiration to develop uphp. I'm not a Drupal expert, but rather a beginner, so I was surprised that uphp be incorporated as naturally to Drupal. No study hard the Drupal core issues, it seems that what I had imagined was quite similar.

So the module was renamed uphp . Static files are placed in sites / default / files / html .

I thought it might be useful to the community and have applied to see if it is accepted as a project on drupal.org.

meantime, I've uploaded the file repository on SourceForge uphp .

Wednesday, May 4, 2011

Do Motorcycle Dealerships Have Layaway?

Solving Using node.save in

services module comes with some services by default. Service Node makes available several services related to nodes. One is node.save .

node.save to publish a node from another site. In particular, another Drupal site.

Without Keys Server

Assuming the site where we publish is http://myserver.example.com , there is installed services. You have to activate the modules:
  • Services
  • XMLRPC Server Node Service
The management interface (admin / build / services) in the Browse tab, you can browse the available services.

As is turned Service Node, available:
  • node.view
  • node.get
  • node.save
  • node.delete
When you choose a service, it will show its syntax and form test. For node.save is required as a parameter an array node.

As the publication will be made as an anonymous user, you must give permission to create the kind of node we want. For example, if we thereby create a node of type 'job' then you have to give anonymous users permission for it. In addition to load node data permit node_service module.

Customer
In a client module, you can use code similar to:

 mymodule_job_plandevuelo_publicar function ($ nid) {$ 
plandevuelo_url = 'http://myserver.example.com/ ';
$ node = node_load ($ nid);
$ node-> type =' job ';
unset ($ node-> nid);
$ xmlrpc_result = xmlrpc ($ plandevuelo_url. " xmlrpc.php ',' node.save ' $ node);
return $ xmlrpc_result;

}

In this example, the client obtains its own tables, a node with nid specified. Then use the function to call xmlrpc node.save service on the server.

Note that the url is the xmlrpc.php file from the server. Also the name of the service is the second parameter xmlrpc (). Thereafter, the remaining parameters are passed in the same order to the function served by the service on the server. So, $ node will be the first parameter to the function it serves node.save.

While it is important to follow the rules of service, can sometimes be frustrating. For example, to create a new node, the service requires that the node has no nid. If so, you get an Access Denied message. It also requires notification of the type of node ( 'job' , in this example).

With Keys

Server server is configured as in the case Without Keys.

activation is required, in addition, the modules:
  • Key Authentication Service System
Also in the admin interface (admin / build / services), the tab Options, choose the combo that authentication module is Key authentication .

If you check Use keys, when you save the options, a Keys tab where you can define keys to limit access to services by domain.

For example, you could define a key My Client, for the domain myclient.example.com , marking node.save there other services you want.

Leave the box for Use sessed include a session id to use in identification. The session ID is obtained using the system.connect service. Entering

and choosing Browse node.save , you can see that the syntax has changed and requires more parameters before node.

a) If left unchecked Use keys, node.save require two parameters:
  1. sessed
  2. node
b) If you check the option left Use keys, node.save require six parameters:
    hash
  1. domain_name
  2. domain_time_stamp
  3. nonce
  4. sessed
  5. node
Customer

a) Not Use keys
If left unchecked Use keys on the server, the client may use a code similar to:

 mymodule_job_plandevuelo_publicar function ($ nid) {$ 
plandevuelo_url = 'http://myserver.example.com/' ;
$ node = node_load ($ nid);
$ node-> type = 'job';
unset ($ node-> nid);

$ domain_name = $ _SERVER ['HTTP_HOST'];
$ domain_time_stamp = (string) time () ;

/ / connect
$ method = ' system.connect ';
$ xmlrpc_result = xmlrpc ($ plandevuelo_url. 'xmlrpc.php', $ method);
$ sessed = $ Xmlrpc_result ['sessed'];

/ / save
$ method = ' node.save ';

$ xmlrpc_result = xmlrpc ($ plandevuelo_url. 'Xmlrpc.php', $ method, $
sessed ,

$ node);

return $ xmlrpc_result;}


Notice is now required to invoke system.connect for sessed.

b) Use keys
If you check the option left Use keys on the server, you can use code similar to:

 mymodule_job_plandevuelo_publicar function ($ nid) {$ 
plandevuelo_url = 'http://myserver.example.com/' ;
$ node = node_load ($ nid);
$ node-> type = 'job';
unset ($ node -> nid);

DOMAIN_NAME $ = $ _SERVER ['HTTP_HOST'];
$ domain_time_stamp = (string) time ();

/ / connect
$ method = ' system.connect ';
$ xmlrpc_result = xmlrpc ($ plandevuelo_url. "xmlrpc.php ', $ method);
$ sessid = $ xmlrpc_result [' sessid '];

/ / save
$ method =' node.save ';
$ Nonce = user_password ();
$ domain_time_stamp = (string) time ();
hash_hmac $ hash = ('sha256', $ domain_name domain_time_stamp .';'.$ .';'. $ nonce .';'.$ method, '90a84268ba54e7ea02571524586997db ');

$ xmlrpc_result = xmlrpc ($ plandevuelo_url.' xmlrpc.php ', $ method, $ hash
,
$ domain_name, $
domain_time_stamp,
$ nonce, $
sessed ,

$ node);

return $ xmlrpc_result;}


One way to update

node.save required $ node-> nid plus a $ node-> date changed, eg

 ... 
/ * / / CREATE
$ node-> type = 'job';
unset ($ node-> nid);
* /
/ / UPDATE
$ node-> nid = 16, $ node-
> changed = time ();
...

Some precautions
Although this example I have come to node.save nearly $ node directly that obtained with node_load () , I noticed that may be more convenient to form an array with only required values \u200b\u200band just pass the array to node.save .

Otherwise, can have unexpected results. For example, if the local node has not enabled the option to comment, while the destination you want if I do, if you spend the entire node will also pass these preferences. Create a node without the feedback option or, to update, eliminate the comments that he had associated.

References:

Tuesday, May 3, 2011

Hard Knot Sternocleidomastoid



Visit Our New Site