How view sections by id - variables

I have database table called sections (id,name,keywords). I have section.ctp file want show on it the section which its
$id = $this->Session->read('secId');
but i don't know how do this on cakephp . Is it I need to pass variables on sessions? .
in what file I should put sessions vairables

You can pass variable through set method in controller action not using session and you can use it in your view. You can use cake bake command to bake section controller, model and view. For more info how to use cake bake command, please visit here
Hope it helps. (vote and select the answer if it helps)

Related

How can we make an Item in socialengine?

I know how to get an item of the particular table. Like for user we can have
$userItem = Engine_Api::_()->getItem("user", $userId);
or for a custom table
$customItem = Engine_Api::_()->getItem("custom", $customeId);
I want to know the code or method how can I make my $customItem to work the same way as $userItem works for users table. So that I can get data or manipulate the data of custom table
Thanks for your help. :-)
You can achieve that by creating a model. Check how it's done in /application/modules/User/Model. There is User.php file that declares User_Model_User and methods available for User such as getTitle, get Href etc.
You may use similar approach for your custom item. You will also need to create a file similar to /application/modules/User/Model/DbTable/User.php to declare table for your custom items.

How to create a view from Bigquery REST api

Is it possible to create a view in Bigquery from REST api.
Please let me know if possible.
please share some sample code.
thanks,
Chandan Reddy
You can create a view by calling tables.insert with a table resource containing a "view" property.
https://developers.google.com/bigquery/docs/reference/v2/tables#resource
The following code works .. !!
Table content= new Table();
TableReference tableReference= new TableReference();
tableReference.setTableId("ViewName");
tableReference.setDatasetId("DataSetName");
tableReference.setProjectId(getProjectId());
content.setTableReference(tableReference);
ViewDefinition view= new ViewDefinition();
view.setQuery("SELECT * FROM [DataSetName.TableName]");
content.setView(view);
System.out.println(content);
bigquery.tables().insert(getProjectId(), "DataSetName", content).execute();
As per the documentation, that's not possible at the moment.
https://developers.google.com/bigquery/querying-data#views
The supported ways of creating a view are the command line tool and the web interface. You can programatically invoke the command line tool and then use the table "patch" method via REST to update the query used for the view if necessary.

How to implement backoffice controller

after lot of google searches and going through prestashop's official documentation over and over again, I still couldn't find an example of backoffice controller. I even looked into the modules folder of prestashop's installation, but couldn't find any.
I need to implement 3 different back-office pages, each served by its own controller and view.
Can anyone provide me any hint, or even one working example...Just hello world is more than enough.
Thanks in advance...
notice:i write this article for prestashop1.5 and i don't check it for prestashop 1.6.perhaps it is works for 1.6 too.
You should know every thing in this way have special structure.
step 1: Create a folder in your module folder call that 'controllers' (notice:this name is static)
step 2: Create a folder in controller folder call that 'admin' (notice:this name is static too)
step 3: Create a php class file call that AdminMyclassnameController (notice:in this name Admin at first and controller at last is the key word and thay are static but Myclassname is dynamic .attention to first words all of should be uppercase A for Admin, M for Mclass,... )
step 4: Then you should write your class in AdminMyclassnameController and this class should extent with AdminController or AdminControllerCore.
for know how does it class work you can search about helper forums in internet.
step 5: When you create the class you want a tab to show that controller notice:when act to step 1,2,3,4 this controller take an automatic URL for access to this URL you should create a tab.in yourmodule.php in install() you should add this codes
$tab = new Tab();
$tab->class_name = 'AdminTest';
$tab->module = 'test';
$tab->id_parent = 9;
$tab->position = 11;
then you can see the tab in admin office that redirect to your controller.
i am tired to continue ... but if you want more send a message and i continue this article
this is use full site really clear:
http://doc.prestashop.com/display/PS15/Using+helpers+to+overload+a+back-office+template
http://presthemes.com/prestashop-news/modules-classes-and-controller-override-by-julien-breux-4.html
http://doc.prestashop.com/display/PS15/Diving+into+PrestaShop+Core+development
http://www.prestashop.com/forums/topic/270177-solved-making-own-objectmodel-class-doesnt-work/
http://doc.prestashop.com/display/PS15/New+Developers+Features+In+PrestaShop+1.5
http://blog.belvg.com/how-to-implement-a-controller.html
best regards

There are no 'DS.MODEL.find' method in ember data Tag: v1.0.0-beta.2?

I'd like to use didLoad callback for 'DS.MODEL.FIND', but can not find 'DS.MODEL.FIND' method in below webpage.
Also can not find "findQuery", Thanks.
http://emberjs.com/api/data/classes/DS.Model.html
find and similar methods should be called from the store now.
For example, if you have a model App.Post you can look up the record with id 1 in a route or controller with:
this.store.find('post', 1)
Instead of how you would in 0.13:
App.Post.find(1)
Also, I recommend using the latest build as there have been a lot of fixes since beta 2.

Displaying Custom Attributes in Documentum - Webtop

I am following an article that explains how to use the ICustomAttributeDataHandler class.
I am creating a custom column for the inbox screen, but the problem is that the value I set for my custom attribute is not being reflected on the screen.
As a test I am changing the task name to "whoKnows". But this code is not effecting what is output on the screen:
ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");
(I am able to print debug lines from my custom class when the inbox is viewed, so I know my code is being run.)
Someone on the comments of that article wrote:
the user must call the
"setCustomAttributesInQuery() method
on the dataprovider passing in a
string array of the custom attributes
...what does that meen? Could this be my problem?
thanks.
To be honest, I have already used Webtop, but just as an user. I found a post in the dm developer discussion group that can be useful, though:
For creating a custom column in the
doclist you dont need to go through
this complex procedures. You can use
custom attribute datahandlers for
this.
First in your object list component xml file add your custom column
definition in the "columns" tag. You
can even add static columns instead of
the documentum attributes.
Now create a class which implements the ICustomAttributeDataHandler.
Implement the default the methods getRequiredAttributes and the getData
function.
In getRequiredAttributes add attributes of the object that you are
looking for.
In your getdata method retrieve each row and then based on the
attribute that you see, just set the
value that you want to. 6) Finally
define your class in the app.xml file
There is a section in WDK developement
guide regarding
ICustomAttribuetDataHandlers. Look for
the topic named "Adding custom
attributes to a datagrid".
I'm not sure if this is the final solution, but I hope it helps!
To answer you question about setCustomAttributesInQuery()
every datagrid in WDK is backed by an underlying data provider. You can get this proivder by using the following code.
Datagrid datagrid = (Datagrid)getControl("doclist_grid",com.documentum.web.form.control.databound.Datagrid.class);
DataProvider dp = datagrid.getDataProvider();
Once you've done that, you can call
dp.setCustomAttributesInQuery(myArr);
I'm not actually sure if this is part of the solution to your problem, but you could try this and see where it gets you.
You have to configure the inbox component.
if using classic view, go to inboxlist component and add your custom attribute.
<column>
<attribute>CustomAttributeName</attribute>
<label>Custom Attribute Label</label>
<visible>true</visible>
</column>
Your custom attribute has to be in a custom type that is a sub type of dmi_queue_item, because inboxlist shows only dmi_queue_item objects.
Hope this helps,
Regards,
Tejas.
This may be a non-issue, but based on your code, I can't tell if you're doing this:
ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");
or this:
ICustomAttributeRecordSet rs;
rs.setCustomAttributeValue(i, "taskName", "whoKnows");
You should be calling the setCustomAttributeValue method on the rs object instance, not on the interface.