نکته و مشکل

0 views
Skip to first unread message

Mohsen Shokouhbakhsh

unread,
Feb 12, 2010, 10:58:31 PM2/12/10
to my_a...@googlegroups.com
بسم الله الرحمن الرحیم
سلام
شهادت امام حسن و وفات پیامبر اکرم و شهادت امام رضا علیهم السلام را
تسلیت می گویم.
اگر متن زیر به خاطر عبارات انگلیسی نا خوانا است. بگویید تا اصلاحش کنم.

به چند نکته برخوردم که گفتم بگویم تا بقیه هم استفاده کنند:
1- id در entityMgmtController برای حذف کردن به کار می رود. لذا اگر می
خواهید پارامتری را به کنترلر پاس بدهید با نام id نفرستید.
2- مثلا یک لیستی داریم که می خواهیم به آن لیست یک ردیف اضافه کنیم. با
زدن کلید اضافه به صفحه جدید می رویم و پس از وارد کردن مشخصات کلید
ذخیره را می فشاریم. برای اینکه پس از زدن کلید ذخیره به صفحه لیست
برگردد باید به فایل pages.xml بروید و در آنجا بگویید که به ازای اکشن
save اگر عبارت succ برگردانده شده بود به صفحه لیست برو. نمونه هایش در
این فایل وجود دارد.

چند تا هم سؤال:
1- در مورد دوم پاراگراف قبل: اگر صفحه لیستمان با توجه به یک پارامتر
مثل forumId از پایگاه داده اطلاعات را می خواند، چگونه در صفحه اضافه
کردن به او بگوییم پس از ذخیره کردن به صفحه ای بازگرد که لیست را با
توجه به forumId بارگذاری می کند. چون در صفحه pages.xml نمی شود پارامتر
پاس داد.
2- هر post یک نویسنده دارد. این نویسنده با توجه به اینکه الان چه کسی
دارد این post را می نویسد، تفاوت می کند. چگونه نویسنده ها را پیدا کنم؟
در ضمن فقط کسانی که وارد سایت شده اند می توانند پستی اضافه کنند.
3- هر کسی نمی تواند forum و thread و post اضافه کند. مثلا کسی که وارد
سایت نشده هیچ کدام از اینها را نمی تواند ایجاد کند. و forum ها را فقط
admin می تواند ایجاد کند. چگونه این محدودیتها را بگذارم؟

فعلا همین سؤالات کافی است!
خداحافظ

Mohsen Shokouhbakhsh

unread,
Feb 12, 2010, 11:05:17 PM2/12/10
to my_a...@googlegroups.com
خوانایش ضمیمه شده
Problem.JPG

Khosro Asgharifard

unread,
Feb 13, 2010, 1:16:54 AM2/13/10
to my_a...@googlegroups.com
Hello,
1.For your first question ,i think we can use parameters in pages.xml,look at the this code in pages.xml :
<page view-id="/people/mgmt/paperEdit.xhtml">
  <param name="pid" value="#{paperController.pid}"/>
  <navigation from-action="#{paperController.save}">
   <rule if-outcome="succ">
    <redirect view-id="/people/mgmt/professorHomeMgmt.xhtml">
     <param name="id" value="#{paperController.pid}"/>
    </redirect>
   </rule>
  </navigation>
   </navigation>
 First ,we are in professorHomeMgmt.xhtml  ,and in this page ,we have a tab that list all papers,and in this tab we have a button that we can add a new paper(paperEdit.xhtml).In paperEdit.xhtml ,when we save a paper,we want to back to tab and list all papers for professor,for doing this in <redirect>
,we use <param name="id" value="#{paperController.pid}"/>.

I think ,this is the same as your situation ,but i ma not sure.And this is a hint for you ,maybe i am wrong ,because i am a novice in Seam.

2.For your third question :When a registered person enters to site,he stored in session,so that ,in your controller  you can inject it ,like :
   @In(value = "person", scope = ScopeType.SESSION, required = false)
     Professor professor;

3.For your third question : you can either use   <restrict>#{s:hasPermission(department,'depManager')}</restrict> in pages.xml or
use  <c:if test="#{identity.hasPermission(department,'depManager')}"> in xhtml page.
For first one
<page view-id="/resource/mgmt/saloonmgmt.xhtml">
     <restrict>#{s:hasPermission(department,'depManager')}</restrict>
        <action execute="#{universityResourcesMgmtController.load}"
            on-postback="false" />
   </page>

and second one :
<c:if test="#{identity.hasPermission(department,'depManager')}">
                    <s:div>
                      <h2><s:link value="#{messages['ResourceManagement']}"
                            view="/resource/mgmt/saloonmgmt.xhtml" /></h2>
                    </s:div>
</c:if>

Khosro.

From: Mohsen Shokouhbakhsh <m.shoko...@gmail.com>
To: my_a...@googlegroups.com
Sent: Fri, February 12, 2010 8:05:17 PM
Subject: [my_autcms] Re: نکته و مشکل
--
You received this message because you are subscribed to the Google Groups "my_autcms" group.
To post to this group, send email to my_a...@googlegroups.com.
To unsubscribe from this group, send email to my_autcms+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/my_autcms?hl=en.


Reply all
Reply to author
Forward
0 new messages